vendor: 4,097 bytes, lines 1-17
1(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const m of c)if(m.type==="childList")for(const f of m.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function i(c){const m={};return c.integrity&&(m.integrity=c.integrity),c.referrerPolicy&&(m.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?m.credentials="include":c.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(c){if(c.ep)return;c.ep=!0;const m=i(c);fetch(c.href,m)}})();function um(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var ou={exports:{}},Dr={};/** 2 * @license React 3 * react-jsx-runtime.production.js 4 * 5 * Copyright (c) Meta Platforms, Inc. and affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var jp;function H2(){if(jp)return Dr;jp=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(o,c,m){var f=null;if(m!==void 0&&(f=""+m),c.key!==void 0&&(f=""+c.key),"key"in c){m={};for(var h in c)h!=="key"&&(m[h]=c[h])}else m=c;return c=m.ref,{$$typeof:l,type:o,key:f,ref:c!==void 0?c:null,props:m}}return Dr.Fragment=r,Dr.jsx=i,Dr.jsxs=i,Dr}var Np;function q2(){return Np||(Np=1,ou.exports=H2()),ou.exports}var t=q2(),cu={exports:{}},Ve={};/** 10 * @license React 11 * react.production.js 12 * 13 * Copyright (c) Meta Platforms, Inc. and affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var wp;function V2(){if(wp)return Ve;wp=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),E=Symbol.iterator;function R(S){return S===null||typeof S!="object"?null:(S=E&&S[E]||S["@@iterator"],typeof S=="function"?S:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,w={};function A(S,B,J){this.props=S,this.context=B,this.refs=w,this.updater=J||N}A.prototype.isReactComponent={},A.prototype.setState=function(S,B){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,B,"setState")},A.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function O(){}O.prototype=A.prototype;function z(S,B,J){this.props=S,this.context=B,this.refs=w,this.updater=J||N}var H=z.prototype=new O;H.constructor=z,k(H,A.prototype),H.isPureReactComponent=!0;var se=Array.isArray;function Z(){}var T={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function q(S,B,J){var oe=J.ref;return{$$typeof:l,type:S,key:B,ref:oe!==void 0?oe:null,props:J}}function Q(S,B){return q(S.type,B,S.props)}function F(S){return typeof S=="object"&&S!==null&&S.$$typeof===l}function $(S){var B={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(J){return B[J]})}var G=/\/+/g;function te(S,B){return typeof S=="object"&&S!==null&&S.key!=null?$(""+S.key):B.toString(36)}function ye(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(Z,Z):(S.status="pending",S.then(function(B){S.status==="pending"&&(S.status="fulfilled",S.value=B)},function(B){S.status==="pending"&&(S.status="rejected",S.reason=B)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function U(S,B,J,oe,ve){var Ce=typeof S;
vendor: 17,354 bytes, lines 17-41
17(Ce==="undefined"||Ce==="boolean")&&(S=null);var Ne=!1;if(S===null)Ne=!0;else switch(Ce){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(S.$$typeof){case l:case r:Ne=!0;break;case y:return Ne=S._init,U(Ne(S._payload),B,J,oe,ve)}}if(Ne)return ve=ve(S),Ne=oe===""?"."+te(S,0):oe,se(ve)?(J="",Ne!=null&&(J=Ne.replace(G,"$&/")+"/"),U(ve,B,J,"",function(ze){return ze})):ve!=null&&(F(ve)&&(ve=Q(ve,J+(ve.key==null||S&&S.key===ve.key?"":(""+ve.key).replace(G,"$&/")+"/")+Ne)),B.push(ve)),1;Ne=0;var ne=oe===""?".":oe+":";if(se(S))for(var ge=0;ge<S.length;ge++)oe=S[ge],Ce=ne+te(oe,ge),Ne+=U(oe,B,J,Ce,ve);else if(ge=R(S),typeof ge=="function")for(S=ge.call(S),ge=0;!(oe=S.next()).done;)oe=oe.value,Ce=ne+te(oe,ge++),Ne+=U(oe,B,J,Ce,ve);else if(Ce==="object"){if(typeof S.then=="function")return U(ye(S),B,J,oe,ve);throw B=String(S),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function ce(S,B,J){if(S==null)return S;var oe=[],ve=0;return U(S,oe,"","",function(Ce){return B.call(J,Ce,ve++)}),oe}function C(S){if(S._status===-1){var B=S._result;B=B(),B.then(function(J){(S._status===0||S._status===-1)&&(S._status=1,S._result=J)},function(J){(S._status===0||S._status===-1)&&(S._status=2,S._result=J)}),S._status===-1&&(S._status=0,S._result=B)}if(S._status===1)return S._result.default;throw S._result}var le=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},de={map:ce,forEach:function(S,B,J){ce(S,function(){B.apply(this,arguments)},J)},count:function(S){var B=0;return ce(S,function(){B++}),B},toArray:function(S){return ce(S,function(B){return B})||[]},only:function(S){if(!F(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return Ve.Activity=v,Ve.Children=de,Ve.Component=A,Ve.Fragment=i,Ve.Profiler=c,Ve.PureComponent=z,Ve.StrictMode=o,Ve.Suspense=p,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(S){return T.H.useMemoCache(S)}},Ve.cache=function(S){return function(){return S.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(S,B,J){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var oe=k({},S.props),ve=S.key;if(B!=null)for(Ce in B.key!==void 0&&(ve=""+B.key),B)!P.call(B,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&B.ref===void 0||(oe[Ce]=B[Ce]);var Ce=arguments.length-2;if(Ce===1)oe.children=J;else if(1<Ce){for(var Ne=Array(Ce),ne=0;ne<Ce;ne++)Ne[ne]=arguments[ne+2];oe.children=Ne}return q(S.type,ve,oe)},Ve.createContext=function(S){return S={$$typeof:f,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:m,_context:S},S},Ve.createElement=function(S,B,J){var oe,ve={},Ce=null;if(B!=null)for(oe in B.key!==void 0&&(Ce=""+B.key),B)P.call(B,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(ve[oe]=B[oe]);var Ne=arguments.length-2;if(Ne===1)ve.children=J;else if(1<Ne){for(var ne=Array(Ne),ge=0;ge<Ne;ge++)ne[ge]=arguments[ge+2];ve.children=ne}if(S&&S.defaultProps)for(oe in Ne=S.defaultProps,Ne)ve[oe]===void 0&&(ve[oe]=Ne[oe]);return q(S,Ce,ve)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(S){return{$$typeof:h,render:S}},Ve.isValidElement=F,Ve.lazy=function(S){return{$$typeof:y,_payload:{_status:-1,_result:S},_init:C}},Ve.memo=function(S,B){return{$$typeof:g,type:S,compare:B===void 0?null:B}},Ve.startTransition=function(S){var B=T.T,J={};T.T=J;try{var oe=S(),ve=T.S;ve!==null&&ve(J,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(Z,le)}catch(Ce){le(Ce)}finally{B!==null&&J.types!==null&&(B.types=J.types),T.T=B}},Ve.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Ve.use=function(S){return T.H.use(S)},Ve.useActionState=function(S,B,J){return T.H.useActionState(S,B,J)},Ve.useCallback=function(S,B){return T.H.useCallback(S,B)},Ve.useContext=function(S){return T.H.useContext(S)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(S,B){return T.H.useDeferredValue(S,B)},Ve.useEffect=function(S,B){return T.H.useEffect(S,B)},Ve.useEffectEvent=function(S){return T.H.useEffectEvent(S)},Ve.useId=function(){return T.H.useId()},Ve.useImperativeHandle=function(S,B,J){return T.H.useImperativeHandle(S,B,J)},Ve.useInsertionEffect=function(S,B){return T.H.useInsertionEffect(S,B)},Ve.useLayoutEffect=function(S,B){return T.H.useLayoutEffect(S,B)},Ve.useMemo=function(S,B){return T.H.useMemo(S,B)},Ve.useOptimistic=function(S,B){return T.H.useOptimistic(S,B)},Ve.useReducer=function(S,B,J){return T.H.useReducer(S,B,J)},Ve.useRef=function(S){return T.H.useRef(S)},Ve.useState=function(S){return T.H.useState(S)},Ve.useSyncExternalStore=function(S,B,J){return T.H.useSyncExternalStore(S,B,J)},Ve.useTransition=function(){return T.H.useTransition()},Ve.version="19.2.4",Ve}var kp;function mm(){return kp||(kp=1,cu.exports=V2()),cu.exports}var b=mm();const Pr=um(b);var du={exports:{}},Or={},uu={exports:{}},mu={};/** 18 * @license React 19 * scheduler.production.js 20 * 21 * Copyright (c) Meta Platforms, Inc. and affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */var Sp;function $2(){return Sp||(Sp=1,(function(l){function r(U,ce){var C=U.length;U.push(ce);e:for(;0<C;){var le=C-1>>>1,de=U[le];if(0<c(de,ce))U[le]=ce,U[C]=de,C=le;else break e}}function i(U){return U.length===0?null:U[0]}function o(U){if(U.length===0)return null;var ce=U[0],C=U.pop();if(C!==ce){U[0]=C;e:for(var le=0,de=U.length,S=de>>>1;le<S;){var B=2*(le+1)-1,J=U[B],oe=B+1,ve=U[oe];if(0>c(J,C))oe<de&&0>c(ve,J)?(U[le]=ve,U[oe]=C,le=oe):(U[le]=J,U[B]=C,le=B);else if(oe<de&&0>c(ve,C))U[le]=ve,U[oe]=C,le=oe;else break e}}return ce}function c(U,ce){var C=U.sortIndex-ce.sortIndex;return C!==0?C:U.id-ce.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;l.unstable_now=function(){return m.now()}}else{var f=Date,h=f.now();l.unstable_now=function(){return f.now()-h}}var p=[],g=[],y=1,v=null,E=3,R=!1,N=!1,k=!1,w=!1,A=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function H(U){for(var ce=i(g);ce!==null;){if(ce.callback===null)o(g);else if(ce.startTime<=U)o(g),ce.sortIndex=ce.expirationTime,r(p,ce);else break;ce=i(g)}}function se(U){if(k=!1,H(U),!N)if(i(p)!==null)N=!0,Z||(Z=!0,$());else{var ce=i(g);ce!==null&&ye(se,ce.startTime-U)}}var Z=!1,T=-1,P=5,q=-1;function Q(){return w?!0:!(l.unstable_now()-q<P)}function F(){if(w=!1,Z){var U=l.unstable_now();q=U;var ce=!0;try{e:{N=!1,k&&(k=!1,O(T),T=-1),R=!0;var C=E;try{t:{for(H(U),v=i(p);v!==null&&!(v.expirationTime>U&&Q());){var le=v.callback;if(typeof le=="function"){v.callback=null,E=v.priorityLevel;var de=le(v.expirationTime<=U);if(U=l.unstable_now(),typeof de=="function"){v.callback=de,H(U),ce=!0;break t}v===i(p)&&o(p),H(U)}else o(p);v=i(p)}if(v!==null)ce=!0;else{var S=i(g);S!==null&&ye(se,S.startTime-U),ce=!1}}break e}finally{v=null,E=C,R=!1}ce=void 0}}finally{ce?$():Z=!1}}}var $;if(typeof z=="function")$=function(){z(F)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,te=G.port2;G.port1.onmessage=F,$=function(){te.postMessage(null)}}else $=function(){A(F,0)};function ye(U,ce){T=A(function(){U(l.unstable_now())},ce)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(U){U.callback=null},l.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<U?Math.floor(1e3/U):5},l.unstable_getCurrentPriorityLevel=function(){return E},l.unstable_next=function(U){switch(E){case 1:case 2:case 3:var ce=3;break;default:ce=E}var C=E;E=ce;try{return U()}finally{E=C}},l.unstable_requestPaint=function(){w=!0},l.unstable_runWithPriority=function(U,ce){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var C=E;E=U;try{return ce()}finally{E=C}},l.unstable_scheduleCallback=function(U,ce,C){var le=l.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?le+C:le):C=le,U){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=C+de,U={id:y++,callback:ce,priorityLevel:U,startTime:C,expirationTime:de,sortIndex:-1},C>le?(U.sortIndex=C,r(g,U),i(p)===null&&U===i(g)&&(k?(O(T),T=-1):k=!0,ye(se,C-le))):(U.sortIndex=de,r(p,U),N||R||(N=!0,Z||(Z=!0,$()))),U},l.unstable_shouldYield=Q,l.unstable_wrapCallback=function(U){var ce=E;return function(){var C=E;E=ce;try{return U.apply(this,arguments)}finally{E=C}}}})(mu)),mu}var Cp;function I2(){return Cp||(Cp=1,uu.exports=$2()),uu.exports}var fu={exports:{}},Zt={};/** 26 * @license React 27 * react-dom.production.js 28 * 29 * Copyright (c) Meta Platforms, Inc. and affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var Ep;function G2(){if(Ep)return Zt;Ep=1;var l=mm();function r(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var o={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},c=Symbol.for("react.portal");function m(p,g,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:v==null?null:""+v,children:p,containerInfo:g,implementation:y}}var f=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Zt.createPortal=function(p,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(r(299));return m(p,g,null,y)},Zt.flushSync=function(p){var g=f.T,y=o.p;try{if(f.T=null,o.p=2,p)return p()}finally{f.T=g,o.p=y,o.d.f()}},Zt.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(p,g))},Zt.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},Zt.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var y=g.as,v=h(y,g.crossOrigin),E=typeof g.integrity=="string"?g.integrity:void 0,R=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?o.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:v,integrity:E,fetchPriority:R}):y==="script"&&o.d.X(p,{crossOrigin:v,integrity:E,fetchPriority:R,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Zt.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=h(g.as,g.crossOrigin);o.d.M(p,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(p)},Zt.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,v=h(y,g.crossOrigin);o.d.L(p,y,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Zt.preloadModule=function(p,g){if(typeof p=="string")if(g){var y=h(g.as,g.crossOrigin);o.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(p)},Zt.requestFormReset=function(p){o.d.r(p)},Zt.unstable_batchedUpdates=function(p,g){return p(g)},Zt.useFormState=function(p,g,y){return f.H.useFormState(p,g,y)},Zt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Zt.version="19.2.4",Zt}var Tp;function Y2(){if(Tp)return fu.exports;Tp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),fu.exports=G2(),fu.exports}/** 34 * @license React 35 * react-dom-client.production.js 36 * 37 * Copyright (c) Meta Platforms, Inc. and affiliates. 38 * 39 * This source code is licensed under the MIT license found in the 40 * LICENSE file in the root directory of this source tree. 41 */var Rp;function P2(){if(Rp)return Or;Rp=1;var l=I2(),r=mm(),i=Y2();function o(e){var a="https://react.dev/errors/"+e;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var a=e,s=e;if(e.alternate)for(;a.return;)a=a.return;else{e=a;do a=e,(a.flags&4098)!==0&&(s=a.return),e=a.return;while(e)}return a.tag===3?s:null}function f(e){if(e.tag===13){var a=e.memoizedState;if(a===null&&(e=e.alternate,e!==null&&(a=e.memoizedState)),a!==null)return a.dehydrated}return null}function h(e){if(e.tag===31){var a=e.memoizedState;if(a===null&&(e=e.alternate,e!==null&&(a=e.memoizedState)),a!==null)return a.dehydrated}return null}function p(e){if(m(e)!==e)throw Error(o(188))}function g(e){var a=e.alternate;if(!a){if(a=m(e),a===null)throw Error(o(188));return a!==e?null:e}for(var s=e,n=a;;){var d=s.return;if(d===null)break;var u=d.alternate;if(u===null){if(n=d.return,n!==null){s=n;continue}break}if(d.child===u.child){for(u=d.child;u;){if(u===s)return p(d),e;if(u===n)return p(d),a;u=u.sibling}throw Error(o(188))}if(s.return!==n.return)s=d,n=u;else{for(var x=!1,j=d.child;j;){if(j===s){x=!0,s=d,n=u;break}if(j===n){x=!0,n=d,s=u;break}j=j.sibling}if(!x){for(j=u.child;j;){if(j===s){x=!0,s=u,n=d;break}if(j===n){x=!0,n=u,s=d;break}j=j.sibling}if(!x)throw Error(o(189))}}if(s.alternate!==n)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:a}function y(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e;for(e=e.child;e!==null;){if(a=y(e),a!==null)return a;e=e.sibling}return null}var v=Object.assign,E=Symbol.for("react.element"),R=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),z=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var G=Symbol.for("react.client.reference");function te(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===G?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case A:return"Profiler";case w:return"StrictMode";case se:return"Suspense";case Z:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case z:return e.displayName||"Context";case O:return(e._context.displayName||"Context")+".Consumer";case H:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T:return a=e.displayName||null,a!==null?a:te(e.type)||"Memo";case P:a=e._payload,e=e._init;try{return te(e(a))}catch{}}return null}var ye=Array.isArray,U=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C={pending:!1,data:null,method:null,action:null},le=[],de=-1;function S(e){return{current:e}}function B(e){0>de||(e.current=le[de],le[de]=null,de--)}function J(e,a){de++,le[de]=e.current,e.current=a}var oe=S(null),ve=S(null),Ce=S(null),Ne=S(null);function ne(e,a){switch(J(Ce,a),J(ve,e),J(oe,null),a.nodeType){case 9:case 11:e=(e
vendor: 10,045 bytes, lines 41-48
41=a.documentElement)&&(e=e.namespaceURI)?G0(e):0;break;default:if(e=a.tagName,a=a.namespaceURI)a=G0(a),e=Y0(a,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(oe),J(oe,e)}function ge(){B(oe),B(ve),B(Ce)}function ze(e){e.memoizedState!==null&&J(Ne,e);var a=oe.current,s=Y0(a,e.type);a!==s&&(J(ve,e),J(oe,s))}function K(e){ve.current===e&&(B(oe),B(ve)),Ne.current===e&&(B(Ne),Lr._currentValue=C)}var fe,xe;function me(e){if(fe===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);fe=a&&a[1]||"",xe=-1<s.stack.indexOf(` 42 at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return` 43`+fe+e+xe}var Te=!1;function Ue(e,a){if(!e||Te)return"";Te=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(a){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(ee){var X=ee}Reflect.construct(e,[],ie)}else{try{ie.call()}catch(ee){X=ee}e.call(ie.prototype)}}else{try{throw Error()}catch(ee){X=ee}(ie=e())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(ee){if(ee&&X&&typeof ee.stack=="string")return[ee.stack,X.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=n.DetermineComponentFrameRoot(),x=u[0],j=u[1];if(x&&j){var M=x.split(` 44`),Y=j.split(` 45`);for(d=n=0;n<M.length&&!M[n].includes("DetermineComponentFrameRoot");)n++;for(;d<Y.length&&!Y[d].includes("DetermineComponentFrameRoot");)d++;if(n===M.length||d===Y.length)for(n=M.length-1,d=Y.length-1;1<=n&&0<=d&&M[n]!==Y[d];)d--;for(;1<=n&&0<=d;n--,d--)if(M[n]!==Y[d]){if(n!==1||d!==1)do if(n--,d--,0>d||M[n]!==Y[d]){var ae=` 46`+M[n].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=n&&0<=d);break}}}finally{Te=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?me(s):""}function Le(e,a){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me("Lazy");case 13:return e.child!==a&&a!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return Ue(e.type,!1);case 11:return Ue(e.type.render,!1);case 1:return Ue(e.type,!0);case 31:return me("Activity");default:return""}}function rt(e){try{var a="",s=null;do a+=Le(e,s),s=e,e=e.return;while(e);return a}catch(n){return` 47Error generating stack: `+n.message+` 48`+n.stack}}var st=Object.prototype.hasOwnProperty,lt=l.unstable_scheduleCallback,aa=l.unstable_cancelCallback,As=l.unstable_shouldYield,we=l.unstable_requestPaint,ke=l.unstable_now,Be=l.unstable_getCurrentPriorityLevel,Oe=l.unstable_ImmediatePriority,Je=l.unstable_UserBlockingPriority,Ct=l.unstable_NormalPriority,Nt=l.unstable_LowPriority,wt=l.unstable_IdlePriority,L=l.log,ue=l.unstable_setDisableYieldValue,pe=null,Re=null;function Ye(e){if(typeof L=="function"&&ue(e),Re&&typeof Re.setStrictMode=="function")try{Re.setStrictMode(pe,e)}catch{}}var Pe=Math.clz32?Math.clz32:la,sa=Math.log,rs=Math.LN2;function la(e){return e>>>=0,e===0?32:31-(sa(e)/rs|0)|0}var ut=256,Ot=262144,Vt=4194304;function ha(e){var a=e&42;if(a!==0)return a;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ka(e,a,s){var n=e.pendingLanes;if(n===0)return 0;var d=0,u=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var j=n&134217727;return j!==0?(n=j&~u,n!==0?d=ha(n):(x&=j,x!==0?d=ha(x):s||(s=j&~e,s!==0&&(d=ha(s))))):(j=n&~u,j!==0?d=ha(j):x!==0?d=ha(x):s||(s=n&~e,s!==0&&(d=ha(s)))),d===0?0:a!==0&&a!==d&&(a&u)===0&&(u=d&-d,s=a&-a,u>=s||u===32&&(s&4194048)!==0)?a:d}function Fa(e,a){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&a)===0}function ll(e,a){switch(e){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $t(){var e=Vt;return Vt<<=1,(Vt&62914560)===0&&(Vt=4194304),e}function Xt(e){for(var a=[],s=0;31>s;s++)a.push(e);return a}function Qa(e,a){e.pendingLanes|=a,a!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function si(e,a,s,n,d,u){var x=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var j=e.entanglements,M=e.expirationTimes,Y=e.hiddenUpdates;for(s=x&~s;0<s;){var ae=31-Pe(s),ie=1<<ae;j[ae]=0,M[ae]=-1;var X=Y[ae];if(X!==null)for(Y[ae]=null,ae=0;ae<X.length;ae++){var ee=X[ae];ee!==null&&(ee.lane&=-536870913)}s&=~ie}n!==0&&In(e,n,0),u!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=u&~(x&~a))}function In(e,a,s){e.pendingLanes|=a,e.suspendedLanes&=~a;var n=31-Pe(a);e.entangledLanes|=a,e.entanglements[n]=e.entanglements[n]|1073741824|s&261930}function Gn(e,a){var s=e.entangledLanes|=a;for(e=e.entanglements;s;){var n=31-Pe(s),d=1<<n;d&a|e[n]&a&&(e[n]|=a),s&=~d}}function Kt(e,a){var s=a&-a;return s=(s&42)!==0?1:Yn(s),(s&(e.suspendedLanes|a))!==0?0:s}function Yn(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Pn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function li(){var e=ce.p;return e!==0?e:(e=window.event,e===void 0?32:hp(e.type))}function _(e,a){var s=ce.p;try{return ce.p=e,a()}finally{ce.p=s}}var be=Math.random().toString(36).slice(2),he="__reactFiber$"+be,Ae="__reactProps$"+be,Ge="__reactContainer$"+be,nt="__reactEvents$"+be,na="__reactListeners$"+be,ni="__reactHandles$"+be,Am="__reactResources$"+be,Fn="__reactMarker$"+be;function ec(e){delete e[he],delete e[Ae],delete e[nt],delete e[na],delete e[ni]}function zl(e){var a=e[he];if(a)return a;for(var s=e.parentNode;s;){if(a=s[Ge]||s[he]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(e=J0(e);e!==null;){if(s=e[he])return s;e=J0(e)}return a}e=s,s=e.parentNode}return null}function Ul(e){if(e=e[he]||e[Ge]){var a=e.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return e}return null}function Qn(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e.stateNode;throw Error(o(33))}function Dl(e){var a=e[Am];return a||(a=e[Am]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Ht(e){e[Fn]=!0}var _m=new Set,Lm={};function nl(e,a){Ol(e,a),Ol(e+"Capture",a)}function Ol(e,a){for(Lm[e]=a,e=0;e<a.length;e++)_m.add(a[e])}var A1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Mm={},zm={};function _1(e){return st.call(zm,e)?!0:st.call(Mm,e)?!1:A1.test(e)?zm[e]=!0:(Mm[e]=!0,!1)}function ri(e,a,s){if(_1(a))if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(a);return;case"boolean":var n=a.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(a);return}}e.setAttribute(a,""+s)}}function ii(e,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttribute(a,""+s)}}function is(e,a,s,n){if(n===null)e.removeAttribute(s);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(a,s,""+n)}}function Sa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Um(e){var a=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function L1(e,a,s){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,a);if(!e.hasOwnProperty(a)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var d=n.get,u=n.set;return Object.defineProperty(e,a,{configurable:!0,get:function(){return d.call(this)},set:function(x){s=""+x,u.call(this,x)}}),Object.defineProperty(e,a,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[a]}}}}function tc(e){if(!e._valueTracker){var a=Um(e)?"checked":"value";e._valueTracker=L1(e,a,""+e[a])}}function Dm(e){if(!e)return!1;var a=e._valueTracker;if(!a)return!0;var s=a.getValue(),n="";return e&&(n=Um(e)?e.checked?"true":"false":e.value),e=n,e!==s?(a.setValue(e),!0):!1}function oi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var M1=/[\n"\\]/g;function Ca(e){return e.replace(M1,function(a){return"\\"+a.charCo
vendor: 4,418 bytes, line 48
48deAt(0).toString(16)+" "})}function ac(e,a,s,n,d,u,x,j){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),a!=null?x==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+Sa(a)):e.value!==""+Sa(a)&&(e.value=""+Sa(a)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),a!=null?sc(e,x,Sa(a)):s!=null?sc(e,x,Sa(s)):n!=null&&e.removeAttribute("value"),d==null&&u!=null&&(e.defaultChecked=!!u),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+Sa(j):e.removeAttribute("name")}function Om(e,a,s,n,d,u,x,j){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),a!=null||s!=null){if(!(u!=="submit"&&u!=="reset"||a!=null)){tc(e);return}s=s!=null?""+Sa(s):"",a=a!=null?""+Sa(a):s,j||a===e.value||(e.value=a),e.defaultValue=a}n=n??d,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=j?e.checked:!!n,e.defaultChecked=!!n,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),tc(e)}function sc(e,a,s){a==="number"&&oi(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Bl(e,a,s,n){if(e=e.options,a){a={};for(var d=0;d<s.length;d++)a["$"+s[d]]=!0;for(s=0;s<e.length;s++)d=a.hasOwnProperty("$"+e[s].value),e[s].selected!==d&&(e[s].selected=d),d&&n&&(e[s].defaultSelected=!0)}else{for(s=""+Sa(s),a=null,d=0;d<e.length;d++){if(e[d].value===s){e[d].selected=!0,n&&(e[d].defaultSelected=!0);return}a!==null||e[d].disabled||(a=e[d])}a!==null&&(a.selected=!0)}}function Bm(e,a,s){if(a!=null&&(a=""+Sa(a),a!==e.value&&(e.value=a),s==null)){e.defaultValue!==a&&(e.defaultValue=a);return}e.defaultValue=s!=null?""+Sa(s):""}function Hm(e,a,s,n){if(a==null){if(n!=null){if(s!=null)throw Error(o(92));if(ye(n)){if(1<n.length)throw Error(o(93));n=n[0]}s=n}s==null&&(s=""),a=s}s=Sa(a),e.defaultValue=s,n=e.textContent,n===s&&n!==""&&n!==null&&(e.value=n),tc(e)}function Hl(e,a){if(a){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=a;return}}e.textContent=a}var z1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function qm(e,a,s){var n=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?n?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="":n?e.setProperty(a,s):typeof s!="number"||s===0||z1.has(a)?a==="float"?e.cssFloat=s:e[a]=(""+s).trim():e[a]=s+"px"}function Vm(e,a,s){if(a!=null&&typeof a!="object")throw Error(o(62));if(e=e.style,s!=null){for(var n in s)!s.hasOwnProperty(n)||a!=null&&a.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var d in a)n=a[d],a.hasOwnProperty(d)&&s[d]!==n&&qm(e,d,n)}else for(var u in a)a.hasOwnProperty(u)&&qm(e,u,a[u])}function lc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var U1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
48dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),D1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ci(e){return D1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function os(){}var nc=null;function rc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ql=null,Vl=null;function $m(e){var a=Ul(e);if(a&&(e=a.stateNode)){var s=e[Ae]||null;e:switch(e=a.stateNode,a.type){case"input":if(ac(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Ca(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var n=s[a];if(n!==e&&n.form===e.form){var d=n[Ae]||null;if(!d)throw Error(o(90));ac(n,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(a=0;a<s.length;a++)n=s[a],n.form===e.form&&Dm(n)}break e;case"textarea":Bm(e,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Bl(e,!!s.multiple,a,!1)}}}var ic=!1;function Im(e,a,s){if(ic)return e(a,s);ic=!0;try{var n=e(a);return n}finally{if(ic=!1,(ql!==null||Vl!==null)&&(Ki(),ql&&(a=ql,e=Vl,Vl=ql=null,$m(a),e)))for(a=0;a<e.length;a++)$m(e[a])}}function Xn(e,a){var s=e.stateNode;if(s===null)return null;var n=s[Ae]||null;if(n===null)return null;s=n[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,a,typeof s));return s}var cs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oc=!1;if(cs)try{var Kn={};Object.defineProperty(Kn,"passive",{get:function(){oc=!0}}),window.addEventListener("test",Kn,Kn),window.removeEventListener("test",Kn,Kn)}catch{oc=!1}var _s=null,cc=null,di=null;function Gm(){if(di)return di;var e,a=cc,s=a.length,n,d="value"in _s?_s.value:_s.textContent,u=d.length;for(e=0;e<s&&a[e]===d[e];e++);var x=s-e;for(n=1;n<=x&&a[s-n]===d[u-n];n++);return di=d.slice(e,1<n?1-n:void 0)}function ui(e){var a=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&a===13&&(e=13)):e=a,e===10&&(e=13),32<=e||e===13?e:0}function mi(){return!0}function Ym(){return!1}function ra(e){function a(s,n,d,u,x){this._reactName=s,this._targetInst=d,this.type=n,this.nativeEvent=u,this.target=x,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(s=e[j],this[j]=s?s(u):u[j]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?mi:Ym,this.isPropagationStopped=Ym,this}return v(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=mi)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=mi)},persist:function(){},isPersistent:mi}),a}var rl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fi=ra(rl),Zn=v({},rl,{view:0,detail:0}),O1=ra(Zn),dc,uc,Jn,hi=v({},Zn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Jn&&(Jn&&e.type==="mousemove"?(dc=e.screenX-Jn.screenX,uc=e.screenY-Jn.screenY):uc=dc=0,Jn=e),dc)},movementY:function(e){return"movementY"in e?e.movementY:uc}}),Pm=ra(hi),B1=v({},hi,{dataTransfer:0}),H1=ra(B1),q1=v({},Zn,{relatedTarget:0}),mc=ra(q1),V1=v({},rl,{animationName:0,elapsedTime:0,pseudoElement:0}),$1=ra(V1),I1=v({},rl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),G1=ra(I1),Y1=v({},rl,{data:0}),Fm=ra(Y1),P1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},F1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Q1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function X1(e){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(e):(e=Q1[e])?!!a[e]:!1}
vendor: 5,306 bytes, line 48
48function fc(){return X1}var K1=v({},Zn,{key:function(e){if(e.key){var a=P1[e.key]||e.key;if(a!=="Unidentified")return a}return e.type==="keypress"?(e=ui(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?F1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fc,charCode:function(e){return e.type==="keypress"?ui(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ui(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Z1=ra(K1),J1=v({},hi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qm=ra(J1),W1=v({},Zn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fc}),eb=ra(W1),tb=v({},rl,{propertyName:0,elapsedTime:0,pseudoElement:0}),ab=ra(tb),sb=v({},hi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),lb=ra(sb),nb=v({},rl,{newState:0,oldState:0}),rb=ra(nb),ib=[9,13,27,32],hc=cs&&"CompositionEvent"in window,Wn=null;cs&&"documentMode"in document&&(Wn=document.documentMode);var ob=cs&&"TextEvent"in window&&!Wn,Xm=cs&&(!hc||Wn&&8<Wn&&11>=Wn),Km=" ",Zm=!1;function Jm(e,a){switch(e){case"keyup":return ib.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $l=!1;function cb(e,a){switch(e){case"compositionend":return Wm(a);case"keypress":return a.which!==32?null:(Zm=!0,Km);case"textInput":return e=a.data,e===Km&&Zm?null:e;default:return null}}function db(e,a){if($l)return e==="compositionend"||!hc&&Jm(e,a)?(e=Gm(),di=cc=_s=null,$l=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Xm&&a.locale!=="ko"?null:a.data;default:return null}}var ub={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ef(e){var a=e&&e.nodeName&&e.nodeName.toLowerCase();return a==="input"?!!ub[e.type]:a==="textarea"}function tf(e,a,s,n){ql?Vl?Vl.push(n):Vl=[n]:ql=n,a=so(a,"onChange"),0<a.length&&(s=new fi("onChange","change",null,s,n),e.push({event:s,listeners:a}))}var er=null,tr=null;function mb(e){B0(e,0)}function pi(e){var a=Qn(e);if(Dm(a))return e}function af(e,a){if(e==="change")return a}var sf=!1;if(cs){var pc;if(cs){var xc="oninput"in document;if(!xc){var lf=document.createElement("div");lf.setAttribute("oninput","return;"),xc=typeof lf.oninput=="function"}pc=xc}else pc=!1;sf=pc&&(!document.documentMode||9<document.documentMode)}function nf(){er&&(er.detachEvent("onpropertychange",rf),tr=er=null)}function rf(e){if(e.propertyName==="value"&&pi(tr)){var a=[];tf(a,tr,e,rc(e)),Im(mb,a)}}function fb(e,a,s){e==="focusin"?(nf(),er=a,tr=s,er.attachEvent("onpropertychange",rf)):e==="focusout"&&nf()}function hb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return pi(tr)}function pb(e,a){if(e==="click")return pi(a)}function xb(e,a){if(e==="input"||e==="change")return pi(a)}function gb(e,a){return e===a&&(e!==0||1/e===1/a)||e!==e&&a!==a}var pa=typeof Object.is=="function"?Object.is:gb;function ar(e,a){if(pa(e,a))return!0;if(typeof e!="object"||e===null||typeof a!="object"||a===null)return!1;var s=Object.keys(e),n=Object.keys(a);if(s.length!==n.length)return!1;for(n=0;n<s.length;n++){var d=s[n];if(!st.call(a,d)||!pa(e[d],a[d]))return!1}return!0}function of(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cf(e,a){var s=of(e);e=0;for(var n;s;){if(s.nodeType===3){if(n=e+s.textContent.length,e<=a&&n>=a)return{node:s,offset:a-e};e=n}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=of(s)}}function df(e,a){return e&&a?e===a?!0:e&&e.nodeType===3?!1:a&&a.nodeType===3?df(e,a.parentNode):"contains"in e?e.contains(a):e.compareDocumentPosition?!!(e.compareDocumentPosition(a)&16):!1:!1}function uf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var a=oi(e.document);a instanceof e.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)e=a.contentWindow;else break;a=oi(e.document)}return a}function gc(e){var a=e&&e.nodeName&&e.nodeName.toLowerCase();return a&&(a==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||a==="textarea"||e.contentEditable==="true")}var bb=cs&&"documentMode"in document&&11>=document.documentMode,Il=null,bc=null,sr=null,yc=!1;function mf(e,a,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;yc||Il==null||Il!==oi(n)||(n=Il,"selectionStart"in n&&gc(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 19,093 bytes, line 48
48sNode:n.focusNode,focusOffset:n.focusOffset}),sr&&ar(sr,n)||(sr=n,n=so(bc,"onSelect"),0<n.length&&(a=new fi("onSelect","select",null,a,s),e.push({event:a,listeners:n}),a.target=Il)))}function il(e,a){var s={};return s[e.toLowerCase()]=a.toLowerCase(),s["Webkit"+e]="webkit"+a,s["Moz"+e]="moz"+a,s}var Gl={animationend:il("Animation","AnimationEnd"),animationiteration:il("Animation","AnimationIteration"),animationstart:il("Animation","AnimationStart"),transitionrun:il("Transition","TransitionRun"),transitionstart:il("Transition","TransitionStart"),transitioncancel:il("Transition","TransitionCancel"),transitionend:il("Transition","TransitionEnd")},vc={},ff={};cs&&(ff=document.createElement("div").style,"AnimationEvent"in window||(delete Gl.animationend.animation,delete Gl.animationiteration.animation,delete Gl.animationstart.animation),"TransitionEvent"in window||delete Gl.transitionend.transition);function ol(e){if(vc[e])return vc[e];if(!Gl[e])return e;var a=Gl[e],s;for(s in a)if(a.hasOwnProperty(s)&&s in ff)return vc[e]=a[s];return e}var hf=ol("animationend"),pf=ol("animationiteration"),xf=ol("animationstart"),yb=ol("transitionrun"),vb=ol("transitionstart"),jb=ol("transitioncancel"),gf=ol("transitionend"),bf=new Map,jc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");jc.push("scrollEnd");function Va(e,a){bf.set(e,a),nl(a,[e])}var xi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ea=[],Yl=0,Nc=0;function gi(){for(var e=Yl,a=Nc=Yl=0;a<e;){var s=Ea[a];Ea[a++]=null;var n=Ea[a];Ea[a++]=null;var d=Ea[a];Ea[a++]=null;var u=Ea[a];if(Ea[a++]=null,n!==null&&d!==null){var x=n.pending;x===null?d.next=d:(d.next=x.next,x.next=d),n.pending=d}u!==0&&yf(s,d,u)}}function bi(e,a,s,n){Ea[Yl++]=e,Ea[Yl++]=a,Ea[Yl++]=s,Ea[Yl++]=n,Nc|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function wc(e,a,s,n){return bi(e,a,s,n),yi(e)}function cl(e,a){return bi(e,null,null,a),yi(e)}function yf(e,a,s){e.lanes|=s;var n=e.alternate;n!==null&&(n.lanes|=s);for(var d=!1,u=e.return;u!==null;)u.childLanes|=s,n=u.alternate,n!==null&&(n.childLanes|=s),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(d=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,d&&a!==null&&(d=31-Pe(s),e=u.hiddenUpdates,n=e[d],n===null?e[d]=[a]:n.push(a),a.lane=s|536870912),u):null}function yi(e){if(50<Sr)throw Sr=0,Ld=null,Error(o(185));for(var a=e.return;a!==null;)e=a,a=e.return;return e.tag===3?e.stateNode:null}var Pl={};function Nb(e,a,s,n){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xa(e,a,s,n){return new Nb(e,a,s,n)}function kc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ds(e,a){var s=e.alternate;return s===null?(s=xa(e.tag,a,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=a,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,a=e.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function vf(e,a){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=a,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,a=s.dependencies,e.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),e}function vi(e,a,s,n,d,u){var x=0;if(n=e,typeof e=="function")kc(e)&&(x=1);else if(typeof e=="string")x=E2(e,s,oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case q:return e=xa(31,s,a,d),e.elementType=q,e.lanes=u,e;case k:return dl(s.children,d,u,a);case w:x=8,d|=24;break;case A:return e=xa(12,s,a,d|2),e.elementType=A,e.lanes=u,e;case se:return e=xa(13,s,a,d),e.elementType=se,e.lanes=u,e;case Z:return e=xa(19,s,a,d),e.elementType=Z,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case z:x=10;break e;case O:x=9;break e;case H:x=11;break e;case T:x=14;break e;case P:x=16,n=null;break e}x=29,s=Error(o(130,e===null?"null":typeof e,"")),n=null}return a=xa(x,s,a,d),a.elementType=e,a.type=n,a.lanes=u,a}function dl(e,a,s,n){return e=xa(7,e,n,a),e.lanes=s,e}function Sc(e,a,s){return e=xa(6,e,null,a),e.lanes=s,e}function jf(e){var a=xa(18,null,null,0);return a.stateNode=e,a}function Cc(e,a,s){return a=xa(4,e.children!==null?e.children:[],e.key,a),a.lanes=s,a.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},a}var Nf=new WeakMap;function Ta(e,a){if(typeof e=="object"&&e!==null){var s=Nf.get(e);return s!==void 0?s:(a={value:e,source:a,stack:rt(a)},Nf.set(e,a),a)}return{value:e,source:a,stack:rt(a)}}var Fl=[],Ql=0,ji=null,lr=0,Ra=[],Aa=0,Ls=null,Xa=1,Ka="";function us(e,a){Fl[Ql++]=lr,Fl[Ql++]=ji,ji=e,lr=a}function wf(e,a,s){Ra[Aa++]=Xa,Ra[Aa++]=Ka,Ra[Aa++]=Ls,Ls=e;var n=Xa;e=Ka;var d=32-Pe(n)-1;n&=~(1<<d),s+=1;var u=32-Pe(a)+d;if(30<u){var x=d-d%5;u=(n&(1<<x)-1).toString(32),n>>=x,d-=x,Xa=1<<32-Pe(a)+d|s<<d|n,Ka=u+e}else Xa=1<<u|s<<d|n,Ka=e}function Ec(e){e.return!==null&&(us(e,1),wf(e,1,0))}function Tc(e){for(;e===ji;)ji=Fl[--Ql],Fl[Ql]=null,lr=Fl[--Ql],Fl[Ql]=null;for(;e===Ls;)Ls=Ra[--Aa],Ra[Aa]=null,Ka=Ra[--Aa],Ra[Aa]=null,Xa=Ra[--Aa],Ra[Aa]=null}function kf(e,a){Ra[Aa++]=Xa,Ra[Aa++]=Ka,Ra[Aa++]=Ls,Xa=a.id,Ka=a.overflow,Ls=e}var It=null,vt=null,Ze=!1,Ms=null,_a=!1,Rc=Error(o(519));function zs(e){var a=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nr(Ta(a,e)),Rc}function Sf(e){var a=e.stateNode,s=e.type,n=e.memoizedProps;switch(a[he]=e,a[Ae]=n,s){case"dialog":Qe("cancel",a),Qe("close",a);break;case"iframe":case"object":case"embed":Qe("load",a);break;case"video":case"audio":for(s=0;s<Er.length;s++)Qe(Er[s],a);break;case"source":Qe("error",a);break;case"img":case"image":case"link":Qe("error",a),Qe("load",a);break;case"details":Qe("toggle",a);break;case"input":Qe("invalid",a),Om(a,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Qe("invalid",a);break;case"textarea":Qe("invalid",a),Hm(a,n.value,n.defaultValue,n.children)}s=n.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||n.suppressHydrationWarning===!0||$0(a.textContent,s)?(n.popover!=null&&(Qe("beforetoggle",a),Qe("toggle",a)),n.onScroll!=null&&Qe("scroll",a),n.onScrollEnd!=null&&Qe("scrollend",a),n.onClick!=null&&(a.onclick=os),a=!0):a=!1,a||zs(e,!0)}function Cf(e){for(It=e.return;It;)switch(It.tag){case 5:case 31:case 13:_a=!1;return;case 27:case 3:_a=!0;return;default:It=It.return}}function Xl(e){if(e!==It)return!1;if(!Ze)return Cf(e),Ze=!0,!1;var a=e.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Fd(e.type,e.memoizedProps)),s=!s),s&&vt&&zs(e),Cf(e),a===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));vt=Z0(e)}else if(a===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));vt=Z0(e)}else a===27?(a=vt,Qs(e.type)?(e=Jd,Jd=null,vt=e):vt=a):vt=It?Ma(e.stateNode.nextSibling):null;return!0}function ul(){vt=It=null,Ze=!1}function Ac(){var e=Ms;return e!==null&&(da===null?da=e:da.push.apply(da,e),Ms=null),e}function nr(e){Ms===null?Ms=[e]:Ms.push(e)}var _c=S(null),ml=null,ms=null;function Us(e,a,s){J(_c,a._currentValue),a._currentValue=s}function fs(e){e._currentValue=_c.current,B(_c)}function Lc(e,a,s){for(;e!==null;){var n=e.alternate;if((e.childLanes&a)!==a?(e.childLanes|=a,n!==null&&(n.childLanes|=a)):n!==null&&(n.childLanes&a)!==a&&(n.childLanes|=a),e===s)break;e=e.return}}function Mc(e,a,s,n){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var u=d.dependencies;if(u!==null){var x=d.child;u=u.firstContext;e:for(;u!==null;){var j=u;u=d;for(var M=0;M<a.length;M++)if(j.context===a[M]){u.lanes|=s,j=u.alternate,j!==null&&(j.lanes|=s),Lc(u.return,s,e),n||(x=null);break e}u=j.next}}else if(d.tag===18){if(x=d.return,x===null)throw Error(o(341));x.lanes|=s,u=x.alternate,u!==null&&(u.lanes|=s),Lc(x,s,e),x=null}else x=d.child;if(x!==null)x.return=d;else for(x=d;x!==null;){if(x===e){x=null;break}if(d=x.sibling,d!==null){d.return=x.return,x=d;break}x=x.return}d=x}}function Kl(e,a,s,n){e=null;for(var d=a,u=!1;d!==null;){if(!u){if((d.flags&524288)!==0)u=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var x=d.alternate;if(x===null)throw Error(o(387));if(x=x.memoizedProps,x!==null){var j=d.type;pa(d.pendingProps.value,x.value)||(e!==null?e.push(j):e=[j])}}else if(d===Ne.current){if(x=d.alternate,x===null)throw Error(o(387));x.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Lr):e=[Lr])}d=d.return}e!==null&&Mc(a,e,s,n),a.flags|=262144}function Ni(e){for(e=e.firstContext;e!==null;){if(!pa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fl(e){ml=e,ms=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gt(e){return Ef(ml,e)}function wi(e,a){return ml===null&&fl(e),Ef(e,a)}function Ef(e,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},ms===null){if(e===null)throw Error(o(308));ms=a,e.dependencies={lanes:0,firstContext:a},e.flags|=524288}else ms=ms.next=a;return s}var wb=typeof AbortController<"u"?AbortController:function(){var e=[],a=this.signal={aborted:!1,addEventListener:function(s,n){e.push(n)}};this.abort=function(){a.aborted=!0,e.forEach(function(s){return s()})}},kb=l.unstable_scheduleCallback,Sb=l.unstable_NormalPriority,Mt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zc(){return{controller:new wb,data:new Map,refCount:0}}function rr(e){e.refCount--,e.refCount===0&&kb(Sb,function(){e.controller.abort()})}var ir=null,Uc=0,Zl=0,Jl=null;function Cb(e,a){if(ir===null){var s=ir=[];Uc=0,Zl=Bd(),Jl={status:"pending",value:void 0,then:function(n){s.push(n)}}}return Uc++,a.then(Tf,Tf),a}function Tf(){if(--Uc===0&&ir!==null){Jl!==null&&(Jl.status="fulfilled");var e=ir;ir=null,Zl=0,Jl=null;for(var a=0;a<e.length;a++)(0,e[a])()}}function Eb(e,a){var s=[],n={status:"pending",value:null,reason:null,then:function(d){s.push(d)}};return e.then(function(){n.status="fulfilled",n.value=a;for(var d=0;d<s.length;d++)(0,s[d])(a)},function(d){for(n.status="rejected",n.reason=d,d=0;d<s.length;d++)(0,s[d])(void 0)}),n}var Rf=U.S;U.S=function(e,a){m0=ke(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&Cb(e,a),Rf!==null&&Rf(e,a)};var hl=S(null);function Dc(){var e=hl.current;return e!==null?e:gt.pooledCache}function ki(e,a){a===null?J(hl,hl.current):J(hl,a.pool)}function Af(){var e=Dc();return e===null?null:{parent:Mt._currentValue,pool:e}}var Wl=Error(o(460)),Oc=Error(o(474)),Si=Error(o(542)),Ci={then:function(){}};function _f(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Lf(e,a,s){switch(s=e[s],s===void 0?e.push(a):s!==a&&(a.then(os,os),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw e=a.reason,zf(e),e;default:if(typeof a.status=="string")a.then(os,os);else{if(e=gt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=a,e.status="pending",e.then(function(n){if(a.status==="pending"){var d=a;d.status="fulfilled",d.value=n}},function(n){if(a.status==="pending"){var d=a;d.status="rejected",d.reason=n}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw e=a.reason,zf(e),e}throw xl=a,Wl}}function pl(e){try{var a=e._init;return a(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(xl=s,Wl):s}}var xl=null;function Mf(){if(xl===null)throw Error(o(459));var e=xl;return xl=null,e}function zf(e){if(e===Wl||e===Si)throw Error(o(483))}var en=null,or=0;function Ei(e){var a=or;return or+=1,en===null&&(en=[]),Lf(en,e,a)}function cr(e,a){a=a.props.ref,e.ref=a!==void 0?a:null}function Ti(e,a){throw a.$$typeof===E?Error(o(525)):(e=Object.prototype.toString.call(a),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":e)))}function Uf(e){function a(V,D){if(e){var I=V.deletions;I===null?(V.deletions=[D],V.flags|=16):I.push(D)}}function s(V,D){if(!e)return null;for(;D!==null;)a(V,D),D=D.sibling;return null}function n(V){for(var D=new Map;V!==null;)V.key!==null?D.set(V.key,V):D.set(V.index,V),V=V.sibling;return D}function d(V,D){return V=ds(V,D),V.index=0,V.sibling=null,V}function u(V,D,I){return V.index=I,e?(I=V.alternate,I!==null?(I=I.index,I<D?(V.flags|=67108866,D):I):(V.flags|=67108866,D)):(V.flags|=1048576,D)}function x(V){return e&&V.alternate===null&&(V.flags|=67108866),V}function j(V,D,I,re){return D===null||D.tag!==6?(D=Sc(I,V.mode,re),D.return=V,D):(D=d(D,I),D.return=V,D)}function M(V,D,I,re){var Me=I.type;return Me===k?ae(V,D,I.props.children,re,I.key):D!==null&&(D.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===P&&pl(Me)===D.type)?(D=d(D,I.props),cr(D,I),D.return=V,D):(D=vi(I.type,I.key,I.props,null,V.mode,re),cr(D,I),D.return=V,D)}function Y(V,D,I,re){return D===null||D.tag!==4||D.stateNode.containerInfo!==I.containerInfo||D.stateNode.implementation!==I.implementation?(D=Cc(I,V.mode,re),D.return=V,D):(D=d(D,I.children||[]),D.return=V,D)}function ae(V,D,I,re,Me){return D===null||D.tag!==7?(D=dl(I,V.mode,re,Me),D.return=V,D):(D=d(D,I),D.return=V,D)}function ie(V,D,I){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=Sc(""+D,V.mode,I),D.return=V,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case R:return I=vi(D.type,D.key,D.props,null,V.mode,I),cr(I,D),I.return=V,I;case N:return D=Cc(D,V.mode,I),D.return=V,D;case P:return D=pl(D),ie(V,D,I)}if(ye(D)||$(D))return D=dl(D,V.mode,I,null),D.return=V,D;if(typeof D.then=="function")return ie(V,Ei(D),I);if(D.$$typeof===z)return ie(V,wi(V,D),I);Ti(V,D)}return null}function X(V,D,I,re){var Me=D!==null?D.key:null;if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return Me!==null?null:j(V,D,""+I,re);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case R:return I.key===Me?M(V,D,I,re):null;case N:return I.key===Me?Y(V,D,I,re):null;case P:return I=pl(I),X(V,D,I,re)}if(ye(I)||$(I))return Me!==null?null:ae(V,D,I,re,null);if(typeof I.then=="function")return X(V,D,Ei(I),re);if(I.$$typeof===z)return X(V,D,wi(V,I),re);Ti(V,I)}return null}function ee(V,D,I,re,Me){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return V=V.get(I)||null,j(D,V,""+re,Me);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case R:return V=V.get(re.key===null?I:re.key)||null,M(D,V,re,Me);case N:return V=V.get(re.key===null?I:re.key)||null,Y(D,V,re,Me);case P:return re=pl(re),ee(V,D,I,re,Me)}if(ye(re)||$(re))return V=V.get(I)||null,ae(D,V,re,Me,null);if(typeof re.then=="function")return ee(V,D,I,Ei(re),Me);if(re.$$typeof===z)return ee(V,D,I,wi(D,re),Me);Ti(D,re)}return null}function Ee(V,D,I,re){for(var Me=null,We=null,_e=D,Ie=D=0,Ke=null;_e!==null&&Ie<I.length;Ie++){_e.index>Ie?(Ke=_e,_e=null):Ke=_e.sibling;var et=X(V,_e,I[Ie],re);if(et===null){_e===null&&(_e=Ke);break}e&&_e&&et.alternate===null&&a(V,_e),D=u(et,D,Ie),We===null?Me=et:We.sibling=et,We=et,_e=Ke}if(Ie===I.length)return s(V,_e),Ze&&us(V,Ie),Me;if(_e===null){for(;Ie<I.length;Ie++)_e=ie(V,I[Ie],re),_e!==null&&(D=u(_e,D,Ie),We===null?Me=_e:We.sibling=_e,We=_e);return Ze&&us(V,Ie),Me}for(_e=n(_e);Ie<I.length;Ie++)Ke=ee(_e,V,Ie,I[Ie],re),Ke!==null&&(e&&Ke.alternate!==null&&_e.delete(Ke.key===null?Ie:Ke.key),D=u(Ke,D,Ie),We===null?Me=Ke:We.sibling=Ke,We=Ke);return e&&_e.forEach(function(Ws){return a(V,Ws)}),Ze&&us(V,Ie),Me}function De(V,D,I,re){if(I==null)throw Error(o(151));for(var Me=null,We=null,_e=D,Ie=D=0,Ke=null,et=I.next();_e!==null&&!et.done;Ie++,et=I.next()){_e.index>Ie?(Ke=_e,_e=null):Ke=_e.sibling;var Ws=X(V,_e,et.value,re);if(Ws===null){_e===null&&(_e=Ke);break}e&&_e&&Ws.alternate===null&&a(V,_e),D=u(Ws,D,Ie),We===null?Me=Ws:We.sibling=Ws,We=Ws,_e=Ke}if(et.done)return s(V,_e),Ze&&us(V,Ie),Me;if(_e===null){for(;!et.done;Ie++,et=I.next())et=ie(V,et.value,re),et!==null&&(D=u(et,D,Ie),We===null?Me=et:We.sibling=et,We=et);return Ze&&us(V,Ie),Me}for(_e=n(_e);!et.done;Ie++,et=I.next())et=ee(_e,V,Ie,et.value,re),et!==null&&(e&&et.alternate!==null&&_e.delete(et.key===null?Ie:et.key),D=u(et,D,Ie),We===null?Me=et:We.sibling=et,We=et);return e&&_e.forEach(function(B2){return a(V,B2)}),Ze&&us(V,Ie),Me}function ht(V,D,I,re){if(typeof I=="object"&&I!==null&&I.type===k&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case R:e:{for(var Me=I.key;D!==null;){if(D.key===Me){if(Me=I.type,Me===k){if(D.tag===7){s(V,D.sibling),re=d(D,I.props.children),re.return=V,V=re;break e}}else if(D.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===P&&pl(Me)===D.type){s(V,D.sibling),re=d(D,I.props),cr(re,I),re.return=V,V=re;break e}s(V,D);break}else a(V,D);D=D.sibling}I.type===k?(re=dl(I.props.children,V.mode,re,I.key),re.return=V,V=re):(re=vi(I.type,I.key,I.props,null,V.mode,re),cr(re,I),re.return=V,V=re)}return x(V);case N:e:{for(Me=I.key;D!==null;){if(D.key===Me)if(D.tag===4&&D.stateNode.containerInfo===I.containerInfo&&D.stateNode.implementation===I.implementation){s(V,D.sibling),re=d(D,I.children||[]),re.return=V,V=re;break e}else{s(V,D);break}else a(V,D);D=D.sibling}re=Cc(I,V.mode,re),re.return=V,V=re}return x(V);case P:return I=pl(I),ht(V,D,I,re)}if(ye(I))return Ee(V,D,I,re);if($(I)){if(Me=$(I),typeof Me!="function")throw Error(o(150));return I=Me.call(I),De(V,D,I,re)}if(typeof I.then=="function")return ht(V,D,Ei(I),re);if(I.$$typeof===z)return ht(V,D,wi(V,I),re);Ti(V,I)}
vendor: 4,950 bytes, line 48
48return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,D!==null&&D.tag===6?(s(V,D.sibling),re=d(D,I),re.return=V,V=re):(s(V,D),re=Sc(I,V.mode,re),re.return=V,V=re),x(V)):s(V,D)}return function(V,D,I,re){try{or=0;var Me=ht(V,D,I,re);return en=null,Me}catch(_e){if(_e===Wl||_e===Si)throw _e;var We=xa(29,_e,null,V.mode);return We.lanes=re,We.return=V,We}finally{}}}var gl=Uf(!0),Df=Uf(!1),Ds=!1;function Bc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hc(e,a){e=e.updateQueue,a.updateQueue===e&&(a.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Os(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Bs(e,a,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(tt&2)!==0){var d=n.pending;return d===null?a.next=a:(a.next=d.next,d.next=a),n.pending=a,a=yi(e),yf(e,null,s),a}return bi(e,n,a,s),yi(e)}function dr(e,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var n=a.lanes;n&=e.pendingLanes,s|=n,a.lanes=s,Gn(e,s)}}function qc(e,a){var s=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,s===n)){var d=null,u=null;if(s=s.firstBaseUpdate,s!==null){do{var x={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};u===null?d=u=x:u=u.next=x,s=s.next}while(s!==null);u===null?d=u=a:u=u.next=a}else d=u=a;s={baseState:n.baseState,firstBaseUpdate:d,lastBaseUpdate:u,shared:n.shared,callbacks:n.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=a:e.next=a,s.lastBaseUpdate=a}var Vc=!1;function ur(){if(Vc){var e=Jl;if(e!==null)throw e}}function mr(e,a,s,n){Vc=!1;var d=e.updateQueue;Ds=!1;var u=d.firstBaseUpdate,x=d.lastBaseUpdate,j=d.shared.pending;if(j!==null){d.shared.pending=null;var M=j,Y=M.next;M.next=null,x===null?u=Y:x.next=Y,x=M;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,j=ae.lastBaseUpdate,j!==x&&(j===null?ae.firstBaseUpdate=Y:j.next=Y,ae.lastBaseUpdate=M))}if(u!==null){var ie=d.baseState;x=0,ae=Y=M=null,j=u;do{var X=j.lane&-536870913,ee=X!==j.lane;if(ee?(Xe&X)===X:(n&X)===X){X!==0&&X===Zl&&(Vc=!0),ae!==null&&(ae=ae.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var Ee=e,De=j;X=a;var ht=s;switch(De.tag){case 1:if(Ee=De.payload,typeof Ee=="function"){ie=Ee.call(ht,ie,X);break e}ie=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=De.payload,X=typeof Ee=="function"?Ee.call(ht,ie,X):Ee,X==null)break e;ie=v({},ie,X);break e;case 2:Ds=!0}}X=j.callback,X!==null&&(e.flags|=64,ee&&(e.flags|=8192),ee=d.callbacks,ee===null?d.callbacks=[X]:ee.push(X))}else ee={lane:X,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ae===null?(Y=ae=ee,M=ie):ae=ae.next=ee,x|=X;if(j=j.next,j===null){if(j=d.shared.pending,j===null)break;ee=j,j=ee.next,ee.next=null,d.lastBaseUpdate=ee,d.shared.pending=null}}while(!0);ae===null&&(M=ie),d.baseState=M,d.firstBaseUpdate=Y,d.lastBaseUpdate=ae,u===null&&(d.shared.lanes=0),Is|=x,e.lanes=x,e.memoizedState=ie}}function Of(e,a){if(typeof e!="function")throw Error(o(191,e));e.call(a)}function Bf(e,a){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Of(s[e],a)}var tn=S(null),Ri=S(0);function Hf(e,a){e=Ns,J(Ri,e),J(tn,a),Ns=e|a.baseLanes}function $c(){J(Ri,Ns),J(tn,tn.current)}function Ic(){Ns=Ri.current,B(tn),B(Ri)}var ga=S(null),La=null;function Hs(e){var a=e.alternate;J(At,At.current&1),J(ga,e),La===null&&(a===null||tn.current!==null||a.memoizedState!==null)&&(La=e)}function Gc(e){J(At,At.current),J(ga,e),La===null&&(La=e)}function qf(e){e.tag===22?(J(At,At.current),J(ga,e),La===null&&(La=e)):qs()}function qs(){J(At,At.current),J(ga,ga.current)}function ba(e){B(ga),La===e&&(La=null),B(At)}var At=S(0);function Ai(e){for(var a=e;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Kd(s)||Zd(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var hs=0,$e=null,mt=null,zt=null,_i=!1,an=!1,bl=!1,Li=0,fr=0,sn=null,Tb=0;function Tt(){throw Error(o(321))}function Yc(e,a){if(a===null)return!1;for(var s=0;s<a.length&&s<e.length;s++)if(!pa(e[s],a[s]))return!1;return!0}function Pc(e,a,s,n,d,u){return hs=u,$e=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,U.H=e===null||e.memoizedState===null?wh:id,bl=!1,u=s(n,d),bl=!1,an&&(u=$f(a,s,n,d)),Vf(e),u}function Vf(e){U.H=xr;var a=mt!==null&&mt.next!==null;if(hs=0,zt=mt=$e=null,_i=!1,fr=0,sn=null,a)throw Error(o(300));
vendor: 18,671 bytes, line 48
48e===null||Ut||(e=e.dependencies,e!==null&&Ni(e)&&(Ut=!0))}function $f(e,a,s,n){$e=e;var d=0;do{if(an&&(sn=null),fr=0,an=!1,25<=d)throw Error(o(301));if(d+=1,zt=mt=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}U.H=kh,u=a(s,n)}while(an);return u}function Rb(){var e=U.H,a=e.useState()[0];return a=typeof a.then=="function"?hr(a):a,e=e.useState()[0],(mt!==null?mt.memoizedState:null)!==e&&($e.flags|=1024),a}function Fc(){var e=Li!==0;return Li=0,e}function Qc(e,a,s){a.updateQueue=e.updateQueue,a.flags&=-2053,e.lanes&=~s}function Xc(e){if(_i){for(e=e.memoizedState;e!==null;){var a=e.queue;a!==null&&(a.pending=null),e=e.next}_i=!1}hs=0,zt=mt=$e=null,an=!1,fr=Li=0,sn=null}function ta(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?$e.memoizedState=zt=e:zt=zt.next=e,zt}function _t(){if(mt===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var a=zt===null?$e.memoizedState:zt.next;if(a!==null)zt=a,mt=e;else{if(e===null)throw $e.alternate===null?Error(o(467)):Error(o(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},zt===null?$e.memoizedState=zt=e:zt=zt.next=e}return zt}function Mi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hr(e){var a=fr;return fr+=1,sn===null&&(sn=[]),e=Lf(sn,e,a),a=$e,(zt===null?a.memoizedState:zt.next)===null&&(a=a.alternate,U.H=a===null||a.memoizedState===null?wh:id),e}function zi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return hr(e);if(e.$$typeof===z)return Gt(e)}throw Error(o(438,String(e)))}function Kc(e){var a=null,s=$e.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var n=$e.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(a={data:n.data.map(function(d){return d.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=Mi(),$e.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(e),n=0;n<e;n++)s[n]=Q;return a.index++,s}function ps(e,a){return typeof a=="function"?a(e):a}function Ui(e){var a=_t();return Zc(a,mt,e)}function Zc(e,a,s){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=s;var d=e.baseQueue,u=n.pending;if(u!==null){if(d!==null){var x=d.next;d.next=u.next,u.next=x}a.baseQueue=d=u,n.pending=null}if(u=e.baseState,d===null)e.memoizedState=u;else{a=d.next;var j=x=null,M=null,Y=a,ae=!1;do{var ie=Y.lane&-536870913;if(ie!==Y.lane?(Xe&ie)===ie:(hs&ie)===ie){var X=Y.revertLane;if(X===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),ie===Zl&&(ae=!0);else if((hs&X)===X){Y=Y.next,X===Zl&&(ae=!0);continue}else ie={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},M===null?(j=M=ie,x=u):M=M.next=ie,$e.lanes|=X,Is|=X;ie=Y.action,bl&&s(u,ie),u=Y.hasEagerState?Y.eagerState:s(u,ie)}else X={lane:ie,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},M===null?(j=M=X,x=u):M=M.next=X,$e.lanes|=ie,Is|=ie;Y=Y.next}while(Y!==null&&Y!==a);if(M===null?x=u:M.next=j,!pa(u,e.memoizedState)&&(Ut=!0,ae&&(s=Jl,s!==null)))throw s;e.memoizedState=u,e.baseState=x,e.baseQueue=M,n.lastRenderedState=u}return d===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Jc(e){var a=_t(),s=a.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var n=s.dispatch,d=s.pending,u=a.memoizedState;if(d!==null){s.pending=null;var x=d=d.next;do u=e(u,x.action),x=x.next;while(x!==d);pa(u,a.memoizedState)||(Ut=!0),a.memoizedState=u,a.baseQueue===null&&(a.baseState=u),s.lastRenderedState=u}return[u,n]}function If(e,a,s){var n=$e,d=_t(),u=Ze;if(u){if(s===void 0)throw Error(o(407));s=s()}else s=a();var x=!pa((mt||d).memoizedState,s);if(x&&(d.memoizedState=s,Ut=!0),d=d.queue,td(Pf.bind(null,n,d,e),[e]),d.getSnapshot!==a||x||zt!==null&&zt.memoizedState.tag&1){if(n.flags|=2048,ln(9,{destroy:void 0},Yf.bind(null,n,d,s,a),null),gt===null)throw Error(o(349));u||(hs&127)!==0||Gf(n,a,s)}return s}function Gf(e,a,s){e.flags|=16384,e={getSnapshot:a,value:s},a=$e.updateQueue,a===null?(a=Mi(),$e.updateQueue=a,a.stores=[e]):(s=a.stores,s===null?a.stores=[e]:s.push(e))}function Yf(e,a,s,n){a.value=s,a.getSnapshot=n,Ff(a)&&Qf(e)}function Pf(e,a,s){return s(function(){Ff(a)&&Qf(e)})}function Ff(e){var a=e.getSnapshot;e=e.value;try{var s=a();return!pa(e,s)}catch{return!0}}function Qf(e){var a=cl(e,2);a!==null&&ua(a,e,2)}function Wc(e){var a=ta();if(typeof e=="function"){var s=e;if(e=s(),bl){Ye(!0);try{s()}finally{Ye(!1)}}}return a.memoizedState=a.baseState=e,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},a}function Xf(e,a,s,n){return e.baseState=s,Zc(e,mt,typeof n=="function"?n:ps)}function Ab(e,a,s,n,d){if(Bi(e))throw Error(o(485));if(e=a.action,e!==null){var u={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){u.listeners.push(x)}};U.T!==null?s(!0):u.isTransition=!1,n(u),s=a.pending,s===null?(u.next=a.pending=u,Kf(a,u)):(u.next=s.next,a.pending=s.next=u)}}function Kf(e,a){var s=a.action,n=a.payload,d=e.state;if(a.isTransition){var u=U.T,x={};U.T=x;try{var j=s(d,n),M=U.S;M!==null&&M(x,j),Zf(e,a,j)}catch(Y){ed(e,a,Y)}finally{u!==null&&x.types!==null&&(u.types=x.types),U.T=u}}else try{u=s(d,n),Zf(e,a,u)}catch(Y){ed(e,a,Y)}}function Zf(e,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(n){Jf(e,a,n)},function(n){return ed(e,a,n)}):Jf(e,a,s)}function Jf(e,a,s){a.status="fulfilled",a.value=s,Wf(a),e.state=s,a=e.pending,a!==null&&(s=a.next,s===a?e.pending=null:(s=s.next,a.next=s,Kf(e,s)))}function ed(e,a,s){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do a.status="rejected",a.reason=s,Wf(a),a=a.next;while(a!==n)}e.action=null}function Wf(e){e=e.listeners;for(var a=0;a<e.length;a++)(0,e[a])()}function eh(e,a){return a}function th(e,a){if(Ze){var s=gt.formState;if(s!==null){e:{var n=$e;if(Ze){if(vt){t:{for(var d=vt,u=_a;d.nodeType!==8;){if(!u){d=null;break t}if(d=Ma(d.nextSibling),d===null){d=null;break t}}u=d.data,d=u==="F!"||u==="F"?d:null}if(d){vt=Ma(d.nextSibling),n=d.data==="F!";break e}}zs(n)}n=!1}n&&(a=s[0])}}return s=ta(),s.memoizedState=s.baseState=a,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:eh,lastRenderedState:a},s.queue=n,s=vh.bind(null,$e,n),n.dispatch=s,n=Wc(!1),u=rd.bind(null,$e,!1,n.queue),n=ta(),d={state:a,dispatch:null,action:e,pending:null},n.queue=d,s=Ab.bind(null,$e,d,u,s),d.dispatch=s,n.memoizedState=e,[a,s,!1]}function ah(e){var a=_t();return sh(a,mt,e)}function sh(e,a,s){if(a=Zc(e,a,eh)[0],e=Ui(ps)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var n=hr(a)}catch(x){throw x===Wl?Si:x}else n=a;a=_t();var d=a.queue,u=d.dispatch;return s!==a.memoizedState&&($e.flags|=2048,ln(9,{destroy:void 0},_b.bind(null,d,s),null)),[n,u,e]}function _b(e,a){e.action=a}function lh(e){var a=_t(),s=mt;if(s!==null)return sh(a,s,e);_t(),a=a.memoizedState,s=_t();var n=s.queue.dispatch;return s.memoizedState=e,[a,n,!1]}function ln(e,a,s,n){return e={tag:e,create:s,deps:n,inst:a,next:null},a=$e.updateQueue,a===null&&(a=Mi(),$e.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=e.next=e:(n=s.next,s.next=e,e.next=n,a.lastEffect=e),e}function nh(){return _t().memoizedState}function Di(e,a,s,n){var d=ta();$e.flags|=e,d.memoizedState=ln(1|a,{destroy:void 0},s,n===void 0?null:n)}function Oi(e,a,s,n){var d=_t();n=n===void 0?null:n;var u=d.memoizedState.inst;mt!==null&&n!==null&&Yc(n,mt.memoizedState.deps)?d.memoizedState=ln(a,u,s,n):($e.flags|=e,d.memoizedState=ln(1|a,u,s,n))}function rh(e,a){Di(8390656,8,e,a)}function td(e,a){Oi(2048,8,e,a)}function Lb(e){$e.flags|=4;var a=$e.updateQueue;if(a===null)a=Mi(),$e.updateQueue=a,a.events=[e];else{var s=a.events;s===null?a.events=[e]:s.push(e)}}function ih(e){var a=_t().memoizedState;return Lb({ref:a,nextImpl:e}),function(){if((tt&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}function oh(e,a){return Oi(4,2,e,a)}function ch(e,a){return Oi(4,4,e,a)}function dh(e,a){if(typeof a=="function"){e=e();var s=a(e);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return e=e(),a.current=e,function(){a.current=null}}function uh(e,a,s){s=s!=null?s.concat([e]):null,Oi(4,4,dh.bind(null,a,e),s)}function ad(){}function mh(e,a){var s=_t();a=a===void 0?null:a;var n=s.memoizedState;return a!==null&&Yc(a,n[1])?n[0]:(s.memoizedState=[e,a],e)}function fh(e,a){var s=_t();a=a===void 0?null:a;var n=s.memoizedState;if(a!==null&&Yc(a,n[1]))return n[0];if(n=e(),bl){Ye(!0);try{e()}finally{Ye(!1)}}return s.memoizedState=[n,a],n}function sd(e,a,s){return s===void 0||(hs&1073741824)!==0&&(Xe&261930)===0?e.memoizedState=a:(e.memoizedState=s,e=h0(),$e.lanes|=e,Is|=e,s)}function hh(e,a,s,n){return pa(s,a)?s:tn.current!==null?(e=sd(e,s,n),pa(e,a)||(Ut=!0),e):(hs&42)===0||(hs&1073741824)!==0&&(Xe&261930)===0?(Ut=!0,e.memoizedState=s):(e=h0(),$e.lanes|=e,Is|=e,a)}function ph(e,a,s,n,d){var u=ce.p;ce.p=u!==0&&8>u?u:8;var x=U.T,j={};U.T=j,rd(e,!1,a,s);try{var M=d(),Y=U.S;if(Y!==null&&Y(j,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var ae=Eb(M,n);pr(e,a,ae,ja(e))}else pr(e,a,n,ja(e))}catch(ie){pr(e,a,{then:function(){},status:"rejected",reason:ie},ja())}finally{ce.p=u,x!==null&&j.types!==null&&(x.types=j.types),U.T=x}}function Mb(){}function ld(e,a,s,n){if(e.tag!==5)throw Error(o(476));var d=xh(e).queue;ph(e,d,a,C,s===null?Mb:function(){return gh(e),s(n)})}function xh(e){var a=e.memoizedState;if(a!==null)return a;a={memoizedState:C,baseState:C,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:C},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:s},next:null},e.memoizedState=a,e=e.alternate,e!==null&&(e.memoizedState=a),a}function gh(e){var a=xh(e);a.next===null&&(a=e.alternate.memoizedState),pr(e,a.next.queue,{},ja())}function nd(){return Gt(Lr)}function bh(){return _t().memoizedState}function yh(){return _t().memoizedState}function zb(e){for(var a=e.return;a!==null;){switch(a.tag){case 24:case 3:var s=ja();e=Os(s);var n=Bs(a,e,s);n!==null&&(ua(n,a,s),dr(n,a,s)),a={cache:zc()},e.payload=a;return}a=a.return}}function Ub(e,a,s){var n=ja();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Bi(e)?jh(a,s):(s=wc(e,a,s,n),s!==null&&(ua(s,e,n),Nh(s,a,n)))}function vh(e,a,s){var n=ja();pr(e,a,s,n)}function pr(e,a,s,n){var d={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Bi(e))jh(a,d);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=a.lastRenderedReducer,u!==null))try{var x=a.lastRenderedState,j=u(x,s);if(d.hasEagerState=!0,d.eagerState=j,pa(j,x))return bi(e,a,d,0),gt===null&&gi(),!1}catch{}finally{}if(s=wc(e,a,d,n),s!==null)return ua(s,e,n),Nh(s,a,n),!0}return!1}function rd(e,a,s,n){if(n={lane:2,revertLane:Bd(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bi(e)){if(a)throw Error(o(479))}else a=wc(e,s,n,2),a!==null&&ua(a,e,2)}function Bi(e){var a=e.alternate;return e===$e||a!==null&&a===$e}function jh(e,a){an=_i=!0;var s=e.pending;s===null?a.next=a:(a.next=s.next,s.next=a),e.pending=a}function Nh(e,a,s){if((s&4194048)!==0){var n=a.lanes;n&=e.pendingLanes,s|=n,a.lanes=s,Gn(e,s)}}var xr={readContext:Gt,use:zi,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};xr.useEffectEvent=Tt;var wh={readContext:Gt,use:zi,useCallback:function(e,a){return ta().memoizedState=[e,a===void 0?null:a],e},useContext:Gt,useEffect:rh,useImperativeHandle:function(e,a,s){s=s!=null?s.concat([e]):null,Di(4194308,4,dh.bind(null,a,e),s)},useLayoutEffect:function(e,a){return Di(4194308,4,e,a)},useInsertionEffect:function(e,a){Di(4,2,e,a)},useMemo:function(e,a){var s=ta();a=a===void 0?null:a;var n=e();if(bl){Ye(!0);try{e()}finally{Ye(!1)}}return s.memoizedState=[n,a],n},useReducer:function(e,a,s){var n=ta();if(s!==void 0){var d=s(a);if(bl){Ye(!0);try{s(a)}finally{Ye(!1)}}}else d=a;return n.memoizedState=n.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},n.queue=e,e=e.dispatch=Ub.bind(null,$e,e),[n.memoizedState,e]},useRef:function(e){var a=ta();return e={current:e},a.memoizedState=e},useState:function(e){e=Wc(e);var a=e.queue,s=vh.bind(null,$e,a);return a.dispatch=s,[e.memoizedState,s]},useDebugValue:ad,useDeferredValue:function(e,a){var s=ta();return sd(s,e,a)},useTransition:function(){var e=Wc(!1);return e=ph.bind(null,$e,e.queue,!0,!1),ta().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,a,s){var n=$e,d=ta();if(Ze){if(s===void 0)throw Error(o(407));s=s()}else{if(s=a(),gt===null)throw Error(o(349));(Xe&127)!==0||Gf(n,a,s)}d.memoizedState=s;var u={value:s,getSnapshot:a};return d.queue=u,rh(Pf.bind(null,n,u,e),[e]),n.flags|=2048,ln(9,{destroy:void 0},Yf.bind(null,n,u,s,a),null),s},useId:function(){var e=ta(),a=gt.identifierPrefix;if(Ze){var s=Ka,n=Xa;s=(n&~(1<<32-Pe(n)-1)).toString(32)+s,a="_"+a+"R_"+s,s=Li++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=Tb++,a="_"+a+"r_"+s.toString(32)+"_";return e.memoizedState=a},useHostTransitionStatus:nd,useFormState:th,useActionState:th,useOptimistic:function(e){var a=ta();a.memoizedState=a.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=rd.bind(null,$e,!0,s),s.dispatch=a,[e,a]},useMemoCache:Kc,useCacheRefresh:function(){return ta().memoizedState=zb.bind(null,$e)},useEffectEvent:function(e){var a=ta(),s={impl:e};return a.memoizedState=s,function(){if((tt&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},id={readContext:Gt,use:zi,useCallback:mh,useContext:Gt,useEffect:td,useImperativeHandle:uh,useInsertionEffect:oh,useLayoutEffect:ch,useMemo:fh,useReducer:Ui,useRef:nh,useState:function(){return Ui(ps)},useDebugValue:ad,useDeferredValue:function(e,a){var s=_t();return hh(s,mt.memoizedState,e,a)},useTransition:function(){var e=Ui(ps)[0],a=_t().memoizedState;return[typeof e=="boolean"?e:hr(e),a]},useSyncExternalStore:If,useId:bh,useHostTransitionStatus:nd,useFormState:ah,useActionState:ah,useOptimistic:function(e,a){var s=_t();return Xf(s,mt,e,a)},useMemoCache:Kc,useCacheRefresh:yh};id.useEffectEvent=ih;var kh={readContext:Gt,use:zi,useCallback:mh,useContext:Gt,useEffect:td,useImperativeHandle:uh,useInsertionEffect:oh,useLayoutEffect:ch,useMemo:fh,useReducer:Jc,useRef:nh,useState:function(){return Jc(ps)},useDebugValue:ad,useDeferredValue:function(e,a){var s=_t();return mt===null?sd(s,e,a):hh(s,mt.memoizedState,e,a)},useTransition:function(){var e=Jc(ps)[0],a=_t().memoizedState;return[typeof e=="boolean"?e:hr(e),a]},useSyncExternalStore:If,useId:bh,useHostTransitionStatus:nd,useFormState:lh,useActionState:lh,useOptimistic:function(e,a){var s=_t();return mt!==null?Xf(s,mt,e,a):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Kc,useCacheRefresh:yh};kh.useEffectEvent=ih;function od(e,a,s,n){a=e.memoizedState,s=s(n,a),s=s==null?a:v({},a,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var cd={enqueueSetState:function(e,a,s){e=e._reactInternals;var n=ja(),d=Os(n);d.payload=a,s!=null&&(d.callback=s),a=Bs(e,d,n),a!==null&&(ua(a,e,n),dr(a,e,n))},enqueueReplaceState:function(e,a,s){e=e._reactInternals;var n=ja(),d=Os(n);d.tag=1,d.payload=a,s!=null&&(d.callback=s),a=Bs(e,d,n),a!==null&&(ua(a,e,n),dr(a,e,n))},enqueueForceUpdate:function(e,a){e=e._reactInternals;var s=ja(),n=Os(s);n.tag=2,a!=null&&(n.callback=a),a=Bs(e,n,s),a!==null&&(ua(a,e,s),dr(a,e,s))}};function Sh(e,a,s,n,d,u,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,u,x):a.prototype&&a.prototype.isPureReactComponent?!ar(s,n)||!ar(d,u):!0}function Ch(e,a,s,n){e=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,n),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,n),a.state!==e&&cd.enqueueReplaceState(a,a.state,null)}function yl(e,a){var s=a;if("ref"in a){s={};for(var n in a)n!=="ref"&&(s[n]=a[n])}if(e=e.defaultProps){s===a&&(s=v({},s));for(var d in e)s[d]===void 0&&(s[d]=e[d])}return s}function Eh(e){xi(e)}function Th(e){console.error(e)}function Rh(e){xi(e)}function Hi(e,a){try{var s=e.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(n){setTimeout(function(){throw n})}}function Ah(e,a,s){try{var n=e.onCaughtError;n(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function dd(e,a,s){return s=Os(s),s.tag=3,s.payload={element:null},s.callback=function(){Hi(e,a)},s}function _h(e){return e=Os(e),e.tag=3,e}function Lh(e,a,s,n){var d=s.type.getDerivedStateFromError;if(typeof d=="function"){var u=n.value;e.payload=function(){return d(u)},e.callback=function(){Ah(a,s,n)}}var x=s.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Ah(a,s,n),typeof d!="function"&&(Gs===null?Gs=new Set([this]):Gs.add(this));var j=n.stack;this.componentDidCatch(n.value,{componentStack:j!==null?j:""})})}function Db(e,a,s,n,d){if(s.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(a=s.alternate,a!==null&&Kl(a,s,d,!0),s=ga.current,s!==null){switch(s.tag){case 31:case 13:return La===null?Zi():s.alternate===null&&Rt===0&&(Rt=3),s.flags&=-257,s.flags|=65536,s.lanes=d,n===Ci?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([n]):a.add(n),Ud(e,n,d)),!1;case 22:return s.flags|=65536,n===Ci?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([n])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([n]):s.add(n)),Ud(e,n,d)),!1}throw Error(o(435,s.tag))}return Ud(e,n,d),Zi(),!1}if(Ze)return a=ga.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=d,n!==Rc&&(e=Error(o(422),{cause:n}),nr(Ta(e,s)))):(n!==Rc&&(a=Error(o(423),{cause:n}),nr(Ta(a,s))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,n=Ta(n,s),d=dd(e.stateNode,n,d),qc(e,d),Rt!==4&&(Rt=2)),!1;var u=Error(o(520),{cause:n});
vendor: 10,678 bytes, line 48
48if(u=Ta(u,s),kr===null?kr=[u]:kr.push(u),Rt!==4&&(Rt=2),a===null)return!0;n=Ta(n,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,e=d&-d,s.lanes|=e,e=dd(s.stateNode,n,e),qc(s,e),!1;case 1:if(a=s.type,u=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Gs===null||!Gs.has(u))))return s.flags|=65536,d&=-d,s.lanes|=d,d=_h(d),Lh(d,e,s,n),qc(s,d),!1}s=s.return}while(s!==null);return!1}var ud=Error(o(461)),Ut=!1;function Yt(e,a,s,n){a.child=e===null?Df(a,null,s,n):gl(a,e.child,s,n)}function Mh(e,a,s,n,d){s=s.render;var u=a.ref;if("ref"in n){var x={};for(var j in n)j!=="ref"&&(x[j]=n[j])}else x=n;return fl(a),n=Pc(e,a,s,x,u,d),j=Fc(),e!==null&&!Ut?(Qc(e,a,d),xs(e,a,d)):(Ze&&j&&Ec(a),a.flags|=1,Yt(e,a,n,d),a.child)}function zh(e,a,s,n,d){if(e===null){var u=s.type;return typeof u=="function"&&!kc(u)&&u.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=u,Uh(e,a,u,n,d)):(e=vi(s.type,null,n,a,a.mode,d),e.ref=a.ref,e.return=a,a.child=e)}if(u=e.child,!yd(e,d)){var x=u.memoizedProps;if(s=s.compare,s=s!==null?s:ar,s(x,n)&&e.ref===a.ref)return xs(e,a,d)}return a.flags|=1,e=ds(u,n),e.ref=a.ref,e.return=a,a.child=e}function Uh(e,a,s,n,d){if(e!==null){var u=e.memoizedProps;if(ar(u,n)&&e.ref===a.ref)if(Ut=!1,a.pendingProps=n=u,yd(e,d))(e.flags&131072)!==0&&(Ut=!0);else return a.lanes=e.lanes,xs(e,a,d)}return md(e,a,s,n,d)}function Dh(e,a,s,n){var d=n.children,u=e!==null?e.memoizedState:null;if(e===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((a.flags&128)!==0){if(u=u!==null?u.baseLanes|s:s,e!==null){for(n=a.child=e.child,d=0;n!==null;)d=d|n.lanes|n.childLanes,n=n.sibling;n=d&~u}else n=0,a.child=null;return Oh(e,a,u,s,n)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},e!==null&&ki(a,u!==null?u.cachePool:null),u!==null?Hf(a,u):$c(),qf(a);else return n=a.lanes=536870912,Oh(e,a,u!==null?u.baseLanes|s:s,s,n)}else u!==null?(ki(a,u.cachePool),Hf(a,u),qs(),a.memoizedState=null):(e!==null&&ki(a,null),$c(),qs());return Yt(e,a,d,s),a.child}function gr(e,a){return e!==null&&e.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Oh(e,a,s,n,d){var u=Dc();return u=u===null?null:{parent:Mt._currentValue,pool:u},a.memoizedState={baseLanes:s,cachePool:u},e!==null&&ki(a,null),$c(),qf(a),e!==null&&Kl(e,a,n,!0),a.childLanes=d,null}function qi(e,a){return a=$i({mode:a.mode,children:a.children},e.mode),a.ref=e.ref,e.child=a,a.return=e,a}function Bh(e,a,s){return gl(a,e.child,null,s),e=qi(a,a.pendingProps),e.flags|=2,ba(a),a.memoizedState=null,e}function Ob(e,a,s){var n=a.pendingProps,d=(a.flags&128)!==0;if(a.flags&=-129,e===null){if(Ze){if(n.mode==="hidden")return e=qi(a,n),a.lanes=536870912,gr(null,e);if(Gc(a),(e=vt)?(e=K0(e,_a),e=e!==null&&e.data==="&"?e:null,e!==null&&(a.memoizedState={dehydrated:e,treeContext:Ls!==null?{id:Xa,overflow:Ka}:null,retryLane:536870912,hydrationErrors:null},s=jf(e),s.return=a,a.child=s,It=a,vt=null)):e=null,e===null)throw zs(a);return a.lanes=536870912,null}return qi(a,n)}var u=e.memoizedState;if(u!==null){var x=u.dehydrated;if(Gc(a),d)if(a.flags&256)a.flags&=-257,a=Bh(e,a,s);else if(a.memoizedState!==null)a.child=e.child,a.flags|=128,a=null;else throw Error(o(558));else if(Ut||Kl(e,a,s,!1),d=(s&e.childLanes)!==0,Ut||d){if(n=gt,n!==null&&(x=Kt(n,s),x!==0&&x!==u.retryLane))throw u.retryLane=x,cl(e,x),ua(n,e,x),ud;Zi(),a=Bh(e,a,s)}else e=u.treeContext,vt=Ma(x.nextSibling),It=a,Ze=!0,Ms=null,_a=!1,e!==null&&kf(a,e),a=qi(a,n),a.flags|=4096;return a}return e=ds(e.child,{mode:n.mode,children:n.children}),e.ref=a.ref,a.child=e,e.return=a,e}function Vi(e,a){var s=a.ref;if(s===null)e!==null&&e.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(a.flags|=4194816)}}function md(e,a,s,n,d){return fl(a),s=Pc(e,a,s,n,void 0,d),n=Fc(),e!==null&&!Ut?(Qc(e,a,d),xs(e,a,d)):(Ze&&n&&Ec(a),a.flags|=1,Yt(e,a,s,d),a.child)}function Hh(e,a,s,n,d,u){return fl(a),a.updateQueue=null,s=$f(a,n,s,d),Vf(e),n=Fc(),e!==null&&!Ut?(Qc(e,a,u),xs(e,a,u)):(Ze&&n&&Ec(a),a.flags|=1,Yt(e,a,s,u),a.child)}function qh(e,a,s,n,d){if(fl(a),a.stateNode===null){var u=Pl,x=s.contextType;typeof x=="object"&&x!==null&&(u=Gt(x)),u=new s(n,u),a.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=cd,a.stateNode=u,u._reactInternals=a,u=a.stateNode,u.props=n,u.state=a.memoizedState,u.refs={},Bc(a),x=s.contextType,u.context=typeof x=="object"&&x!==null?Gt(x):Pl,u.state=a.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(od(a,s,x,n),u.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(x=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),x!==u.state&&cd.enqueueReplaceState(u,u.state,null),mr(a,n,u,d),ur(),u.state=a.memoizedState),typeof u.componentDidMount=="function"&&(a.flags|=4194308),n=!0}else if(e===null){u=a.stateNode;var j=a.memoizedProps,M=yl(s,j);u.props=M;var Y=u.context,ae=s.contextType;x=Pl,typeof ae=="object"&&ae!==null&&(x=Gt(ae));var ie=s.getDerivedStateFromProps;ae=typeof ie=="function"||typeof u.getSnapshotBeforeUpdate=="function",j=a.pendingProps!==j,ae||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(j||Y!==x)&&Ch(a,u,n,x),Ds=!1;var X=a.memoizedState;u.state=X,mr(a,n,u,d),ur(),Y=a.memoizedState,j||X!==Y||Ds?(typeof ie=="function"&&(od(a,s,ie,n),Y=a.memoizedState),(M=Ds||Sh(a,s,M,n,X,Y,x))?(ae||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(a.flags|=4194308)):(typeof u.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=n,a.memoizedState=Y),u.props=n,u.state=Y,u.context=x,n=M):(typeof u.componentDidMount=="function"&&(a.flags|=4194308),n=!1)}else{u=a.stateNode,Hc(e,a),x=a.memoizedProps,ae=yl(s,x),u.props=ae,ie=a.pendingProps,X=u.context,Y=s.contextType,M=Pl,typeof Y=="object"&&Y!==null&&(M=Gt(Y)),j=s.getDerivedStateFromProps,(Y=typeof j=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(x!==ie||X!==M)&&Ch(a,u,n,M),Ds=!1,X=a.memoizedState,u.state=X,mr(a,n,u,d),ur();var ee=a.memoizedState;x!==ie||X!==ee||Ds||e!==null&&e.dependencies!==null&&Ni(e.dependencies)?(typeof j=="function"&&(od(a,s,j,n),ee=a.memoizedState),(ae=Ds||Sh(a,s,ae,n,X,ee,M)||e!==null&&e.dependencies!==null&&Ni(e.dependencies))?(Y||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(n,ee,M),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(n,ee,M)),typeof u.componentDidUpdate=="function"&&(a.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof u.componentDidUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(a.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(a.flags|=1024),a.memoizedProps=n,a.memoizedState=ee),u.props=n,u.state=ee,u.context=M,n=ae):(typeof u.componentDidUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(a.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(a.flags|=1024),n=!1)}return u=n,Vi(e,a),n=(a.flags&128)!==0,u||n?(u=a.stateNode,s=n&&typeof s.getDerivedStateFromError!="function"?null:u.render(),a.flags|=1,e!==null&&n?(a.child=gl(a,e.child,null,d),a.child=gl(a,null,s,d)):Yt(e,a,s,d),a.memoizedState=u.state,e=a.child):e=xs(e,a,d),e}function Vh(e,a,s,n){return ul(),a.flags|=256,Yt(e,a,s,n),a.child}var fd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hd(e){return{baseLanes:e,cachePool:Af()}}function pd(e,a,s){return e=e!==null?e.childLanes&~s:0,a&&(e|=va),e}function $h(e,a,s){var n=a.pendingProps,d=!1,u=(a.flags&128)!==0,x;if((x=u)||(x=e!==null&&e.memoizedState===null?!1:(At.current&2)!==0),x&&(d=!0,a.flags&=-129),x=(a.flags&32)!==0,a.flags&=-33,e===null){if(Ze){if(d?Hs(a):qs(),(e=vt)?(e=K0(e,_a),e=e!==null&&e.data!=="&"?e:null,e!==null&&(a.memoizedState={dehydrated:e,treeContext:Ls!==null?{id:Xa,overflow:Ka}:null,retryLane:536870912,hydrationErrors:null},s=jf(e),s.return=a,a.child=s,It=a,vt=null)):e=null,e===null)throw zs(a);return Zd(e)?a.lanes=32:a.lanes=536870912,null}var j=n.children;return n=n.fallback,d?(qs(),d=a.mode,j=$i({mode:"hidden",children:j},d),n=dl(n,d,s,null),j.return=a,n.return=a,j.sibling=n,a.child=j,n=a.child,n.memoizedState=hd(s),n.childLanes=pd(e,x,s),a.memoizedState=fd,gr(null,n)):(Hs(a),xd(a,j))}var M=e.memoizedState;if(M!==null&&(j=M.dehydrated,j!==null)){if(u)a.flags&256?(Hs(a),a.flags&=-257,a=gd(e,a,s)):a.memoizedState!==null?(qs(),a.child=e.child,a.flags|=128,a=null):(qs(),j=n.fallback,d=a.mode,n=$i({mode:"visible",children:n.children},d),j=dl(j,d,s,null),j.flags|=2,n.return=a,j.return=a,n.sibling=j,a.child=n,gl(a,e.child,null,s),n=a.child,n.memoizedState=hd(s),n.childLanes=pd(e,x,s),a.memoizedState=fd,a=gr(null,n));else if(Hs(a),Zd(j)){if(x=j.nextSibling&&j.nextSibling.dataset,x)var Y=x.dgst;x=Y,n=Error(o(419)),n.stack="",n.digest=x,nr({value:n,source:null,stack:null}),a=gd(e,a,s)}else if(Ut||Kl(e,a,s,!1),x=(s&e.childLanes)!==0,Ut||x){if(x=gt,x!==null&&(n=Kt(x,s),n!==0&&n!==M.retryLane))throw M.retryLane=n,cl(e,n),ua(x,e,n),ud;Kd(j)||Zi(),a=gd(e,a,s)}else Kd(j)?(a.flags|=192,a.child=e.child,a=null):(e=M.treeContext,vt=Ma(j.nextSibling),It=a,Ze=!0,Ms=null,_a=!1,e!==null&&kf(a,e),a=xd(a,n.children),a.flags|=4096);return a}return d?(qs(),j=n.fallback,d=a.mode,M=e.child,Y=M.sibling,n=ds(M,{mode:"hidden",children:n.children}),n.subtreeFlags=M.subtreeFlags&65011712,Y!==null?j=ds(Y,j):(j=dl(j,d,s,null),j.flags|=2),j.return=a,n.return=a,n.sibling=j,a.child=n,gr(null,n),n=a.child,j=e.child.memoizedState,j===null?j=hd(s):(d=j.cachePool,d!==null?(M=Mt._currentValue,d=d.parent!==M?{parent:M,pool:M}:d):d=Af(),j={baseLanes:j.baseLanes|s,cachePool:d}),n.memoizedState=j,n.childLanes=pd(e,x,s),a.memoizedState=fd,gr(e.child,n)):(Hs(a),s=e.child,e=s.sibling,s=ds(s,{mode:"visible",children:n.children}
vendor: 8,291 bytes, line 48
48),s.return=a,s.sibling=null,e!==null&&(x=a.deletions,x===null?(a.deletions=[e],a.flags|=16):x.push(e)),a.child=s,a.memoizedState=null,s)}function xd(e,a){return a=$i({mode:"visible",children:a},e.mode),a.return=e,e.child=a}function $i(e,a){return e=xa(22,e,null,a),e.lanes=0,e}function gd(e,a,s){return gl(a,e.child,null,s),e=xd(a,a.pendingProps.children),e.flags|=2,a.memoizedState=null,e}function Ih(e,a,s){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a),Lc(e.return,a,s)}function bd(e,a,s,n,d,u){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:d,treeForkCount:u}:(x.isBackwards=a,x.rendering=null,x.renderingStartTime=0,x.last=n,x.tail=s,x.tailMode=d,x.treeForkCount=u)}function Gh(e,a,s){var n=a.pendingProps,d=n.revealOrder,u=n.tail;n=n.children;var x=At.current,j=(x&2)!==0;if(j?(x=x&1|2,a.flags|=128):x&=1,J(At,x),Yt(e,a,n,s),n=Ze?lr:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=a.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ih(e,s,a);else if(e.tag===19)Ih(e,s,a);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===a)break e;for(;e.sibling===null;){if(e.return===null||e.return===a)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(s=a.child,d=null;s!==null;)e=s.alternate,e!==null&&Ai(e)===null&&(d=s),s=s.sibling;s=d,s===null?(d=a.child,a.child=null):(d=s.sibling,s.sibling=null),bd(a,!1,d,s,u,n);break;case"backwards":case"unstable_legacy-backwards":for(s=null,d=a.child,a.child=null;d!==null;){if(e=d.alternate,e!==null&&Ai(e)===null){a.child=d;break}e=d.sibling,d.sibling=s,s=d,d=e}bd(a,!0,s,null,u,n);break;case"together":bd(a,!1,null,null,void 0,n);break;default:a.memoizedState=null}return a.child}function xs(e,a,s){if(e!==null&&(a.dependencies=e.dependencies),Is|=a.lanes,(s&a.childLanes)===0)if(e!==null){if(Kl(e,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(e!==null&&a.child!==e.child)throw Error(o(153));if(a.child!==null){for(e=a.child,s=ds(e,e.pendingProps),a.child=s,s.return=a;e.sibling!==null;)e=e.sibling,s=s.sibling=ds(e,e.pendingProps),s.return=a;s.sibling=null}return a.child}function yd(e,a){return(e.lanes&a)!==0?!0:(e=e.dependencies,!!(e!==null&&Ni(e)))}function Bb(e,a,s){switch(a.tag){case 3:ne(a,a.stateNode.containerInfo),Us(a,Mt,e.memoizedState.cache),ul();break;case 27:case 5:ze(a);break;case 4:ne(a,a.stateNode.containerInfo);break;case 10:Us(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Gc(a),null;break;case 13:var n=a.memoizedState;if(n!==null)return n.dehydrated!==null?(Hs(a),a.flags|=128,null):(s&a.child.childLanes)!==0?$h(e,a,s):(Hs(a),e=xs(e,a,s),e!==null?e.sibling:null);Hs(a);break;case 19:var d=(e.flags&128)!==0;if(n=(s&a.childLanes)!==0,n||(Kl(e,a,s,!1),n=(s&a.childLanes)!==0),d){if(n)return Gh(e,a,s);a.flags|=128}if(d=a.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),J(At,At.current),n)break;return null;case 22:return a.lanes=0,Dh(e,a,s,a.pendingProps);case 24:Us(a,Mt,e.memoizedState.cache)}return xs(e,a,s)}function Yh(e,a,s){if(e!==null)if(e.memoizedProps!==a.pendingProps)Ut=!0;else{if(!yd(e,s)&&(a.flags&128)===0)return Ut=!1,Bb(e,a,s);Ut=(e.flags&131072)!==0}else Ut=!1,Ze&&(a.flags&1048576)!==0&&wf(a,lr,a.index);switch(a.lanes=0,a.tag){case 16:e:{var n=a.pendingProps;if(e=pl(a.elementType),a.type=e,typeof e=="function")kc(e)?(n=yl(e,n),a.tag=1,a=qh(null,a,e,n,s)):(a.tag=0,a=md(null,a,e,n,s));else{if(e!=null){var d=e.$$typeof;if(d===H){a.tag=11,a=Mh(null,a,e,n,s);break e}else if(d===T){a.tag=14,a=zh(null,a,e,n,s);break e}}throw a=te(e)||e,Error(o(306,a,""))}}return a;case 0:return md(e,a,a.type,a.pendingProps,s);case 1:return n=a.type,d=yl(n,a.pendingProps),qh(e,a,n,d,s);case 3:e:{if(ne(a,a.stateNode.containerInfo),e===null)throw Error(o(387));n=a.pendingProps;var u=a.memoizedState;d=u.element,Hc(e,a),mr(a,n,null,s);var x=a.memoizedState;if(n=x.cache,Us(a,Mt,n),n!==u.cache&&Mc(a,[Mt],s,!0),ur(),n=x.element,u.isDehydrated)if(u={element:n,isDehydrated:!1,cache:x.cache},a.updateQueue.baseState=u,a.memoizedState=u,a.flags&256){a=Vh(e,a,n,s);break e}else if(n!==d){d=Ta(Error(o(424)),a),nr(d),a=Vh(e,a,n,s);break e}else{switch(e=a.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(vt=Ma(e.firstChild),It=a,Ze=!0,Ms=null,_a=!0,s=Df(a,null,n,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ul(),n===d){a=xs(e,a,s);break e}Yt(e,a,n,s)}a=a.child}return a;case 26:return Vi(e,a),e===null?(s=ap(a.type,null,a.pendingProps,null))?a.memoizedState=s:Ze||(s=a.type,e=a.pendingProps,n=lo(Ce.current).createElement(s),n[he]=a,n[Ae]=e,Pt(n,s,e),Ht(n),a.stateNode=n):a.memoizedState=ap(a.type,e.memoizedProps,a.pendingProps,e.memoizedState),null;case 27:return ze(a),e===null&&Ze&&(n=a.stateNode=W0(a.type,a.pendingProps,Ce.current),It=a,_a=!0,d=vt,Qs(a.type)?(Jd=d,vt=Ma(n.firstChild)):vt=d),Yt(e,a,a.pendingProps.children,s),Vi(e,a),e===null&&(a.flags|=4194304),a.child;case 5:return e===null&&Ze&&((d=n=vt)&&(n=h2(n,a.type,a.pendingProps,_a),n!==null?(a.stateNode=n,It=a,vt=Ma(n.firstChild),_a=!1,d=!0):d=!1),d||zs(a)),ze(a),d=a.type,u=a.pendingProps,x=e!==null?e.memoizedProps:null,n=u.children,Fd(d,u)?n=null:x!==null&&Fd(d,x)&&(a.flags|=32),a.memoizedState!==null&&(d=Pc(e,a,Rb,null,null,s),Lr._currentValue=d),Vi(e,a),Yt(e,a,n,s),a.child;case 6:return e===null&&Ze&&((e=s=vt)&&(s=p2(s,a.pendingProps,_a),s!==null?(a.stateNode=s,It=a,vt=null,e=!0):e=!1),e||zs(a)),null;case 13:return $h(e,a,s);case 4:return ne(a,a.stateNode.containerInfo),n=a.pendingProps,e===null?a.child=gl(a,null,n,s):Yt(e,a,n,s),a.child;case 11:return Mh(e,a,a.type,a.pendingProps,s);case 7:return Yt(e,a,a.pendingProps,s),a.child;case 8:return Yt(e,a,a.pendingProps.children,s),a.child;case 12:return Yt(e,a,a.pendingProps.children,s),a.child;case 10:return n=a.pendingProps,Us(a,a.type,n.value),Yt(e,a,n.children,s),a.child;case 9:return d=a.type._context,n=a.pendingProps.children,fl(a),d=Gt(d),n=n(d),a.flags|=1,Yt(e,a,n,s),a.child;case 14:return zh(e,a,a.type,a.pendingProps,s);case 15:return Uh(e,a,a.type,a.pendingProps,s);case 19:return Gh(e,a,s);case 31:return Ob(e,a,s);case 22:return Dh(e,a,s,a.pendingProps);case 24:return fl(a),n=Gt(Mt),e===null?(d=Dc(),d===null&&(d=gt,u=zc(),d.pooledCache=u,u.refCount++,u!==null&&(d.pooledCacheLanes|=s),d=u),a.memoizedState={parent:n,cache:d},Bc(a),Us(a,Mt,d)):((e.lanes&s)!==0&&(Hc(e,a),mr(a,null,null,s),ur()),d=e.memoizedState,u=a.memoizedState,d.parent!==n?(d={parent:n,cache:n},a.memoizedState=d,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=d),Us(a,Mt,n)):(n=u.cache,Us(a,Mt,n),n!==d.cache&&Mc(a,[Mt],s,!0))),Yt(e,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(o(156,a.tag))}function gs(e){e.flags|=4}function vd(e,a,s,n,d){if((a=(e.mode&32)!==0)&&(a=!1),a){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(b0())e.flags|=8192;else throw xl=Ci,Oc}else e.flags&=-16777217}function Ph(e,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ip(a))if(b0())e.flags|=8192;else throw xl=Ci,Oc}function Ii(e,a){a!==null&&(e.flags|=4),e.flags&16384&&(a=e.tag!==22?$t():536870912,e.lanes|=a,cn|=a)}function br(e,a){if(!Ze)switch(e.tailMode){case"hidden":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var n=null;s!==null;)s.alternate!==null&&(n=s),s=s.sibling;n===null?a||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function jt(e){var a=e.alternate!==null&&e.alternate.child===e.child,s=0,n=0;if(a)for(var d=e.child;d!==null;)s|=d.lanes|d.childLanes,n|=d.subtreeFlags&65011712,n|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,n|=d.subtreeFlags,n|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=n,e.childLanes=s,a}function Hb(e,a,s){var n=a.pendingProps;switch(Tc(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(a),null;case 1:return jt(a),null;case 3:return s=a.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),a.memoizedState.cache!==n&&(a.flags|=2048),fs(Mt),ge(),s.pe
vendor: 7,495 bytes, line 48
48ndingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Xl(a)?gs(a):e===null||e.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Ac())),jt(a),null;case 26:var d=a.type,u=a.memoizedState;return e===null?(gs(a),u!==null?(jt(a),Ph(a,u)):(jt(a),vd(a,d,null,n,s))):u?u!==e.memoizedState?(gs(a),jt(a),Ph(a,u)):(jt(a),a.flags&=-16777217):(e=e.memoizedProps,e!==n&&gs(a),jt(a),vd(a,d,e,n,s)),null;case 27:if(K(a),s=Ce.current,d=a.type,e!==null&&a.stateNode!=null)e.memoizedProps!==n&&gs(a);else{if(!n){if(a.stateNode===null)throw Error(o(166));return jt(a),null}e=oe.current,Xl(a)?Sf(a):(e=W0(d,n,s),a.stateNode=e,gs(a))}return jt(a),null;case 5:if(K(a),d=a.type,e!==null&&a.stateNode!=null)e.memoizedProps!==n&&gs(a);else{if(!n){if(a.stateNode===null)throw Error(o(166));return jt(a),null}if(u=oe.current,Xl(a))Sf(a);else{var x=lo(Ce.current);switch(u){case 1:u=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:u=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":u=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":u=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":u=x.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof n.is=="string"?x.createElement("select",{is:n.is}):x.createElement("select"),n.multiple?u.multiple=!0:n.size&&(u.size=n.size);break;default:u=typeof n.is=="string"?x.createElement(d,{is:n.is}):x.createElement(d)}}u[he]=a,u[Ae]=n;e:for(x=a.child;x!==null;){if(x.tag===5||x.tag===6)u.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===a)break e;for(;x.sibling===null;){if(x.return===null||x.return===a)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}a.stateNode=u;e:switch(Pt(u,d,n),d){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&gs(a)}}return jt(a),vd(a,a.type,e===null?null:e.memoizedProps,a.pendingProps,s),null;case 6:if(e&&a.stateNode!=null)e.memoizedProps!==n&&gs(a);else{if(typeof n!="string"&&a.stateNode===null)throw Error(o(166));if(e=Ce.current,Xl(a)){if(e=a.stateNode,s=a.memoizedProps,n=null,d=It,d!==null)switch(d.tag){case 27:case 5:n=d.memoizedProps}e[he]=a,e=!!(e.nodeValue===s||n!==null&&n.suppressHydrationWarning===!0||$0(e.nodeValue,s)),e||zs(a,!0)}else e=lo(e).createTextNode(n),e[he]=a,a.stateNode=e}return jt(a),null;case 31:if(s=a.memoizedState,e===null||e.memoizedState!==null){if(n=Xl(a),s!==null){if(e===null){if(!n)throw Error(o(318));if(e=a.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[he]=a}else ul(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;jt(a),e=!1}else s=Ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return a.flags&256?(ba(a),a):(ba(a),null);if((a.flags&128)!==0)throw Error(o(558))}return jt(a),null;case 13:if(n=a.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Xl(a),n!==null&&n.dehydrated!==null){if(e===null){if(!d)throw Error(o(318));if(d=a.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));d[he]=a}else ul(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;jt(a),d=!1}else d=Ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return a.flags&256?(ba(a),a):(ba(a),null)}return ba(a),(a.flags&128)!==0?(a.lanes=s,a):(s=n!==null,e=e!==null&&e.memoizedState!==null,s&&(n=a.child,d=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(d=n.alternate.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==d&&(n.flags|=2048)),s!==e&&s&&(a.child.flags|=8192),Ii(a,a.updateQueue),jt(a),null);case 4:return ge(),e===null&&$d(a.stateNode.containerInfo),jt(a),null;case 10:return fs(a.type),jt(a),null;case 19:if(B(At),n=a.memoizedState,n===null)return jt(a),null;if(d=(a.flags&128)!==0,u=n.rendering,u===null)if(d)br(n,!1);else{if(Rt!==0||e!==null&&(e.flags&128)!==0)for(e=a.child;e!==null;){if(u=Ai(e),u!==null){for(a.flags|=128,br(n,!1),e=u.updateQueue,a.updateQueue=e,Ii(a,e),a.subtreeFlags=0,e=s,s=a.child;s!==null;)vf(s,e),s=s.sibling;return J(At,At.current&1|2),Ze&&us(a,n.treeForkCount),a.child}e=e.sibling}n.tail!==null&&ke()>Qi&&(a.flags|=128,d=!0,br(n,!1),a.lanes=4194304)}else{if(!d)if(e=Ai(u),e!==null){if(a.flags|=128,d=!0,e=e.updateQueue,a.updateQueue=e,Ii(a,e),br(n,!0),n.tail===null&&n.tailMode==="hidden"&&!u.alternate&&!Ze)return jt(a),null}else 2*ke()-n.renderingStartTime>Qi&&s!==536870912&&(a.flags|=128,d=!0,br(n,!1),a.lanes=4194304);n.isBackwards?(u.sibling=a.child,a.child=u):(e=n.last,e!==null?e.sibling=u:a.child=u,n.last=u)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=ke(),e.sibling=null,s=At.current,J(At,d?s&1|2:s&1),Ze&&us(a,n.treeForkCount),e):(jt(a),null);case 22:case 23:return ba(a),Ic(),n=a.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(a.flags|=8192):n&&(a.flags|=8192),n?(s&536870912)!==0&&(a.flags&128)===0&&(jt(a),a.subtreeFlags&6&&(a.flags|=8192)):jt(a),s=a.updateQueue,s!==null&&Ii(a,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==s&&(a.flags|=2048),e!==null&&B(hl),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),fs(Mt),jt(a),null;case 25:return null;case 30:return null}throw Error(o(156,a.tag))}function qb(e,a){switch(Tc(a),a.tag){case 1:return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 3:return fs(Mt),ge(),e=a.flags,(e&65536)!==0&&(e&128)===0?(a.flags=e&-65537|128,a):null;case 26:case 27:case 5:return K(a),null;case 31:if(a.memoizedState!==null){if(ba(a),a.alternate===null)throw Error(o(340));ul()}return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 13:if(ba(a),e=a.memoizedState,e!==null&&e.dehydrated!==null){if(a.alternate===null)throw Error(o(340));ul()}return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 19:return B(At),null;case 4:return ge(),null;case 10:return fs(a.type),null;case 22:case 23:return ba(a),Ic(),e!==null&&B(hl),e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 24:return fs(Mt),null;case 25:return null;default:return null}}function Fh(e,a){switch(Tc(a),a.tag){case 3:fs(Mt),ge();break;case 26:case 27:case 5:K(a);break;case 4:ge();break;case 31:a.memoizedState!==null&&ba(a);break;case 13:ba(a);break;case 19:B(At);break;case 10:fs(a.type);break;case 22:case 23:ba(a),Ic(),e!==null&&B(hl);break;case 24:fs(Mt)}}function yr(e,a){try{var s=a.updateQueue,n=s!==null?s.lastEffect:null;if(n!==null){var d=n.next;s=d;do{if((s.tag&e)===e){n=void 0;var u=s.create,x=s.inst;n=u(),x.destroy=n}s=s.next}while(s!==d)}}catch(j){ot(a,a.return,j)}}function Vs(e,a,s){try{var n=a.updateQueue,d=n!==null?n.lastEffect:null;if(d!==null){var u=d.next;n=u;do{if((n.tag&e)===e){var x=n.inst,j=x.destroy;if(j!==void 0){x.destroy=void 0,d=a;var M=s,Y=j;try{Y()}catch(ae){ot(d,M,ae)}}}n=n.next}while(n!==u)}}catch(ae){ot(a,a.return,ae)}}function Qh(e){var a=e.updateQueue;if(a!==null){var s=e.stateNode;try{Bf(a,s)}catch(n){ot(e,e.return,n)}}}function Xh(e,a,s){s.props=yl(e.type,e.memoizedProps),s.state=e.memoizedState;
vendor: 19,451 bytes, line 48
48try{s.componentWillUnmount()}catch(n){ot(e,a,n)}}function vr(e,a){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof s=="function"?e.refCleanup=s(n):s.current=n}}catch(d){ot(e,a,d)}}function Za(e,a){var s=e.ref,n=e.refCleanup;if(s!==null)if(typeof n=="function")try{n()}catch(d){ot(e,a,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(d){ot(e,a,d)}else s.current=null}function Kh(e){var a=e.type,s=e.memoizedProps,n=e.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break e;case"img":s.src?n.src=s.src:s.srcSet&&(n.srcset=s.srcSet)}}catch(d){ot(e,e.return,d)}}function jd(e,a,s){try{var n=e.stateNode;o2(n,e.type,s,a),n[Ae]=a}catch(d){ot(e,e.return,d)}}function Zh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qs(e.type)||e.tag===4}function Nd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Zh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Qs(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function wd(e,a,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(e),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=os));else if(n!==4&&(n===27&&Qs(e.type)&&(s=e.stateNode,a=null),e=e.child,e!==null))for(wd(e,a,s),e=e.sibling;e!==null;)wd(e,a,s),e=e.sibling}function Gi(e,a,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,a?s.insertBefore(e,a):s.appendChild(e);else if(n!==4&&(n===27&&Qs(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Gi(e,a,s),e=e.sibling;e!==null;)Gi(e,a,s),e=e.sibling}function Jh(e){var a=e.stateNode,s=e.memoizedProps;try{for(var n=e.type,d=a.attributes;d.length;)a.removeAttributeNode(d[0]);Pt(a,n,s),a[he]=e,a[Ae]=s}catch(u){ot(e,e.return,u)}}var bs=!1,Dt=!1,kd=!1,Wh=typeof WeakSet=="function"?WeakSet:Set,qt=null;function Vb(e,a){if(e=e.containerInfo,Yd=mo,e=uf(e),gc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var n=s.getSelection&&s.getSelection();if(n&&n.rangeCount!==0){s=n.anchorNode;var d=n.anchorOffset,u=n.focusNode;n=n.focusOffset;try{s.nodeType,u.nodeType}catch{s=null;break e}var x=0,j=-1,M=-1,Y=0,ae=0,ie=e,X=null;t:for(;;){for(var ee;ie!==s||d!==0&&ie.nodeType!==3||(j=x+d),ie!==u||n!==0&&ie.nodeType!==3||(M=x+n),ie.nodeType===3&&(x+=ie.nodeValue.length),(ee=ie.firstChild)!==null;)X=ie,ie=ee;for(;;){if(ie===e)break t;if(X===s&&++Y===d&&(j=x),X===u&&++ae===n&&(M=x),(ee=ie.nextSibling)!==null)break;ie=X,X=ie.parentNode}ie=ee}s=j===-1||M===-1?null:{start:j,end:M}}else s=null}s=s||{start:0,end:0}}else s=null;for(Pd={focusedElem:e,selectionRange:s},mo=!1,qt=a;qt!==null;)if(a=qt,e=a.child,(a.subtreeFlags&1028)!==0&&e!==null)e.return=a,qt=e;else for(;qt!==null;){switch(a=qt,u=a.alternate,e=a.flags,a.tag){case 0:if((e&4)!==0&&(e=a.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)d=e[s],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,s=a,d=u.memoizedProps,u=u.memoizedState,n=s.stateNode;try{var Ee=yl(s.type,d);e=n.getSnapshotBeforeUpdate(Ee,u),n.__reactInternalSnapshotBeforeUpdate=e}catch(De){ot(s,s.return,De)}}break;case 3:if((e&1024)!==0){if(e=a.stateNode.containerInfo,s=e.nodeType,s===9)Xd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Xd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=a.sibling,e!==null){e.return=a.return,qt=e;break}qt=a.return}}function e0(e,a,s){var n=s.flags;switch(s.tag){case 0:case 11:case 15:vs(e,s),n&4&&yr(5,s);break;case 1:if(vs(e,s),n&4)if(e=s.stateNode,a===null)try{e.componentDidMount()}catch(x){ot(s,s.return,x)}else{var d=yl(s.type,a.memoizedProps);a=a.memoizedState;try{e.componentDidUpdate(d,a,e.__reactInternalSnapshotBeforeUpdate)}catch(x){ot(s,s.return,x)}}n&64&&Qh(s),n&512&&vr(s,s.return);break;case 3:if(vs(e,s),n&64&&(e=s.updateQueue,e!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{Bf(e,a)}catch(x){ot(s,s.return,x)}}break;case 27:a===null&&n&4&&Jh(s);case 26:case 5:vs(e,s),a===null&&n&4&&Kh(s),n&512&&vr(s,s.return);break;case 12:vs(e,s);break;case 31:vs(e,s),n&4&&s0(e,s);break;case 13:vs(e,s),n&4&&l0(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Kb.bind(null,s),x2(e,s))));break;case 22:if(n=s.memoizedState!==null||bs,!n){a=a!==null&&a.memoizedState!==null||Dt,d=bs;var u=Dt;bs=n,(Dt=a)&&!u?js(e,s,(s.subtreeFlags&8772)!==0):vs(e,s),bs=d,Dt=u}break;case 30:break;default:vs(e,s)}}function t0(e){var a=e.alternate;a!==null&&(e.alternate=null,t0(a)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(a=e.stateNode,a!==null&&ec(a)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kt=null,ia=!1;function ys(e,a,s){for(s=s.child;s!==null;)a0(e,a,s),s=s.sibling}function a0(e,a,s){if(Re&&typeof Re.onCommitFiberUnmount=="function")try{Re.onCommitFiberUnmount(pe,s)}catch{}switch(s.tag){case 26:Dt||Za(s,a),ys(e,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Dt||Za(s,a);var n=kt,d=ia;Qs(s.type)&&(kt=s.stateNode,ia=!1),ys(e,a,s),Rr(s.stateNode),kt=n,ia=d;break;case 5:Dt||Za(s,a);case 6:if(n=kt,d=ia,kt=null,ys(e,a,s),kt=n,ia=d,kt!==null)if(ia)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(s.stateNode)}catch(u){ot(s,a,u)}else try{kt.removeChild(s.stateNode)}catch(u){ot(s,a,u)}break;case 18:kt!==null&&(ia?(e=kt,Q0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),gn(e)):Q0(kt,s.stateNode));break;case 4:n=kt,d=ia,kt=s.stateNode.containerInfo,ia=!0,ys(e,a,s),kt=n,ia=d;break;case 0:case 11:case 14:case 15:Vs(2,s,a),Dt||Vs(4,s,a),ys(e,a,s);break;case 1:Dt||(Za(s,a),n=s.stateNode,typeof n.componentWillUnmount=="function"&&Xh(s,a,n)),ys(e,a,s);break;case 21:ys(e,a,s);break;case 22:Dt=(n=Dt)||s.memoizedState!==null,ys(e,a,s),Dt=n;break;default:ys(e,a,s)}}function s0(e,a){if(a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gn(e)}catch(s){ot(a,a.return,s)}}}function l0(e,a){if(a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gn(e)}catch(s){ot(a,a.return,s)}}function $b(e){switch(e.tag){case 31:case 13:case 19:var a=e.stateNode;return a===null&&(a=e.stateNode=new Wh),a;case 22:return e=e.stateNode,a=e._retryCache,a===null&&(a=e._retryCache=new Wh),a;default:throw Error(o(435,e.tag))}}function Yi(e,a){var s=$b(e);a.forEach(function(n){if(!s.has(n)){s.add(n);var d=Zb.bind(null,e,n);n.then(d,d)}})}function oa(e,a){var s=a.deletions;if(s!==null)for(var n=0;n<s.length;n++){var d=s[n],u=e,x=a,j=x;e:for(;j!==null;){switch(j.tag){case 27:if(Qs(j.type)){kt=j.stateNode,ia=!1;break e}break;case 5:kt=j.stateNode,ia=!1;break e;case 3:case 4:kt=j.stateNode.containerInfo,ia=!0;break e}j=j.return}if(kt===null)throw Error(o(160));a0(u,x,d),kt=null,ia=!1,u=d.alternate,u!==null&&(u.return=null),d.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)n0(a,e),a=a.sibling}var $a=null;function n0(e,a){var s=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:oa(a,e),ca(e),n&4&&(Vs(3,e,e.return),yr(3,e),Vs(5,e,e.return));break;case 1:oa(a,e),ca(e),n&512&&(Dt||s===null||Za(s,s.return)),n&64&&bs&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?n:s.concat(n))));break;case 26:var d=$a;if(oa(a,e),ca(e),n&512&&(Dt||s===null||Za(s,s.return)),n&4){var u=s!==null?s.memoizedState:null;if(n=e.memoizedState,s===null)if(n===null)if(e.stateNode===null){e:{n=e.type,s=e.memoizedProps,d=d.ownerDocument||d;t:switch(n){case"title":u=d.getElementsByTagName("title")[0],(!u||u[Fn]||u[he]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=d.createElement(n),d.head.insertBefore(u,d.querySelector("head > title"))),Pt(u,n,s),u[he]=e,Ht(u),n=u;break e;case"link":var x=np("link","href",d).get(n+(s.href||""));if(x){for(var j=0;j<x.length;j++)if(u=x[j],u.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&u.getAttribute("rel")===(s.rel==null?null:s.rel)&&u.getAttribute("title")===(s.title==null?null:s.title)&&u.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){x.splice(j,1);break t}}u=d.createElement(n),Pt(u,n,s),d.head.appendChild(u);break;case"meta":if(x=np("meta","content",d).get(n+(s.content||""))){for(j=0;j<x.length;j++)if(u=x[j],u.getAttribute("content")===(s.content==null?null:""+s.content)&&u.getAttribute("name")===(s.name==null?null:s.name)&&u.getAttribute("property")===(s.property==null?null:s.property)&&u.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&u.getAttribute("charset")===(s.charSet==null?null:s.charSet)){x.splice(j,1);break t}}u=d.createElement(n),Pt(u,n,s),d.head.appendChild(u);break;default:throw Error(o(468,n))}u[he]=e,Ht(u),n=u}e.stateNode=n}else rp(d,e.type,e.stateNode);else e.stateNode=lp(d,n,e.memoizedProps);else u!==n?(u===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):u.count--,n===null?rp(d,e.type,e.stateNode):lp(d,n,e.memoizedProps)):n===null&&e.stateNode!==null&&jd(e,e.memoizedProps,s.memoizedProps)}break;case 27:oa(a,e),ca(e),n&512&&(Dt||s===null||Za(s,s.return)),s!==null&&n&4&&jd(e,e.memoizedProps,s.memoizedProps);break;case 5:if(oa(a,e),ca(e),n&512&&(Dt||s===null||Za(s,s.return)),e.flags&32){d=e.stateNode;try{Hl(d,"")}catch(Ee){ot(e,e.return,Ee)}}n&4&&e.stateNode!=null&&(d=e.memoizedProps,jd(e,d,s!==null?s.memoizedProps:d)),n&1024&&(kd=!0);break;case 6:if(oa(a,e),ca(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,s=e.stateNode;try{s.nodeValue=n}catch(Ee){ot(e,e.return,Ee)}}break;case 3:if(io=null,d=$a,$a=no(a.containerInfo),oa(a,e),$a=d,ca(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{gn(a.containerInfo)}catch(Ee){ot(e,e.return,Ee)}kd&&(kd=!1,r0(e));break;case 4:n=$a,$a=no(e.stateNode.containerInfo),oa(a,e),ca(e),$a=n;break;case 12:oa(a,e),ca(e);break;case 31:oa(a,e),ca(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Yi(e,n)));break;case 13:oa(a,e),ca(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Fi=ke()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Yi(e,n)));break;case 22:d=e.memoizedState!==null;var M=s!==null&&s.memoizedState!==null,Y=bs,ae=Dt;if(bs=Y||d,Dt=ae||M,oa(a,e),Dt=ae,bs=Y,ca(e),n&8192)e:for(a=e.stateNode,a._visibility=d?a._visibility&-2:a._visibility|1,d&&(s===null||M||bs||Dt||vl(e)),s=null,a=e;;){if(a.tag===5||a.tag===26){if(s===null){M=s=a;try{if(u=M.stateNode,d)x=u.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{j=M.stateNode;var ie=M.memoizedProps.style,X=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;j.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Ee){ot(M,M.return,Ee)}}}else if(a.tag===6){if(s===null){M=a;try{M.stateNode.nodeValue=d?"":M.memoizedProps}catch(Ee){ot(M,M.return,Ee)}}}else if(a.tag===18){if(s===null){M=a;try{var ee=M.stateNode;d?X0(ee,!0):X0(M.stateNode,!1)}catch(Ee){ot(M,M.return,Ee)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===e)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break e;for(;a.sibling===null;){if(a.return===null||a.return===e)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}n&4&&(n=e.updateQueue,n!==null&&(s=n.retryQueue,s!==null&&(n.retryQueue=null,Yi(e,s))));break;case 19:oa(a,e),ca(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Yi(e,n)));break;case 30:break;case 21:break;default:oa(a,e),ca(e)}}function ca(e){var a=e.flags;if(a&2){try{for(var s,n=e.return;n!==null;){if(Zh(n)){s=n;break}n=n.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var d=s.stateNode,u=Nd(e);Gi(e,u,d);break;case 5:var x=s.stateNode;s.flags&32&&(Hl(x,""),s.flags&=-33);var j=Nd(e);Gi(e,j,x);break;case 3:case 4:var M=s.stateNode.containerInfo,Y=Nd(e);wd(e,Y,M);break;default:throw Error(o(161))}}catch(ae){ot(e,e.return,ae)}e.flags&=-3}a&4096&&(e.flags&=-4097)}function r0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var a=e;r0(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),e=e.sibling}}function vs(e,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)e0(e,a.alternate,a),a=a.sibling}function vl(e){for(e=e.child;e!==null;){var a=e;switch(a.tag){case 0:case 11:case 14:case 15:Vs(4,a,a.return),vl(a);break;case 1:Za(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&Xh(a,a.return,s),vl(a);break;case 27:Rr(a.stateNode);case 26:case 5:Za(a,a.return),vl(a);break;case 22:a.memoizedState===null&&vl(a);break;case 30:vl(a);break;default:vl(a)}e=e.sibling}}function js(e,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var n=a.alternate,d=e,u=a,x=u.flags;switch(u.tag){case 0:case 11:case 15:js(d,u,s),yr(4,u);break;case 1:if(js(d,u,s),n=u,d=n.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(Y){ot(n,n.return,Y)}if(n=u,d=n.updateQueue,d!==null){var j=n.stateNode;try{var M=d.shared.hiddenCallbacks;if(M!==null)for(d.shared.hiddenCallbacks=null,d=0;d<M.length;d++)Of(M[d],j)}catch(Y){ot(n,n.return,Y)}}s&&x&64&&Qh(u),vr(u,u.return);break;case 27:Jh(u);case 26:case 5:js(d,u,s),s&&n===null&&x&4&&Kh(u),vr(u,u.return);break;case 12:js(d,u,s);break;case 31:js(d,u,s),s&&x&4&&s0(d,u);break;case 13:js(d,u,s),s&&x&4&&l0(d,u);break;case 22:u.memoizedState===null&&js(d,u,s),vr(u,u.return);break;case 30:break;default:js(d,u,s)}a=a.sibling}}function Sd(e,a){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(e=a.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&rr(s))}function Cd(e,a){e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(a.refCount++,e!=null&&rr(e))}function Ia(e,a,s,n){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)i0(e,a,s,n),a=a.sibling}function i0(e,a,s,n){var d=a.flags;switch(a.tag){case 0:case 11:case 15:Ia(e,a,s,n),d&2048&&yr(9,a);break;case 1:Ia(e,a,s,n);break;case 3:Ia(e,a,s,n),d&2048&&(e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(a.refCount++,e!=null&&rr(e)));break;case 12:if(d&2048){Ia(e,a,s,n),e=a.stateNode;try{var u=a.memoizedProps,x=u.id,j=u.onPostCommit;typeof j=="function"&&j(x,a.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){ot(a,a.return,M)}}else Ia(e,a,s,n);break;case 31:Ia(e,a,s,n);break;case 13:Ia(e,a,s,n);break;case 23:break;case 22:u=a.stateNode,x=a.alternate,a.memoizedState!==null?u._visibility&2?Ia(e,a,s,n):jr(e,a):u._visibility&2?Ia(e,a,s,n):(u._visibility|=2,nn(e,a,s,n,(a.subtreeFlags&10256)!==0||!1)),d&2048&&Sd(x,a);break;case 24:Ia(e,a,s,n),d&2048&&Cd(a.alternate,a);break;default:Ia(e,a,s,n)}}function nn(e,a,s,n,d){for(d=d&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var u=e,x=a,j=s,M=n,Y=x.flags;switch(x.tag){case 0:case 11:case 15:nn(u,x,j,M,d),yr(8,x);break;case 23:break;case 22:var ae=x.stateNode;x.memoizedState!==null?ae._visibility&2?nn(u,x,j,M,d):jr(u,x):(ae._visibility|=2,nn(u,x,j,M,d)),d&&Y&2048&&Sd(x.alternate,x);break;case 24:nn(u,x,j,M,d),d&&Y&2048&&Cd(x.alternate,x);break;default:nn(u,x,j,M,d)}a=a.sibling}}function jr(e,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=e,n=a,d=n.flags;switch(n.tag){case 22:jr(s,n),d&2048&&Sd(n.alternate,n);break;case 24:jr(s,n),d&2048&&Cd(n.alternate,n);break;default:jr(s,n)}a=a.sibling}}var Nr=8192;function rn(e,a,s){if(e.subtreeFlags&Nr)for(e=e.child;e!==null;)o0(e,a,s),e=e.sibling}function o0(e,a,s){switch(e.tag){case 26:rn(e,a,s),e.flags&Nr&&e.memoizedState!==null&&T2(s,$a,e.memoizedState,e.memoizedProps);break;case 5:rn(e,a,s);break;case 3:case 4:var n=$a;$a=no(e.stateNode.containerInfo),rn(e,a,s),$a=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Nr,Nr=16777216,rn(e,a,s),Nr=n):rn(e,a,s));break;default:rn(e,a,s)}}function c0(e){var a=e.alternate;if(a!==null&&(e=a.child,e!==null)){a.child=null;do a=e.sibling,e.sibling=null,e=a;while(e!==null)}}function wr(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var n=a[s];qt=n,u0(n,e)}c0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)d0(e),e=e.sibling}function d0(e){switch(e.tag){case 0:case 11:case 15:wr(e),e.flags&2048&&Vs(9,e,e.return);break;case 3:wr(e);break;case 12:wr(e);break;case 22:var a=e.stateNode;e.memoizedState!==null&&a._visibility&2&&(e.return===null||e.return.tag!==13)?(a._visibility&=-3,Pi(e)):wr(e);break;default:wr(e)}}function Pi(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var n=a[s];qt=n,u0(n,e)}c0(e)}for(e=e.child;e!==null;){switch(a=e,a.tag){case 0:case 11:case 15:Vs(8,a,a.return),Pi(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,Pi(a));break;default:Pi(a)}e=e.sibling}}function u0(e,a){for(;qt!==null;){var s=qt;switch(s.tag){case 0:case 11:case 15:Vs(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var n=s.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:rr(s.memoizedState.cache)}if(n=s.child,n!==null)n.return=s,qt=n;else e:for(s=e;qt!==null;){n=qt;var d=n.sibling,u=n.return;if(t0(n),n===s){qt=null;break e}if(d!==null){d.return=u,qt=d;break e}qt=u}}}var Ib={getCacheForType:function(e){var a=Gt(Mt),s=a.data.get(e);return s===void 0&&(s=e(),a.data.set(e,s)),s},cacheSignal:function(){return Gt(Mt).controller.signal}},Gb=typeof WeakMap=="function"?WeakMap:Map,tt=0,gt=null,Fe=null,Xe=0,it=0,ya=null,$s=!1,on=!1,Ed=!1,Ns=0,Rt=0,Is=0,jl=0,Td=0,va=0,cn=0,kr=null,da=null,Rd=!1,Fi=0,m0=0,Qi=1/0,Xi=null,Gs=null,Bt=0,Ys=null,dn=null,ws=0,Ad=0,_d=null,f0=null,Sr=0,Ld=null;function ja(){return(tt&2)!==0&&Xe!==0?Xe&-Xe:U.T!==null?Bd():li()}function h0(){if(va===0)if((Xe&536870912)===0||Ze){var e=Ot;Ot<<=1,(Ot&3932160)===0&&(Ot=262144),va=e}else va=536870912;return e=ga.current,e!==null&&(e.flags|=32),va}function ua(e,a,s){(e===gt&&(it===2||it===9)||e.cancelPendingCommit!==null)&&(un(e,0),Ps(e,Xe,va,!1)),Qa(e,s),((tt&2)===0||e!==gt)&&(e===gt&&((tt&2)===0&&(jl|=s),Rt===4&&Ps(e,Xe,va,!1)),Ja(e))}function p0(e,a,s){if((tt&6)!==0)throw Error(o(327));var n=!s&&(a&127)===0&&(a&e.expiredLanes)===0||Fa(e,a),d=n?Fb(e,a):zd(e,a,!0),u=n;do{if(d===0){on&&!n&&Ps(e,a,0,!1);break}else{if(s=e.current.alternate,u&&!Yb(s)){d=zd(e,a,!1),u=!1;continue}if(d===2){if(u=a,e.errorRecoveryDisabledLanes&u)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){a=x;e:{var j=e;d=kr;var M=j.current.memoizedState.isDehydrated;if(M&&(un(j,x).flags|=256),x=zd(j,x,!1),x!==2){if(Ed&&!M){j.errorRecoveryDisabledLanes|=u,jl|=u,d=4;break e}
vendor: 23,809 bytes, lines 48-49
48u=da,da=d,u!==null&&(da===null?da=u:da.push.apply(da,u))}d=x}if(u=!1,d!==2)continue}}if(d===1){un(e,0),Ps(e,a,0,!0);break}e:{switch(n=e,u=d,u){case 0:case 1:throw Error(o(345));case 4:if((a&4194048)!==a)break;case 6:Ps(n,a,va,!$s);break e;case 2:da=null;break;case 3:case 5:break;default:throw Error(o(329))}if((a&62914560)===a&&(d=Fi+300-ke(),10<d)){if(Ps(n,a,va,!$s),ka(n,0,!0)!==0)break e;ws=a,n.timeoutHandle=P0(x0.bind(null,n,s,da,Xi,Rd,a,va,jl,cn,$s,u,"Throttled",-0,0),d);break e}x0(n,s,da,Xi,Rd,a,va,jl,cn,$s,u,null,-0,0)}}break}while(!0);Ja(e)}function x0(e,a,s,n,d,u,x,j,M,Y,ae,ie,X,ee){if(e.timeoutHandle=-1,ie=a.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:os},o0(a,u,ie);var Ee=(u&62914560)===u?Fi-ke():(u&4194048)===u?m0-ke():0;if(Ee=R2(ie,Ee),Ee!==null){ws=u,e.cancelPendingCommit=Ee(k0.bind(null,e,a,u,s,n,d,x,j,M,ae,ie,null,X,ee)),Ps(e,u,x,!Y);return}}k0(e,a,u,s,n,d,x,j,M)}function Yb(e){for(var a=e;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var n=0;n<s.length;n++){var d=s[n],u=d.getSnapshot;d=d.value;try{if(!pa(u(),d))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ps(e,a,s,n){a&=~Td,a&=~jl,e.suspendedLanes|=a,e.pingedLanes&=~a,n&&(e.warmLanes|=a),n=e.expirationTimes;for(var d=a;0<d;){var u=31-Pe(d),x=1<<u;n[u]=-1,d&=~x}s!==0&&In(e,s,a)}function Ki(){return(tt&6)===0?(Cr(0),!1):!0}function Md(){if(Fe!==null){if(it===0)var e=Fe.return;else e=Fe,ms=ml=null,Xc(e),en=null,or=0,e=Fe;for(;e!==null;)Fh(e.alternate,e),e=e.return;Fe=null}}function un(e,a){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,u2(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ws=0,Md(),gt=e,Fe=s=ds(e.current,null),Xe=a,it=0,ya=null,$s=!1,on=Fa(e,a),Ed=!1,cn=va=Td=jl=Is=Rt=0,da=kr=null,Rd=!1,(a&8)!==0&&(a|=a&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=a;0<n;){var d=31-Pe(n),u=1<<d;a|=e[d],n&=~u}return Ns=a,gi(),s}function g0(e,a){$e=null,U.H=xr,a===Wl||a===Si?(a=Mf(),it=3):a===Oc?(a=Mf(),it=4):it=a===ud?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,ya=a,Fe===null&&(Rt=1,Hi(e,Ta(a,e.current)))}function b0(){var e=ga.current;return e===null?!0:(Xe&4194048)===Xe?La===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?e===La:!1}function y0(){var e=U.H;return U.H=xr,e===null?xr:e}function v0(){var e=U.A;return U.A=Ib,e}function Zi(){Rt=4,$s||(Xe&4194048)!==Xe&&ga.current!==null||(on=!0),(Is&134217727)===0&&(jl&134217727)===0||gt===null||Ps(gt,Xe,va,!1)}function zd(e,a,s){var n=tt;tt|=2;var d=y0(),u=v0();(gt!==e||Xe!==a)&&(Xi=null,un(e,a)),a=!1;var x=Rt;e:do try{if(it!==0&&Fe!==null){var j=Fe,M=ya;switch(it){case 8:Md(),x=6;break e;case 3:case 2:case 9:case 6:ga.current===null&&(a=!0);var Y=it;if(it=0,ya=null,mn(e,j,M,Y),s&&on){x=0;break e}break;default:Y=it,it=0,ya=null,mn(e,j,M,Y)}}Pb(),x=Rt;break}catch(ae){g0(e,ae)}while(!0);return a&&e.shellSuspendCounter++,ms=ml=null,tt=n,U.H=d,U.A=u,Fe===null&&(gt=null,Xe=0,gi()),x}function Pb(){for(;Fe!==null;)j0(Fe)}function Fb(e,a){var s=tt;tt|=2;var n=y0(),d=v0();gt!==e||Xe!==a?(Xi=null,Qi=ke()+500,un(e,a)):on=Fa(e,a);e:do try{if(it!==0&&Fe!==null){a=Fe;var u=ya;t:switch(it){case 1:it=0,ya=null,mn(e,a,u,1);break;case 2:case 9:if(_f(u)){it=0,ya=null,N0(a);break}a=function(){it!==2&&it!==9||gt!==e||(it=7),Ja(e)},u.then(a,a);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:_f(u)?(it=0,ya=null,N0(a)):(it=0,ya=null,mn(e,a,u,7));break;case 5:var x=null;switch(Fe.tag){case 26:x=Fe.memoizedState;case 5:case 27:var j=Fe;if(x?ip(x):j.stateNode.complete){it=0,ya=null;var M=j.sibling;if(M!==null)Fe=M;else{var Y=j.return;Y!==null?(Fe=Y,Ji(Y)):Fe=null}break t}}it=0,ya=null,mn(e,a,u,5);break;case 6:it=0,ya=null,mn(e,a,u,6);break;case 8:Md(),Rt=6;break e;default:throw Error(o(462))}}Qb();break}catch(ae){g0(e,ae)}while(!0);return ms=ml=null,U.H=n,U.A=d,tt=s,Fe!==null?0:(gt=null,Xe=0,gi(),Rt)}function Qb(){for(;Fe!==null&&!As();)j0(Fe)}function j0(e){var a=Yh(e.alternate,e,Ns);e.memoizedProps=e.pendingProps,a===null?Ji(e):Fe=a}function N0(e){var a=e,s=a.alternate;switch(a.tag){case 15:case 0:a=Hh(s,a,a.pendingProps,a.type,void 0,Xe);break;case 11:a=Hh(s,a,a.pendingProps,a.type.render,a.ref,Xe);break;case 5:Xc(a);default:Fh(s,a),a=Fe=vf(a,Ns),a=Yh(s,a,Ns)}e.memoizedProps=e.pendingProps,a===null?Ji(e):Fe=a}function mn(e,a,s,n){ms=ml=null,Xc(a),en=null,or=0;var d=a.return;try{if(Db(e,d,a,s,Xe)){Rt=1,Hi(e,Ta(s,e.current)),Fe=null;return}}catch(u){if(d!==null)throw Fe=d,u;Rt=1,Hi(e,Ta(s,e.current)),Fe=null;return}a.flags&32768?(Ze||n===1?e=!0:on||(Xe&536870912)!==0?e=!1:($s=e=!0,(n===2||n===9||n===3||n===6)&&(n=ga.current,n!==null&&n.tag===13&&(n.flags|=16384))),w0(a,e)):Ji(a)}function Ji(e){var a=e;do{if((a.flags&32768)!==0){w0(a,$s);return}e=a.return;var s=Hb(a.alternate,a,Ns);if(s!==null){Fe=s;return}if(a=a.sibling,a!==null){Fe=a;return}Fe=a=e}while(a!==null);Rt===0&&(Rt=5)}function w0(e,a){do{var s=qb(e.alternate,e);if(s!==null){s.flags&=32767,Fe=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(e=e.sibling,e!==null)){Fe=e;return}Fe=e=s}while(e!==null);Rt=6,Fe=null}function k0(e,a,s,n,d,u,x,j,M){e.cancelPendingCommit=null;do Wi();while(Bt!==0);if((tt&6)!==0)throw Error(o(327));if(a!==null){if(a===e.current)throw Error(o(177));if(u=a.lanes|a.childLanes,u|=Nc,si(e,s,u,x,j,M),e===gt&&(Fe=gt=null,Xe=0),dn=a,Ys=e,ws=s,Ad=u,_d=d,f0=n,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Jb(Ct,function(){return R0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||n){n=U.T,U.T=null,d=ce.p,ce.p=2,x=tt,tt|=4;try{Vb(e,a,s)}finally{tt=x,ce.p=d,U.T=n}}Bt=1,S0(),C0(),E0()}}function S0(){if(Bt===1){Bt=0;var e=Ys,a=dn,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=U.T,U.T=null;var n=ce.p;ce.p=2;var d=tt;tt|=4;try{n0(a,e);var u=Pd,x=uf(e.containerInfo),j=u.focusedElem,M=u.selectionRange;if(x!==j&&j&&j.ownerDocument&&df(j.ownerDocument.documentElement,j)){if(M!==null&&gc(j)){var Y=M.start,ae=M.end;if(ae===void 0&&(ae=Y),"selectionStart"in j)j.selectionStart=Y,j.selectionEnd=Math.min(ae,j.value.length);else{var ie=j.ownerDocument||document,X=ie&&ie.defaultView||window;if(X.getSelection){var ee=X.getSelection(),Ee=j.textContent.length,De=Math.min(M.start,Ee),ht=M.end===void 0?De:Math.min(M.end,Ee);!ee.extend&&De>ht&&(x=ht,ht=De,De=x);var V=cf(j,De),D=cf(j,ht);if(V&&D&&(ee.rangeCount!==1||ee.anchorNode!==V.node||ee.anchorOffset!==V.offset||ee.focusNode!==D.node||ee.focusOffset!==D.offset)){var I=ie.createRange();I.setStart(V.node,V.offset),ee.removeAllRanges(),De>ht?(ee.addRange(I),ee.extend(D.node,D.offset)):(I.setEnd(D.node,D.offset),ee.addRange(I))}}}}for(ie=[],ee=j;ee=ee.parentNode;)ee.nodeType===1&&ie.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<ie.length;j++){var re=ie[j];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}mo=!!Yd,Pd=Yd=null}finally{tt=d,ce.p=n,U.T=s}}e.current=a,Bt=2}}function C0(){if(Bt===2){Bt=0;var e=Ys,a=dn,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=U.T,U.T=null;var n=ce.p;ce.p=2;var d=tt;tt|=4;try{e0(e,a.alternate,a)}finally{tt=d,ce.p=n,U.T=s}}Bt=3}}function E0(){if(Bt===4||Bt===3){Bt=0,we();var e=Ys,a=dn,s=ws,n=f0;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Bt=5:(Bt=0,dn=Ys=null,T0(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Gs=null),Pn(s),a=a.stateNode,Re&&typeof Re.onCommitFiberRoot=="function")try{Re.onCommitFiberRoot(pe,a,void 0,(a.current.flags&128)===128)}catch{}if(n!==null){a=U.T,d=ce.p,ce.p=2,U.T=null;try{for(var u=e.onRecoverableError,x=0;x<n.length;x++){var j=n[x];u(j.value,{componentStack:j.stack})}}finally{U.T=a,ce.p=d}}(ws&3)!==0&&Wi(),Ja(e),d=e.pendingLanes,(s&261930)!==0&&(d&42)!==0?e===Ld?Sr++:(Sr=0,Ld=e):Sr=0,Cr(0)}}function T0(e,a){(e.pooledCacheLanes&=a)===0&&(a=e.pooledCache,a!=null&&(e.pooledCache=null,rr(a)))}function Wi(){return S0(),C0(),E0(),R0()}function R0(){if(Bt!==5)return!1;var e=Ys,a=Ad;Ad=0;var s=Pn(ws),n=U.T,d=ce.p;try{ce.p=32>s?32:s,U.T=null,s=_d,_d=null;var u=Ys,x=ws;if(Bt=0,dn=Ys=null,ws=0,(tt&6)!==0)throw Error(o(331));var j=tt;if(tt|=4,d0(u.current),i0(u,u.current,x,s),tt=j,Cr(0,!1),Re&&typeof Re.onPostCommitFiberRoot=="function")try{Re.onPostCommitFiberRoot(pe,u)}catch{}return!0}finally{ce.p=d,U.T=n,T0(e,a)}}function A0(e,a,s){a=Ta(s,a),a=dd(e.stateNode,a,2),e=Bs(e,a,2),e!==null&&(Qa(e,2),Ja(e))}function ot(e,a,s){if(e.tag===3)A0(e,e,s);else for(;a!==null;){if(a.tag===3){A0(a,e,s);break}else if(a.tag===1){var n=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Gs===null||!Gs.has(n))){e=Ta(s,e),s=_h(2),n=Bs(a,s,2),n!==null&&(Lh(s,n,a,e),Qa(n,2),Ja(n));break}}a=a.return}}function Ud(e,a,s){var n=e.pingCache;if(n===null){n=e.pingCache=new Gb;var d=new Set;n.set(a,d)}else d=n.get(a),d===void 0&&(d=new Set,n.set(a,d));d.has(s)||(Ed=!0,d.add(s),e=Xb.bind(null,e,a,s),a.then(e,e))}function Xb(e,a,s){var n=e.pingCache;n!==null&&n.delete(a),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,gt===e&&(Xe&s)===s&&(Rt===4||Rt===3&&(Xe&62914560)===Xe&&300>ke()-Fi?(tt&2)===0&&un(e,0):Td|=s,cn===Xe&&(cn=0)),Ja(e)}function _0(e,a){a===0&&(a=$t()),e=cl(e,a),e!==null&&(Qa(e,a),Ja(e))}function Kb(e){var a=e.memoizedState,s=0;a!==null&&(s=a.retryLane),_0(e,s)}function Zb(e,a){var s=0;switch(e.tag){case 31:case 13:var n=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}n!==null&&n.delete(a),_0(e,s)}function Jb(e,a){return lt(e,a)}var eo=null,fn=null,Dd=!1,to=!1,Od=!1,Fs=0;function Ja(e){e!==fn&&e.next===null&&(fn===null?eo=fn=e:fn=fn.next=e),to=!0,Dd||(Dd=!0,e2())}function Cr(e,a){if(!Od&&to){Od=!0;do for(var s=!1,n=eo;n!==null;){if(e!==0){var d=n.pendingLanes;if(d===0)var u=0;else{var x=n.suspendedLanes,j=n.pingedLanes;u=(1<<31-Pe(42|e)+1)-1,u&=d&~(x&~j),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(s=!0,U0(n,u))}else u=Xe,u=ka(n,n===gt?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(u&3)===0||Fa(n,u)||(s=!0,U0(n,u));n=n.next}while(s);Od=!1}}function Wb(){L0()}function L0(){to=Dd=!1;var e=0;Fs!==0&&d2()&&(e=Fs);for(var a=ke(),s=null,n=eo;n!==null;){var d=n.next,u=M0(n,a);u===0?(n.next=null,s===null?eo=d:s.next=d,d===null&&(fn=s)):(s=n,(e!==0||(u&3)!==0)&&(to=!0)),n=d}Bt!==0&&Bt!==5||Cr(e),Fs!==0&&(Fs=0)}function M0(e,a){for(var s=e.suspendedLanes,n=e.pingedLanes,d=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var x=31-Pe(u),j=1<<x,M=d[x];M===-1?((j&s)===0||(j&n)!==0)&&(d[x]=ll(j,a)):M<=a&&(e.expiredLanes|=j),u&=~j}if(a=gt,s=Xe,s=ka(e,e===a?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,s===0||e===a&&(it===2||it===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&aa(n),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Fa(e,s)){if(a=s&-s,a===e.callbackPriority)return a;switch(n!==null&&aa(n),Pn(s)){case 2:case 8:s=Je;break;case 32:s=Ct;break;case 268435456:s=wt;break;default:s=Ct}return n=z0.bind(null,e),s=lt(s,n),e.callbackPriority=a,e.callbackNode=s,a}return n!==null&&n!==null&&aa(n),e.callbackPriority=2,e.callbackNode=null,2}function z0(e,a){if(Bt!==0&&Bt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Wi()&&e.callbackNode!==s)return null;var n=Xe;return n=ka(e,e===gt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(p0(e,n,a),M0(e,ke()),e.callbackNode!=null&&e.callbackNode===s?z0.bind(null,e):null)}function U0(e,a){if(Wi())return null;p0(e,a,!0)}function e2(){m2(function(){(tt&6)!==0?lt(Oe,Wb):L0()})}function Bd(){if(Fs===0){var e=Zl;e===0&&(e=ut,ut<<=1,(ut&261888)===0&&(ut=256)),Fs=e}return Fs}function D0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ci(""+e)}function O0(e,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,e.id&&s.setAttribute("form",e.id),a.parentNode.insertBefore(s,a),e=new FormData(e),s.parentNode.removeChild(s),e}function t2(e,a,s,n,d){if(a==="submit"&&s&&s.stateNode===d){var u=D0((d[Ae]||null).action),x=n.submitter;x&&(a=(a=x[Ae]||null)?D0(a.formAction):x.getAttribute("formAction"),a!==null&&(u=a,x=null));var j=new fi("action","action",null,n,d);e.push({event:j,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Fs!==0){var M=x?O0(d,x):new FormData(d);ld(s,{pending:!0,data:M,method:d.method,action:u},null,M)}}else typeof u=="function"&&(j.preventDefault(),M=x?O0(d,x):new FormData(d),ld(s,{pending:!0,data:M,method:d.method,action:u},u,M))},currentTarget:d}]})}}for(var Hd=0;Hd<jc.length;Hd++){var qd=jc[Hd],a2=qd.toLowerCase(),s2=qd[0].toUpperCase()+qd.slice(1);Va(a2,"on"+s2)}Va(hf,"onAnimationEnd"),Va(pf,"onAnimationIteration"),Va(xf,"onAnimationStart"),Va("dblclick","onDoubleClick"),Va("focusin","onFocus"),Va("focusout","onBlur"),Va(yb,"onTransitionRun"),Va(vb,"onTransitionStart"),Va(jb,"onTransitionCancel"),Va(gf,"onTransitionEnd"),Ol("onMouseEnter",["mouseout","mouseover"]),Ol("onMouseLeave",["mouseout","mouseover"]),Ol("onPointerEnter",["pointerout","pointerover"]),Ol("onPointerLeave",["pointerout","pointerover"]),nl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nl("onBeforeInput",["compositionend","keypress","textInput","paste"]),nl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Er="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),l2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Er));function B0(e,a){a=(a&4)!==0;for(var s=0;s<e.length;s++){var n=e[s],d=n.event;n=n.listeners;e:{var u=void 0;if(a)for(var x=n.length-1;0<=x;x--){var j=n[x],M=j.instance,Y=j.currentTarget;if(j=j.listener,M!==u&&d.isPropagationStopped())break e;u=j,d.currentTarget=Y;try{u(d)}catch(ae){xi(ae)}d.currentTarget=null,u=M}else for(x=0;x<n.length;x++){if(j=n[x],M=j.instance,Y=j.currentTarget,j=j.listener,M!==u&&d.isPropagationStopped())break e;u=j,d.currentTarget=Y;try{u(d)}catch(ae){xi(ae)}d.currentTarget=null,u=M}}}}function Qe(e,a){var s=a[nt];s===void 0&&(s=a[nt]=new Set);var n=e+"__bubble";s.has(n)||(H0(a,e,2,!1),s.add(n))}function Vd(e,a,s){var n=0;a&&(n|=4),H0(s,e,n,a)}var ao="_reactListening"+Math.random().toString(36).slice(2);function $d(e){if(!e[ao]){e[ao]=!0,_m.forEach(function(s){s!=="selectionchange"&&(l2.has(s)||Vd(s,!1,e),Vd(s,!0,e))});var a=e.nodeType===9?e:e.ownerDocument;a===null||a[ao]||(a[ao]=!0,Vd("selectionchange",!1,a))}}function H0(e,a,s,n){switch(hp(a)){case 2:var d=L2;break;case 8:d=M2;break;default:d=su}s=d.bind(null,a,s,e),d=void 0,!oc||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(d=!0),n?d!==void 0?e.addEventListener(a,s,{capture:!0,passive:d}):e.addEventListener(a,s,!0):d!==void 0?e.addEventListener(a,s,{passive:d}):e.addEventListener(a,s,!1)}function Id(e,a,s,n,d){var u=n;if((a&1)===0&&(a&2)===0&&n!==null)e:for(;;){if(n===null)return;var x=n.tag;if(x===3||x===4){var j=n.stateNode.containerInfo;if(j===d)break;if(x===4)for(x=n.return;x!==null;){var M=x.tag;if((M===3||M===4)&&x.stateNode.containerInfo===d)return;x=x.return}for(;j!==null;){if(x=zl(j),x===null)return;if(M=x.tag,M===5||M===6||M===26||M===27){n=u=x;continue e}j=j.parentNode}}n=n.return}Im(function(){var Y=u,ae=rc(s),ie=[];e:{var X=bf.get(e);if(X!==void 0){var ee=fi,Ee=e;switch(e){case"keypress":if(ui(s)===0)break e;case"keydown":case"keyup":ee=Z1;break;case"focusin":Ee="focus",ee=mc;break;case"focusout":Ee="blur",ee=mc;break;case"beforeblur":case"afterblur":ee=mc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=Pm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=H1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=eb;break;case hf:case pf:case xf:ee=$1;break;case gf:ee=ab;break;case"scroll":case"scrollend":ee=O1;break;case"wheel":ee=lb;break;case"copy":case"cut":case"paste":ee=G1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Qm;break;case"toggle":case"beforetoggle":ee=rb}var De=(a&4)!==0,ht=!De&&(e==="scroll"||e==="scrollend"),V=De?X!==null?X+"Capture":null:X;De=[];for(var D=Y,I;D!==null;){var re=D;if(I=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||I===null||V===null||(re=Xn(D,V),re!=null&&De.push(Tr(D,re,I))),ht)break;D=D.return}0<De.length&&(X=new ee(X,Ee,null,s,ae),ie.push({event:X,listeners:De}))}}if((a&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",ee=e==="mouseout"||e==="pointerout",X&&s!==nc&&(Ee=s.relatedTarget||s.fromElement)&&(zl(Ee)||Ee[Ge]))break e;if((ee||X)&&(X=ae.window===ae?ae:(X=ae.ownerDocument)?X.defaultView||X.parentWindow:window,ee?(Ee=s.relatedTarget||s.toElement,ee=Y,Ee=Ee?zl(Ee):null,Ee!==null&&(ht=m(Ee),De=Ee.tag,Ee!==ht||De!==5&&De!==27&&De!==6)&&(Ee=null)):(ee=null,Ee=Y),ee!==Ee)){if(De=Pm,re="onMouseLeave",V="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(De=Qm,re="onPointerLeave",V="onPointerEnter",D="pointer"),ht=ee==null?X:Qn(ee),I=Ee==null?X:Qn(Ee),X=new De(re,D+"leave",ee,s,ae),X.target=ht,X.relatedTarget=I,re=null,zl(ae)===Y&&(De=new De(V,D+"enter",Ee,s,ae),De.target=I,De.relatedTarget=ht,re=De),ht=re,ee&&Ee)t:{for(De=n2,V=ee,D=Ee,I=0,re=V;re;re=De(re))I++;re=0;for(var Me=D;Me;Me=De(Me))re++;for(;0<I-re;)V=De(V),I--;for(;0<re-I;)D=De(D),re--;for(;I--;){if(V===D||D!==null&&V===D.alternate){De=V;break t}V=De(V),D=De(D)}De=null}else De=null;ee!==null&&q0(ie,X,ee,De,!1),Ee!==null&&ht!==null&&q0(ie,ht,Ee,De,!0)}}e:{if(X=Y?Qn(Y):window,ee=X.nodeName&&X.nodeName.toLowerCase(),ee==="select"||ee==="input"&&X.type==="file")var We=af;else if(ef(X))if(sf)We=xb;else{We=hb;var _e=fb}else ee=X.nodeName,!ee||ee.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?Y&&lc(Y.elementType)&&(We=af):We=pb;if(We&&(We=We(e,Y))){tf(ie,We,s,ae);break e}_e&&_e(e,X,Y),e==="focusout"&&Y&&X.type==="number"&&Y.memoizedProps.value!=null&&sc(X,"number",X.value)}switch(_e=Y?Qn(Y):window,e){case"focusin":(ef(_e)||_e.contentEditable==="true")&&(Il=_e,bc=Y,sr=null);break;case"focusout":sr=bc=Il=null;break;case"mousedown":yc=!0;break;case"contextmenu":case"mouseup":case"dragend":yc=!1,mf(ie,s,ae);break;case"selectionchange":if(bb)break;case"keydown":case"keyup":mf(ie,s,ae)}var Ie;if(hc)e:{switch(e){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else $l?Jm(e,s)&&(Ke="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ke="onCompositionStart");Ke&&(Xm&&s.locale!=="ko"&&($l||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&$l&&(Ie=Gm()):(_s=ae,cc="value"in _s?_s.value:_s.textContent,$l=!0)),_e=so(Y,Ke),0<_e.length&&(Ke=new Fm(Ke,e,null,s,ae),ie.push({event:Ke,listeners:_e}),Ie?Ke.data=Ie:(Ie=Wm(s),Ie!==null&&(Ke.data=Ie)))),(Ie=ob?cb(e,s):db(e,s))&&(Ke=so(Y,"onBeforeInput"),0<Ke.length&&(_e=new Fm("onBeforeInput","beforeinput",null,s,ae),ie.push({event:_e,listeners:Ke}),_e.data=Ie)),t2(ie,e,Y,s,ae)}B0(ie,a)})}function Tr(e,a,s){return{instance:e,listener:a,currentTarget:s}}function so(e,a){for(var s=a+"Capture",n=[];e!==null;){var d=e,u=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||u===null||(d=Xn(e,s),d!=null&&n.unshift(Tr(e,d,u)),d=Xn(e,a),d!=null&&n.push(Tr(e,d,u))),e.tag===3)return n;e=e.return}return[]}function n2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function q0(e,a,s,n,d){for(var u=a._reactName,x=[];s!==null&&s!==n;){var j=s,M=j.alternate,Y=j.stateNode;if(j=j.tag,M!==null&&M===n)break;j!==5&&j!==26&&j!==27||Y===null||(M=Y,d?(Y=Xn(s,u),Y!=null&&x.unshift(Tr(s,Y,M))):d||(Y=Xn(s,u),Y!=null&&x.push(Tr(s,Y,M)))),s=s.return}x.length!==0&&e.push({event:a,listeners:x})}var r2=/\r\n?/g,i2=/\u0000|\uFFFD/g;function V0(e){return(typeof e=="string"?e:""+e).replace(r2,` 49`).replace(i2,"")}function $0(e,a){return a=V0(a),V0(e)===a}function ft(e,a,s,n,d,u){switch(s){case"children":typeof n=="string"?a==="body"||a==="textarea"&&n===""||Hl(e,n):(typeof n=="number"||typeof n=="bigint")&&a!=="body"&&Hl(e,""+n);break;case"className":ii(e,"class",n);break;case"tabIndex":ii(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ii(e,s,n);break;case"style":Vm(e,n,u);break;case"data":if(a!=="object"){ii(e,"data",n);break}case"src":case"href":if(n===""&&(a!=="a"||s!=="href")){e.removeAttribute(s);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=ci(""+n),e.setAttribute(s,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(s==="formAction"?(a!=="input"&&ft(e,a,"name",d.name,d,null),ft(e,a,"formEncType",d.formEncType,d,null),ft(e,a,"formMethod",d.formMethod,d,null),ft(e,a,"formTarget",d.formTarget,d,null)):(ft(e,a,"encType",d.encType,d,null),ft(e,a,"method",d.method,d,null),ft(e,a,"target",d.target,d,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=ci(""+n),e.setAttribute(s,n);break;case"onClick":n!=null&&(e.onclick=os);break;case"onScroll":n!=null&&Qe("scroll",e);break;case"onScrollEnd":n!=null&&Qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(s=n.__html,s!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}s=ci(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,""+n):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
49ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":n===!0?e.setAttribute(s,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,n):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(s,n):e.removeAttribute(s);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(s):e.setAttribute(s,n);break;case"popover":Qe("beforetoggle",e),Qe("toggle",e),ri(e,"popover",n);break;case"xlinkActuate":is(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":is(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":is(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":is(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":is(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":is(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":is(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":is(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":is(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":ri(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=U1.get(s)||s,ri(e,s,n))}}function Gd(e,a,s,n,d,u){switch(s){case"style":Vm(e,n,u);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(s=n.__html,s!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof n=="string"?Hl(e,n):(typeof n=="number"||typeof n=="bigint")&&Hl(e,""+n);break;case"onScroll":n!=null&&Qe("scroll",e);break;case"onScrollEnd":n!=null&&Qe("scrollend",e);break;case"onClick":n!=null&&(e.onclick=os);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Lm.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(d=s.endsWith("Capture"),a=s.slice(2,d?s.length-7:void 0),u=e[Ae]||null,u=u!=null?u[s]:null,typeof u=="function"&&e.removeEventListener(a,u,d),typeof n=="function")){typeof u!="function"&&u!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(a,n,d);break e}s in e?e[s]=n:n===!0?e.setAttribute(s,""):ri(e,s,n)}}}function Pt(e,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",e),Qe("load",e);var n=!1,d=!1,u;for(u in s)if(s.hasOwnProperty(u)){var x=s[u];if(x!=null)switch(u){case"src":n=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:ft(e,a,u,x,s,null)}}d&&ft(e,a,"srcSet",s.srcSet,s,null),n&&ft(e,a,"src",s.src,s,null);return;case"input":Qe("invalid",e);var j=u=x=d=null,M=null,Y=null;for(n in s)if(s.hasOwnProperty(n)){var ae=s[n];if(ae!=null)switch(n){case"name":d=ae;break;case"type":x=ae;break;case"checked":M=ae;break;case"defaultChecked":Y=ae;break;case"value":u=ae;break;case"defaultValue":j=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,a));break;default:ft(e,a,n,ae,s,null)}}Om(e,u,j,M,Y,x,d,!1);return;case"select":Qe("invalid",e),n=x=u=null;for(d in s)if(s.hasOwnProperty(d)&&(j=s[d],j!=null))switch(d){case"value":u=j;break;case"defaultValue":x=j;break;case"multiple":n=j;default:ft(e,a,d,j,s,null)}a=u,s=x,e.multiple=!!n,a!=null?Bl(e,!!n,a,!1):s!=null&&Bl(e,!!n,s,!0);return;case"textarea":Qe("invalid",e),u=d=n=null;for(x in s)if(s.hasOwnProperty(x)&&(j=s[x],j!=null))switch(x){case"value":n=j;break;case"defaultValue":d=j;break;case"children":u=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(o(91));break;default:ft(e,a,x,j,s,null)}Hm(e,n,d,u);return;case"option":for(M in s)if(s.hasOwnProperty(M)&&(n=s[M],n!=null))switch(M){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:ft(e,a,M,n,s,null)}return;case"dialog":Qe("beforetoggle",e),Qe("toggle",e),Qe("cancel",e),Qe("close",e);break;case"iframe":case"object":Qe("load",e);break;case"video":case"audio":for(n=0;n<Er.length;n++)Qe(Er[n],e);break;case"image":Qe("error",e),Qe("load",e);break;case"details":Qe("toggle",e);break;case"embed":case"source":case"link":Qe("error",e),Qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in s)if(s.hasOwnProperty(Y)&&(n=s[Y],n!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:ft(e,a,Y,n,s,null)}return;default:if(lc(a)){for(ae in s)s.hasOwnProperty(ae)&&(n=s[ae],n!==void 0&&Gd(e,a,ae,n,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(n=s[j],n!=null&&ft(e,a,j,n,s,null))}function o2(e,a,s,n){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,u=null,x=null,j=null,M=null,Y=null,ae=null;for(ee in s){var ie=s[ee];if(s.hasOwnProperty(ee)&&ie!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":M=ie;default:n.hasOwnProperty(ee)||ft(e,a,ee,null,n,ie)}}for(var X in n){var ee=n[X];if(ie=s[X],n.hasOwnProperty(X)&&(ee!=null||ie!=null))switch(X){case"type":u=ee;break;case"name":d=ee;break;case"checked":Y=ee;break;case"defaultChecked":ae=ee;break;case"value":x=ee;break;case"defaultValue":j=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,a));break;default:ee!==ie&&ft(e,a,X,ee,n,ie)}}ac(e,x,j,M,Y,ae,u,d);return;case"select":ee=x=j=X=null;for(u in s)if(M=s[u],s.hasOwnProperty(u)&&M!=null)switch(u){case"value":break;case"multiple":ee=M;default:n.hasOwnProperty(u)||ft(e,a,u,null,n,M)}for(d in n)if(u=n[d],M=s[d],n.hasOwnProperty(d)&&(u!=null||M!=null))switch(d){case"value":X=u;break;case"defaultValue":j=u;break;case"multiple":x=u;default:u!==M&&ft(e,a,d,u,n,M)}a=j,s=x,n=ee,X!=null?Bl(e,!!s,X,!1):!!n!=!!s&&(a!=null?Bl(e,!!s,a,!0):Bl(e,!!s,s?[]:"",!1));return;case"textarea":ee=X=null;for(j in s)if(d=s[j],s.hasOwnProperty(j)&&d!=null&&!n.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:ft(e,a,j,null,n,d)}for(x in n)if(d=n[x],u=s[x],n.hasOwnProperty(x)&&(d!=null||u!=null))switch(x){case"value":X=d;break;case"defaultValue":ee=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==u&&ft(e,a,x,d,n,u)}Bm(e,X,ee);return;case"option":for(var Ee in s)if(X=s[Ee],s.hasOwnProperty(Ee)&&X!=null&&!n.hasOwnProperty(Ee))switch(Ee){case"selected":e.selected=!1;break;default:ft(e,a,Ee,null,n,X)}for(M in n)if(X=n[M],ee=s[M],n.hasOwnProperty(M)&&X!==ee&&(X!=null||ee!=null))switch(M){case"selected":e.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:ft(e,a,M,X,n,ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var De in s)X=s[De],s.hasOwnProperty(De)&&X!=null&&!n.hasOwnProperty(De)&&ft(e,a,De,null,n,X);for(Y in n)if(X=n[Y],ee=s[Y],n.hasOwnProperty(Y)&&X!==ee&&(X!=null||ee!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(o(137,a));break;default:ft(e,a,Y,X,n,ee)}return;default:if(lc(a)){for(var ht in s)X=s[ht],s.hasOwnProperty(ht)&&X!==void 0&&!n.hasOwnProperty(ht)&&Gd(e,a,ht,void 0,n,X);for(ae in n)X=n[ae],ee=s[ae],!n.hasOwnProperty(ae)||X===ee||X===void 0&&ee===void 0||Gd(e,a,ae,X,n,ee);return}}for(var V in s)X=s[V],s.hasOwnProperty(V)&&X!=null&&!n.hasOwnProperty(V)&&ft(e,a,V,null,n,X);for(ie in n)X=n[ie],ee=s[ie],!n.hasOwnProperty(ie)||X===ee||X==null&&ee==null||ft(e,a,ie,X,n,ee)}function I0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c2(){if(typeof performance.getEntriesByType=="function"){for(var e=0,a=0,s=performance.getEntriesByType("resource"),n=0;n<s.length;n++){var d=s[n],u=d.transferSize,x=d.initiatorType,j=d.duration;if(u&&j&&I0(x)){for(x=0,j=d.responseEnd,n+=1;n<s.length;n++){var M=s[n],Y=M.startTime;if(Y>j)break;var ae=M.transferSize,ie=M.initiatorType;ae&&I0(ie)&&(M=M.responseEnd,x+=ae*(M<j?1:(j-Y)/(M-Y)))}if(--n,a+=8*(u+x)/(d.duration/1e3),e++,10<e)break}}if(0<e)return a/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Yd=null,Pd=null;
vendor: 13,171 bytes, line 49
49function lo(e){return e.nodeType===9?e:e.ownerDocument}function G0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Y0(e,a){if(e===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&a==="foreignObject"?0:e}function Fd(e,a){return e==="textarea"||e==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Qd=null;function d2(){var e=window.event;return e&&e.type==="popstate"?e===Qd?!1:(Qd=e,!0):(Qd=null,!1)}var P0=typeof setTimeout=="function"?setTimeout:void 0,u2=typeof clearTimeout=="function"?clearTimeout:void 0,F0=typeof Promise=="function"?Promise:void 0,m2=typeof queueMicrotask=="function"?queueMicrotask:typeof F0<"u"?function(e){return F0.resolve(null).then(e).catch(f2)}:P0;function f2(e){setTimeout(function(){throw e})}function Qs(e){return e==="head"}function Q0(e,a){var s=a,n=0;do{var d=s.nextSibling;if(e.removeChild(s),d&&d.nodeType===8)if(s=d.data,s==="/$"||s==="/&"){if(n===0){e.removeChild(d),gn(a);return}n--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")n++;else if(s==="html")Rr(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Rr(s);for(var u=s.firstChild;u;){var x=u.nextSibling,j=u.nodeName;u[Fn]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&u.rel.toLowerCase()==="stylesheet"||s.removeChild(u),u=x}}else s==="body"&&Rr(e.ownerDocument.body);s=d}while(s);gn(a)}function X0(e,a){var s=e;e=0;do{var n=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),n&&n.nodeType===8)if(s=n.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=n}while(s)}function Xd(e){var a=e.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Xd(s),ec(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function h2(e,a,s,n){for(;e.nodeType===1;){var d=s;if(e.nodeName.toLowerCase()!==a.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Fn])switch(a){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(a==="input"&&e.type==="hidden"){var u=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Ma(e.nextSibling),e===null)break}return null}function p2(e,a,s){if(a==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Ma(e.nextSibling),e===null))return null;return e}function K0(e,a){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Ma(e.nextSibling),e===null))return null;return e}function Kd(e){return e.data==="$?"||e.data==="$~"}function Zd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function x2(e,a){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=a;else if(e.data!=="$?"||s.readyState!=="loading")a();else{var n=function(){a(),s.removeEventListener("DOMContentLoaded",n)};s.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Ma(e){for(;e!=null;e=e.nextSibling){var a=e.nodeType;if(a===1||a===3)break;if(a===8){if(a=e.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return e}var Jd=null;function Z0(e){e=e.nextSibling;for(var a=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(a===0)return Ma(e.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}e=e.nextSibling}return null}function J0(e){e=e.previousSibling;for(var a=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return e;a--}else s!=="/$"&&s!=="/&"||a++}e=e.previousSibling}return null}function W0(e,a,s){switch(a=lo(s),e){case"html":if(e=a.documentElement,!e)throw Error(o(452));return e;case"head":if(e=a.head,!e)throw Error(o(453));return e;case"body":if(e=a.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Rr(e){for(var a=e.attributes;a.length;)e.removeAttributeNode(a[0]);ec(e)}var za=new Map,ep=new Set;function no(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ks=ce.d;ce.d={f:g2,r:b2,D:y2,C:v2,L:j2,m:N2,X:k2,S:w2,M:S2};function g2(){var e=ks.f(),a=Ki();return e||a}function b2(e){var a=Ul(e);a!==null&&a.tag===5&&a.type==="form"?gh(a):ks.r(e)}var hn=typeof document>"u"?null:document;function tp(e,a,s){var n=hn;if(n&&typeof a=="string"&&a){var d=Ca(a);d='link[rel="'+e+'"][href="'+d+'"]',typeof s=="string"&&(d+='[crossorigin="'+s+'"]'),ep.has(d)||(ep.add(d),e={rel:e,crossOrigin:s,href:a},n.querySelector(d)===null&&(a=n.createElement("link"),Pt(a,"link",e),Ht(a),n.head.appendChild(a)))}}function y2(e){ks.D(e),tp("dns-prefetch",e,null)}function v2(e,a){ks.C(e,a),tp("preconnect",e,a)}function j2(e,a,s){ks.L(e,a,s);var n=hn;if(n&&e&&a){var d='link[rel="preload"][as="'+Ca(a)+'"]';a==="image"&&s&&s.imageSrcSet?(d+='[imagesrcset="'+Ca(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(d+='[imagesizes="'+Ca(s.imageSizes)+'"]')):d+='[href="'+Ca(e)+'"]';var u=d;switch(a){case"style":u=pn(e);break;case"script":u=xn(e)}za.has(u)||(e=v({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:e,as:a},s),za.set(u,e),n.querySelector(d)!==null||a==="style"&&n.querySelector(Ar(u))||a==="script"&&n.querySelector(_r(u))||(a=n.createElement("link"),Pt(a,"link",e),Ht(a),n.head.appendChild(a)))}}function N2(e,a){ks.m(e,a);var s=hn;if(s&&e){var n=a&&typeof a.as=="string"?a.as:"script",d='link[rel="modulepreload"][as="'+Ca(n)+'"][href="'+Ca(e)+'"]',u=d;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=xn(e)}if(!za.has(u)&&(e=v({rel:"modulepreload",href:e},a),za.set(u,e),s.querySelector(d)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(_r(u)))return}n=s.createElement("link"),Pt(n,"link",e),Ht(n),s.head.appendChild(n)}}}function w2(e,a,s){ks.S(e,a,s);var n=hn;if(n&&e){var d=Dl(n).hoistableStyles,u=pn(e);a=a||"default";var x=d.get(u);if(!x){var j={loading:0,preload:null};if(x=n.querySelector(Ar(u)))j.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":a},s),(s=za.get(u))&&Wd(e,s);var M=x=n.createElement("link");Ht(M),Pt(M,"link",e),M._p=new Promise(function(Y,ae){M.onload=Y,M.onerror=ae}),M.addEventListener("load",function(){j.loading|=1}),M.addEventListener("error",function(){j.loading|=2}),j.loading|=4,ro(x,a,n)}x={type:"stylesheet",instance:x,count:1,state:j},d.set(u,x)}}}function k2(e,a){ks.X(e,a);var s=hn;if(s&&e){var n=Dl(s).hoistableScripts,d=xn(e),u=n.get(d);u||(u=s.querySelector(_r(d)),u||(e=v({src:e,async:!0},a),(a=za.get(d))&&eu(e,a),u=s.createElement("script"),Ht(u),Pt(u,"link",e),s.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(d,u))}}function S2(e,a){ks.M(e,a);var s=hn;if(s&&e){var n=Dl(s).hoistableScripts,d=xn(e),u=n.get(d);u||(u=s.querySelector(_r(d)),u||(e=v({src:e,async:!0,type:"module"},a),(a=za.get(d))&&eu(e,a),u=s.createElement("script"),Ht(u),Pt(u,"link",e),s.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(d,u))}}function ap(e,a,s,n){var d=(d=Ce.current)?no(d):null;if(!d)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=pn(s.href),s=Dl(d).hoistableStyles,n=s.get(a),n||(n={type:"style",instance:null,count:0,state:null},s.set(a,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=pn(s.href);var u=Dl(d).hoistableStyles,x=u.get(e);if(x||(d=d.ownerDocument||d,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,x),(u=d.querySelector(Ar(e)))&&!u._p&&(x.instance=u,x.state.loading=5),za.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},za.set(e,s),u||C2(d,e,s,x.state))),a&&n===null)throw Error(o(528,""));return x}if(a&&n!==null)throw Error(o(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=xn(s),s=Dl(d).hoistableScripts,n=s.get(a),n||(n={type:"script",instance:null,count:0,state:null},s.set(a,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function pn(e){return'href="'+Ca(e)+'"'}function Ar(e){return'link[rel="stylesheet"]['+e+"]"}function sp(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function C2(e,a,s,n){e.querySelector('link[rel="preload"][as="style"]['+a+"]")?n.loading=1:(a=e.createElement("link"),n.preload=a,a.addEventListener("load",function(){return n.loading|=1}),a.addEventListener("error",function(){return n.loading|=2}),Pt(a,"link",s),Ht(a),e.head.appendChild(a))}function xn(e){return'[src="'+Ca(e)+'"]'}function _r(e){return"script[async]"+e}function lp(e,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var n=e.querySelector('style[data-href~="'+Ca(s.href)+'"]');if(n)return a.instance=n,Ht(n),n;var d=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Ht(n),Pt(n,"style",d),ro(n,s.precedence,e),a.instance=n;case"stylesheet":d=pn(s.href);var u=e.querySelector(Ar(d));if(u)return a.state.loading|=4,a.instance=u,Ht(u),u;n=sp(s),(d=za.get(d))&&Wd(n,d),u=(e.ownerDocument||e).createElement("link"),Ht(u);var x=u;return x._p=new Promise(function(j,M){x.onload=j,x.onerror=M}),Pt(u,"link",n),a.state.loading|=4,ro(u,s.precedence,e),a.instance=u;case"script":return u=xn(s.src),(d=e.querySelector(_r(u)))?(a.instance=d,Ht(d),d):(n=s,(d=za.get(u))&&(n=v({},s),eu(n,d)),e=e.ownerDocument||e,d=e.createElement("script"),Ht(d),Pt(d,"link",n),e.head.appendChild(d),a.instance=d);case"void":return null;default:throw Error(o(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(n=a.instance,a.state.loading|=4,ro(n,s.precedence,e));return a.instance}function ro(e,a,s){for(var n=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=n.length?n[n.length-1]:null,u=d,x=0;x<n.length;x++){var j=n[x];if(j.dataset.precedence===a)u=j;else if(u!==d)break}u?u.parentNode.insertBefore(e,u.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(e,a.firstChild))}function Wd(e,a){e.crossOrigin==null&&(e.crossOrigin=a.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=a.referrerPolicy),e.title==null&&(e.title=a.title)}function eu(e,a){e.crossOrigin==null&&(e.crossOrigin=a.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=a.referrerPolicy),e.integrity==null&&(e.integrity=a.integrity)}var io=null;function np(e,a,s){if(io===null){var n=new Map,d=io=new Map;d.set(s,n)}else d=io,n=d.get(s),n||(n=new Map,d.set(s,n));if(n.has(e))return n;for(n.set(e,null),s=s.getElementsByTagName(e),d=0;d<s.length;d++){var u=s[d];if(!(u[Fn]||u[he]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var x=u.getAttribute(a)||"";x=e+x;var j=n.get(x);j?j.push(u):n.set(x,[u])}}return n}function rp(e,a,s){e=e.ownerDocument||e,e.head.insertBefore(s,a==="title"?e.querySelector("head > title"):null)}function E2(e,a,s){if(s===1||a.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return e=a.disabled,typeof a.precedence=="string"&&e==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function ip(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function T2(e,a,s,n){if(s.type==="stylesheet"&&(typeof n.media!="str
49ing"||matchMedia(n.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var d=pn(n.href),u=a.querySelector(Ar(d));if(u){a=u._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(e.count++,e=oo.bind(e),a.then(e,e)),s.state.loading|=4,s.instance=u,Ht(u);return}u=a.ownerDocument||a,n=sp(n),(d=za.get(d))&&Wd(n,d),u=u.createElement("link"),Ht(u);var x=u;x._p=new Promise(function(j,M){x.onload=j,x.onerror=M}),Pt(u,"link",n),s.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=oo.bind(e),a.addEventListener("load",s),a.addEventListener("error",s))}}var tu=0;function R2(e,a){return e.stylesheets&&e.count===0&&uo(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var n=setTimeout(function(){if(e.stylesheets&&uo(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+a);0<e.imgBytes&&tu===0&&(tu=62500*c2());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&uo(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>tu?50:800)+a);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(d)}}:null}function oo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)uo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var co=null;function uo(e,a){e.stylesheets=null,e.unsuspend!==null&&(e.count++,co=new Map,a.forEach(A2,e),co=null,oo.call(e))}function A2(e,a){if(!(a.state.loading&4)){var s=co.get(e);if(s)var n=s.get(null);else{s=new Map,co.set(e,s);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<d.length;u++){var x=d[u];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(s.set(x.dataset.precedence,x),n=x)}n&&s.set(null,n)}d=a.instance,x=d.getAttribute("data-precedence"),u=s.get(x)||n,u===n&&s.set(null,d),s.set(x,d),this.count++,n=oo.bind(this),d.addEventListener("load",n),d.addEventListener("error",n),u?u.parentNode.insertBefore(d,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),a.state.loading|=4}}var Lr={$$typeof:z,Provider:null,Consumer:null,_currentValue:C,_currentValue2:C,_threadCount:0};function _2(e,a,s,n,d,u,x,j,M){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xt(0),this.hiddenUpdates=Xt(null),this.identifierPrefix=n,this.onUncaughtError=d,this.onCaughtError=u,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function op(e,a,s,n,d,u,x,j,M,Y,ae,ie){return e=new _2(e,a,s,x,M,Y,ae,ie,j),a=1,u===!0&&(a|=24),u=xa(3,null,null,a),e.current=u,u.stateNode=e,a=zc(),a.refCount++,e.pooledCache=a,a.refCount++,u.memoizedState={element:n,isDehydrated:s,cache:a},Bc(u),e}function cp(e){return e?(e=Pl,e):Pl}function dp(e,a,s,n,d,u){d=cp(d),n.context===null?n.context=d:n.pendingContext=d,n=Os(a),n.payload={element:s},u=u===void 0?null:u,u!==null&&(n.callback=u),s=Bs(e,n,a),s!==null&&(ua(s,e,a),dr(s,e,a))}function up(e,a){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<a?s:a}}function au(e,a){up(e,a),(e=e.alternate)&&up(e,a)}function mp(e){if(e.tag===13||e.tag===31){var a=cl(e,67108864);a!==null&&ua(a,e,67108864),au(e,67108864)}}function fp(e){if(e.tag===13||e.tag===31){var a=ja();a=Yn(a);var s=cl(e,a);s!==null&&ua(s,e,a),au(e,a)}}var mo=!0;function L2(e,a,s,n){var d=U.T;U.T=null;var u=ce.p;try{ce.p=2,su(e,a,s,n)}finally{ce.p=u,U.T=d}}function M2(e,a,s,n){var d=U.T;U.T=null;var u=ce.p;try{ce.p=8,su(e,a,s,n)}finally{ce.p=u,U.T=d}}function su(e,a,s,n){if(mo){var d=lu(n);if(d===null)Id(e,a,n,fo,s),pp(e,n);else if(U2(d,e,a,s,n))n.stopPropagation();
vendor: 7,229 bytes, line 49
49else if(pp(e,n),a&4&&-1<z2.indexOf(e)){for(;d!==null;){var u=Ul(d);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var x=ha(u.pendingLanes);if(x!==0){var j=u;for(j.pendingLanes|=2,j.entangledLanes|=2;x;){var M=1<<31-Pe(x);j.entanglements[1]|=M,x&=~M}Ja(u),(tt&6)===0&&(Qi=ke()+500,Cr(0))}}break;case 31:case 13:j=cl(u,2),j!==null&&ua(j,u,2),Ki(),au(u,2)}if(u=lu(n),u===null&&Id(e,a,n,fo,s),u===d)break;d=u}d!==null&&n.stopPropagation()}else Id(e,a,n,null,s)}}function lu(e){return e=rc(e),nu(e)}var fo=null;function nu(e){if(fo=null,e=zl(e),e!==null){var a=m(e);if(a===null)e=null;else{var s=a.tag;if(s===13){if(e=f(a),e!==null)return e;e=null}else if(s===31){if(e=h(a),e!==null)return e;e=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;e=null}else a!==e&&(e=null)}}return fo=e,null}function hp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Be()){case Oe:return 2;case Je:return 8;case Ct:case Nt:return 32;case wt:return 268435456;default:return 32}default:return 32}}var ru=!1,Xs=null,Ks=null,Zs=null,Mr=new Map,zr=new Map,Js=[],z2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function pp(e,a){switch(e){case"focusin":case"focusout":Xs=null;break;case"dragenter":case"dragleave":Ks=null;break;case"mouseover":case"mouseout":Zs=null;break;case"pointerover":case"pointerout":Mr.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":zr.delete(a.pointerId)}}function Ur(e,a,s,n,d,u){return e===null||e.nativeEvent!==u?(e={blockedOn:a,domEventName:s,eventSystemFlags:n,nativeEvent:u,targetContainers:[d]},a!==null&&(a=Ul(a),a!==null&&mp(a)),e):(e.eventSystemFlags|=n,a=e.targetContainers,d!==null&&a.indexOf(d)===-1&&a.push(d),e)}function U2(e,a,s,n,d){switch(a){case"focusin":return Xs=Ur(Xs,e,a,s,n,d),!0;case"dragenter":return Ks=Ur(Ks,e,a,s,n,d),!0;case"mouseover":return Zs=Ur(Zs,e,a,s,n,d),!0;case"pointerover":var u=d.pointerId;return Mr.set(u,Ur(Mr.get(u)||null,e,a,s,n,d)),!0;case"gotpointercapture":return u=d.pointerId,zr.set(u,Ur(zr.get(u)||null,e,a,s,n,d)),!0}return!1}function xp(e){var a=zl(e.target);if(a!==null){var s=m(a);if(s!==null){if(a=s.tag,a===13){if(a=f(s),a!==null){e.blockedOn=a,_(e.priority,function(){fp(s)});return}}else if(a===31){if(a=h(s),a!==null){e.blockedOn=a,_(e.priority,function(){fp(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ho(e){if(e.blockedOn!==null)return!1;for(var a=e.targetContainers;0<a.length;){var s=lu(e.nativeEvent);if(s===null){s=e.nativeEvent;var n=new s.constructor(s.type,s);nc=n,s.target.dispatchEvent(n),nc=null}else return a=Ul(s),a!==null&&mp(a),e.blockedOn=s,!1;a.shift()}return!0}function gp(e,a,s){ho(e)&&s.delete(a)}function D2(){ru=!1,Xs!==null&&ho(Xs)&&(Xs=null),Ks!==null&&ho(Ks)&&(Ks=null),Zs!==null&&ho(Zs)&&(Zs=null),Mr.forEach(gp),zr.forEach(gp)}function po(e,a){e.blockedOn===a&&(e.blockedOn=null,ru||(ru=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,D2)))}var xo=null;function bp(e){xo!==e&&(xo=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){xo===e&&(xo=null);for(var a=0;a<e.length;a+=3){var s=e[a],n=e[a+1],d=e[a+2];if(typeof n!="function"){if(nu(n||s)===null)continue;break}var u=Ul(s);u!==null&&(e.splice(a,3),a-=3,ld(u,{pending:!0,data:d,method:s.method,action:n},n,d))}}))}function gn(e){function a(M){return po(M,e)}Xs!==null&&po(Xs,e),Ks!==null&&po(Ks,e),Zs!==null&&po(Zs,e),Mr.forEach(a),zr.forEach(a);for(var s=0;s<Js.length;s++){var n=Js[s];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Js.length&&(s=Js[0],s.blockedOn===null);)xp(s),s.blockedOn===null&&Js.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(n=0;n<s.length;n+=3){var d=s[n],u=s[n+1],x=d[Ae]||null;if(typeof u=="function")x||bp(s);else if(x){var j=null;if(u&&u.hasAttribute("formAction")){if(d=u,x=u[Ae]||null)j=x.formAction;else if(nu(d)!==null)continue}else j=x.action;typeof j=="function"?s[n+1]=j:(s.splice(n,3),n-=3),bp(s)}}}function yp(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(x){return d=x})},focusReset:"manual",scroll:"manual"})}function a(){d!==null&&(d(),d=null),n||setTimeout(s,20)}function s(){if(!n&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),d!==null&&(d(),d=null)}}}function iu(e){this._internalRoot=e}go.prototype.render=iu.prototype.render=function(e){var a=this._internalRoot;if(a===null)throw Error(o(409));var s=a.current,n=ja();dp(s,n,e,a,null,null)},go.prototype.unmount=iu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var a=e.containerInfo;dp(e.current,2,null,e,null,null),Ki(),a[Ge]=null}};function go(e){this._internalRoot=e}go.prototype.unstable_scheduleHydration=function(e){if(e){var a=li();e={blockedOn:null,target:e,priority:a};for(var s=0;s<Js.length&&a!==0&&a<Js[s].priority;s++);Js.splice(s,0,e),s===0&&xp(e)}};var vp=r.version;if(vp!=="19.2.4")throw Error(o(527,vp,"19.2.4"));ce.findDOMNode=function(e){var a=e._reactInternals;if(a===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(a),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var O2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};
49if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bo.isDisabled&&bo.supportsFiber)try{pe=bo.inject(O2),Re=bo}catch{}}return Or.createRoot=function(e,a){if(!c(e))throw Error(o(299));var s=!1,n="",d=Eh,u=Th,x=Rh;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(u=a.onCaughtError),a.onRecoverableError!==void 0&&(x=a.onRecoverableError)),a=op(e,1,!1,null,null,s,n,null,d,u,x,yp),e[Ge]=a.current,$d(e),new iu(a)},Or.hydrateRoot=function(e,a,s){if(!c(e))throw Error(o(299));var n=!1,d="",u=Eh,x=Th,j=Rh,M=null;return s!=null&&(s.unstable_strictMode===!0&&(n=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(u=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.formState!==void 0&&(M=s.formState)),a=op(e,1,!0,a,s??null,n,d,M,u,x,j,yp),a.context=cp(null),s=a.current,n=ja(),n=Yn(n),d=Os(n),d.callback=null,Bs(s,d,n),s=n,a.current.lanes=s,Qa(a,s),Ja(a),e[Ge]=a.current,$d(e),new go(a)},Or.version="19.2.4",Or}var Ap;function F2(){if(Ap)return du.exports;Ap=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),du.exports=P2(),du.exports}var Q2=F2();const X2=um(Q2);/** 50 * react-router v7.13.1 51 * 52 * Copyright (c) Remix Software Inc. 53 * 54 * This source code is licensed under the MIT license found in the 55 * LICENSE.md file in the root directory of this source tree. 56 * 57 * @license MIT 58 */var _p="popstate";function Lp(l){return typeof l=="object"&&l!=null&&"pathname"in l&&"search"in l&&"hash"in l&&"state"in l&&"key"in l}function K2(l={}){function r(o,c){var g;let m=(g=c.state)==null?void 0:g.masked,{pathname:f,search:h,hash:p}=m||o.location;return tm("",{pathname:f,search:h,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default",m?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function i(o,c){return typeof c=="string"?c:Qr(c)}return J2(r,i,null,l)}function St(l,r){if(l===!1||l===null||typeof l>"u")throw new Error(r)}function Ba(l,r){if(!l){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Z2(){return Math.random().toString(36).substring(2,10)}function Mp(l,r){return{usr:l.state,key:l.key,idx:r,masked:l.unstable_mask?{pathname:l.pathname,search:l.search,hash:l.hash}:void 0}}function tm(l,r,i=null,o,c){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof r=="string"?Bn(r):r,state:i,key:r&&r.key||o||Z2(),unstable_mask:c}}function Qr({pathname:l="/",search:r="",hash:i=""}){return r&&r!=="?"&&(l+=r.charAt(0)==="?"?r:"?"+r),i&&i!=="#"&&(l+=i.charAt(0)==="#"?i:"#"+i),l}function Bn(l){let r={};if(l){let i=l.indexOf("#");i>=0&&(r.hash=l.substring(i),l=l.substring(0,i));let o=l.indexOf("?");o>=0&&(r.search=l.substring(o),l=l.substring(0,o)),l&&(r.pathname=l)}return r}function J2(l,r,i,o={}){let{window:c=document.defaultView,v5Compat:m=!1}=o,f=c.history,h="POP",p=null,g=y();g==null&&(g=0,f.replaceState({...f.state,idx:g},""));function y(){return(f.state||{idx:null}).idx}function v(){h="POP";let w=y(),A=w==null?null:w-g;g=w,p&&p({action:h,location:k.location,delta:A})}function E(w,A){h="PUSH";let O=Lp(w)?w:tm(k.location,w,A);g=y()+1;let z=Mp(O,g),H=k.createHref(O.unstable_mask||O);try{f.pushState(z,"",H)}catch(se){if(se instanceof DOMException&&se.name==="DataCloneError")throw se;c.location.assign(H)}m&&p&&p({action:h,location:k.location,delta:1})}function R(w,A){h="REPLACE";let O=Lp(w)?w:tm(k.location,w,A);g=y();let z=Mp(O,g),H=k.createHref(O.unstable_mask||O);f.replaceState(z,"",H),m&&p&&p({action:h,location:k.location,delta:0})}function N(w){return W2(w)}let k={get action(){return h},get location(){return l(c,f)},listen(w){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(_p,v),p=w,()=>{c.removeEventListener(_p,v),p=null}},createHref(w){return r(c,w)},createURL:N,encodeLocation(w){let A=N(w);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:E,replace:R,go(w){return f.go(w)}};return k}function W2(l,r=!1){let i="http://localhost";
58typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),St(i,"No window.location.(origin|href) available to create URL");let o=typeof l=="string"?l:Qr(l);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=i+o),new URL(o,i)}function pg(l,r,i="/"){return ey(l,r,i,!1)}function ey(l,r,i,o){let c=typeof r=="string"?Bn(r):r,m=Es(c.pathname||"/",i);if(m==null)return null;let f=xg(l);ty(f);let h=null;for(let p=0;h==null&&p<f.length;++p){let g=my(m);h=dy(f[p],g,o)}return h}function xg(l,r=[],i=[],o="",c=!1){let m=(f,h,p=c,g)=>{let y={relativePath:g===void 0?f.path||"":g,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&p)return;St(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let v=ss([o,y.relativePath]),E=i.concat(y);f.children&&f.children.length>0&&(St(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),xg(f.children,r,E,v,p)),!(f.path==null&&!f.index)&&r.push({path:v,score:oy(v,f.index),routesMeta:E})};return l.forEach((f,h)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))m(f,h);else for(let g of gg(f.path))m(f,h,!0,g)}),r}function gg(l){let r=l.split("/");if(r.length===0)return[];let[i,...o]=r,c=i.endsWith("?"),m=i.replace(/\?$/,"");if(o.length===0)return c?[m,""]:[m];let f=gg(o.join("/")),h=[];return h.push(...f.map(p=>p===""?m:[m,p].join("/"))),c&&h.push(...f),h.map(p=>l.startsWith("/")&&p===""?"/":p)}function ty(l){l.sort((r,i)=>r.score!==i.score?i.score-r.score:cy(r.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var ay=/^:[\w-]+$/,sy=3,ly=2,ny=1,ry=10,iy=-2,zp=l=>l==="*";function oy(l,r){let i=l.split("/"),o=i.length;return i.some(zp)&&(o+=iy),r&&(o+=ly),i.filter(c=>!zp(c)).reduce((c,m)=>c+(ay.test(m)?sy:m===""?ny:ry),o)}function cy(l,r){return l.length===r.length&&l.slice(0,-1).every((o,c)=>o===r[c])?l[l.length-1]-r[r.length-1]:0}function dy(l,r,i=!1){let{routesMeta:o}=l,c={},m="/",f=[];for(let h=0;h<o.length;++h){let p=o[h],g=h===o.length-1,y=m==="/"?r:r.slice(m.length)||"/",v=Mo({path:p.relativePath,caseSensitive:p.caseSensitive,end:g},y),E=p.route;if(!v&&g&&i&&!o[o.length-1].route.index&&(v=Mo({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!v)return null;
58Object.assign(c,v.params),f.push({params:c,pathname:ss([m,v.pathname]),pathnameBase:xy(ss([m,v.pathnameBase])),route:E}),v.pathnameBase!=="/"&&(m=ss([m,v.pathnameBase]))}return f}function Mo(l,r){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[i,o]=uy(l.path,l.caseSensitive,l.end),c=r.match(i);if(!c)return null;let m=c[0],f=m.replace(/(.)\/+$/,"$1"),h=c.slice(1);return{params:o.reduce((g,{paramName:y,isOptional:v},E)=>{if(y==="*"){let N=h[E]||"";f=m.slice(0,m.length-N.length).replace(/(.)\/+$/,"$1")}const R=h[E];return v&&!R?g[y]=void 0:g[y]=(R||"").replace(/%2F/g,"/"),g},{}),pathname:m,pathnameBase:f,pattern:l}}function uy(l,r=!1,i=!0){Ba(l==="*"||!l.endsWith("*")||l.endsWith("/*"),`Route path "${l}" will be treated as if it were "${l.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${l.replace(/\*$/,"/*")}".`);let o=[],c="^"+l.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,p,g,y)=>{if(o.push({paramName:h,isOptional:p!=null}),p){let v=y.charAt(g+f.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return l.endsWith("*")?(o.push({paramName:"*"}),c+=l==="*"||l==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?c+="\\/*$":l!==""&&l!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,r?void 0:"i"),o]}function my(l){try{return l.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Ba(!1,`The URL path "${l}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),l}}function Es(l,r){if(r==="/")return l;if(!l.toLowerCase().startsWith(r.toLowerCase()))return null;let i=r.endsWith("/")?r.length-1:r.length,o=l.charAt(i);return o&&o!=="/"?null:l.slice(i)||"/"}var fy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function hy(l,r="/"){let{pathname:i,search:o="",hash:c=""}=typeof l=="string"?Bn(l):l,m;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?m=Up(i.substring(1),"/"):m=Up(i,r)):m=r,{pathname:m,search:gy(o),hash:by(c)}}function Up(l,r){let i=r.replace(/\/+$/,"").split("/");return l.split("/").forEach(c=>{c===".."?i.length>1&&i.pop():c!=="."&&i.push(c)}),i.length>1?i.join("/"):"/"}function hu(l,r,i,o){return`Cannot include a '${l}' character in a manually specified \`to.${r}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function py(l){return l.filter((r,i)=>i===0||r.route.path&&r.route.path.length>0)}function fm(l){let r=py(l);return r.map((i,o)=>o===r.length-1?i.pathname:i.pathnameBase)}function Vo(l,r,i,o=!1){let c;typeof l=="string"?c=Bn(l):(c={...l},St(!c.pathname||!c.pathname.includes("?"),hu("?","pathname","search",c)),St(!c.pathname||!c.pathname.includes("#"),hu("#","pathname","hash",c)),St(!c.search||!c.search.includes("#"),hu("#","search","hash",c)));let m=l===""||c.pathname==="",f=m?"/":c.pathname,h;if(f==null)h=i;else{let v=r.length-1;if(!o&&f.startsWith("..")){let E=f.split("/");for(;E[0]==="..";)E.shift(),v-=1;c.pathname=E.join("/")}h=v>=0?r[v]:"/"}let p=hy(c,h),g=f&&f!=="/"&&f.endsWith("/"),y=(m||f===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(g||y)&&(p.pathname+="/"),p}var ss=l=>l.join("/").replace(/\/\/+/g,"/"),xy=l=>l.replace(/\/+$/,"").replace(/^\/*/,"/"),gy=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,by=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l,yy=class{constructor(l,r,i,o=!1){this.status=l,this.statusText=r||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function vy(l){return l!=null&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.internal=="boolean"&&"data"in l}function jy(l){return l.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var bg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function yg(l,r){let i=l;
58if(typeof i!="string"||!fy.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,c=!1;if(bg)try{let m=new URL(window.location.href),f=i.startsWith("//")?new URL(m.protocol+i):new URL(i),h=Es(f.pathname,r);f.origin===m.origin&&h!=null?i=h+f.search+f.hash:c=!0}catch{Ba(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:c,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var vg=["POST","PUT","PATCH","DELETE"];new Set(vg);var Ny=["GET",...vg];new Set(Ny);var Hn=b.createContext(null);Hn.displayName="DataRouter";var $o=b.createContext(null);$o.displayName="DataRouterState";var wy=b.createContext(!1),jg=b.createContext({isTransitioning:!1});jg.displayName="ViewTransition";var ky=b.createContext(new Map);ky.displayName="Fetchers";var Sy=b.createContext(null);Sy.displayName="Await";var wa=b.createContext(null);wa.displayName="Navigation";var Kr=b.createContext(null);Kr.displayName="Location";var Ha=b.createContext({outlet:null,matches:[],isDataRoute:!1});Ha.displayName="Route";var hm=b.createContext(null);hm.displayName="RouteError";var Ng="REACT_ROUTER_ERROR",Cy="REDIRECT",Ey="ROUTE_ERROR_RESPONSE";function Ty(l){if(l.startsWith(`${Ng}:${Cy}:{`))try{let r=JSON.parse(l.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function Ry(l){if(l.startsWith(`${Ng}:${Ey}:{`))try{let r=JSON.parse(l.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new yy(r.status,r.statusText,r.data)}catch{}}function Ay(l,{relative:r}={}){St(qn(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:o}=b.useContext(wa),{hash:c,pathname:m,search:f}=Zr(l,{relative:r}),h=m;return i!=="/"&&(h=m==="/"?i:ss([i,m])),o.createHref({pathname:h,search:f,hash:c})}function qn(){return b.useContext(Kr)!=null}function Ga(){return St(qn(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Kr).location}var wg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function kg(l){b.useContext(wa).static||b.useLayoutEffect(l)}function Ya(){let{isDataRoute:l}=b.useContext(Ha);return l?Yy():_y()}function _y(){St(qn(),"useNavigate() may be used only in the context of a <Router> component.");let l=b.useContext(Hn),{basename:r,navigator:i}=b.useContext(wa),{matches:o}=b.useContext(Ha),{pathname:c}=Ga(),m=JSON.stringify(fm(o)),f=b.useRef(!1);return kg(()=>{f.current=!0}),b.useCallback((p,g={})=>{if(Ba(f.current,wg),!f.current)return;if(typeof p=="number"){i.go(p);return}let y=Vo(p,JSON.parse(m),c,g.relative==="path");l==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:ss([r,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[r,i,m,c,l])}var Ly=b.createContext(null);function My(l){let r=b.useContext(Ha).outlet;return b.useMemo(()=>r&&b.createElement(Ly.Provider,{value:l},r),[r,l])}function qa(){let{matches:l}=b.useContext(Ha),r=l[l.length-1];return r?r.params:{}}function Zr(l,{relative:r}={}){let{matches:i}=b.useContext(Ha),{pathname:o}=Ga(),c=JSON.stringify(fm(i));return b.useMemo(()=>Vo(l,JSON.parse(c),o,r==="path"),[l,c,o,r])}function zy(l,r){return Sg(l,r)}function Sg(l,r,i){var w;St(qn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=b.useContext(wa),{matches:c}=b.useContext(Ha),m=c[c.length-1],f=m?m.params:{},h=m?m.pathname:"/",p=m?m.pathnameBase:"/",g=m&&m.route;{let A=g&&g.path||"";Eg(h,!g||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${A}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 59 60Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let y=Ga(),v;if(r){let A=typeof r=="string"?Bn(r):r;St(p==="/"||((w=A.pathname)==null?void 0:w.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${A.pathname}" was given in the \`location\` prop.`),v=A}else v=y;let E=v.pathname||"/",R=E;if(p!=="/"){let A=p.replace(/^\//,"").split("/");R="/"+E.replace(/^\//,"").split("/").slice(A.length).join("/")}let N=pg(l,{pathname:R});Ba(g||N!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Ba(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let k=Hy(N&&N.map(A=>Object.assign({},A,{params:Object.assign({},f,A.params),pathname:ss([p,o.encodeLocation?o.encodeLocation(A.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?p:ss([p,o.encodeLocation?o.encodeLocation(A.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),c,i);return r&&k?b.createElement(Kr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},k):k}function Uy(){let l=Gy(),r=vy(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),i=l instanceof Error?l.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},m={padding:"2px 4px",backgroundColor:o},f=null;return console.error("Error handled by React Router default ErrorBoundary:",l),f=b.createElement(b.Fragment,null,b.createElement("p",null,"ð¿ Hey developer ð"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:m},"ErrorBoundary")," or"," ",b.createElement("code",{style:m},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application
60Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},r),i?b.createElement("pre",{style:c},i):null,f)}var Dy=b.createElement(Uy,null),Cg=class extends b.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,r){return r.location!==l.location||r.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:r.error,location:r.location,revalidation:l.revalidation||r.revalidation}}componentDidCatch(l,r){this.props.onError?this.props.onError(l,r):console.error("React Router caught the following error during render",l)}render(){let l=this.state.error;if(this.context&&typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){const i=Ry(l.digest);i&&(l=i)}let r=l!==void 0?b.createElement(Ha.Provider,{value:this.props.routeContext},b.createElement(hm.Provider,{value:l,children:this.props.component})):this.props.children;return this.context?b.createElement(Oy,{error:l},r):r}};Cg.contextType=wy;var pu=new WeakMap;function Oy({children:l,error:r}){let{basename:i}=b.useContext(wa);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=Ty(r.digest);if(o){let c=pu.get(r);if(c)throw c;let m=yg(o.location,i);if(bg&&!pu.get(r))if(m.isExternal||o.reloadDocument)window.location.href=m.absoluteURL||m.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:o.replace}));throw pu.set(r,f),f}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m.absoluteURL||m.to}`})}}return l}function By({routeContext:l,match:r,children:i}){let o=b.useContext(Hn);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),b.createElement(Ha.Provider,{value:l},i)}function Hy(l,r=[],i){let o=i==null?void 0:i.state;if(l==null){if(!o)return null;if(o.errors)l=o.matches;else if(r.length===0&&!o.initialized&&o.matches.length>0)l=o.matches;else return null}let c=l,m=o==null?void 0:o.errors;if(m!=null){let y=c.findIndex(v=>v.route.id&&(m==null?void 0:m[v.route.id])!==void 0);St(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),c=c.slice(0,Math.min(c.length,y+1))}let f=!1,h=-1;if(i&&o){f=o.renderFallback;for(let y=0;y<c.length;y++){let v=c[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(h=y),v.route.id){let{loaderData:E,errors:R}=o,N=v.route.loader&&!E.hasOwnProperty(v.route.id)&&(!R||R[v.route.id]===void 0);if(v.route.lazy||N){i.isStatic&&(f=!0),h>=0?c=c.slice(0,h+1):c=[c[0]];break}}}}let p=i==null?void 0:i.onError,g=o&&p?(y,v)=>{var E,R;p(y,{location:o.location,params:((R=(E=o.matches)==null?void 0:E[0])==null?void 0:R.params)??{},unstable_pattern:jy(o.matches),errorInfo:v})}:void 0;return c.reduceRight((y,v,E)=>{let R,N=!1,k=null,w=null;o&&(R=m&&v.route.id?m[v.route.id]:void 0,k=v.route.errorElement||Dy,f&&(h<0&&E===0?(Eg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,w=null):h===E&&(N=!0,w=v.route.hydrateFallbackElement||null)));let A=r.concat(c.slice(0,E+1)),O=()=>{let z;return R?z=k:N?z=w:v.route.Component?z=b.createElement(v.route.Component,null):v.route.element?z=v.route.element:z=y,b.createElement(By,{match:v,routeContext:{outlet:y,matches:A,isDataRoute:o!=null},children:z})};return o&&(v.route.ErrorBoundary||v.route.errorElement||E===0)?b.createElement(Cg,{location:o.location,revalidation:o.revalidation,component:k,error:R,children:O(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:g}):O()},null)}function pm(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qy(l){let r=b.useContext(Hn);return St(r,pm(l)),r}function Vy(l){let r=b.useContext($o);return St(r,pm(l)),r}function $y(l){let r=b.useContext(Ha);return St(r,pm(l)),r}function xm(l){let r=$y(l),i=r.matches[r.matches.length-1];return St(i.route.id,`${l} can only be used on routes that contain a unique "id"`),i.route.id}function Iy(){return xm("useRouteId")}function Gy(){var o;let l=b.useContext(hm),r=Vy("useRouteError"),i=xm("useRouteError");return l!==void 0?l:(o=r.errors)==null?void 0:o[i]}function Yy(){let{router:l}=qy("useNavigate"),r=xm("useNavigate"),i=b.useRef(!1);return kg(()=>{i.current=!0}),b.useCallback(async(c,m={})=>{Ba(i.current,wg),i.current&&(typeof c=="number"?await l.navigate(c):await l.navigate(c,{fromRouteId:r,...m}))},[l,r])}var Dp={};function Eg(l,r,i){!r&&!Dp[l]&&(Dp[l]=!0,Ba(!1,i))}b.memo(Py);function Py({routes:l,future:r,state:i,isStatic:o,onError:c}){return Sg(l,void 0,{state:i,isStatic:o,onError:c})}function Yr({to:l,replace:r,state:i,relative:o}){St(qn(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=b.useContext(wa);Ba(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:m}=b.useContext(Ha),{pathname:f}=Ga(),h=Ya(),p=Vo(l,fm(m),f,o==="path"),g=JSON.stringify(p);return b.useEffect(()=>{h(JSON.parse(g),{replace:r,state:i,relative:o})},[h,g,o,r,i]),null}function Tg(l){return My(l.context)}function bt(l){St(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Fy({basename:l="/",children:r=null,location:i,navigationType:o="POP",navigator:c,static:m=!1,unstable_useTransitions:f}){St(!qn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=l.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:h,navigator:c,static:m,unstable_useTransitions:f,future:{}}),[h,c,m,f]);typeof i=="string"&&(i=Bn(i));let{pathname:g="/",search:y="",hash:v="",state:E=null,key:R="default",unstable_mask:N}=i,k=b.useMemo(()=>{let w=Es(g,h);return w==null?null:{location:{pathname:w,search:y,hash:v,state:E,key:R,unstable_mask:N},navigationType:o}},[h,g,y,v,E,R,o,N]);
60return Ba(k!=null,`<Router basename="${h}"> is not able to match the URL "${g}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:b.createElement(wa.Provider,{value:p},b.createElement(Kr.Provider,{children:r,value:k}))}function Qy({children:l,location:r}){return zy(am(l),r)}function am(l,r=[]){let i=[];return b.Children.forEach(l,(o,c)=>{if(!b.isValidElement(o))return;let m=[...r,c];if(o.type===b.Fragment){i.push.apply(i,am(o.props.children,m));return}St(o.type===bt,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),St(!o.props.index||!o.props.children,"An index route cannot have child routes.");let f={id:o.props.id||m.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(f.children=am(o.props.children,m)),i.push(f)}),i}var To="get",Ro="application/x-www-form-urlencoded";function Io(l){return typeof HTMLElement<"u"&&l instanceof HTMLElement}function Xy(l){return Io(l)&&l.tagName.toLowerCase()==="button"}function Ky(l){return Io(l)&&l.tagName.toLowerCase()==="form"}function Zy(l){return Io(l)&&l.tagName.toLowerCase()==="input"}function Jy(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function Wy(l,r){return l.button===0&&(!r||r==="_self")&&!Jy(l)}function sm(l=""){return new URLSearchParams(typeof l=="string"||Array.isArray(l)||l instanceof URLSearchParams?l:Object.keys(l).reduce((r,i)=>{let o=l[i];return r.concat(Array.isArray(o)?o.map(c=>[i,c]):[[i,o]])},[]))}function ev(l,r){let i=sm(l);return r&&r.forEach((o,c)=>{i.has(c)||r.getAll(c).forEach(m=>{i.append(c,m)})}),i}var yo=null;function tv(){if(yo===null)try{new FormData(document.createElement("form"),0),yo=!1}catch{yo=!0}return yo}var av=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xu(l){return l!=null&&!av.has(l)?(Ba(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ro}"`),null):l}function sv(l,r){let i,o,c,m,f;if(Ky(l)){let h=l.getAttribute("action");o=h?Es(h,r):null,i=l.getAttribute("method")||To,c=xu(l.getAttribute("enctype"))||Ro,m=new FormData(l)}else if(Xy(l)||Zy(l)&&(l.type==="submit"||l.type==="image")){let h=l.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=l.getAttribute("formaction")||h.getAttribute("action");if(o=p?Es(p,r):null,i=l.getAttribute("formmethod")||h.getAttribute("method")||To,c=xu(l.getAttribute("formenctype"))||xu(h.getAttribute("enctype"))||Ro,m=new FormData(h,l),!tv()){let{name:g,type:y,value:v}=l;if(y==="image"){let E=g?`${g}.`:"";m.append(`${E}x`,"0"),m.append(`${E}y`,"0")}else g&&m.append(g,v)}}else{if(Io(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=To,o=null,c=Ro,f=l}return m&&c==="text/plain"&&(f=m,m=void 0),{action:o,method:i.toLowerCase(),encType:c,formData:m,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function gm(l,r){if(l===!1||l===null||typeof l>"u")throw new Error(r)}function lv(l,r,i,o){let c=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return i?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:r&&Es(c.pathname,r)==="/"?c.pathname=`${r.replace(/\/$/,"")}/_root.${o}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${o}`,c}async function nv(l,r){if(l.id in r)return r[l.id];try{let i=await import(l.module);return r[l.id]=i,i}catch(i){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.
60isSpaMode,window.location.reload(),new Promise(()=>{})}}function rv(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function iv(l,r,i){let o=await Promise.all(l.map(async c=>{let m=r.routes[c.route.id];if(m){let f=await nv(m,i);return f.links?f.links():[]}return[]}));return uv(o.flat(1).filter(rv).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Op(l,r,i,o,c,m){let f=(p,g)=>i[g]?p.route.id!==i[g].route.id:!0,h=(p,g)=>{var y;return i[g].pathname!==p.pathname||((y=i[g].route.path)==null?void 0:y.endsWith("*"))&&i[g].params["*"]!==p.params["*"]};return m==="assets"?r.filter((p,g)=>f(p,g)||h(p,g)):m==="data"?r.filter((p,g)=>{var v;let y=o.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(f(p,g)||h(p,g))return!0;if(p.route.shouldRevalidate){let E=p.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((v=i[0])==null?void 0:v.params)||{},nextUrl:new URL(l,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function ov(l,r,{includeHydrateFallback:i}={}){return cv(l.map(o=>{let c=r.routes[o.route.id];if(!c)return[];let m=[c.module];return c.clientActionModule&&(m=m.concat(c.clientActionModule)),c.clientLoaderModule&&(m=m.concat(c.clientLoaderModule)),i&&c.hydrateFallbackModule&&(m=m.concat(c.hydrateFallbackModule)),c.imports&&(m=m.concat(c.imports)),m}).flat(1))}function cv(l){return[...new Set(l)]}function dv(l){let r={},i=Object.keys(l).sort();for(let o of i)r[o]=l[o];return r}function uv(l,r){let i=new Set;return new Set(r),l.reduce((o,c)=>{let m=JSON.stringify(dv(c));return i.has(m)||(i.add(m),o.push({key:m,link:c})),o},[])}function Rg(){let l=b.useContext(Hn);return gm(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function mv(){let l=b.useContext($o);return gm(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var bm=b.createContext(void 0);bm.displayName="FrameworkContext";function Ag(){let l=b.useContext(bm);return gm(l,"You must render this element inside a <HydratedRouter> element"),l}function fv(l,r){let i=b.useContext(bm),[o,c]=b.useState(!1),[m,f]=b.useState(!1),{onFocus:h,onBlur:p,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=r,E=b.useRef(null);b.useEffect(()=>{if(l==="render"&&f(!0),l==="viewport"){let k=A=>{A.forEach(O=>{f(O.isIntersecting)})},w=new IntersectionObserver(k,{threshold:.5});return E.current&&w.observe(E.current),()=>{w.disconnect()}}},[l]),b.useEffect(()=>{if(o){let k=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(k)}}},[o]);let R=()=>{c(!0)},N=()=>{c(!1),f(!1)};return i?l!=="intent"?[m,E,{}]:[m,E,{onFocus:Br(h,R),onBlur:Br(p,N),onMouseEnter:Br(g,R),onMouseLeave:Br(y,N),onTouchStart:Br(v,R)}]:[!1,E,{}]}function Br(l,r){return i=>{l&&l(i),i.defaultPrevented||r(i)}}function hv({page:l,...r}){let{router:i}=Rg(),o=b.useMemo(()=>pg(i.routes,l,i.basename),[i.routes,l,i.basename]);return o?b.createElement(xv,{page:l,matches:o,...r}):null}function pv(l){let{manifest:r,routeModules:i}=Ag(),[o,c]=b.useState([]);return b.useEffect(()=>{let m=!1;return iv(l,r,i).then(f=>{m||c(f)}),()=>{m=!0}},[l,r,i]),o}function xv({page:l,matches:r,...i}){let o=Ga(),{future:c,manifest:m,routeModules:f}=Ag(),{basename:h}=Rg(),{loaderData:p,matches:g}=mv(),y=b.useMemo(()=>Op(l,r,g,m,o,"data"),[l,r,g,m,o]),v=b.useMemo(()=>Op(l,r,g,m,o,"assets"),[l,r,g,m,o]),E=b.useMemo(()=>{if(l===o.pathname+o.search+o.hash)return[];let k=new Set,w=!1;if(r.forEach(O=>{var H;let z=m.routes[O.route.id];!z||!z.hasLoader||(!y.some(se=>se.route.id===O.route.id)&&O.route.id in p&&((H=f[O.route.id])!=null&&H.shouldRevalidate)||z.hasClientLoader?w=!0:k.add(O.route.id))}),k.size===0)return[];let A=lv(l,h,c.unstable_trailingSlashAwareDataRequests,"data");return w&&k.size>0&&A.searchParams.set("_routes",r.filter(O=>k.has(O.route.id)).map(O=>O.route.id).join(",")),[A.pathname+A.search]},[h,c.unstable_trailingSlashAwareDataRequests,p,o,m,y,r,l,f]),R=b.useMemo(()=>ov(v,m),[v,m]),N=pv(v);return b.createElement(b.Fragment,null,E.map(k=>b.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...i})),R.map(k=>b.createElement("link",{key:k,rel:"modulepreload",href:k,...i})),N.map(({key:k,link:w})=>b.createElement("link",{key:k,nonce:i.nonce,...w,crossOrigin:w.crossOrigin??i.crossOrigin})))}
60function gv(...l){return r=>{l.forEach(i=>{typeof i=="function"?i(r):i!=null&&(i.current=r)})}}var bv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{bv&&(window.__reactRouterVersion="7.13.1")}catch{}function yv({basename:l,children:r,unstable_useTransitions:i,window:o}){let c=b.useRef();c.current==null&&(c.current=K2({window:o,v5Compat:!0}));let m=c.current,[f,h]=b.useState({action:m.action,location:m.location}),p=b.useCallback(g=>{i===!1?h(g):b.startTransition(()=>h(g))},[i]);return b.useLayoutEffect(()=>m.listen(p),[m,p]),b.createElement(Fy,{basename:l,children:r,location:f.location,navigationType:f.action,navigator:m,unstable_useTransitions:i})}var _g=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ts=b.forwardRef(function({onClick:r,discover:i="render",prefetch:o="none",relative:c,reloadDocument:m,replace:f,unstable_mask:h,state:p,target:g,to:y,preventScrollReset:v,viewTransition:E,unstable_defaultShouldRevalidate:R,...N},k){let{basename:w,navigator:A,unstable_useTransitions:O}=b.useContext(wa),z=typeof y=="string"&&_g.test(y),H=yg(y,w);y=H.to;let se=Ay(y,{relative:c}
60),Z=Ga(),T=null;if(h){let ye=Vo(h,[],Z.unstable_mask?Z.unstable_mask.pathname:"/",!0);w!=="/"&&(ye.pathname=ye.pathname==="/"?w:ss([w,ye.pathname])),T=A.createHref(ye)}let[P,q,Q]=fv(o,N),F=Nv(y,{replace:f,unstable_mask:h,state:p,target:g,preventScrollReset:v,relative:c,viewTransition:E,unstable_defaultShouldRevalidate:R,unstable_useTransitions:O});function $(ye){r&&r(ye),ye.defaultPrevented||F(ye)}let G=!(H.isExternal||m),te=b.createElement("a",{...N,...Q,href:(G?T:void 0)||H.absoluteURL||se,onClick:G?$:r,ref:gv(k,q),target:g,"data-discover":!z&&i==="render"?"true":void 0});return P&&!z?b.createElement(b.Fragment,null,te,b.createElement(hv,{page:se})):te});Ts.displayName="Link";var Lg=b.forwardRef(function({"aria-current":r="page",caseSensitive:i=!1,className:o="",end:c=!1,style:m,to:f,viewTransition:h,children:p,...g},y){let v=Zr(f,{relative:g.relative}),E=Ga(),R=b.useContext($o),{navigator:N,basename:k}=b.useContext(wa),w=R!=null&&Tv(v)&&h===!0,A=N.encodeLocation?N.encodeLocation(v).pathname:v.pathname,O=E.pathname,z=R&&R.navigation&&R.navigation.location?R.navigation.location.pathname:null;i||(O=O.toLowerCase(),z=z?z.toLowerCase():null,A=A.toLowerCase()),z&&k&&(z=Es(z,k)||z);const H=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let se=O===A||!c&&O.startsWith(A)&&O.charAt(H)==="/",Z=z!=null&&(z===A||!c&&z.startsWith(A)&&z.charAt(A.length)==="/"),T={isActive:se,isPending:Z,isTransitioning:w},P=se?r:void 0,q;typeof o=="function"?q=o(T):q=[o,se?"active":null,Z?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let Q=typeof m=="function"?m(T):m;return b.createElement(Ts,{...g,"aria-current":P,className:q,ref:y,style:Q,to:f,viewTransition:h},typeof p=="function"?p(T):p)});Lg.displayName="NavLink";var vv=b.forwardRef(({discover:l="render",fetcherKey:r,navigate:i,reloadDocument:o,replace:c,state:m,method:f=To,action:h,onSubmit:p,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:E,...R},N)=>{let{unstable_useTransitions:k}=b.useContext(wa),w=Cv(),A=Ev(h,{relative:g}),O=f.toLowerCase()==="get"?"get":"post",z=typeof h=="string"&&_g.test(h),H=se=>{if(p&&p(se),se.defaultPrevented)return;se.preventDefault();let Z=se.nativeEvent.submitter,T=(Z==null?void 0:Z.getAttribute("formmethod"))||f,P=()=>w(Z||se.currentTarget,{fetcherKey:r,method:T,navigate:i,replace:c,state:m,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:E});k&&i!==!1?b.startTransition(()=>P()):P()};return b.createElement("form",{ref:N,method:O,action:A,onSubmit:o?p:H,...R,"data-discover":!z&&l==="render"?"true":void 0})});vv.displayName="Form";function jv(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mg(l){let r=b.useContext(Hn);return St(r,jv(l)),r}function Nv(l,{target:r,replace:i,unstable_mask:o,state:c,preventScrollReset:m,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:p,unstable_useTransitions:g}={}){let y=Ya(),v=Ga(),E=Zr(l,{relative:f});return b.useCallback(R=>{if(Wy(R,r)){R.preventDefault();let N=i!==void 0?i:Qr(v)===Qr(E),k=()=>y(l,{replace:N,unstable_mask:o,state:c,preventScrollReset:m,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:p});g?b.startTransition(()=>k()):k()}},[v,y,E,i,o,c,r,l,m,f,h,p,g])}function wv(l){Ba(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let r=b.useRef(sm(l)),i=b.useRef(!1),o=Ga(),c=b.useMemo(()=>ev(o.search,i.current?null:r.current),[o.search]),m=Ya(),f=b.useCallback((h,p)=>{const g=sm(typeof h=="function"?h(new URLSearchParams(c)):h);i.current=!0,m("?"+g,p)},[m,c]);return[c,f]}var kv=0,Sv=()=>`__${String(++kv)}__`;function Cv(){let{router:l}=Mg("useSubmit"),{basename:r}=b.useContext(wa),i=Iy(),o=l.fetch,c=l.navigate;return b.useCallback(async(m,f={})=>{let{action:h,method:p,encType:g,formData:y,body:v}=sv(m,r);if(f.navigate===!1){let E=f.fetcherKey||Sv();await o(E,i,f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:y,body:v,formMethod:f.method||p,formEncType:f.encType||g,flushSync:f.flushSync})}else await c(f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:y,body:v,formMethod:f.method||p,formEncType:f.encType||g,replace:f.replace,state:f.state,fromRouteId:i,flushSync:f.flushSync,viewTransition:f.viewTransition})},[o,c,r,i])}function Ev(l,{relative:r}={}){let{basename:i}=b.useContext(wa),o=b.useContext(Ha);St(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),m={...Zr(l||".",{relative:r})},f=Ga();if(l==null){m.search=f.search;let h=new URLSearchParams(m.search),p=h.getAll("index");if(p.some(y=>y==="")){h.delete("index"),p.filter(v=>v).forEach(v=>h.append("index",v));let y=h.toString();m.search=y?`?${y}`:""}}
60return(!l||l===".")&&c.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(m.pathname=m.pathname==="/"?i:ss([i,m.pathname])),Qr(m)}function Tv(l,{relative:r}={}){let i=b.useContext(jg);St(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Mg("useViewTransitionState"),c=Zr(l,{relative:r});if(!i.isTransitioning)return!1;let m=Es(i.currentLocation.pathname,o)||i.currentLocation.pathname,f=Es(i.nextLocation.pathname,o)||i.nextLocation.pathname;return Mo(c.pathname,f)!=null||Mo(c.pathname,m)!=null}/** 61 * @license lucide-react v0.564.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */const zg=(...l)=>l.filter((r,i,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===i).join(" ").trim();/** 66 * @license lucide-react v0.564.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const Rv=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** 71 * @license lucide-react v0.564.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const Av=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,i,o)=>o?o.toUpperCase():i.toLowerCase());/** 76 * @license lucide-react v0.564.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const Bp=l=>{const r=Av(l);return r.charAt(0).toUpperCase()+r.slice(1)};/** 81 * @license lucide-react v0.564.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */var _v={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"};/** 86 * @license lucide-react v0.564.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const Lv=l=>{for(const r in l)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1};/** 91 * @license lucide-react v0.564.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const Mv=b.forwardRef(({color:l="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:c="",children:m,iconNode:f,...h},p)=>b.createElement("svg",{ref:p,..._v,width:r,height:r,stroke:l,strokeWidth:o?Number(i)*24/Number(r):i,className:zg("lucide",c),...!m&&!Lv(h)&&{"aria-hidden":"true"},...h},[...f.map(([g,y])=>b.createElement(g,y)),...Array.isArray(m)?m:[m]]));/** 96 * @license lucide-react v0.564.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const je=(l,r)=>{const i=b.forwardRef(({className:o,...c},m)=>b.createElement(Mv,{ref:m,iconNode:r,className:zg(`lucide-${Rv(Bp(l))}`,`lucide-${l}`,o),...c}));return i.displayName=Bp(l),i};/** 101 * @license lucide-react v0.564.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const zv=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Uv=je("activity",zv);/** 106 * @license lucide-react v0.564.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const Dv=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],Ov=je("arrow-down-right",Dv);/** 111 * @license lucide-react v0.564.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const Bv=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ln=je("arrow-left",Bv);/** 116 * @license lucide-react v0.564.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const Hv=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],qv=je("arrow-up-right",Hv);/** 121 * @license lucide-react v0.564.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const Vv=[["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"}]],$v=je("bell",Vv);/** 126 * @license lucide-react v0.564.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const Iv=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],Gv=je("bold",Iv);/** 131 * @license lucide-react v0.564.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const Yv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Mn=je("check",Yv);
135/** 136 * @license lucide-react v0.564.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const Pv=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Fv=je("chevron-left",Pv);/** 141 * @license lucide-react v0.564.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const Qv=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ls=je("chevron-right",Qv);/** 146 * @license lucide-react v0.564.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree. 150 */const Xv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ym=je("circle-alert",Xv);/** 151 * @license lucide-react v0.564.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const Kv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],zo=je("circle-check",Kv);/** 156 * @license lucide-react v0.564.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const Zv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],Hp=je("circle-minus",Zv);/** 161 * @license lucide-react v0.564.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const Jv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],vo=je("circle-plus",Jv);/** 166 * @license lucide-react v0.564.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const Wv=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],ej=je("code",Wv);/** 171 * @license lucide-react v0.564.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const tj=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Uo=je("copy",tj);/** 176 * @license lucide-react v0.564.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const aj=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Ug=je("credit-card",aj);/** 181 * @license lucide-react v0.564.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const sj=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],lj=je("dollar-sign",sj);/** 186 * @license lucide-react v0.564.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const nj=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Fr=je("download",nj);/** 191 * @license lucide-react v0.564.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const rj=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],ij=je("ellipsis-vertical",rj);/** 196 * @license lucide-react v0.564.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const oj=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],cj=je("eraser",oj);/** 201 * @license lucide-react v0.564.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree. 205 */const dj=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Xr=je("external-link",dj);/** 206 * @license lucide-react v0.564.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree. 210 */const uj=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Dg=je("eye-off",uj);/** 211 * @license lucide-react v0.564.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const mj=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Og=je("eye",mj);/** 216 * @license lucide-react v0.564.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const fj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 16s-1.5-2-4-2-4 2-4 2",key:"epbg0q"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],qp=je("frown",fj);/** 221 * @license lucide-react v0.564.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const hj=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],pj=je("heading-1",hj);/** 226 * @license lucide-react v0.564.0 - ISC 227 * 228 * This source code is licensed under the ISC license. 229 * See the LICENSE file in the root directory of this source tree. 230 */const xj=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}
230]],gj=je("heading-2",xj);/** 231 * @license lucide-react v0.564.0 - ISC 232 * 233 * This source code is licensed under the ISC license. 234 * See the LICENSE file in the root directory of this source tree. 235 */const bj=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],yj=je("heading-3",bj);/** 236 * @license lucide-react v0.564.0 - ISC 237 * 238 * This source code is licensed under the ISC license. 239 * See the LICENSE file in the root directory of this source tree. 240 */const vj=[["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"}]],jj=je("image",vj);/** 241 * @license lucide-react v0.564.0 - ISC 242 * 243 * This source code is licensed under the ISC license. 244 * See the LICENSE file in the root directory of this source tree. 245 */const Nj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Vp=je("info",Nj);/** 246 * @license lucide-react v0.564.0 - ISC 247 * 248 * This source code is licensed under the ISC license. 249 * See the LICENSE file in the root directory of this source tree. 250 */const wj=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],kj=je("italic",wj);/** 251 * @license lucide-react v0.564.0 - ISC 252 * 253 * This source code is licensed under the ISC license. 254 * See the LICENSE file in the root directory of this source tree. 255 */const Sj=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Cj=je("key-round",Sj);/** 256 * @license lucide-react v0.564.0 - ISC 257 * 258 * This source code is licensed under the ISC license. 259 * See the LICENSE file in the root directory of this source tree. 260 */const Ej=[["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"}]],lm=je("layers",Ej);/** 261 * @license lucide-react v0.564.0 - ISC 262 * 263 * This source code is licensed under the ISC license. 264 * See the LICENSE file in the root directory of this source tree. 265 */const Tj=[["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"}]],Rj=je("layout-dashboard",Tj);/** 266 * @license lucide-react v0.564.0 - ISC 267 * 268 * This source code is licensed under the ISC license. 269 * See the LICENSE file in the root directory of this source tree. 270 */const Aj=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],_j=je("layout-grid",Aj);/** 271 * @license lucide-react v0.564.0 - ISC 272 * 273 * This source code is licensed under the ISC license. 274 * See the LICENSE file in the root directory of this source tree. 275 */const Lj=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Mj=je("lightbulb",Lj);/** 276 * @license lucide-react v0.564.0 - ISC 277 * 278 * This source code is licensed under the ISC license. 279 * See the LICENSE file in the root directory of this source tree.
280 */const zj=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],nm=je("link-2",zj);/** 281 * @license lucide-react v0.564.0 - ISC 282 * 283 * This source code is licensed under the ISC license. 284 * See the LICENSE file in the root directory of this source tree. 285 */const Uj=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Dj=je("link",Uj);/** 286 * @license lucide-react v0.564.0 - ISC 287 * 288 * This source code is licensed under the ISC license. 289 * See the LICENSE file in the root directory of this source tree. 290 */const Oj=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Bj=je("list-ordered",Oj);/** 291 * @license lucide-react v0.564.0 - ISC 292 * 293 * This source code is licensed under the ISC license. 294 * See the LICENSE file in the root directory of this source tree. 295 */const Hj=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],qj=je("list",Hj);/** 296 * @license lucide-react v0.564.0 - ISC 297 * 298 * This source code is licensed under the ISC license. 299 * See the LICENSE file in the root directory of this source tree. 300 */const Vj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],yt=je("loader-circle",Vj);/** 301 * @license lucide-react v0.564.0 - ISC 302 * 303 * This source code is licensed under the ISC license. 304 * See the LICENSE file in the root directory of this source tree. 305 */const $j=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Ij=je("lock",$j);/** 306 * @license lucide-react v0.564.0 - ISC 307 * 308 * This source code is licensed under the ISC license. 309 * See the LICENSE file in the root directory of this source tree. 310 */const Gj=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Yj=je("log-out",Gj);/** 311 * @license lucide-react v0.564.0 - ISC 312 * 313 * This source code is licensed under the ISC license. 314 * See the LICENSE file in the root directory of this source tree. 315 */const Pj=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Bg=je("mail",Pj);/** 316 * @license lucide-react v0.564.0 - ISC 317 * 318 * This source code is licensed under the ISC license. 319 * See the LICENSE file in the root directory of this source tree. 320 */const Fj=[["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"}]],Qj=je("map-pin",Fj);/** 321 * @license lucide-react v0.564.0 - ISC 322 * 323 * This source code is licensed under the ISC license. 324 * See the LICENSE file in the root directory of this source tree. 325 */const Xj=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Kj=je("menu",Xj);/** 326 * @license lucide-react v0.564.0 - ISC 327 * 328 * This source code is licensed under the ISC license. 329 * See the LICENSE file in the root directory of this source tree. 330 */const Zj=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],Jj=je("package-check",Zj);/** 331 * @license lucide-react v0.564.0 - ISC 332 * 333 * This source code is licensed under the ISC license. 334 * See the LICENSE file in the root directory of this source tree. 335 */const Wj=[["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"}]],zn=je("package",Wj);/** 336 * @license lucide-react v0.564.0 - ISC 337 * 338 * This source code is licensed under the ISC license. 339 * See the LICENSE file in the root directory of this source tree. 340 */const eN=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["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:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Hg=je("palette",eN);/** 341 * @license lucide-react v0.564.0 - ISC 342 * 343 * This source code is licensed under the ISC license. 344 * See the LICENSE file in the root directory of this source tree. 345 */const tN=[["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"}]],Un=je("pen",tN);/** 346 * @license lucide-react v0.564.0 - ISC 347 * 348 * This source code is licensed under the ISC license. 349 * See the LICENSE file in the root directory of this source tree. 350 */const aN=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2
3500 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],sN=je("phone",aN);/** 351 * @license lucide-react v0.564.0 - ISC 352 * 353 * This source code is licensed under the ISC license. 354 * See the LICENSE file in the root directory of this source tree. 355 */const lN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Tl=je("plus",lN);/** 356 * @license lucide-react v0.564.0 - ISC 357 * 358 * This source code is licensed under the ISC license. 359 * See the LICENSE file in the root directory of this source tree. 360 */const nN=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],rN=je("power-off",nN);/** 361 * @license lucide-react v0.564.0 - ISC 362 * 363 * This source code is licensed under the ISC license. 364 * See the LICENSE file in the root directory of this source tree. 365 */const iN=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Dn=je("qr-code",iN);/** 366 * @license lucide-react v0.564.0 - ISC 367 * 368 * This source code is licensed under the ISC license. 369 * See the LICENSE file in the root directory of this source tree. 370 */const oN=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],cN=je("quote",oN);/** 371 * @license lucide-react v0.564.0 - ISC 372 * 373 * This source code is licensed under the ISC license. 374 * See the LICENSE file in the root directory of this source tree. 375 */const dN=[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]],uN=je("receipt",dN);/** 376 * @license lucide-react v0.564.0 - ISC 377 * 378 * This source code is licensed under the ISC license. 379 * See the LICENSE file in the root directory of this source tree. 380 */const mN=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],fN=je("redo-2",mN);/** 381 * @license lucide-react v0.564.0 - ISC 382 * 383 * This source code is licensed under the ISC license. 384 * See the LICENSE file in the root directory of this source tree. 385 */const hN=[["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"}]],pN=je("refresh-cw",hN);/** 386 * @license lucide-react v0.564.0 - ISC 387 * 388 * This source code is licensed under the ISC license. 389 * See the LICENSE file in the root directory of this source tree. 390 */const xN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Al=je("search",xN);/** 391 * @license lucide-react v0.564.0 - ISC 392 * 393 * This source code is licensed under the ISC license. 394 * See the LICENSE file in the root directory of this source tree. 395 */const gN=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],bN=je("send",gN);/** 396 * @license lucide-react v0.564.0 - ISC 397 * 398 * This source code is licensed under the ISC license. 399 * See the LICENSE file in the root directory of this source tree. 400 */const yN=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vN=je("settings",yN);/** 401 * @license lucide-react v0.564.0 - ISC 402 * 403 * This source code is licensed under the ISC license. 404 * See the LICENSE file in the root directory of this source tree. 405 */const jN=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7
405a2 2 0 0 0-1.6.8z",key:"o988cm"}]],vm=je("shopping-bag",jN);/** 406 * @license lucide-react v0.564.0 - ISC 407 * 408 * This source code is licensed under the ISC license. 409 * See the LICENSE file in the root directory of this source tree. 410 */const NN=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],wN=je("shopping-cart",NN);/** 411 * @license lucide-react v0.564.0 - ISC 412 * 413 * This source code is licensed under the ISC license. 414 * See the LICENSE file in the root directory of this source tree. 415 */const kN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],$p=je("smile",kN);/** 416 * @license lucide-react v0.564.0 - ISC 417 * 418 * This source code is licensed under the ISC license. 419 * See the LICENSE file in the root directory of this source tree. 420 */const SN=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Go=je("star",SN);/** 421 * @license lucide-react v0.564.0 - ISC 422 * 423 * This source code is licensed under the ISC license. 424 * See the LICENSE file in the root directory of this source tree. 425 */const CN=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],EN=je("strikethrough",CN);/** 426 * @license lucide-react v0.564.0 - ISC 427 * 428 * This source code is licensed under the ISC license. 429 * See the LICENSE file in the root directory of this source tree. 430 */const TN=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],RN=je("text-align-center",TN);/** 431 * @license lucide-react v0.564.0 - ISC 432 * 433 * This source code is licensed under the ISC license. 434 * See the LICENSE file in the root directory of this source tree. 435 */const AN=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}
vendor: 4,834 bytes, lines 435-490
435]],_N=je("text-align-end",AN);/** 436 * @license lucide-react v0.564.0 - ISC 437 * 438 * This source code is licensed under the ISC license. 439 * See the LICENSE file in the root directory of this source tree. 440 */const LN=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],MN=je("text-align-start",LN);/** 441 * @license lucide-react v0.564.0 - ISC 442 * 443 * This source code is licensed under the ISC license. 444 * See the LICENSE file in the root directory of this source tree. 445 */const zN=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],_l=je("trash-2",zN);/** 446 * @license lucide-react v0.564.0 - ISC 447 * 448 * This source code is licensed under the ISC license. 449 * See the LICENSE file in the root directory of this source tree. 450 */const UN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],DN=je("trending-up",UN);/** 451 * @license lucide-react v0.564.0 - ISC 452 * 453 * This source code is licensed under the ISC license. 454 * See the LICENSE file in the root directory of this source tree. 455 */const ON=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Do=je("triangle-alert",ON);/** 456 * @license lucide-react v0.564.0 - ISC 457 * 458 * This source code is licensed under the ISC license. 459 * See the LICENSE file in the root directory of this source tree. 460 */const BN=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],HN=je("truck",BN);/** 461 * @license lucide-react v0.564.0 - ISC 462 * 463 * This source code is licensed under the ISC license. 464 * See the LICENSE file in the root directory of this source tree. 465 */const qN=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],VN=je("underline",qN);/** 466 * @license lucide-react v0.564.0 - ISC 467 * 468 * This source code is licensed under the ISC license. 469 * See the LICENSE file in the root directory of this source tree. 470 */const $N=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],IN=je("undo-2",$N);/** 471 * @license lucide-react v0.564.0 - ISC 472 * 473 * This source code is licensed under the ISC license. 474 * See the LICENSE file in the root directory of this source tree. 475 */const GN=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Oa=je("upload",GN);/** 476 * @license lucide-react v0.564.0 - ISC 477 * 478 * This source code is licensed under the ISC license. 479 * See the LICENSE file in the root directory of this source tree. 480 */const YN=[["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"}]],An=je("user",YN);/** 481 * @license lucide-react v0.564.0 - ISC 482 * 483 * This source code is licensed under the ISC license. 484 * See the LICENSE file in the root directory of this source tree. 485 */const PN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],qg=je("users",PN);/** 486 * @license lucide-react v0.564.0 - ISC 487 * 488 * This source code is licensed under the ISC license. 489 * See the LICENSE file in the root directory of this source tree. 490 */const FN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ns=je("x",FN);function Vg(l,r){return function(){return l.apply(r,arguments)}}const{toString:QN}=Object.prototype,{getPrototypeOf:jm}=Object,{iterator:Yo,toStringTag:$g}=Symbol,Po=(l=>r=>{const i=QN.call(r);return l[i]||(l[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Pa=l=>(l=l.toLowerCase(),r=>Po(r)===l),Fo=l=>r=>typeof r===l,{isArray:Vn}=Array,On=Fo("undefined");function Jr(l){return l!==null&&!On(l)&&l.constructor!==null&&!On(l.constructor)&&ma(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const Ig=Pa("ArrayBuffer");function XN(l){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(l):r=l&&l.buffer&&Ig(l.buffer),r}const KN=Fo("string"),ma=Fo("function"),Gg=Fo("number"),Wr=l=>l!==null&&typeof l=="object",ZN=l=>l===!0||l===!1,Ao=l=>{if(Po(l)!=="object")return!1;const r=jm(l);
vendor: 17,617 bytes, lines 490-492
490return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!($g in l)&&!(Yo in l)},JN=l=>{if(!Wr(l)||Jr(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},WN=Pa("Date"),ew=Pa("File"),tw=l=>!!(l&&typeof l.uri<"u"),aw=l=>l&&typeof l.getParts<"u",sw=Pa("Blob"),lw=Pa("FileList"),nw=l=>Wr(l)&&ma(l.pipe);function rw(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Ip=rw(),Gp=typeof Ip.FormData<"u"?Ip.FormData:void 0,iw=l=>{let r;return l&&(Gp&&l instanceof Gp||ma(l.append)&&((r=Po(l))==="formdata"||r==="object"&&ma(l.toString)&&l.toString()==="[object FormData]"))},ow=Pa("URLSearchParams"),[cw,dw,uw,mw]=["ReadableStream","Request","Response","Headers"].map(Pa),fw=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ei(l,r,{allOwnKeys:i=!1}={}){if(l===null||typeof l>"u")return;let o,c;if(typeof l!="object"&&(l=[l]),Vn(l))for(o=0,c=l.length;o<c;o++)r.call(null,l[o],o,l);else{if(Jr(l))return;const m=i?Object.getOwnPropertyNames(l):Object.keys(l),f=m.length;let h;for(o=0;o<f;o++)h=m[o],r.call(null,l[h],h,l)}}function Yg(l,r){if(Jr(l))return null;r=r.toLowerCase();const i=Object.keys(l);let o=i.length,c;for(;o-- >0;)if(c=i[o],r===c.toLowerCase())return c;return null}const Sl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pg=l=>!On(l)&&l!==Sl;function rm(){const{caseless:l,skipUndefined:r}=Pg(this)&&this||{},i={},o=(c,m)=>{if(m==="__proto__"||m==="constructor"||m==="prototype")return;const f=l&&Yg(i,m)||m;Ao(i[f])&&Ao(c)?i[f]=rm(i[f],c):Ao(c)?i[f]=rm({},c):Vn(c)?i[f]=c.slice():(!r||!On(c))&&(i[f]=c)};for(let c=0,m=arguments.length;c<m;c++)arguments[c]&&ei(arguments[c],o);return i}const hw=(l,r,i,{allOwnKeys:o}={})=>(ei(r,(c,m)=>{i&&ma(c)?Object.defineProperty(l,m,{value:Vg(c,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(l,m,{value:c,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),l),pw=l=>(l.charCodeAt(0)===65279&&(l=l.slice(1)),l),xw=(l,r,i,o)=>{l.prototype=Object.create(r.prototype,o),Object.defineProperty(l.prototype,"constructor",{value:l,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(l,"super",{value:r.prototype}),i&&Object.assign(l.prototype,i)},gw=(l,r,i,o)=>{let c,m,f;const h={};if(r=r||{},l==null)return r;do{for(c=Object.getOwnPropertyNames(l),m=c.length;m-- >0;)f=c[m],(!o||o(f,l,r))&&!h[f]&&(r[f]=l[f],h[f]=!0);l=i!==!1&&jm(l)}while(l&&(!i||i(l,r))&&l!==Object.prototype);return r},bw=(l,r,i)=>{l=String(l),(i===void 0||i>l.length)&&(i=l.length),i-=r.length;const o=l.indexOf(r,i);return o!==-1&&o===i},yw=l=>{if(!l)return null;if(Vn(l))return l;let r=l.length;if(!Gg(r))return null;const i=new Array(r);for(;r-- >0;)i[r]=l[r];return i},vw=(l=>r=>l&&r instanceof l)(typeof Uint8Array<"u"&&jm(Uint8Array)),jw=(l,r)=>{const o=(l&&l[Yo]).call(l);let c;for(;(c=o.next())&&!c.done;){const m=c.value;r.call(l,m[0],m[1])}},Nw=(l,r)=>{let i;const o=[];for(;(i=l.exec(r))!==null;)o.push(i);return o},ww=Pa("HTMLFormElement"),kw=l=>l.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,o,c){return o.toUpperCase()+c}),Yp=(({hasOwnProperty:l})=>(r,i)=>l.call(r,i))(Object.prototype),Sw=Pa("RegExp"),Fg=(l,r)=>{const i=Object.getOwnPropertyDescriptors(l),o={};ei(i,(c,m)=>{let f;(f=r(c,m,l))!==!1&&(o[m]=f||c)}),Object.defineProperties(l,o)},Cw=l=>{Fg(l,(r,i)=>{if(ma(l)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const o=l[i];if(ma(o)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Ew=(l,r)=>{const i={},o=c=>{c.forEach(m=>{i[m]=!0})};return Vn(l)?o(l):o(String(l).split(r)),i},Tw=()=>{},Rw=(l,r)=>l!=null&&Number.isFinite(l=+l)?l:r;function Aw(l){return!!(l&&ma(l.append)&&l[$g]==="FormData"&&l[Yo])}const _w=l=>{const r=new Array(10),i=(o,c)=>{if(Wr(o)){if(r.indexOf(o)>=0)return;if(Jr(o))return o;if(!("toJSON"in o)){r[c]=o;const m=Vn(o)?[]:{};return ei(o,(f,h)=>{const p=i(f,c+1);!On(p)&&(m[h]=p)}),r[c]=void 0,m}}return o};return i(l,0)},Lw=Pa("AsyncFunction"),Mw=l=>l&&(Wr(l)||ma(l))&&ma(l.then)&&ma(l.catch),Qg=((l,r)=>l?setImmediate:r?((i,o)=>(Sl.addEventListener("message",({source:c,data:m})=>{c===Sl&&m===i&&o.length&&o.shift()()},!1),c=>{o.push(c),Sl.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",ma(Sl.postMessage)),zw=typeof queueMicrotask<"u"?queueMicrotask.bind(Sl):typeof process<"u"&&process.nextTick||Qg,Uw=l=>l!=null&&ma(l[Yo]),W={isArray:Vn,isArrayBuffer:Ig,isBuffer:Jr,isFormData:iw,isArrayBufferView:XN,isString:KN,isNumber:Gg,isBoolean:ZN,isObject:Wr,isPlainObject:Ao,isEmptyObject:JN,isReadableStream:cw,isRequest:dw,isResponse:uw,isHeaders:mw,isUndefined:On,isDate:WN,isFile:ew,isReactNativeBlob:tw,isReactNative:aw,isBlob:sw,isRegExp:Sw,isFunction:ma,isStream:nw,isURLSearchParams:ow,isTypedArray:vw,isFileList:lw,forEach:ei,merge:rm,extend:hw,trim:fw,stripBOM:pw,inherits:xw,toFlatObject:gw,kindOf:Po,kindOfTest:Pa,endsWith:bw,toArray:yw,forEachEntry:jw,matchAll:Nw,isHTMLForm:ww,hasOwnProperty:Yp,hasOwnProp:Yp,reduceDescriptors:Fg,freezeMethods:Cw,toObjectSet:Ew,toCamelCase:kw,noop:Tw,toFiniteNumber:Rw,findKey:Yg,global:Sl,isContextDefined:Pg,isSpecCompliantForm:Aw,toJSONObject:_w,isAsyncFn:Lw,isThenable:Mw,setImmediate:Qg,asap:zw,isIterable:Uw};let He=class Xg extends Error{static from(r,i,o,c,m,f){const h=new Xg(r.message,i||r.code,o,c,m);return h.cause=r,h.name=r.name,r.status!=null&&h.status==null&&(h.status=r.status),f&&Object.assign(h,f),h}constructor(r,i,o,c,m){super(r),Object.defineProperty(this,"message",{value:r,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,i&&(this.code=i),o&&(this.config=o),c&&(this.request=c),m&&(this.response=m,this.status=m.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:W.toJSONObject(this.config),code:this.code,status:this.status}}};He.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";He.ERR_BAD_OPTION="ERR_BAD_OPTION";He.ECONNABORTED="ECONNABORTED";He.ETIMEDOUT="ETIMEDOUT";He.ERR_NETWORK="ERR_NETWORK";He.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";He.ERR_DEPRECATED="ERR_DEPRECATED";He.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";He.ERR_BAD_REQUEST="ERR_BAD_REQUEST";He.ERR_CANCELED="ERR_CANCELED";He.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";He.ERR_INVALID_URL="ERR_INVALID_URL";const Dw=null;function im(l){return W.isPlainObject(l)||W.isArray(l)}function Kg(l){return W.endsWith(l,"[]")?l.slice(0,-2):l}function gu(l,r,i){return l?l.concat(r).map(function(c,m){return c=Kg(c),!i&&m?"["+c+"]":c}).join(i?".":""):r}function Ow(l){return W.isArray(l)&&!l.some(im)}const Bw=W.toFlatObject(W,{},null,function(r){return/^is[A-Z]/.test(r)});function Qo(l,r,i){if(!W.isObject(l))throw new TypeError("target must be an object");r=r||new FormData,i=W.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,w){return!W.isUndefined(w[k])});const o=i.metaTokens,c=i.visitor||y,m=i.dots,f=i.indexes,p=(i.Blob||typeof Blob<"u"&&Blob)&&W.isSpecCompliantForm(r);if(!W.isFunction(c))throw new TypeError("visitor must be a function");function g(N){if(N===null)return"";if(W.isDate(N))return N.toISOString();if(W.isBoolean(N))return N.toString();if(!p&&W.isBlob(N))throw new He("Blob is not supported. Use a Buffer instead.");return W.isArrayBuffer(N)||W.isTypedArray(N)?p&&typeof Blob=="function"?new Blob([N]):Buffer.from(N):N}function y(N,k,w){let A=N;if(W.isReactNative(r)&&W.isReactNativeBlob(N))return r.append(gu(w,k,m),g(N)),!1;if(N&&!w&&typeof N=="object"){if(W.endsWith(k,"{}"))k=o?k:k.slice(0,-2),N=JSON.stringify(N);else if(W.isArray(N)&&Ow(N)||(W.isFileList(N)||W.endsWith(k,"[]"))&&(A=W.toArray(N)))return k=Kg(k),A.forEach(function(z,H){!(W.isUndefined(z)||z===null)&&r.append(f===!0?gu([k],H,m):f===null?k:k+"[]",g(z))}),!1}return im(N)?!0:(r.append(gu(w,k,m),g(N)),!1)}const v=[],E=Object.assign(Bw,{defaultVisitor:y,convertValue:g,isVisitable:im});function R(N,k){if(!W.isUndefined(N)){if(v.indexOf(N)!==-1)throw Error("Circular reference detected in "+k.join("."));v.push(N),W.forEach(N,function(A,O){(!(W.isUndefined(A)||A===null)&&c.call(r,A,W.isString(O)?O.trim():O,k,E))===!0&&R(A,k?k.concat(O):[O])}),v.pop()}}if(!W.isObject(l))throw new TypeError("data must be an object");return R(l),r}function Pp(l){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(l).replace(/[!'()~]|%20|%00/g,function(o){return r[o]})}function Nm(l,r){this._pairs=[],l&&Qo(l,this,r)}const Zg=Nm.prototype;Zg.append=function(r,i){this._pairs.push([r,i])};Zg.toString=function(r){const i=r?function(o){return r.call(this,o,Pp)}:Pp;return this._pairs.map(function(c){return i(c[0])+"="+i(c[1])},"").join("&")};function Hw(l){return encodeURIComponent(l).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Jg(l,r,i){if(!r)return l;const o=i&&i.encode||Hw,c=W.isFunction(i)?{serialize:i}:i,m=c&&c.serialize;let f;if(m?f=m(r,c):f=W.isURLSearchParams(r)?r.toString():new Nm(r,c).toString(o),f){const h=l.indexOf("#");h!==-1&&(l=l.slice(0,h)),l+=(l.indexOf("?")===-1?"?":"&")+f}return l}class Fp{constructor(){this.handlers=[]}use(r,i,o){return this.handlers.push({fulfilled:r,rejected:i,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){W.forEach(this.handlers,function(o){o!==null&&r(o)})}}const wm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},qw=typeof URLSearchParams<"u"?URLSearchParams:Nm,Vw=typeof FormData<"u"?FormData:null,$w=typeof Blob<"u"?Blob:null,Iw={isBrowser:!0,classes:{URLSearchParams:qw,FormData:Vw,Blob:$w},protocols:["http","https","file","blob","url","data"]},km=typeof window<"u"&&typeof document<"u",om=typeof navigator=="object"&&navigator||void 0,Gw=km&&(!om||["ReactNative","NativeScript","NS"].indexOf(om.product)<0),Yw=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Pw=km&&window.location.href||"http://localhost",Fw=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:km,hasStandardBrowserEnv:Gw,hasStandardBrowserWebWorkerEnv:Yw,navigator:om,origin:Pw},Symbol.toStringTag,{value:"Module"})),ea={...Fw,...Iw};function Qw(l,r){return Qo(l,new ea.classes.URLSearchParams,{visitor:function(i,o,c,m){return ea.isNode&&W.isBuffer(i)?(this.append(o,i.toString("base64")),!1):m.defaultVisitor.apply(this,arguments)},...r})}function Xw(l){return W.matchAll(/\w+|\[(\w*)]/g,l).map(r=>r[0]==="[]"?"":r[1]||r[0])}function Kw(l){const r={},i=Object.keys(l);let o;const c=i.length;let m;for(o=0;o<c;o++)m=i[o],r[m]=l[m];return r}function Wg(l){function r(i,o,c,m){let f=i[m++];if(f==="__proto__")return!0;const h=Number.isFinite(+f),p=m>=i.length;return f=!f&&W.isArray(c)?c.length:f,p?(W.hasOwnProp(c,f)?c[f]=[c[f],o]:c[f]=o,!h):((!c[f]||!W.isObject(c[f]))&&(c[f]=[]),r(i,o,c[f],m)&&W.isArray(c[f])&&(c[f]=Kw(c[f])),!h)}if(W.isFormData(l)&&W.isFunction(l.entries)){const i={};return W.forEachEntry(l,(o,c)=>{r(Xw(o),c,i,0)}),i}return null}function Zw(l,r,i){if(W.isString(l))try{return(r||JSON.parse)(l),W.trim(l)}catch(o){if(o.name!=="SyntaxError")throw o}return(i||JSON.stringify)(l)}const ti={transitional:wm,adapter:["xhr","http","fetch"],transformRequest:[function(r,i){const o=i.getContentType()||"",c=o.indexOf("application/json")>-1,m=W.isObject(r);if(m&&W.isHTMLForm(r)&&(r=new FormData(r)),W.isFormData(r))return c?JSON.stringify(Wg(r)):r;if(W.isArrayBuffer(r)||W.isBuffer(r)||W.isStream(r)||W.isFile(r)||W.isBlob(r)||W.isReadableStream(r))return r;if(W.isArrayBufferView(r))return r.buffer;if(W.isURLSearchParams(r))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let h;if(m){if(o.indexOf("application/x-www-form-urlencoded")>-1)return Qw(r,this.formSerializer).toString();if((h=W.isFileList(r))||o.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return Qo(h?{"files[]":r}:r,p&&new p,this.formSerializer)}}return m||c?(i.setContentType("application/json",!1),Zw(r)):r}],transformResponse:[function(r){const i=this.transitional||ti.transitional,o=i&&i.forcedJSONParsing,c=this.responseType==="json";if(W.isResponse(r)||W.isReadableStream(r))return r;if(r&&W.isString(r)&&(o&&!this.responseType||c)){const f=!(i&&i.silentJSONParsing)&&c;try{return JSON.parse(r,this.parseReviver)}catch(h){if(f)throw h.name==="SyntaxError"?He.from(h,He.ERR_BAD_RESPONSE,this,null,this.response):h}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ea.classes.FormData,Blob:ea.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};W.forEach(["delete","get","head","post","put","patch"],l=>{ti.headers[l]={}});const Jw=W.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ww=l=>{const r={};let i,o,c;return l&&l.split(` 491`).forEach(function(f){c=f.indexOf(":"),i=f.substring(0,c).trim().toLowerCase(),o=f.substring(c+1).trim(),!(!i||r[i]&&Jw[i])&&(i==="set-cookie"?r[i]?r[i].push(o):r[i]=[o]:r[i]=r[i]?r[i]+", "+o:o)}),r},Qp=Symbol("internals");function Hr(l){return l&&String(l).trim().toLowerCase()}function _o(l){return l===!1||l==null?l:W.isArray(l)?l.map(_o):String(l)}function e5(l){const r=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=i.exec(l);)r[o[1]]=o[2];return r}const t5=l=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(l.trim());function bu(l,r,i,o,c){if(W.isFunction(o))return o.call(this,r,i);if(c&&(r=i),!!W.isString(r)){if(W.isString(o))return r.indexOf(o)!==-1;if(W.isRegExp(o))return o.test(r)}}function a5(l){return l.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,i,o)=>i.toUpperCase()+o)}function s5(l,r){const i=W.toCamelCase(" "+r);["get","set","has"].forEach(o=>{Object.defineProperty(l,o+i,{value:function(c,m,f){return this[o].call(this,r,c,m,f)},configurable:!0})})}let fa=class{constructor(r){r&&this.set(r)}set(r,i,o){const c=this;function m(h,p,g){const y=Hr(p);if(!y)throw new Error("header name must be a non-empty string");const v=W.findKey(c,y);(!v||c[v]===void 0||g===!0||g===void 0&&c[v]!==!1)&&(c[v||p]=_o(h))}const f=(h,p)=>W.forEach(h,(g,y)=>m(g,y,p));if(W.isPlainObject(r)||r instanceof this.constructor)f(r,i);else if(W.isString(r)&&(r=r.trim())&&!t5(r))f(Ww(r),i);else if(W.isObject(r)&&W.isIterable(r)){let h={},p,g;for(const y of r){if(!W.isArray(y))throw TypeError("Object iterator must return a key-value pair");h[g=y[0]]=(p=h[g])?W.isArray(p)?[...p,y[1]]:[p,y[1]]:y[1]}f(h,i)}else r!=null&&m(i,r,o);return this}get(r,i){if(r=Hr(r),r){const o=W.findKey(this,r);if(o){const c=this[o];if(!i)return c;if(i===!0)return e5(c);if(W.isFunction(i))return i.call(this,c,o);if(W.isRegExp(i))return i.exec(c);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,i){if(r=Hr(r),r){const o=W.findKey(this,r);return!!(o&&this[o]!==void 0&&(!i||bu(this,this[o],o,i)))}return!1}delete(r,i){const o=this;let c=!1;function m(f){if(f=Hr(f),f){const h=W.findKey(o,f);h&&(!i||bu(o,o[h],h,i))&&(delete o[h],c=!0)}}return W.isArray(r)?r.forEach(m):m(r),c}clear(r){const i=Object.keys(this);let o=i.length,c=!1;for(;o--;){const m=i[o];(!r||bu(this,this[m],m,r,!0))&&(delete this[m],c=!0)}return c}normalize(r){const i=this,o={};return W.forEach(this,(c,m)=>{const f=W.findKey(o,m);if(f){i[f]=_o(c),delete i[m];return}const h=r?a5(m):String(m).trim();h!==m&&delete i[m],i[h]=_o(c),o[h]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){const i=Object.create(null);return W.forEach(this,(o,c)=>{o!=null&&o!==!1&&(i[c]=r&&W.isArray(o)?o.join(", "):o)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,i])=>r+": "+i).join(` 492`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...i){const o=new this(r);return i.forEach(c=>o.set(c)),o}static accessor(r){const o=(this[Qp]=this[Qp]={accessors:{}}).accessors,c=this.prototype;function m(f){const h=Hr(f);o[h]||(s5(c,f),o[h]=!0)}return W.isArray(r)?r.forEach(m):m(r),this}};fa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);W.reduceDescriptors(fa.prototype,({value:l},r)=>{let i=r[0].toUpperCase()+r.slice(1);return{get:()=>l,set(o){this[i]=o}}});W.freezeMethods(fa);function yu(l,r){const i=this||ti,o=r||i,c=fa.from(o.headers);let m=o.data;return W.forEach(l,function(h){m=h.call(i,m,c.normalize(),r?r.status:void 0)}),c.normalize(),m}function e1(l){return!!(l&&l.__CANCEL__)}let ai=class extends He{constructor(r,i,o){super(r??"canceled",He.ERR_CANCELED,i,o),this.name="CanceledError",this.__CANCEL__=!0}};function t1(l,r,i){const o=i.config.validateStatus;!i.status||!o||o(i.status)?l(i):r(new He("Request failed with status code "+i.status,[He.ERR_BAD_REQUEST,He.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.c
vendor: 8,032 bytes, line 492
492onfig,i.request,i))}function l5(l){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l);return r&&r[1]||""}function n5(l,r){l=l||10;const i=new Array(l),o=new Array(l);let c=0,m=0,f;return r=r!==void 0?r:1e3,function(p){const g=Date.now(),y=o[m];f||(f=g),i[c]=p,o[c]=g;let v=m,E=0;for(;v!==c;)E+=i[v++],v=v%l;if(c=(c+1)%l,c===m&&(m=(m+1)%l),g-f<r)return;const R=y&&g-y;return R?Math.round(E*1e3/R):void 0}}function r5(l,r){let i=0,o=1e3/r,c,m;const f=(g,y=Date.now())=>{i=y,c=null,m&&(clearTimeout(m),m=null),l(...g)};return[(...g)=>{const y=Date.now(),v=y-i;v>=o?f(g,y):(c=g,m||(m=setTimeout(()=>{m=null,f(c)},o-v)))},()=>c&&f(c)]}const Oo=(l,r,i=3)=>{let o=0;const c=n5(50,250);return r5(m=>{const f=m.loaded,h=m.lengthComputable?m.total:void 0,p=f-o,g=c(p),y=f<=h;o=f;const v={loaded:f,total:h,progress:h?f/h:void 0,bytes:p,rate:g||void 0,estimated:g&&h&&y?(h-f)/g:void 0,event:m,lengthComputable:h!=null,[r?"download":"upload"]:!0};l(v)},i)},Xp=(l,r)=>{const i=l!=null;return[o=>r[0]({lengthComputable:i,total:l,loaded:o}),r[1]]},Kp=l=>(...r)=>W.asap(()=>l(...r)),i5=ea.hasStandardBrowserEnv?((l,r)=>i=>(i=new URL(i,ea.origin),l.protocol===i.protocol&&l.host===i.host&&(r||l.port===i.port)))(new URL(ea.origin),ea.navigator&&/(msie|trident)/i.test(ea.navigator.userAgent)):()=>!0,o5=ea.hasStandardBrowserEnv?{write(l,r,i,o,c,m,f){if(typeof document>"u")return;const h=[`${l}=${encodeURIComponent(r)}`];W.isNumber(i)&&h.push(`expires=${new Date(i).toUTCString()}`),W.isString(o)&&h.push(`path=${o}`),W.isString(c)&&h.push(`domain=${c}`),m===!0&&h.push("secure"),W.isString(f)&&h.push(`SameSite=${f}`),document.cookie=h.join("; ")},read(l){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+l+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(l){this.write(l,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function c5(l){return typeof l!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(l)}function d5(l,r){return r?l.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):l}function a1(l,r,i){let o=!c5(r);return l&&(o||i==!1)?d5(l,r):r}const Zp=l=>l instanceof fa?{...l}:l;function Rl(l,r){r=r||{};const i={};function o(g,y,v,E){return W.isPlainObject(g)&&W.isPlainObject(y)?W.merge.call({caseless:E},g,y):W.isPlainObject(y)?W.merge({},y):W.isArray(y)?y.slice():y}function c(g,y,v,E){if(W.isUndefined(y)){if(!W.isUndefined(g))return o(void 0,g,v,E)}else return o(g,y,v,E)}function m(g,y){if(!W.isUndefined(y))return o(void 0,y)}function f(g,y){if(W.isUndefined(y)){if(!W.isUndefined(g))return o(void 0,g)}else return o(void 0,y)}function h(g,y,v){if(v in r)return o(g,y);if(v in l)return o(void 0,g)}const p={url:m,method:m,data:m,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:h,headers:(g,y,v)=>c(Zp(g),Zp(y),v,!0)};return W.forEach(Object.keys({...l,...r}),function(y){if(y==="__proto__"||y==="constructor"||y==="prototype")return;const v=W.hasOwnProp(p,y)?p[y]:c,E=v(l[y],r[y],y);W.isUndefined(E)&&v!==h||(i[y]=E)}),i}const s1=l=>{const r=Rl({},l);let{data:i,withXSRFToken:o,xsrfHeaderName:c,xsrfCookieName:m,headers:f,auth:h}=r;if(r.headers=f=fa.from(f),r.url=Jg(a1(r.baseURL,r.url,r.allowAbsoluteUrls),l.params,l.paramsSerializer),h&&f.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):""))),W.isFormData(i)){if(ea.hasStandardBrowserEnv||ea.hasStandardBrowserWebWorkerEnv)f.setContentType(void 0);else if(W.isFunction(i.getHeaders)){const p=i.getHeaders(),g=["content-type","content-length"];Object.entries(p).forEach(([y,v])=>{g.includes(y.toLowerCase())&&f.set(y,v)})}}if(ea.hasStandardBrowserEnv&&(o&&W.isFunction(o)&&(o=o(r)),o||o!==!1&&i5(r.url))){const p=c&&m&&o5.read(m);p&&f.set(c,p)}return r},u5=typeof XMLHttpRequest<"u",m5=u5&&function(l){return new Promise(function(i,o){const c=s1(l);let m=c.data;const f=fa.from(c.headers).normalize();let{responseType:h,onUploadProgress:p,onDownloadProgress:g}=c,y,v,E,R,N;function k(){R&&R(),N&&N(),c.cancelToken&&c.cancelToken.unsubscribe(y),c.signal&&c.signal.removeEventListener("abort",y)}let w=new XMLHttpRequest;w.open(c.method.toUpperCase(),c.url,!0),w.timeout=c.timeout;function A(){if(!w)return;const z=fa.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),se={data:!h||h==="text"||h==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:z,config:l,request:w};t1(function(T){i(T),k()},function(T){o(T),k()},se),w=null}"onloadend"in w?w.onloadend=A:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(A)},w.onabort=function(){w&&(o(new He("Request aborted",He.ECONNABORTED,l,w)),w=null)},w.onerror=function(H){const se=H&&H.message?H.message:"Network Error",Z=new He(se,He.ERR_NETWORK,l,w);Z.event=H||null,o(Z),w=null},w.ontimeout=function(){let H=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded";const se=c.transitional||wm;c.timeoutErrorMessage&&(H=c.timeoutErrorMessage),o(new He(H,se.clarifyTimeoutError?He.ETIMEDOUT:He.ECONNABORTED,l,w)),w=null},m===void 0&&f.setContentType(null),"setRequestHeader"in w&&W.forEach(f.toJSON(),function(H,se){w.setRequestHeader(se,H)}),W.isUndefined(c.withCredentials)||(w.withCredentials=!!c.withCredentials),h&&h!=="json"&&(w.responseType=c.responseType),g&&([E,N]=Oo(g,!0),w.addEventListener("progress",E)),p&&w.upload&&([v,R]=Oo(p),w.upload.addEventListener("progress",v),w.upload.addEventListener("loadend",R)),(c.cancelToken||c.signal)&&(y=z=>{w&&(o(!z||z.type?new ai(null,l,w):z),w.abort(),w=null)},c.cancelToken&&c.cancelToken.subscribe(y),c.signal&&(c.signal.aborted?y():c.signal.addEventListener("abort",y)));const O=l5(c.url);if(O&&ea.protocols.indexOf(O)===-1){o(new He("Unsupported protocol "+O+":",He.ERR_BAD_REQUEST,l));return}w.send(m||null)})},f5=(l,r)=>{const{length:i}=l=l?l.filter(Boolean):[];if(r||i){let o=new AbortController,c;const m=function(g){if(!c){c=!0,h();const y=g instanceof Error?g:this.reason;o.abort(y instanceof He?y:new ai(y instanceof Error?y.message:y))}};let f=r&&setTimeout(()=>{f=null,m(new He(`timeout of ${r}ms exceeded`,He.ETIMEDOUT))},r);const h=()=>{l&&(f&&clearTimeout(f),f=null,l.forEach(g=>{g.unsubscribe?g.unsubscribe(m):g.removeEventListener("abort",m)}),l=null)};l.forEach(g=>g.addEventListener("abort",m));const{signal:p}=o;return p.unsubscribe=()=>W.asap(h),p}},h5=function*(l,r){let i=l.byteLength;if(i<r){yield l;return}let o=0,c;for(;o<i;)c=o+r,yield l.slice(o,c),o=c},p5=async function*(l,r){for await(const i of x5(l))yield*h5(i,r)},x5=async function*(l){if(l[Symbol.asyncIterator]){yield*l;return}const r=l.getReader();try{for(;;){const{done:i,value:o}=await r.read();if(i)break;yield o}}finally{await r.cancel()}},Jp=(l,r,i,o)=>{const c=p5(l,r);let m=0,f,h=p=>{f||(f=!0,o&&o(p))};return new ReadableStream({async pull(p){try{const{done:g,value:y}=await c.next();if(g){h(),p.close();return}let v=y.byteLength;if(i){let E=m+=v;i(E)}p.enqueue(new Uint8Array(y))}catch(g){throw h(g),g}},cancel(p){return h(p),c.return()}},{highWaterMark:2})},Wp=64*1024,{isFunction:jo}=W,g5=(({Request:l,Response:r})=>({Request:l,Response:r}))(W.global),{ReadableStream:ex,TextEncoder:tx}=W.global,ax=(l,...r)=>{try{return!!l(...r)}catch{return!1}},b5=l=>{l=W.merge.call({skipUndefined:!0},g5,l);const{fetch:r,Request:i,Response:o}=l,c=r?jo(r):typeof fetch=="function",m=jo(i),f=jo(o);if(!c)return!1;const h=c&&jo(ex),p=c&&(typeof tx=="function"?(N=>k=>N.encode(k))(new tx):async N=>new Uint8Array(await new i(N).arrayBuffer())),g=m&&h&&ax(()=>{let N=!1;const k=new i(ea.origin,{body:new ex,method:"POST",get duplex(){return N=!0,"half"}}).headers.has("Content-Type");return N&&!k}),y=f&&h&&ax(()=>
vendor: 4,210 bytes, lines 492-494
492W.isReadableStream(new o("").body)),v={stream:y&&(N=>N.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(N=>{!v[N]&&(v[N]=(k,w)=>{let A=k&&k[N];if(A)return A.call(k);throw new He(`Response type '${N}' is not supported`,He.ERR_NOT_SUPPORT,w)})});const E=async N=>{if(N==null)return 0;if(W.isBlob(N))return N.size;if(W.isSpecCompliantForm(N))return(await new i(ea.origin,{method:"POST",body:N}).arrayBuffer()).byteLength;if(W.isArrayBufferView(N)||W.isArrayBuffer(N))return N.byteLength;if(W.isURLSearchParams(N)&&(N=N+""),W.isString(N))return(await p(N)).byteLength},R=async(N,k)=>{const w=W.toFiniteNumber(N.getContentLength());return w??E(k)};return async N=>{let{url:k,method:w,data:A,signal:O,cancelToken:z,timeout:H,onDownloadProgress:se,onUploadProgress:Z,responseType:T,headers:P,withCredentials:q="same-origin",fetchOptions:Q}=s1(N),F=r||fetch;T=T?(T+"").toLowerCase():"text";let $=f5([O,z&&z.toAbortSignal()],H),G=null;const te=$&&$.unsubscribe&&(()=>{$.unsubscribe()});let ye;try{if(Z&&g&&w!=="get"&&w!=="head"&&(ye=await R(P,A))!==0){let S=new i(k,{method:"POST",body:A,duplex:"half"}),B;if(W.isFormData(A)&&(B=S.headers.get("content-type"))&&P.setContentType(B),S.body){const[J,oe]=Xp(ye,Oo(Kp(Z)));A=Jp(S.body,Wp,J,oe)}}W.isString(q)||(q=q?"include":"omit");const U=m&&"credentials"in i.prototype,ce={...Q,signal:$,method:w.toUpperCase(),headers:P.normalize().toJSON(),body:A,duplex:"half",credentials:U?q:void 0};G=m&&new i(k,ce);let C=await(m?F(G,Q):F(k,ce));const le=y&&(T==="stream"||T==="response");if(y&&(se||le&&te)){const S={};["status","statusText","headers"].forEach(ve=>{S[ve]=C[ve]});const B=W.toFiniteNumber(C.headers.get("content-length")),[J,oe]=se&&Xp(B,Oo(Kp(se),!0))||[];C=new o(Jp(C.body,Wp,J,()=>{oe&&oe(),te&&te()}),S)}T=T||"text";let de=await v[W.findKey(v,T)||"text"](C,N);return!le&&te&&te(),await new Promise((S,B)=>{t1(S,B,{data:de,headers:fa.from(C.headers),status:C.status,statusText:C.statusText,config:N,request:G})})}catch(U){throw te&&te(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new He("Network Error",He.ERR_NETWORK,N,G,U&&U.response),{cause:U.cause||U}):He.from(U,U&&U.code,N,G,U&&U.response)}}},y5=new Map,l1=l=>{let r=l&&l.env||{};const{fetch:i,Request:o,Response:c}=r,m=[o,c,i];let f=m.length,h=f,p,g,y=y5;for(;h--;)p=m[h],g=y.get(p),g===void 0&&y.set(p,g=h?new Map:b5(r)),y=g;return g};l1();const Sm={http:Dw,xhr:m5,fetch:{get:l1}};W.forEach(Sm,(l,r)=>{if(l){try{Object.defineProperty(l,"name",{value:r})}catch{}Object.defineProperty(l,"adapterName",{value:r})}});const sx=l=>`- ${l}`,v5=l=>W.isFunction(l)||l===null||l===!1;function j5(l,r){l=W.isArray(l)?l:[l];const{length:i}=l;let o,c;const m={};for(let f=0;f<i;f++){o=l[f];let h;if(c=o,!v5(o)&&(c=Sm[(h=String(o)).toLowerCase()],c===void 0))throw new He(`Unknown adapter '${h}'`);if(c&&(W.isFunction(c)||(c=c.get(r))))break;m[h||"#"+f]=c}if(!c){const f=Object.entries(m).map(([p,g])=>`adapter ${p} `+(g===!1?"is not supported by the environment":"is not available in the build"));let h=i?f.length>1?`since : 493`+f.map(sx).join(` 494`):" "+sx(f[0]):"as no adapter specified";throw new He("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return c}const n1={getAdapter:j5,adapters:Sm};function vu(l){if(l.cancelToken&&l.cancelToken.throwIfRequested(),l.signal&&l.signal.aborted)throw new ai(null,l)}function lx(l){return vu(l),l.headers=fa.from(l.headers),l.data=yu.call(l,l.transformRequest),["post","put","patch"].indexOf(l.method)!==-1&&l.headers.setContentType("application/x-www-form-urlencoded",!1),n1.getAdapter(l.adapter||ti.adapter,l)(l).then(function(o){return vu(l),o.data=yu.call(l,l.transformResponse,o),o.headers=fa.from(o.headers),o},function(o){return e1(o)||(vu(l),o&&o.response&&(o.response.data=yu.call(l,l.transformResponse,o.response),o.response.headers=fa.from(o.response.headers))),Promise.reject(o)})}const r1="1.13.6",Xo={};["object","boolean","number","function","string","symbol"].forEach((l,r)=>{Xo[l]=function(o){return typeof o===l||"a"+(r<1?"n ":" ")+l}});const nx={};Xo.transitional=function(r,i,o){function c(m,f){return"[Axios v"+r1+"] Transitional option '"+m+"'"+f+(o?". "+o:"")}return(m,f,h)=>
vendor: 4,614 bytes, lines 494-495
494{if(r===!1)throw new He(c(f," has been removed"+(i?" in "+i:"")),He.ERR_DEPRECATED);return i&&!nx[f]&&(nx[f]=!0,console.warn(c(f," has been deprecated since v"+i+" and will be removed in the near future"))),r?r(m,f,h):!0}};Xo.spelling=function(r){return(i,o)=>(console.warn(`${o} is likely a misspelling of ${r}`),!0)};function N5(l,r,i){if(typeof l!="object")throw new He("options must be an object",He.ERR_BAD_OPTION_VALUE);const o=Object.keys(l);let c=o.length;for(;c-- >0;){const m=o[c],f=r[m];if(f){const h=l[m],p=h===void 0||f(h,m,l);if(p!==!0)throw new He("option "+m+" must be "+p,He.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new He("Unknown option "+m,He.ERR_BAD_OPTION)}}const Lo={assertOptions:N5,validators:Xo},Ua=Lo.validators;let El=class{constructor(r){this.defaults=r||{},this.interceptors={request:new Fp,response:new Fp}}async request(r,i){try{return await this._request(r,i)}catch(o){if(o instanceof Error){let c={};Error.captureStackTrace?Error.captureStackTrace(c):c=new Error;const m=c.stack?c.stack.replace(/^.+\n/,""):"";try{o.stack?m&&!String(o.stack).endsWith(m.replace(/^.+\n.+\n/,""))&&(o.stack+=` 495`+m):o.stack=m}catch{}}throw o}}_request(r,i){typeof r=="string"?(i=i||{},i.url=r):i=r||{},i=Rl(this.defaults,i);const{transitional:o,paramsSerializer:c,headers:m}=i;o!==void 0&&Lo.assertOptions(o,{silentJSONParsing:Ua.transitional(Ua.boolean),forcedJSONParsing:Ua.transitional(Ua.boolean),clarifyTimeoutError:Ua.transitional(Ua.boolean),legacyInterceptorReqResOrdering:Ua.transitional(Ua.boolean)},!1),c!=null&&(W.isFunction(c)?i.paramsSerializer={serialize:c}:Lo.assertOptions(c,{encode:Ua.function,serialize:Ua.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),Lo.assertOptions(i,{baseUrl:Ua.spelling("baseURL"),withXsrfToken:Ua.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let f=m&&W.merge(m.common,m[i.method]);m&&W.forEach(["delete","get","head","post","put","patch","common"],N=>{delete m[N]}),i.headers=fa.concat(f,m);const h=[];let p=!0;this.interceptors.request.forEach(function(k){if(typeof k.runWhen=="function"&&k.runWhen(i)===!1)return;p=p&&k.synchronous;const w=i.transitional||wm;w&&w.legacyInterceptorReqResOrdering?h.unshift(k.fulfilled,k.rejected):h.push(k.fulfilled,k.rejected)});const g=[];this.interceptors.response.forEach(function(k){g.push(k.fulfilled,k.rejected)});let y,v=0,E;if(!p){const N=[lx.bind(this),void 0];for(N.unshift(...h),N.push(...g),E=N.length,y=Promise.resolve(i);v<E;)y=y.then(N[v++],N[v++]);return y}E=h.length;let R=i;for(;v<E;){const N=h[v++],k=h[v++];try{R=N(R)}catch(w){k.call(this,w);break}}try{y=lx.call(this,R)}catch(N){return Promise.reject(N)}for(v=0,E=g.length;v<E;)y=y.then(g[v++],g[v++]);return y}getUri(r){r=Rl(this.defaults,r);const i=a1(r.baseURL,r.url,r.allowAbsoluteUrls);return Jg(i,r.params,r.paramsSerializer)}};W.forEach(["delete","get","head","options"],function(r){El.prototype[r]=function(i,o){return this.request(Rl(o||{},{method:r,url:i,data:(o||{}).data}))}});W.forEach(["post","put","patch"],function(r){function i(o){return function(m,f,h){return this.request(Rl(h||{},{method:r,headers:o?{"Content-Type":"multipart/form-data"}:{},url:m,data:f}))}}El.prototype[r]=i(),El.prototype[r+"Form"]=i(!0)});let w5=class i1{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(m){i=m});const o=this;this.promise.then(c=>{if(!o._listeners)return;let m=o._listeners.length;for(;m-- >0;)o._listeners[m](c);o._listeners=null}),this.promise.then=c=>{let m;const f=new Promise(h=>{o.subscribe(h),m=h}).then(c);return f.cancel=function(){o.unsubscribe(m)},f},r(function(m,f,h){o.reason||(o.reason=new ai(m,f,h),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const i=this._listeners.indexOf(r);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const r=new AbortController,i=o=>{r.abort(o)};return this.subscribe(i),r.signal.unsubscribe=()=>this.unsubscribe(i),r.signal}static source(){let r;return{token:new i1(function(c){r=c}),cancel:r}}};function k5(l){return function(i){return l.apply(null,i)}}function S5(l){return W.isObject(l)&&l.isAxiosError===!0}const cm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,Re
495setContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(cm).forEach(([l,r])=>{cm[r]=l});function o1(l){const r=new El(l),i=Vg(El.prototype.request,r);return W.extend(i,El.prototype,r,{allOwnKeys:!0}),W.extend(i,r,null,{allOwnKeys:!0}),i.create=function(c){return o1(Rl(l,c))},i}const Lt=o1(ti);Lt.Axios=El;Lt.CanceledError=ai;Lt.CancelToken=w5;Lt.isCancel=e1;Lt.VERSION=r1;Lt.toFormData=Qo;Lt.AxiosError=He;Lt.Cancel=Lt.CanceledError;Lt.all=function(r){return Promise.all(r)};Lt.spread=k5;Lt.isAxiosError=S5;Lt.mergeConfig=Rl;Lt.AxiosHeaders=fa;Lt.formToJSON=l=>Wg(W.isHTMLForm(l)?new FormData(l):l);Lt.getAdapter=n1.getAdapter;Lt.HttpStatusCode=cm;Lt.default=Lt;const{Axios:S6,AxiosError:C6,CanceledError:E6,isCancel:T6,CancelToken:R6,VERSION:A6,all:_6,Cancel:L6,isAxiosError:M6,spread:z6,toFormData:U6,AxiosHeaders:D6,HttpStatusCode:O6,formToJSON:B6,getAdapter:H6,mergeConfig:q6}=Lt,ju={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_VERCEL_BRANCH_URL:"sleektap-admin-frontend-skele-git-fbcd82-xlnc-digitals-projects.vercel.app",VITE_VERCEL_DEPLOYMENT_ID:"dpl_C282w36q8ZAErw7X53pB1iMBFLu6",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"xlncdigitalagency",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"xlncdigitalagency",VITE_VERCEL_GIT_COMMIT_MESSAGE:"Fixed Stuff",VITE_VERCEL_GIT_COMMIT_REF:"main",VITE_VERCEL_GIT_COMMIT_SHA:"c896ab1b83d1847c97436fab23b42f6259ac52d1",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"1159276875",VITE_VERCEL_GIT_REPO_OWNER:"xlncdigitalagency",VITE_VERCEL_GIT_REPO_SLUG:"sleektap-admin-frontend-skeleton",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"18086404b52547dd/script.js","viewEndpoint":"18086404b52547dd/view","eventEndpoint":"18086404b52547dd/event","sessionEndpoint":"18086404b52547dd/session"},"speedInsights":{"scriptSrc":"e27c2ad8eef4d90c/script.js","endpoint":"e27c2ad8eef4d90c/vitals"}}',VITE_VERCEL_PROJECT_ID:"prj_4SSojkAOM11wzpj3FijC4wrQTISY",VITE_VERCEL_PROJECT_PRODUCTION_URL:"sleektap-admin-frontend-skeleton.vercel.app",VITE_VERCEL_TARGET_ENV:"production",VITE_VERCEL_URL:"sleektap-admin-frontend-skeleton-512js42ix.vercel.app"},C5=()=>{const l="https://sleektap-backend-test.vercel.app/api";try{const r=ju==null?void 0:ju.VITE_API_URL;if(r)return r}catch{}return l},c1=C5(),E5=c1,d1=()=>{localStorage.removeItem("sleektap_token"),localStorage.removeItem("sleektap_user"),localStorage.removeItem("sleektap_auth")},T5=l=>{try{const r=l.split(".")[1];if(!r)return!0;const i=JSON.parse(atob(r.replace(/-/g,"+").replace(/_/g,"/")));return typeof i.exp!="number"?!1:i.exp*1e3<=Date.now()}catch{return!0}},rx=()=>{const l=localStorage.getItem("sleektap_token");return!!l&&!T5(l)},qe=Lt.create({baseURL:c1,headers:{"Content-Type":"application/json"}});qe.interceptors.request.use(l=>{const r=localStorage.getItem("sleektap_token");return r&&(l.headers.Authorization=`Bearer ${r}`),l},l=>Promise.reject(l));let ix=!1;qe.interceptors.response.use(l=>l,l=>(l.response&&(l.response.status===401||l.response.status===403)&&!l.config.url.includes("/auth/admin/login")&&(d1(),!ix&&typeof window<"u"&&(ix=!0,window.location.assign("/login"))),Promise.reject(l)));const R5=({onLogin:l})=>{const[r,i]=b.useState(""),[o,c]=b.useState(""),[m,f]=b.useState(!1),[h,p]=b.useState(!1),[g,y]=b.useState(""),v=async E=>{var R,N;E.preventDefault(),y(""),p(!0);try{const k=await qe.post("/auth/admin/login",{email:r,password:o});if(k.data.success){const w=k.data.data;if(w.role!=="admin"&&w.role!=="super-admin"){y("Access denied. Admin privileges required.");return}l(k.data.token,w)}else y(k.data.error||"Login failed")}catch(k){y(((N=(R=k.response)==null?void 0:R.data)==null?void 0:N.error)||"Login failed. Please check your credentials.")}finally{p(!1)}};return t.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center p-6",children:t.jsxs("div",{className:"max-w-md w-full",children:[t.jsxs("div",{className:"text-center mb-10",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-primary rounded-2xl text-white shadow-xl shadow-primary/20 mb-6",children:t.jsx("span",{className:"text-3xl font-bold",children:"S"})}),t.jsx("h1",{className:"text-3xl font-bold text-slate-900 mb-2",children:"Welcome Back"}),t.jsx("p",{className:"text-slate-500",children:"Sign in to manage your inventory"})]}),t.jsx("div",{className:"bg-white rounded-3xl shadow-xl shadow-slate-200/60 p-8 md:p-10 border border-slate-100",children:t.jsxs("form",{onSubmit:v,className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Email Address"}),t.jsxs("div",{className:"relative",children:[t.jsx("span",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none text-slate-400",children:t.jsx(Bg,{size:20})}),t.jsx("input",{type:"email",value:r,onChange:E=>i(E.target.value),className:"block w-full pl-12 pr-4 py-3 bg-white border border-slate-200 rounded-xl text-slate-900 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",placeholder:"[email protected]",required:!0})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Password"}),t.jsxs("div",{className:"relative",children:[t.jsx("span",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none text-slate-400",children:t.jsx(Ij,{size:20})}),t.jsx("input",{type:m?"text":"password",value:o,onChange:E=>c(E.target.value),className:"block w-full pl-12 pr-12 py-3 bg-white border border-slate-200 rounded-xl text-slate-900 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",required:!0}),t.jsx("button",{type:"button",onClick:()=>f(!m),className:"absolute inset-y-0 right-0 pr-4 flex items-center text-slate-400 hover:text-slate-600 transition-colors",children:m?t.jsx(Dg,{size:20}):t.jsx(Og,{size:20})})]})]}),g&&t.jsx("div",{className:"p-4 bg-red-50 border border-red-100 text-red-600 text-sm rounded-xl animate-shake",children:g}),t.jsxs("div",{className:"flex items-center justify-between text-sm",children:[t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[t.jsx("input",{type:"checkbox",className:"w-4 h-4 rounded border-slate-300 text-primary focus:ring-primary/20"}),t.jsx("span",{className:"text-slate-600 group-hover:text-slate-900 transition-colors",children:"Remember me"})]}),t.jsx("a",{href:"#",className:"text-primary font-semibold hover:underline",children:"Forgot password?"})]}),t.jsx("button",{type:"submit",disabled:h,className:"w-full py-4 px-6 bg-primary hover:bg-primary-hover text-white font-bold rounded-xl shadow-lg shadow-primary/25 transition-all flex items-center justify-center gap-2 active:scale-[0.98] disabled:opacity-70 disabled:cursor-not-allowed",children:h?t.jsxs(t.Fragment,{children:[t.jsx(yt,{className:"animate-spin",size:20}),t.jsx("span",{children:"Signing in..."})]}):"Sign In"})]})}),t.jsxs("div",{className:"mt-10 text-center text-sm text-slate-500",children:["© ",new Date().getFullYear()," SleekTap. All rights reserved.",t.jsxs("div",{className:"mt-2 flex items-center justify-center gap-4",children:[t.jsx("a",{href:"https://sleektap.com/privacy-policy/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-700 underline",children:"Privacy Policy"}),t.jsx("span",{className:"text-slate-300",children:"|"}),t.jsx("a",{href:"https://sleektap.com/terms-and-conditions/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-700 underline",children:"Terms and Conditions"})]})]})]})})};let Rs=null;const ox=l=>{Rs=l},Cs={updateMe:async l=>{if(!Rs)throw new Error("No customer selected.");return(await qe.put(`/customers/${Rs}`,l)).data}},A5=async l=>{if(!Rs)throw new Error("No customer selected.");return(await qe.patch(`/customers/${Rs}/credentials`,l)).data},bn=()=>
495{if(!Rs)throw new Error("No customer selected.");return`/loyalty/owner/${encodeURIComponent(Rs)}`},yn={getProgram:async()=>(await qe.get(`${bn()}/program`)).data.data,updateProgram:async l=>(await qe.put(`${bn()}/program`,l)).data.data,rotateDailyCode:async()=>{const l=await qe.post(`${bn()}/program/rotate-code`);return{dailyCode:l.data.dailyCode,dailyCodeDate:l.data.dailyCodeDate}},getMembers:async()=>(await qe.get(`${bn()}/members`)).data.data,getReport:async(l=30)=>(await qe.get(`${bn()}/report`,{params:{days:l}})).data.data,getVouchers:async l=>(await qe.get(`${bn()}/vouchers`,{params:l?{status:l}:void 0})).data.data},_5=async l=>{if(!Rs)throw new Error("No customer selected.");return(await qe.delete(`/analytics/customer/${Rs}/product/${l}`)).data},u1=b.createContext(void 0),$n=()=>{const l=b.useContext(u1);if(!l)throw new Error("useAppContext must be used within a CustomerViewProvider");return l},L5=({children:l})=>{const{id:r}=qa(),[i,o]=b.useState(null),[c,m]=b.useState(!0),[f,h]=b.useState(null);return b.useEffect(()=>{if(r)return ox(r),m(!0),h(null),qe.get(`/customers/${r}`).then(p=>{var g;(g=p.data)!=null&&g.success?o(p.data.data):h("Customer not found.")}).catch(p=>{var g,y;return h(((y=(g=p==null?void 0:p.response)==null?void 0:g.data)==null?void 0:y.error)||"Failed to load customer.")}).finally(()=>m(!1)),()=>ox(null)},[r]),c?t.jsx("div",{className:"min-h-[400px] flex items-center justify-center",children:t.jsx(yt,{className:"animate-spin text-primary",size:40})}):f||!i?t.jsxs("div",{className:"min-h-[400px] flex flex-col items-center justify-center gap-4 text-slate-400",children:[t.jsx(An,{size:48}),t.jsx("p",{className:"text-lg font-semibold",children:f||"Customer not found."}),t.jsxs(Ts,{to:"/customers",className:"flex items-center gap-2 px-4 py-2 text-sm font-semibold text-primary hover:underline",children:[t.jsx(Ln,{size:16}),"Back to Customers"]})]}):t.jsx(u1.Provider,{value:{user:null,customerProfile:i,setCustomerProfile:o},children:l})},tl=async(l,r="products/gallery")=>{var c,m,f;const i=new FormData;i.append("file",l),i.append("folder",r);const o=await qe.post("/upload",i,{headers:{"Content-Type":"multipart/form-data"}});if(!((c=o.data)!=null&&c.success)||!((m=o.data)!=null&&m.url))throw new Error(((f=o.data)==null?void 0:f.error)||"Upload failed");return o.data.url},M5=async l=>{const r=l.filter(Boolean);if(r.length!==0)try{await qe.post("/upload/delete",{urls:r})}catch(i){console.error("Failed to delete images:",i)}},cx=(l,r)=>{var c;const i=l==null?void 0:l.response,o=(c=i==null?void 0:i.data)==null?void 0:c.error;return Array.isArray(o)?o.join(" "):typeof o=="string"&&o?o:l instanceof Error?l.message:r},Da=({label:l,placeholder:r,value:i,onChange:o,type:c="text",readOnly:m=!1,disabled:f=!1})=>t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("label",{className:"text-sm font-medium text-slate-700",children:l}),t.jsx("input",{type:c,value:i??"",readOnly:m,disabled:f,onChange:h=>o==null?void 0:o(h.target.value),placeholder:r,className:"w-full px-4 py-3 rounded-xl border border-slate-200 bg-white text-slate-900 focus:outline-none focus:ring-2 focus:ring-sleek-purple focus:border-transparent transition-all read-only:bg-slate-50 read-only:text-slate-400 disabled:bg-slate-50 disabled:text-slate-400 disabled:cursor-not-allowed"})]}),dx=({addr:l,onChange:r,disabled:i=!1})=>t.jsxs("div",{className:"space-y-6",children:[t.jsx(Da,{label:"Street Address",placeholder:"Text your street address",value:l.line1,onChange:o=>r("line1",o),disabled:i}),t.jsx(Da,{label:"Apartment, suite, etc. (optional)",placeholder:"Apt, suite, unit, etc.",value:l.line2,onChange:o=>r("line2",o),disabled:i}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsx(Da,{label:"City",placeholder:"Text your city",value:l.city,onChange:o=>r("city",o),disabled:i}),t.jsx(Da,{label:"State",placeholder:"Text your state",value:l.state,onChange:o=>r("state",o),disabled:i})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsx(Da,{label:"Zip Code",placeholder:"Text your zip code",value:l.postal_code,onChange:o=>r("postal_code",o),disabled:i}),t.jsx(Da,{label:"Country",placeholder:"Text your country",value:l.country,onChange:o=>r("country",o),disabled:i})]})]}),No=()=>({line1:"",line2:"",city:"",state:"",postal_code:"",country:""}),z5=()=>{const{id:l}=qa(),{user:r,customerProfile:i,setCustomerProfile:o}=$n(),[c,m]=b.useState(""),[f,h]=b.useState(""),[p,g]=b.useState(""),[y,v]=b.useState(""),[E,R]=b.useState(!1),[N,k]=b.useState(null),w=b.useRef(null),[A,O]=b.useState(No()),[z,H]=b.useState(No()),[se,Z]=b.useState(!1);b.useEffect(()=>{const Le=((i==null?void 0:i.name)||"").split(" ");m(Le[0]||(r==null?void 0:r.firstName)||""),h(Le.slice(1).join(" ")||(r==null?void 0:r.lastName)||""),g((i==null?void 0:i.phone)||""),v((i==null?void 0:i.logoUrl)||""),O({...No(),...(i==null?void 0:i.billingAddress)??{}}),H({...No(),...(i==null?void 0:i.shippingAddress)??{}})},[i,r==null?void 0:r.firstName,r==null?void 0:r.lastName]);const T=(i==null?void 0:i.email)||(r==null?void 0:r.email)||"",[P,q]=b.useState(!1),[Q,F]=b.useState(null),[$,G]=b.useState(!1),[te,ye]=b.useState(""),[U,ce]=b.useState(""),[C,le]=b.useState(""),[de,S]=b.useState(!1),[B,J]=b.useState(!0),[oe,ve]=b.useState(!1),[Ce,Ne]=b.useState(null),[ne,ge]=b.useState(null);b.useEffect(()=>{ye((i==null?void 0:i.email)||"")},[i==null?void 0:i.email]);const ze=te.trim().toLowerCase()!==((i==null?void 0:i.email)||"").toLowerCase(),K=async()=>{Ne(null),ge(null);const Le=te.trim(),rt=ze,st=U!=="";if(!rt&&!st){Ne("Change the email or enter a new password first.");return}if(rt&&!Le){Ne("Email cannot be empty.");return}if(st&&U.length<6){Ne("New password must be at least 6 characters.");return}if(st&&U!==C){Ne("The two passwords don't match.");return}ve(!0);try{const lt=await A5({...rt?{email:Le}:{},...st?{password:U}:{},notify:B});i&&o({...i,email:lt.data.email}),ce(""),le(""),S(!1);const aa=[lt.emailChanged?"Email updated":null,lt.passwordChanged?"password updated":null].filter(
495Boolean).join(" and ");ge(aa?`${aa.charAt(0).toUpperCase()}${aa.slice(1)}.${B?" The customer has been emailed.":""}`:"Nothing to change â those are already the customer's sign-in details.")}catch(lt){Ne(cx(lt,"Failed to update sign-in details."))}finally{ve(!1)}},fe=(Le,rt)=>{O(st=>({...st,[Le]:rt}))},xe=(Le,rt)=>{H(st=>({...st,[Le]:rt}))},me=Le=>{Z(Le),Le&&H({...A})},Te=async Le=>{var st;const rt=(st=Le.target.files)==null?void 0:st[0];if(Le.target.value="",!!rt){k(null),R(!0);try{const lt=await tl(rt,"customers/brand-logos");v(lt)}catch(lt){k(lt instanceof Error?lt.message:"Failed to upload logo.")}finally{R(!1)}}},Ue=async()=>{q(!0),F(null),G(!1);const Le=[c,f].filter(Boolean).join(" "),rt=se?{...A}:z;try{const st=await Cs.updateMe({name:Le,phone:p,logoUrl:y.trim(),billingAddress:A,shippingAddress:rt});o(st.data),G(!0)}catch(st){F(cx(st,"Failed to update settings."))}finally{q(!1)}};return t.jsxs("div",{className:"space-y-10",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[t.jsx(Ts,{to:"/customers",className:"hover:text-primary transition-colors font-medium",children:"Customers"}),t.jsx(ls,{size:14}),t.jsx(Ts,{to:`/customers/${l}`,className:"hover:text-primary transition-colors font-medium",children:(i==null?void 0:i.name)||"Customer"}),t.jsx(ls,{size:14}),t.jsx("span",{className:"text-slate-700 font-semibold",children:"Account Details"})]}),t.jsx("h2",{className:"text-3xl font-bold text-slate-900",children:"Account Details"}),t.jsxs("section",{className:"bg-white p-8 rounded-2xl border border-slate-100 shadow-sm",children:[t.jsx("h3",{className:"text-xl font-bold text-slate-800 mb-6",children:"Account"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[t.jsx(Da,{label:"First Name",placeholder:"Text your first name",value:c,onChange:m}),t.jsx(Da,{label:"Last Name",placeholder:"Text your last name",value:f,onChange:h}),t.jsx(Da,{label:"Phone",placeholder:"Text your phone number",value:p,onChange:g}),t.jsx(Da,{label:"Email",placeholder:"Text your email",value:T,type:"email",readOnly:!0})]}),t.jsx("p",{className:"mt-4 text-xs text-slate-400",children:"The email shown here is what the customer signs in with â change it in Sign-in Details below."})]}),t.jsxs("section",{className:"bg-white p-8 rounded-2xl border border-slate-100 shadow-sm",children:[t.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-sleek-purple/10 flex items-center justify-center text-sleek-purple shrink-0",children:t.jsx(Cj,{size:18})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-xl font-bold text-slate-800",children:"Sign-in Details"}),t.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Change the email address or password this customer signs in with â for account recovery, a changed business email, or a lockout. A password reset here also clears any failed-login lockout on the account."})]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mt-6",children:[t.jsx(Da,{label:"Sign-in Email",placeholder:"[email protected]",value:te,onChange:ye,type:"email"}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("label",{className:"text-sm font-medium text-slate-700",children:"New Password"}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{type:de?"text":"password",value:U,onChange:Le=>ce(Le.target.value),placeholder:"Leave blank to keep current",autoComplete:"new-password",className:"w-full px-4 py-3 pr-11 rounded-xl border border-slate-200 bg-white text-slate-900 focus:outline-none focus:ring-2 focus:ring-sleek-purple focus:border-transparent transition-all"}),t.jsx("button",{type:"button",onClick:()=>S(Le=>!Le),"aria-label":de?"Hide password":"Show password",className:"absolute inset-y-0 right-0 px-3 flex items-center text-slate-400 hover:text-slate-600 transition-colors",children:de?t.jsx(Dg,{size:16}):t.jsx(Og,{size:16})})]})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("label",{className:"text-sm font-medium text-slate-700",children:"Confirm New Password"}),t.jsx("input",{type:de?"text":"password",value:C,onChange:Le=>le(Le.target.value),placeholder:"Re-enter the new password",autoComplete:"new-password",className:"w-full px-4 py-3 rounded-xl border border-slate-200 bg-white text-slate-900 focus:outline-none focus:ring-2 focus:ring-sleek-purple focus:border-transparent transition-all"})]})]}),t.jsxs("label",{className:"flex items-start gap-2.5 mt-6 cursor-pointer group w-fit",children:[t.jsx("input",{type:"checkbox",checked:B,onChange:Le=>J(Le.target.checked),className:"mt-0.5 w-4 h-4 text-sleek-purple border-slate-300 rounded focus:ring-sleek-purple bg-white"}),t.jsxs("span",{className:"text-sm text-slate-600",children:["Email the customer about the change",t.jsx("span",{className:"block text-xs text-slate-400",children:"Sent to the new address, and to the old one as well if the email itself changed. The new password is never included â pass it on yourself."})]})]}),Ce&&t.jsx("p",{className:"mt-5 text-sm text-red-500 font-medium",children:Ce}),ne&&t.jsx("p",{className:"mt-5 text-sm text-green-600 font-medium",children:ne}),t.jsx("div",{className:"mt-6",children:t.jsx("button",{onClick:K,disabled:oe||!ze&&U==="",className:"px-8 py-3 bg-slate-900 text-white font-semibold rounded-xl hover:opacity-90 transition-opacity disabled:opacity-40 disabled:cursor-not-allowed",children:oe?"Updatingâ¦":"Update Sign-in Details"})})]}),t.jsxs("section",{className:"bg-white p-8 rounded-2xl border border-slate-100 shadow-sm",children:[t.jsx("h3",{className:"text-xl font-bold text-slate-800 mb-2",children:"Brand Logo"}),t.jsx("p",{className:"text-sm text-slate-500 mb-6",children:"Upload an image or paste a URL to display your brand at the top of your QR landing page. Leave empty to hide. Use a public, square image for best results."}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 items-start",children:[t.jsxs("div",{className:"md:col-span-2 flex flex-col gap-3",children:[t.jsx(Da,{label:"Logo URL",placeholder:"https://example.com/logo.png",value:y,onChange:v,type:"url"}),t.jsx("input",{type:"file",ref:w,onChange:Te,accept:"image/*",className:"hidden"}),t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsxs("button",{type:"button",onClick:()=>{var Le;return(Le=w.current)==null?void 0:Le.click()},disabled:E,className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl border border-slate-200 bg-white text-sm font-medium text-slate-700 hover:bg-slate-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"17 8 12 3 7 8"}),t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),E?"Uploadingâ¦":y?"Replace Image":"Upload Image"]}),y&&!E&&t.jsx("button",{type:"button",onClick:()=>v(""),className:"text-sm text-slate-500 hover:text-red-600 transition-colors",children:"Clear"})]}),N&&t.jsx("p",{className:"text-sm text-red-500 font-medium",children:N})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("label",{className:"text-sm font-medium text-slate-700",children:"Preview"}),t.jsxs("div",{onClick:()=>{var Le;return!E&&((Le=w.current)==null?void 0:Le.click())},className:"group relative w-20 h-20 rounded-2xl border border-slate-200 bg-slate-50 flex items-center justify-center overflow-hidden cursor-pointer hover:border-sleek-purple transition-colors",children:[y.trim()?t.jsx("img",{src:y.trim(),alt:"Logo preview",className:"w-full h-full object-cover",onError:Le=>{Le.currentTarget.style.display="none"}}):t.jsx("span",{className:"text-xs text-slate-400",children:"No logo"}),E&&t.jsx("div",{className:"absolute inset-0 bg-white/70 flex items-center justify-center",children:t.jsxs("svg",{className:"animate-spin",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"6"}),t.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"22"}),t.jsx("line",{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"}),t.jsx("line",{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"}),t.jsx("line",{x1:"2",y1:"12",x2:"6",y2:"12"}),t.jsx("line",{x1:"18",y1:"12",x2:"22",y2:"12"}),t.jsx("line",{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"}),t.jsx("line",{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"})]})})]})]})]})]}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[t.jsxs("section",{className:"bg-white p-8 rounded-2xl border border-slate-100 shadow-sm",children:[t.jsx("h3",{className:"text-xl font-bold text-slate-800 mb-6",children:"Billing Address"}),t.jsx(dx,{addr:A,onChange:fe})]}),t.jsxs("section",{className:"bg-white p-8 rounded-2xl border border-slate-100 shadow-sm",children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsx("h3",{className:"text-xl font-bold text-slate-800",children:"Shipping Address"}),t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[t.jsx("span",{className:"text-xs text-sleek-purple group-hover:underline",children:"Use same as billing address"}),t.jsx("input",{type:"checkbox",checked:se,onChange:Le=>me(Le.target.checked),className:"w-4 h-4 text-sleek-purple border-slate-300 rounded focus:ring-sleek-purple bg-white"})]})]}),t.jsx(dx,{addr:se?A:z,onChange:xe,disabled:se})]})]}),Q&&t.jsx("p",{className:"text-sm text-red-500 font-medium",children:Q}),$&&t.jsx("p",{className:"text-sm text-green-600 font-medium",children:"Settings updated successfully."}),t.jsx("div",{className:"flex justify-start",children:t.jsx("button",{onClick:Ue,disabled:P,className:"px-10 py-3 bg-sleek-purple text-white font-semibold rounded-xl hover:opacity-90 transition-opacity shadow-lg shadow-purple-100 disabled:opacity-50",children:P?"Savingâ¦":"Update Settings"})}),t.jsx("div",{className:"pb-10"})]})},U5=l=>l.product&&typeof l.product=="object"&&l.product._id?l.product._id:l._id,D5=l=>{const r=new Map;for(const i of l){const o=U5(i),c=r.get(o);c?(c.devices.push(i),c.count=c.devices.length):r.set(o,{key:o,devices:[i],representative:i,count:1})}return Array.from(r.values())},O5=()=>{const{id:l}=qa(),{customerProfile:r}=$n(),[i,o]=b.useState("All"),[c,m]=b.useState(""),f=(r==null?void 0:r.purchasedProducts)??[],h=b.useMemo(()=>D5(f),[f]);if(!r)return t.jsxs("div",{className:"space-y-10",children:[t.jsx("h2",{className:"text-[32px] font-bold text-[#1A202C] mb-8",children:"My Product"}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:[...Array(4)].map((v,E)=>t.jsxs("div",{className:"flex flex-col rounded-2xl border border-slate-100 overflow-hidden bg-white",children:[t.jsx("div",{className:"aspect-square bg-slate-100 animate-pulse"}),t.jsxs("div",{className:"bg-[#f5efe9] px-6 py-5 space-y-2 flex-1",children:[t.jsx("div",{className:"h-5 w-2/3 bg-slate-200/70 rounded animate-pulse"}),t.jsx("div",{className:"h-4 w-1/2 bg-slate-200/50 rounded animate-pulse"})]})]},E))})]});if(f.length===0)return t.jsxs("div",{className:"space-y-10",children:[t.jsx("h2",{className:"text-[32px] font-bold text-[#1A202C] mb-8",children:"My Product"}),t.jsx("div",{className:"flex items-center justify-center h-64 bg-white rounded-2xl border border-slate-100 shadow-sm",children:t.jsx("p",{className:"text-slate-400 text-[15px]",children:"No products found."})})]});const p=["All",...Array.from(new Set(h.map(v=>v.representative.productCategory||"Uncategorized")))],g=c.trim().toLowerCase(),y=h.filter(v=>{if(!(i==="All"||(v.representative.productCategory||"Uncategorized")===i))return!1;if(!g)return!0;const R=v.representative;return[R.productName,R.productCategory,R.variant,R.quantityOption,...v.devices.map(k=>
495k.deviceName)].filter(Boolean).join(" ").toLowerCase().includes(g)});return t.jsxs("div",{className:"space-y-10",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[t.jsx(Ts,{to:"/customers",className:"hover:text-primary transition-colors font-medium",children:"Customers"}),t.jsx(ls,{size:14}),t.jsx(Ts,{to:`/customers/${l}`,className:"hover:text-primary transition-colors font-medium",children:(r==null?void 0:r.name)||"Customer"}),t.jsx(ls,{size:14}),t.jsx("span",{className:"text-slate-700 font-semibold",children:"Product Details"})]}),t.jsx("h2",{className:"text-[32px] font-bold text-[#1A202C] mb-8",children:"Product Details"}),t.jsxs("div",{className:"relative max-w-md",children:[t.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-4.35-4.35M11 19a8 8 0 100-16 8 8 0 000 16z"})})}),t.jsx("input",{type:"search",placeholder:"Search products, category, or device nameâ¦",value:c,onChange:v=>m(v.target.value),className:"w-full pl-11 pr-4 py-3 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-sleek-purple/10 focus:border-sleek-purple transition-all"})]}),t.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(v=>t.jsx("button",{onClick:()=>o(v),className:`px-4 py-1.5 rounded-full text-[13px] font-medium transition-all duration-200 border ${i===v?"bg-[#1A202C] text-white border-[#1A202C]":"bg-white text-slate-500 border-slate-200 hover:border-slate-400 hover:text-slate-700"}`,children:v},v))}),y.length===0?t.jsx("div",{className:"flex items-center justify-center h-48 bg-white rounded-2xl border border-slate-100 shadow-sm",children:t.jsx("p",{className:"text-slate-400 text-[15px]",children:g?"No products match your search.":"No products in this category."})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:y.map(v=>{var k;const E=v.representative,R=typeof E.category=="object"?E.category:null,N=E.productImage||((k=E.product)==null?void 0:k.featuredImage)||(R==null?void 0:R.thumbnail)||(R==null?void 0:R.image);return t.jsxs(Lg,{to:`/customers/${l}/products/${E._id}`,className:"group flex flex-col bg-white rounded-2xl overflow-hidden border border-slate-100 shadow-sm hover:shadow-xl hover:-translate-y-1 transition-all duration-500",children:[t.jsx("div",{className:"aspect-square bg-slate-50 overflow-hidden",children:t.jsx("img",{src:N,alt:E.productName,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"})}),t.jsxs("div",{className:"bg-[#f5efe9] px-6 py-5 flex-1",children:[t.jsxs("h4",{className:"text-lg font-bold text-[#1A202C] leading-snug",children:[E.productName,v.count>1&&t.jsxs("span",{className:"ml-2 text-xs text-slate-500 font-medium align-middle",children:["Ã",v.count]})]}),t.jsxs("span",{className:"mt-2 inline-flex items-center gap-2 text-sleek-purple font-bold text-sm group-hover:gap-3 transition-all",children:["Manage ",E.productName,t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M9 5l7 7-7 7"})})]})]})]},v.key)})})]})},B5=[{key:"facebook",label:"Facebook",domains:["facebook.com","fb.com"]},{key:"x",label:"X",domains:["x.com","twitter.com","t.co"]},{key:"youtube",label:"YouTube",domains:["youtube.com","youtu.be"]},{key:"instagram",label:"Instagram",domains:["instagram.com"]},{key:"tiktok",label:"TikTok",domains:["tiktok.com"]},{key:"pinterest",label:"Pinterest",domains:["pinterest.com","pin.it"]},{key:"yelp",label:"Yelp Review",domains:["yelp.com","yelp.to"]},{key:"tripadvisor",label:"TripAdvisor Review",domains:["tripadvisor.com","tripadvisor.co.uk","tripadvisor.in","tripadvisor.ca","tripadvisor.com.au"]},{key:"googleReview",label:"Google Review",domains:["g.page","search.google.com","maps.app.goo.gl","goo.gl","google.com"]},{key:"facebookReview",label:"Facebook Review",domains:["facebook.com","fb.com"]},{key:"linkedin",label:"LinkedIn",domains:["linkedin.com","lnkd.in"]}],Cl="custom",H5={key:Cl,label:"Custom URL",domains:[]},m1=[...B5,H5],q5={facebook:"/logos/Facebook.svg",x:"/logos/X.svg",youtube:"/logos/Youtube.svg",instagram:"/logos/Instagram.svg",tiktok:"/logos/Tiktok.svg",pinterest:"/logos/Pinterest.svg",yelp:"/logos/Ylep.svg",tripadvisor:"/logos/Tripadvisor.svg",googleReview:"/logos/Google.svg",facebookReview:"/logos/Facebook.svg",linkedin:"/logos/Linkedin.svg"};function vn(l){if(l)return q5[l]}
495const f1=Object.fromEntries(m1.map(l=>[l.key,l]));function V5(l){if(l)return f1[l]}function kl(l){if(!l)return"";const r=f1[l];return r?r.label:l}function wo(l,r){const i=V5(r);if(!i)return!0;if(r===Cl)return $5(l);let o="";try{o=new URL(l.trim()).hostname.toLowerCase()}catch{return!1}return i.domains.some(c=>o===c||o.endsWith("."+c))}function $5(l){if(!l||!l.trim())return!1;try{const r=new URL(l.trim());return(r.protocol==="http:"||r.protocol==="https:")&&!!r.hostname}catch{return!1}}function ux(l){return l===Cl?"Enter a valid URL starting with http:// or https://.":`This URL must be a ${kl(l)} link.`}const I5="https://sleektap-admin-frontend-skeleton.vercel.app/q",G5=()=>{const{id:l,categoryId:r}=qa(),i=Ya(),{customerProfile:o,setCustomerProfile:c}=$n(),m=`/customers/${l}/products`,f=o==null?void 0:o.purchasedProducts.find(_=>_._id===r),h=(f==null?void 0:f.urlType)==="sleek-widget",p=(f==null?void 0:f.urlType)==="multiple"||h,g=(f==null?void 0:f.urlType)==="business-card",y=(f==null?void 0:f.urlType)==="loyalty",v=g||y,E=f?f.product&&typeof f.product=="object"&&f.product._id||f._id:null,R=b.useMemo(()=>{if(!E)return[];const be=((o==null?void 0:o.purchasedProducts)??[]).filter(he=>(he.product&&typeof he.product=="object"&&he.product._id||he._id)===E);return be.sort((he,Ae)=>{const Ge=he.purchasedAt?new Date(he.purchasedAt).getTime():0,nt=Ae.purchasedAt?new Date(Ae.purchasedAt).getTime():0;return Ge!==nt?Ge-nt:he._id<Ae._id?-1:he._id>Ae._id?1:0}),be},[o==null?void 0:o.purchasedProducts,E]),N=b.useMemo(()=>(f==null?void 0:f.allowedUrls)||[],[f==null?void 0:f.allowedUrls]),k=N.length>0,w=!p&&k?N[0]:"",A=_=>o!=null&&o._id?`${I5}/${_}`:void 0,O=b.useMemo(()=>{if(!f)return[];if(p&&f.destinationUrls&&f.destinationUrls.length>0){const _=A(f._id);return f.destinationUrls.map((be,he)=>{var ni;const Ae=be.label||`Link ${he+1}`,Ge=N.includes(Ae),nt=((ni=be.customLabel)==null?void 0:ni.trim())||"",na=Ge&&Ae===Cl&&nt?nt:Ge?kl(Ae):Ae;return{id:be._id,parentId:f._id,label:na,customLabel:nt,platformKey:Ge?Ae:void 0,destinationUrl:be.destinationUrl,displayUrl:f.qrCode||be.destinationUrl?_:void 0,productName:f.productName,variant:f.variant,quantityOption:f.quantityOption,urlEntryId:be._id}})}return p?[]:R.map((_,be)=>{var na;const he=A(_._id),Ae=v||!!_.qrCode||!!_.destinationUrl,Ge=((na=_.deviceName)==null?void 0:na.trim())||"",nt=Ge||_.productName;return{id:_._id,parentId:_._id,label:w?kl(w):nt,platformKey:w||void 0,destinationUrl:v?he:_.destinationUrl,displayUrl:Ae?he:void 0,qrCode:_.qrCode,productName:_.productName,variant:_.variant,quantityOption:_.quantityOption,deviceIndex:be+1,deviceName:Ge||void 0}}).filter(_=>_.id===f._id)},[f,R,p,v,o==null?void 0:o._id,N,w]),z=p?f.qrCode:void 0,[H,se]=b.useState([]),[Z,T]=b.useState(!1),[P,q]=b.useState(""),[Q,F]=b.useState(!1),[$,G]=b.useState(null),[te,ye]=b.useState(null),[U,ce]=b.useState(null),[C,le]=b.useState(!1),[de,S]=b.useState(null),[B,J]=b.useState(null),[oe,ve]=b.useState(null),[Ce,Ne]=b.useState(!1),[ne,ge]=b.useState(!1),[ze,K]=b.useState(""),[fe,xe]=b.useState(!1),[me,Te]=b.useState(null),[Ue,Le]=b.useState(null),[rt,st]=b.useState(""),[lt,aa]=b.useState(!1),[As,we]=b.useState(null),[ke,Be]=b.useState(!1),Oe=b.useMemo(()=>!f||!p||!k?new Set:new Set((f.destinationUrls||[]).map(_=>_.label).filter(_=>!!_&&N.includes(_))),[p,k,f==null?void 0:f.destinationUrls,N]),Je=b.useMemo(()=>N.filter(_=>!Oe.has(_)),[N,Oe]),[Ct,Nt]=b.useState({}),[wt,L]=b.useState({}),[ue,pe]=b.useState({}),Re=async(_,be)=>{if(_)try{await navigator.clipboard.writeText(_),ce(be),setTimeout(()=>ce(he=>he===be?null:he),1500)}catch{}},Ye=_=>Re(_.displayUrl,_.id),Pe=_=>{if(!_.qrCode)return;const be=new Blob([_.qrCode],{type:"image/svg+xml"}),he=URL.createObjectURL(be),Ae=document.createElement("a");Ae.href=he;const Ge=_.deviceIndex?`-device-${_.deviceIndex}`:"";Ae.download=`${_.label}${Ge}-qr.svg`,Ae.click(),URL.revokeObjectURL(he)},sa=O.length>0&&H.length===O.length,rs=()=>{se(sa?[]:O.map(_=>_.id))},la=_=>{se(be=>be.includes(_)?be.filter(he=>he!==_):[...be,_])},ut=_=>{if(se(_),G(null),p){const be={},he={},Ae={};for(const Ge of _){const nt=O.find(na=>na.id===Ge);be[Ge]=(nt==null?void 0:nt.destinationUrl)||"",he[Ge]=(nt==null?void 0:nt.label)||"",Ae[Ge]=(nt==null?void 0:nt.customLabel)||""}Nt(be),L(he),pe(Ae),q("")}else{const be=O.find(he=>he.id===_[0]);q(_.length===1&&(be==null?void 0:be.destinationUrl)||""),Nt({}),L({}),pe({})}T(!0)},Ot=async()=>
495{if(H.length!==0){F(!0),G(null);try{if(p){const _=H.map(he=>{const Ae=O.find(nt=>nt.id===he);if(!(Ae!=null&&Ae.urlEntryId))return null;const Ge={_id:Ae.urlEntryId,destinationUrl:Ct[he]||""};return k?Ae.platformKey===Cl&&(Ge.customLabel=(ue[he]??Ae.customLabel??"").trim()):Ge.label=(wt[he]??Ae.label).trim(),Ge}).filter(Boolean);if(_.length===0)return;if(!k&&_.some(he=>!he.label)){G("Label cannot be empty.");return}const be=await Cs.updateMe({purchasedProducts:[{_id:f._id,destinationUrls:_}]});c(be.data)}else{if(!P)return;const _=await Cs.updateMe({purchasedProducts:H.map(be=>({_id:be,destinationUrl:P}))});c(_.data)}T(!1),q(""),Nt({}),L({}),se([])}catch(_){G(_ instanceof Error?_.message:"Failed to update destination URL.")}finally{F(!1)}}},Vt=async _=>{var be;if(!(k&&(!_||!N.includes(_)||Oe.has(_)))){le(!0);try{const he=k?_:`Link ${(((be=f.destinationUrls)==null?void 0:be.length)||0)+1}`,Ae=await Cs.updateMe({purchasedProducts:[{_id:f._id,addUrls:[{label:he}]}]});c(Ae.data),Be(!1)}catch(he){console.error("Failed to add link:",he)}finally{le(!1)}}},ha=async _=>{S(_);try{const be=await Cs.updateMe({purchasedProducts:[{_id:f._id,removeUrlIds:[_]}]});c(be.data),se(he=>he.filter(Ae=>Ae!==_))}catch(be){console.error("Failed to remove link:",be)}finally{S(null)}},ka=b.useMemo(()=>O.filter(_=>H.includes(_.id)),[O,H]),Fa=()=>{K(Kt.productName),Te(null),ge(!0)},ll=()=>{ge(!1),Te(null)},$t=async()=>{const _=ze.trim();if(!_){Te("Name cannot be empty.");return}if(_===Kt.productName){ge(!1);return}xe(!0),Te(null);try{const be=await Cs.updateMe({purchasedProducts:R.map(he=>({_id:he._id,productName:_}))});c(be.data),ge(!1)}catch(be){Te(be instanceof Error?be.message:"Failed to rename product.")}finally{xe(!1)}},Xt=_=>{const be=R.find(he=>he._id===_);Le(_),st((be==null?void 0:be.deviceName)||""),we(null)},Qa=()=>{Le(null),we(null)},si=async()=>{if(!Ue)return;const _=rt.trim();aa(!0),we(null);try{const be=await Cs.updateMe({purchasedProducts:[{_id:Ue,deviceName:_}]});c(be.data),Le(null)}catch(be){we(be instanceof Error?be.message:"Failed to rename device.")}finally{aa(!1)}},In=_=>{f.urlType==="business-card"?i(`${m}/${_.id}/edit/${_.id}`):f.urlType==="loyalty"?i(`${m}/${_.id}/loyalty/${_.id}`):ut([_.id])},Gn=async _=>{if(window.confirm(`Clear all analytics for "${_.label}"? 496 497This permanently deletes every tap, visitor and location record for this device and cannot be undone.`)){J(_.id);try{await _5(_.parentId),ve(_.id),setTimeout(()=>ve(he=>he===_.id?null:he),2e3)}catch(he){console.error("Failed to clear analytics:",he),window.alert("Failed to clear analytics. Please try again.")}finally{J(null)}}},Kt=(o==null?void 0:o.purchasedProducts.find(_=>_._id===r))??f,Yn=p&&k?H.some(_=>{const be=O.find(Ae=>Ae.id===_),he=Ct[_]||"";return!(be!=null&&be.platformKey)||!he?!1:!wo(he,be.platformKey)}):!1,Pn=!p&&!!w&&!!P&&!wo(P,w),li=p?H.length===0||!k&&H.some(_=>!(wt[_]??"").trim())||Yn:H.length===0||!P||Pn;return!f||!Kt?t.jsx(Yr,{to:m,replace:!0}):t.jsxs("div",{className:"pb-10 relative min-h-screen",children:[Z&&t.jsx("div",{className:"fixed inset-0 z-90 bg-slate-900/40 backdrop-blur-[2px] transition-opacity",onClick:()=>T(!1)}),t.jsxs("div",{className:`fixed top-0 bottom-0 right-0 w-full max-w-125 bg-white z-100 shadow-2xl transform transition-transform duration-300 ease-in-out flex flex-col ${Z?"translate-x-0":"translate-x-full"}`,children:[t.jsxs("div",{className:"px-8 py-10 flex items-center justify-between gap-4 shrink-0 bg-white shadow-[0_4px_20px_rgba(0,0,0,0.03)] border-b border-slate-50 z-10",children:[t.jsx("h3",{className:"text-2xl sm:text-[32px] font-bold text-[#281E49] min-w-0",children:H.length>1?`Bulk Edit (${H.length})`:`Edit ${Kt.productName}`}),t.jsx("button",{onClick:()=>T(!1),className:"w-10 h-10 shrink-0 flex items-center justify-center bg-[#281E49] text-white rounded-full hover:bg-slate-800 transition-colors shadow-lg",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsx("div",{className:"flex-1 overflow-y-auto px-8 space-y-10 py-10",children:t.jsxs("div",{className:"space-y-8",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h4",{className:"text-[16px] font-bold text-[#1A202C]",children:"Selected Devices"}),t.jsxs("span",{className:"text-xs bg-slate-100 text-slate-500 px-2.5 py-1 rounded-full font-bold",children:[ka.length," ",ka.length===1?"Item":"Items"]})]}),t.jsx("div",{className:"flex flex-wrap gap-2",children:ka.map(_=>t.jsxs("div",{className:"bg-slate-50 border border-slate-100 px-3 py-2 rounded-lg flex flex-col",children:[t.jsx("span",{className:"text-[13px] font-bold text-[#1A202C]",children:_.label}),t.jsxs("span",{className:"text-[11px] text-slate-400 font-medium",children:["ID: ",_.id]})]},_.id))}),p?t.jsxs("div",{className:"space-y-6 pt-4 border-t border-slate-50",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-[14px] font-bold text-[#1A202C]",children:k?"Destination URLs":"Link Labels & Destinations"}),t.jsx("p",{className:"text-[12px] text-slate-400 font-medium mt
497-1",children:k?"Update the destination URL for each platform.":"Rename a link or update its destination URL."})]}),ka.map(_=>{const be=wt[_.id]??_.label,he=!be.trim(),Ae=Ct[_.id]||"",Ge=k&&_.platformKey&&Ae?!wo(Ae,_.platformKey):!1;return t.jsxs("div",{className:"space-y-3 p-4 bg-slate-50/60 rounded-xl border border-slate-100",children:[k&&_.platformKey?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-[12px] font-semibold text-slate-500",children:"Platform"}),t.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-sleek-purple/10 text-sleek-purple text-[12px] font-bold",children:[vn(_.platformKey)&&t.jsx("img",{src:vn(_.platformKey),alt:"",className:"w-4 h-4"}),kl(_.platformKey)]})]}),_.platformKey===Cl&&t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("label",{className:"text-[12px] font-semibold text-slate-500",children:"Link name"}),t.jsx("input",{type:"text",value:ue[_.id]??_.customLabel??"",onChange:nt=>pe(na=>({...na,[_.id]:nt.target.value})),placeholder:"e.g. Our Menu",maxLength:60,className:"w-full px-5 py-3 rounded-xl border border-slate-300 bg-white text-slate-900 focus:outline-none focus:ring-2 focus:ring-sleek-purple/10 focus:border-sleek-purple transition-all placeholder:text-slate-300 text-[14px]"}),t.jsx("p",{className:"text-[11px] text-slate-400 font-medium",children:'Shown on the SleekTap page instead of "Custom URL". Leave empty to use the default.'})]})]}):t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("label",{className:"text-[12px] font-semibold text-slate-500",children:"Label"}),t.jsx("input",{type:"text",value:be,onChange:nt=>L(na=>({...na,[_.id]:nt.target.value})),placeholder:"e.g. My Website",maxLength:80,"aria-invalid":he,className:`w-full px-5 py-3 rounded-xl border bg-white text-slate-900 focus:outline-none focus:ring-2 transition-all placeholder:text-slate-300 text-[14px] ${he?"border-red-300 focus:ring-red-100 focus:border-red-400":"border-slate-300 focus:ring-sleek-purple/10 focus:border-sleek-purple"}`}),he&&t.jsx("p",{className:"text-[11px] text-red-500 font-medium",children:"Label cannot be empty."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("label",{className:"text-[12px] font-semibold text-slate-500",children:"Destination URL"}),t.jsx("input",{type:"url",value:Ae,onChange:nt=>Nt(na=>({...na,[_.id]:nt.target.value})),placeholder:"https://example.com/your-destination",className:"w-full px-5 py-3 rounded-xl border border-slate-300 bg-white text-slate-900 focus:outline-none focus:ring-2 focus:ring-sleek-purple/10 focus:border-sleek-purple transition-all placeholder:text-slate-300 text-[14px]"}),Ge&&t.jsx("p",{className:"text-[11px] text-red-500 font-medium",children:ux(_.platformKey)})]})]},_.id)}),$&&t.jsx("p",{className:"text-xs text-red-500 font-medium",children:$})]}):t.jsxs("div",{className:"space-y-3 pt-4 border-t border-slate-50",children:[t.jsx("label",{className:"text-[14px] font-bold text-[#1A202C]",children:"Destination URL"}),t.jsx("p",{className:"text-[12px] text-slate-400 font-medium -mt-2",children:w===Cl?"This product accepts any valid link (http:// or https://).":w?`This product accepts a ${kl(w)} URL only.`:H.length===1?"This URL will be applied to the selected item.":`This URL will be applied to all ${H.length} selected items.`}),w&&t.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-sleek-purple/10 text-sleek-purple text-[12px] font-bold",children:[vn(w)&&t.jsx("img",{src:vn(w),alt:"",className:"w-4 h-4"}),kl(w)]}),t.jsx("input",{type:"url",value:P,onChange:_=>q(_.target.value),placeholder:"https://example.com/your-destination",className:"w-full px-5 py-3.5 rounded-xl border border-slate-300 bg-white text-slate-900 focus:outline-none focus:ring-2 focus:ring-sleek-purple/10 focus:border-sleek-purple transition-all placeholder:text-slate-300 text-[14px]"}),w&&P&&!wo(P,w)&&t.jsx("p",{className:"text-[11px] text-red-500 font-medium",children:ux(w)}),$&&t.jsx("p",{className:"text-xs text-red-500 font-medium",children:$})]})]})}),t.jsx("div",{className:"p-8 bg-[#F8F9FE] flex justify-end items-center border-t border-slate-100 shadow-[0_-4px_15px_rgba(0,0,0,0.05)] shrink-0 z-10",children:t.jsx("button",{onClick:Ot,disabled:li||Q,className:"px-14 py-4 bg-[#553C9A] text-white font-bold rounded-xl hover:bg-[#483385] transition-all shadow-xl shadow-purple-200 disabled:opacity-50 disabled:cursor-not-allowed text-[16px]",children:Q?"Saving...":`Assign to ${H.length} ${H.length===1?"Device":"Devices"}`})})]}),t.jsxs("h2",{className:"text-2xl sm:text-[32px] font-bold text-[#1A202C] mb-8 tracking-tight",children:[t.jsx(Ts,{to:m,className:"text-[#281E49] hover:text-sleek-purple transition-colors",children:"Product Details"}),t.jsx("span",{className:"mx-2 text-slate-300",children:"/"}),t.jsx("span",{className:"text-[#281E49]",children:Kt.productName})]}),te&&t.jsx("div",{className:"fixed inset-0 z-110 flex items-center justify-center bg-slate-900/50 backdrop-blur-[2px]",onClick:()=>ye(null),children:t.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl p-8 flex flex-col items-center gap-6 w-full max-w-sm mx-4",onClick:_=>_.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[te.deviceIndex&&t.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-wider px-2 py-0.5 bg-sleek-purple/10 text-sleek-purple roun
497ded-full",children:["Device ",te.deviceIndex]}),t.jsx("h3",{className:"text-lg font-bold text-[#281E49]",children:te.label})]}),t.jsx("button",{onClick:()=>ye(null),className:"w-8 h-8 flex items-center justify-center bg-slate-100 text-slate-500 rounded-full hover:bg-slate-200 transition-colors",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsx("div",{className:"w-56 h-56",dangerouslySetInnerHTML:{__html:te.qrCode}}),te.displayUrl&&t.jsxs("div",{className:"w-full flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:"Destination URL"}),t.jsxs("div",{className:"flex items-center gap-2 w-full bg-slate-50 border border-slate-200 rounded-xl px-3 py-2.5",children:[t.jsx("a",{href:te.displayUrl,target:"_blank",rel:"noopener noreferrer",title:te.displayUrl,className:"flex-1 min-w-0 truncate text-sm font-medium text-sleek-purple hover:underline",children:te.displayUrl}),t.jsx("button",{onClick:()=>Re(te.displayUrl,"qr-modal"),title:U==="qr-modal"?"Copied!":"Copy URL","aria-label":"Copy destination URL",className:"shrink-0 p-1.5 text-slate-400 hover:text-sleek-purple hover:bg-slate-200 rounded-md transition-colors",children:U==="qr-modal"?t.jsx("svg",{className:"w-4 h-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M5 13l4 4L19 7"})}):t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]}),t.jsxs("button",{onClick:()=>Pe(te),className:"w-full py-3 bg-[#553C9A] text-white font-bold rounded-xl hover:bg-[#483385] transition-all shadow-lg shadow-purple-200 text-sm flex items-center justify-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3"})}),"Download SVG"]})]})}),Ce&&z&&t.jsx("div",{className:"fixed inset-0 z-110 flex items-center justify-center bg-slate-900/50 backdrop-blur-[2px]",onClick:()=>Ne(!1),children:t.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl p-8 flex flex-col items-center gap-6 w-full max-w-sm mx-4",onClick:_=>_.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("h3",{className:"text-lg font-bold text-[#281E49]",children:Kt.productName}),t.jsx("button",{onClick:()=>Ne(!1),className:"w-8 h-8 flex items-center justify-center bg-slate-100 text-slate-500 rounded-full hover:bg-slate-200 transition-colors",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsx("div",{className:"w-56 h-56",dangerouslySetInnerHTML:{__html:z}}),A(Kt._id)&&t.jsxs("div",{className:"w-full flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:"Destination URL"}),t.jsxs("div",{className:"flex items-center gap-2 w-full bg-slate-50 border border-slate-200 rounded-xl px-3 py-2.5",children:[t.jsx("a",{href:A(Kt._id),target:"_blank",rel:"noopener noreferrer",title:A(Kt._id),className:"flex-1 min-w-0 truncate text-sm font-medium text-sleek-purple hover:underline",children:A(Kt._id)}),t.jsx("button",{onClick:()=>Re(A(Kt._id),"product-qr-modal"),title:U==="product-qr-modal"?"Copied!":"Copy URL","aria-label":"Copy destination URL",className:"shrink-0 p-1.5 text-slate-400 hover:text-sleek-purple hover:bg-slate-200 rounded-md transition-colors",children:U==="product-qr-modal"?t.jsx("svg",{className:"w-4 h-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M5 13l4 4L19 7"})}):t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]}),t.jsx("p",{className:"text-xs text-slate-400 text-center",children:"Scanning this QR code will show all destination links for this product."}),t.jsxs("button",{onClick:()=>{const _=new Blob([z],{type:"image/svg+xml"}),be=URL.createObjectURL(_),he=document.createElement("a");he.href=be,he.download=`${Kt.productName}-qr.svg`,he.click(),URL.revokeObjectURL(be)},className:"w-full py-3 bg-[#553C9A] text-white font-bold rounded-xl hover:bg-[#483385] transition-all shadow-lg shadow-purple-200 text-sm flex items-center justify-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3"})}),"Download SVG"]})]})}),Ue&&(()=>{const _=R.find(Ge=>Ge._id===Ue),be=R.findIndex(Ge=>Ge._id===Ue),he=be>=0?`Device ${be+1}`:"device",Ae=w?kl(w):p?he:(_==null?void 0:_.productName)||he;return t.jsx("div",{className:"fixed inset-0 z-110 flex items-center justify-center bg-slate-900/50 backdrop-blur-[2px]",onClick:()=>!lt&&Qa(),children:t.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl p-7 flex flex-col gap-5 w-full max-w-sm mx-4",onClick:Ge=>Ge.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("h3",{className:"text-lg font-bold text-[#281E49]",children:["Rename ",he]}),t.jsx("button",{onClick:Qa,disabled:lt,className:"w-8 h-8 flex items-center justify-center bg-slate-100 text-slate-500 rounded-full hover:bg-slate-200 transition-colors disabled:opacity-50","aria-label":"Close",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-[12px] font-bold text-slate-500 uppercase tracking-wider",children:"Device name"}),t.jsx("input",{type:"text",autoFocus:!0,value:rt,onChange:Ge=>st(Ge.target.value),onKeyDown:Ge=>{Ge.key==="Enter"&&si(),Ge.key==="Escape"&&Qa()},disabled:lt,maxLength:120,placeholder:(_==null?void 0:_.productName)||he,className:"w-full px-4 py-3 rounded-xl border border-slate-300 bg-white text-slate-900 focus:outline-none focus:ring-4 focus:ring-sleek-purple/10 focus:border-sleek-purple transition-all text-sm"}),t.jsxs("p",{className:"text-[11px] text-slate-400",children:['Leave blank to fall back to "',Ae,'".']}),As&&t.jsx("p",{className:"text-[11px] text-red-500 font-medium",children:As})]}),t.jsxs("div",{className:"flex gap-2 justify-end",children:[t.jsx("button",{onClick:Qa,disabled:lt,className:"px-4 py-2.5 bg-white border border-slate-200 text-slate-600 font-bold rounded-xl hover:bg-slate-50 transition-colors text-sm",children:"Cancel"}),t.jsx("button",{onClick:si,disabled:lt,className:"px-5 py-2.5 bg-primary text-white font-bold rounded-xl hover:bg-[#483385] transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed",children:lt?"Savingâ¦":"Save"})]})]})})})(),t.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 shadow-sm overflow-hidden flex flex-col",children:[t.jsxs("div",{className:"p-6 sm:p-10 flex flex-col md:flex-row md:items-center justify-between gap-6",children:[t.jsxs("div",{className:"space-y-1 min-w-0",children:[ne?t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx("input",{type:"text",value:ze,onChange:_=>K(_.target.value),onKeyDown:_=>{_.key==="Enter"&&$t(),_.key==="Escape"&&ll()},autoFocus:!0,disabled:fe,maxLength:120,className:"text-2xl font-bold text-[#281E49] bg-transparent border-b-2 border-sleek-purple focus:outline-none px-1 py-0.5 min-w-0"}),t.jsx("button",{onClick:$t,disabled:fe||!ze.trim(),className:"px-4 py-2 bg-[#553C9A] text-white font-bold rounded-lg hover:bg-[#483385] transition-colors text-xs shadow-md shadow-purple-100 disabled:opacity-50 disabled:cursor-not-allowed",children:fe?"Saving...":"Save"}),t.jsx("button",{onClick:ll,disabled:fe,className:"px-4 py-2 bg-white border border-slate-200 text-slate-600 font-bold rounded-lg hover:bg-slate-50 transition-colors text-xs",children:"Cancel"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h3",{className:"text-2xl font-bold text-[#281E49]",children:Kt.productName}),t.jsx("button",{onClick:Fa,title:"Rename product","aria-label":"Rename product",className:"p-1.5 text-slate-400 hover:text-sleek-purple hover:bg-slate-100 rounded-md transition-colors",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})})]}),t.jsx("p",{className:"text-sm text-slate-400 font-medium",children:y?"Scanning this tag opens the loyalty sign-up and check-in page. There's no URL to set â the program settings, members and rewards are shared across every loyalty tag on this account.":p?"Each link has its own destination URL and QR code. Add new links or edit existing ones.":R.length>1?"Each device has its own destination URL and QR code. Switch devices using the tabs above.":"Set this device's destination URL and QR code."}),me&&t.jsx("p",{className:"text-xs text-red-500 font-medium",children:me})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[p&&t.jsxs("button",{onClick:()=>Xt(f._id),className:"px-6 py-3 bg-white border border-slate-200 text-slate-700 font-bold rounded-xl hover:bg-slate-50 transition-all shadow-sm active:scale-95 text-sm flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}),"Rename Device"]}),y&&t.jsxs("button",{onClick:()=>i(`${m}/${f._id}/loyalty/${f._id}`),className:"px-6 py-3 bg-primary text-white font-bold rounded-xl hover:bg-primary/90 transition-all shadow-sm active:scale-95 text-sm flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.196-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118L2.98 10.1c-.783-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),"Manage Loyalty Program"]}),h&&t.jsxs("button",{onClick:()=>i(`${m}/${f._id}/widget/${f._id}`),className:"px-6 py-3 bg-white border border-slate-200 text-slate-700 font-bold rounded-xl hover:bg-slate-50 transition-all shadow-sm active:scale-95 text-sm flex items-center gap-2",children:[t.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:[t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v14a1 1 0 01-1 1H5a1 1 0 01-1-1V5z"}),t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 15h6"})]}),"Customize Widget"]}),p&&z&&t.jsxs("button",{onClick:()=>Ne(!0),className:"px-6 py-3 bg-white border border-slate-200 text-slate-700 font-bold rounded-xl hover:bg-slate-50 transition-all shadow-sm active:scale-95 text-sm flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm12 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1zM5 20h2a1 1 0 001-1v-2a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1z"})}),"QR Code"]}),p&&!k&&t.jsxs("button",{onClick:()=>Vt(),disabled:C,className:"px-6 py-3 bg-white border border-slate-200 text-slate-700 font-bold rounded-xl hover:bg-slate-50 transition-all shadow-sm active:scale-95 text-sm disabled:opacity-50 flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M12 4v16m8-8H4"})}),C?"Adding...":"Add Link"]}),p&&k&&t.jsxs("div",{className:"relative",children:[t.jsxs("button",{onClick:()=>Be(_=>!_),disabled:C||Je.length===0,className:"px-6 py-3 bg-white border border-slate-200 text-slate-700 font-bold rounded-xl hover:bg-slate-50 transition-all shadow-sm active:scale-95 text-sm disabled:opacity-50 flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M12 4v16m8-8H4"})}),C?"Adding...":Je.length===0?"All platforms added":"Add Link"]}),ke&&Je.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Be(!1)}),t.jsxs("div",{className:"absolute right-0 mt-2 w-56 bg-white border border-slate-100 rounded-2xl shadow-xl z-50 overflow-hidden",children:[t.jsx("div",{className:"px-4 py-2 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-slate-50",children:"Choose a platform"}),m1.filter(_=>
497Je.includes(_.key)).map(_=>t.jsxs("button",{onClick:()=>Vt(_.key),className:"w-full flex items-center gap-2.5 text-left px-4 py-2.5 text-sm font-semibold text-slate-700 hover:bg-slate-50 transition-colors",children:[vn(_.key)?t.jsx("img",{src:vn(_.key),alt:"",className:"shrink-0 w-5 h-5"}):t.jsx("svg",{className:"shrink-0 w-5 h-5 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13.828 10.172a4 4 0 010 5.656l-3 3a4 4 0 01-5.656-5.656l1.5-1.5M10.172 13.828a4 4 0 010-5.656l3-3a4 4 0 015.656 5.656l-1.5 1.5"})}),_.label]},_.key))]})]})]}),H.length>1&&t.jsxs("button",{onClick:()=>ut(H),className:"px-6 py-3 bg-white border border-slate-200 text-slate-700 font-bold rounded-xl hover:bg-slate-50 transition-all shadow-sm active:scale-95 text-sm",children:["Bulk Edit (",H.length,")"]}),t.jsx("button",{disabled:H.length===0,onClick:()=>ut(H),className:"px-8 sm:px-10 py-3 bg-sleek-purple text-white font-bold rounded-xl hover:bg-purple-700 transition-all shadow-xl shadow-purple-100 active:scale-95 text-sm disabled:opacity-50",children:"Assign"})]})]}),R.length>1&&t.jsxs("div",{className:"px-10 pb-6 -mt-4",children:[t.jsxs("p",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-wider mb-3",children:["Switch device (",R.length," total)"]}),t.jsx("div",{className:"flex flex-wrap gap-2",children:R.map((_,be)=>{const he=_._id===f._id,Ae=_.deviceName&&_.deviceName.trim()||`Device ${be+1}`;return t.jsxs("div",{className:`flex items-stretch rounded-xl overflow-hidden border transition-all ${he?"border-sleek-purple shadow-md shadow-purple-100":"border-slate-200 hover:border-slate-400"}`,children:[t.jsx("button",{onClick:()=>i(`${m}/${_._id}`),className:`px-4 py-2 text-[13px] font-bold transition-colors ${he?"bg-sleek-purple text-white":"bg-white text-slate-600 hover:text-slate-900"}`,children:Ae}),_.qrCode&&t.jsx("button",{onClick:()=>ye({id:_._id,parentId:_._id,label:Ae,productName:_.productName,qrCode:_.qrCode,displayUrl:A(_._id),deviceIndex:be+1}),title:`Show QR for ${Ae}`,"aria-label":`Show QR for ${Ae}`,className:`px-2.5 transition-colors border-l ${he?"bg-sleek-purple text-white border-white/30 hover:bg-purple-700":"bg-white text-slate-500 border-slate-200 hover:bg-slate-50 hover:text-sleek-purple"}`,children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm12 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1zM5 20h2a1 1 0 001-1v-2a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1z"})})}),t.jsx("button",{onClick:()=>Xt(_._id),title:`Rename ${Ae}`,"aria-label":`Rename ${Ae}`,className:`px-2.5 transition-colors border-l ${he?"bg-sleek-purple text-white border-white/30 hover:bg-purple-700":"bg-white text-slate-500 border-slate-200 hover:bg-slate-50 hover:text-sleek-purple"}`,children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})})]},_._id)})})]}),t.jsx("div",{className:"hidden md:block overflow-x-auto",children:t.jsxs("table",{className:"w-full text-left border-collapse",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#F5F5FA] border-y border-slate-50",children:[t.jsx("th",{className:"px-10 py-5 text-[13px] font-bold text-slate-600 tracking-tight w-24",children:t.jsxs("div",{className:"flex items-center gap-3 cursor-pointer select-none",onClick:rs,children:[t.jsx("input",{type:"checkbox",className:"custom-checkbox",checked:sa,onChange:()=>{},disabled:O.length===0}),t.jsx("span",{children:"Select"})]})}),t.jsx("th",{className:"px-6 py-5 text-[13px] font-bold text-slate-600 tracking-tight",children:p?"Link ID":"Device ID"}),t.jsx("th",{className:"px-6 py-5 text-[13px] font-bold text-slate-600 tracking-tight",children:p?"Label":"Device Name"}),!p&&t.jsx("th",{className:"px-6 py-5 text-[13px] font-bold text-slate-600 tracking-tight",children:"Variant"}),t.jsx("th",{className:"px-6 py-5 text-[13px] font-bold text-slate-600 tracking-tight",children:"Destination"}),!p&&t.jsx("th",{className:"px-6 py-5 text-[13px] font-bold text-slate-600 tracking-tight text-center",children:"QR Code"}),t.jsx("th",{className:"px-10 py-5 text-[13px] font-bold text-slate-600 tracking-tight text-center",children:"Action"})]})}),t.jsxs("tbody",{className:"divide-y divide-slate-50",children:[O.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:p?5:7,className:"px-10 py-16 text-center",children:t.jsx("p",{className:"text-slate-400 text-sm font-medium",children:'No links yet. Click "Add Link" to create one.'})})}),O.map(_=>{const be=H.includes(_.id),he=de===_.id;return t.jsxs("tr",{className:`transition-colors group ${he?"opacity-50":""} ${be?"bg-slate-50":"hover:bg-slate-50/50"}`,children:[t.jsx("td",{className:"px-10 py-5",children:t.jsx("input",{type:"checkbox",className:"custom-checkbox",checked:be,onChange:()=>la(_.id)})}),t.jsx("td",{className:"px-6 py-5 text-sm font-semibold text-slate-600 tracking-tight",children:_.id}),t.jsx("td",{className:"px-6 py-5 text-sm font-semibold text-slate-600 tracking-tight",children:t.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[_.deviceIndex&&t.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-wider px-2 py-0.5 bg-sleek-purple/10 text-sleek-purple roun
497ded-full",children:["Device ",_.deviceIndex]}),t.jsx("span",{children:_.label}),!p&&w&&_.deviceName&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-slate-300","aria-hidden":"true",children:"·"}),t.jsx("span",{className:"text-[#281E49] font-bold",children:_.deviceName})]}),!p&&t.jsx("button",{onClick:()=>Xt(_.id),title:"Rename device","aria-label":"Rename device",className:"p-1 text-slate-400 hover:text-sleek-purple hover:bg-slate-100 rounded-md transition-colors",children:t.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})})]})}),!p&&t.jsxs("td",{className:"px-6 py-5 text-sm font-semibold text-slate-600 tracking-tight",children:[t.jsx("div",{children:_.variant||"â"}),_.quantityOption&&t.jsxs("div",{className:"mt-1 inline-flex items-center gap-1 px-2 py-0.5 bg-sleek-purple/10 text-sleek-purple text-[10px] font-bold rounded-full uppercase tracking-wider",children:["Qty: ",_.quantityOption]})]}),t.jsx("td",{className:"px-6 py-5 max-w-xs",children:_.displayUrl?t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("a",{href:_.displayUrl,target:"_blank",rel:"noopener noreferrer",title:_.displayUrl,"aria-label":"View destination URL",className:"shrink-0 inline-flex items-center p-1.5 text-slate-400 hover:text-sleek-purple hover:bg-slate-100 rounded-md transition-colors",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})}),t.jsx("button",{onClick:()=>Ye(_),title:U===_.id?"Copied!":"Copy URL","aria-label":"Copy destination URL",className:"shrink-0 p-1.5 text-slate-400 hover:text-sleek-purple hover:bg-slate-100 rounded-md transition-colors",children:U===_.id?t.jsx("svg",{className:"w-4 h-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M5 13l4 4L19 7"})}):t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}):t.jsx("span",{className:"text-sm text-slate-400",children:"â"})}),!p&&t.jsx("td",{className:"px-6 py-5 text-center",children:_.qrCode?t.jsxs("div",{className:"inline-flex items-center gap-2",children:[t.jsx("button",{onClick:()=>ye(_),title:`View QR${_.deviceIndex?` for Device ${_.deviceIndex}`:""}`,"aria-label":"View QR code",className:"p-2 text-slate-400 hover:text-sleek-purple hover:bg-slate-100 rounded-md transition-colors",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4V4zM14 4h6v6h-6V4zM4 14h6v6H4v-6zM14 14h2v2h-2v-2zM18 14h2v2h-2v-2zM14 18h2v2h-2v-2zM18 18h2v2h-2v-2z"})})}),t.jsx("button",{onClick:()=>Pe(_),title:`Download QR${_.deviceIndex?` for Device ${_.deviceIndex}`:""}`,"aria-label":"Download QR code",className:"p-2 text-slate-400 hover:text-sleek-purple hover:bg-slate-100 rounded-md transition-colors",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3"})})})]}):t.jsx("span",{className:"text-sm text-slate-400",children:"â"})}),t.jsx("td",{className:"px-10 py-5 text-center",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx("button",{onClick:()=>Gn(_),disabled:B===_.id,className:"p-2 text-slate-400 hover:text-red-500 transition-colors inline-flex justify-center disabled:opacity-50",title:"Clear analytics for this device","aria-label":"Clear analytics for this device",children:oe===_.id?t.jsx("svg",{className:"w-5 h-5 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M5 13l4 4L19 7"})}):t.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M3 20h18M7 20v-5M12 20v-9M17 20v-3"}),t.jsx("path",{strokeLinecap:"round",strokeWidth:"2.5",d:"M4 5l15 14"})]})}),t.jsx("button",{onClick:()=>In(_),className:"p-2 text-slate-400 hover:text-sleek-purple transition-colors inline-flex justify-center",title:"Edit",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})}),p&&t.jsx("button",{onClick:()=>ha(_.id),disabled:he,className:"p-2 text-slate-400 hover:text-red-500 transition-colors inline-flex justify-center disabled:opacity-50",title:"Remove link",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})})]},_.id)})]})]})}),t.jsxs("div",{className:"md:hidden border-t border-slate-100",children:[t.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 bg-[#F5F5FA] border-b border-slate-50",children:[t.jsx("input",{type:"checkbox",className:"custom-checkbox",checked:sa,onChange:rs,disabled:O.length===0}),t.jsxs("span",{className:"text-[13px] font-bold text-slate-600",children:["Select all (",O.length,")"]})]}),O.length===0?t.jsx("p",{className:"px-6 py-16 text-center text-slate-400 text-sm font-medium",children:'No links yet. Click "Add Link" to create one.'}):t.jsx("div",{className:"divide-y divide-slate-100",children:O.map(_=>{const be=H.includes(_.id),he=de===_.id;return t.jsxs("div",{className:`px-6 py-5 space-y-4 transition-colors ${he?"opacity-50":""} ${be?"bg-slate-50":""}`,children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[t.jsx("input",{type:"checkbox",className:"custom-checkbox mt-0.5 shrink-0",checked:be,onChange:()=>la(_.id)}),t.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap min-w-0",children:[_.deviceIndex&&t.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-wider px-2 py-0.5 bg-sleek-purple/10 text-sleek-purple roun
497ded-full",children:["Device ",_.deviceIndex]}),t.jsx("span",{className:"text-sm font-bold text-[#281E49] break-words",children:_.label}),!p&&w&&_.deviceName&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-slate-300","aria-hidden":"true",children:"·"}),t.jsx("span",{className:"text-[#281E49] font-bold text-sm break-words",children:_.deviceName})]})]})]}),t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[!p&&t.jsx("button",{onClick:()=>Xt(_.id),title:"Rename device","aria-label":"Rename device",className:"p-2 text-slate-400 hover:text-sleek-purple hover:bg-slate-100 rounded-md transition-colors",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})}),t.jsx("button",{onClick:()=>Gn(_),disabled:B===_.id,title:"Clear analytics for this device","aria-label":"Clear analytics for this device",className:"p-2 text-slate-400 hover:text-red-500 hover:bg-slate-100 rounded-md transition-colors disabled:opacity-50",children:oe===_.id?t.jsx("svg",{className:"w-5 h-5 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M5 13l4 4L19 7"})}):t.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M3 20h18M7 20v-5M12 20v-9M17 20v-3"}),t.jsx("path",{strokeLinecap:"round",strokeWidth:"2.5",d:"M4 5l15 14"})]})}),t.jsx("button",{onClick:()=>In(_),title:"Edit","aria-label":"Edit",className:"p-2 text-slate-400 hover:text-sleek-purple hover:bg-slate-100 rounded-md transition-colors",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})}),p&&t.jsx("button",{onClick:()=>ha(_.id),disabled:he,title:"Remove link","aria-label":"Remove link",className:"p-2 text-slate-400 hover:text-red-500 hover:bg-slate-100 rounded-md transition-colors disabled:opacity-50",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),t.jsxs("dl",{className:"space-y-2.5 text-sm",children:[t.jsxs("div",{className:"flex justify-between gap-3",children:[t.jsx("dt",{className:"text-slate-400 font-medium shrink-0",children:p?"Link ID":"Device ID"}),t.jsx("dd",{className:"text-slate-600 font-semibold truncate",children:_.id})]}),!p&&t.jsxs("div",{className:"flex justify-between gap-3",children:[t.jsx("dt",{className:"text-slate-400 font-medium shrink-0",children:"Variant"}),t.jsxs("dd",{className:"text-slate-600 font-semibold text-right",children:[_.variant||"â",_.quantityOption&&t.jsxs("span",{className:"text-slate-400 font-normal",children:[" ","· Qty: ",_.quantityOption]})]})]}),t.jsxs("div",{className:"flex justify-between gap-3 items-center",children:[t.jsx("dt",{className:"text-slate-400 font-medium shrink-0",children:"Destination"}),t.jsx("dd",{className:"min-w-0",children:_.displayUrl?t.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[t.jsxs("a",{href:_.displayUrl,target:"_blank",rel:"noopener noreferrer",title:_.displayUrl,className:"inline-flex items-center gap-1.5 font-medium text-sleek-purple hover:underline",children:["View",t.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]}),t.jsx("button",{onClick:()=>Ye(_),title:U===_.id?"Copied!":"Copy URL","aria-label":"Copy destination URL",className:"shrink-0 p-1.5 text-slate-400 hover:text-sleek-purple hover:bg-slate-100 rounded-md transition-colors",children:U===_.id?t.jsx("svg",{className:"w-4 h-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M5 13l4 4L19 7"})}):t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}):t.jsx("span",{className:"text-slate-400",children:"â"})})]}),!p&&t.jsxs("div",{className:"flex justify-between gap-3 items-center",children:[t.jsx("dt",{className:"text-slate-400 font-medium shrink-0",children:"QR Code"}),t.jsx("dd",{children:_.qrCode?t.jsxs("div",{className:"inline-flex items-center gap-2",children:[t.jsx("button",{onClick:()=>ye(_),title:`View QR${_.deviceIndex?` for Device ${_.deviceIndex}`:""}`,className:"inline-flex w-10 h-10 hover:opacity-75 transition-opacity cursor-pointer p-0 bg-transparent border-0",children:t.jsx("div",{className:"w-10 h-10",dangerouslySetInnerHTML:{__html:_.qrCode}})}),t.jsx("button",{onClick:()=>Pe(_),title:`Download QR${_.deviceIndex?` for Device ${_.deviceIndex}`:""}`,"aria-label":"Download QR code",className:"p-2 text-slate-400 hover:text-sleek-purple hover:bg-slate-100 rounded-md transition-colors",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3"})})})]}):t.jsx("span",{className:"text-slate-400",children:"â"})})]})]})]},_.id)})})]})]})]})},al="w-full px-5 py-3.5 rounded-xl border border-slate-200 bg-white text-slate-900 focus:outline-none transition-all placeholder:text-slate-300 text-[15px]",sl=({label:l,error:r,children:i})=>t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-[14px] font-bold text-[#1A202C]",children:l}),i,r&&t.jsx("p",{className:"text-[12px] text-red-500 font-medium",children:r})]}),Y5="border-red-300 focus:border-red-400",Ko=({block:l,onChange:r})=>t.jsx(sl,{label:"Label",children:t.jsx("input",{type:"text",value:l.title,onChange:i=>r({title:i.target.value}),className:al})}),Tn=({label:l,value:r,href:i,icon:o})=>{const c=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-wider",children:l}),t.jsx("p",{className:"text-[14px] text-slate-800 font-semibold truncate",children:r})]}),t.jsx("div",{className:"w-10 h-10 bg-[#EDEEF9] text-sleek-purple roun
497ded-xl flex items-center justify-center shrink-0",children:o})]});return i?t.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 border-b border-slate-100 pb-4",children:c}):t.jsx("div",{className:"flex items-center gap-3 border-b border-slate-100 pb-4",children:c})},Se={user:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),briefcase:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 13.255A23.93 23.93 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),building:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0H5m14 0h2m-2 0v-5a2 2 0 00-2-2h-2a2 2 0 00-2 2v5m-4 0v-5a2 2 0 00-2-2H7a2 2 0 00-2 2v5"})}),phone:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.95.68l1.5 4.49a1 1 0 01-.5 1.21l-2.26 1.13a11 11 0 005.52 5.52l1.13-2.26a1 1 0 011.21-.5l4.49 1.5a1 1 0 01.68.95V19a2 2 0 01-2 2h-1C9.72 21 3 14.28 3 6V5z"})}),email:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),globe:t.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:[t.jsx("circle",{cx:"12",cy:"12",r:"9"}),t.jsx("path",{strokeLinecap:"round",d:"M3 12h18M12 3a14 14 0 010 18M12 3a14 14 0 000 18"})]}),about:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h6m-6 4h6m-6-8h6M5 4h14a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2z"})}),contact:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),calendar:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),instagram:t.jsx("img",{src:"/logos/Instagram.svg",alt:"",className:"w-5 h-5"}),facebook:t.jsx("img",{src:"/logos/Facebook.svg",alt:"",className:"w-5 h-5"}),linkedin:t.jsx("img",{src:"/logos/Linkedin.svg",alt:"",className:"w-5 h-5"}),twitter:t.jsx("img",{src:"/logos/X.svg",alt:"",className:"w-5 h-5"}),youtube:t.jsx("img",{src:"/logos/Youtube.svg",alt:"",className:"w-5 h-5"}),soundcloud:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M23.999 14.165c-.052 1.796-1.612 3.169-3.409 3.169h-8.07c-.18-.02-.317-.169-.317-.353V6.456c0-.2.135-.298.317-.353 1.027-.346 2.137-.519 3.319-.519 4.291 0 7.704 3.342 7.704 7.586 0 .337-.018.67-.054 1zm-12.7 3.166h-.452c-.18 0-.317-.146-.317-.328V7.114c0-.18.137-.328.317-.328h.452c.18 0 .317.146.317.328v9.889c0 .18-.137.327-.317.327zm-2.207 0h-.452c-.18 0-.317-.146-.317-.328V8.151c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v8.852c0 .18-.137.327-.317.327zm-2.207 0H6.43c-.18 0-.317-.146-.317-.328V9.16c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v7.843c0 .18-.137.327-.317.327zm-2.207 0h-.452c-.18 0-.317-.146-.317-.328v-6.39c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v6.39c0 .18-.137.327-.317.327zm-2.208 0h-.452c-.18 0-.317-.146-.317-.328v-5.31c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v5.31c0 .18-.137.327-.317.327zM0 13.987c0-.18.146-.327.327-.327h.452c.18 0 .317.146.317.327v2.554c0 .181-.137.328-.317.328H.327c-.18 0-.327-.146-.327-.328v-2.554z"})}),pinterest:t.jsx("img",{src:"/logos/Pinterest.svg",alt:"",className:"w-5 h-5"}),behance:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"})}),dribbble:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm9.885 11.441c-2.575-.422-4.943-.445-7.103-.073-.244-.563-.497-1.125-.767-1.68 2.31-1 4.165-2.358 5.548-4.082 1.35 1.594 2.197 3.619 2.322 5.835zm-3.842-7.282c-1.205 1.554-2.868 2.783-4.986 3.68-1.016-1.861-2.178-3.676-3.488-5.438.779-.197 1.591-.314 2.431-.314 2.275 0 4.368.779 6.043 2.072zM7.072 1.985c1.341 1.728 2.521 3.523 3.554 5.381-2.674.71-5.713 1.073-9.099 1.084.426-2.892 2.262-5.319 4.871-6.465zm-5.221 8.43c.06 0 .12.002.18.002 3.92 0 7.412-.504 10.475-1.529.243.491.476.984.692 1.481-3.51 1.063-6.498 3.16-8.97 6.290-1.522-1.567-2.502-3.654-2.679-5.96zm3.681 7.342c2.292-2.957 5.041-4.864 8.31-
4975.745.916 2.379 1.585 4.811 2.001 7.293-3.483 1.673-7.55 1.106-10.311-1.548zm12.027.561c-.39-2.301-1.011-4.564-1.85-6.789 1.956-.312 4.012-.232 6.158.232-.401 2.682-1.91 5.022-4.308 6.557z"})}),tiktok:t.jsx("img",{src:"/logos/Tiktok.svg",alt:"",className:"w-5 h-5"}),yelp:t.jsx("img",{src:"/logos/Ylep.svg",alt:"",className:"w-5 h-5"}),google:t.jsx("img",{src:"/logos/Google.svg",alt:"",className:"w-5 h-5"}),twitch:t.jsx("img",{src:"/logos/Twitch.svg",alt:"",className:"w-5 h-5"}),discord:t.jsx("img",{src:"/logos/Discord.svg",alt:"",className:"w-5 h-5"}),telegram:t.jsx("img",{src:"/logos/Telegram.svg",alt:"",className:"w-5 h-5"}),whatsapp:t.jsx("img",{src:"/logos/Whatsapp.svg",alt:"",className:"w-5 h-5"}),threads:t.jsx("img",{src:"/logos/Threads.svg",alt:"",className:"w-5 h-5"}),messenger:t.jsx("img",{src:"/logos/Messenger.svg",alt:"",className:"w-5 h-5"}),snapchat:t.jsx("img",{src:"/logos/Snapchat.svg",alt:"",className:"w-5 h-5"}),signal:t.jsx("img",{src:"/logos/Signal.svg",alt:"",className:"w-5 h-5"}),reddit:t.jsx("img",{src:"/logos/Reddit.svg",alt:"",className:"w-5 h-5"}),vimeo:t.jsx("img",{src:"/logos/Vimeo.svg",alt:"",className:"w-5 h-5"}),tripadvisor:t.jsx("img",{src:"/logos/Tripadvisor.svg",alt:"",className:"w-5 h-5"}),pin:t.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:[t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.657 16.657L13.414 20.9a2 2 0 01-2.827 0L6.343 16.657a8 8 0 1111.314 0z"}),t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),clock:t.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:[t.jsx("circle",{cx:"12",cy:"12",r:"9"}),t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 7v5l3 2"})]}),video:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),gallery:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),link:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),pdf:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h7l5 5v11a2 2 0 01-2 2z"})})},Zo=l=>l.replace(/^@+/,"").trim(),mx=l=>{const[r,i="00"]=(l||"").split(":"),o=Number(r);if(Number.isNaN(o))return l;const c=o<12?"AM":"PM";return`${o%12===0?12:o%12}:${i.padStart(2,"0")} ${c}`},h1=(l,r)=>{const i=Zo(r);if(!i)return"";switch(l){case"instagram":return`https://instagram.com/${i}`;case"facebook":return`https://facebook.com/${i}`;case"linkedin":return/^https?:\/\//i.test(i)?i:/linkedin\.com/i.test(i)?`https://${i}`:`https://linkedin.com/in/${i}`;case"twitter":return`https://x.com/${i}`;case"youtube":return`https://youtube.com/@${i}`;case"soundcloud":return`https://soundcloud.com/${i}`;case"pinterest":return`https://pinterest.com/${i}`;case"behance":return`https://behance.net/${i}`;case"dribbble":return`https://dribbble.com/${i}`;case"tiktok":return`https://tiktok.com/@${i}`;case"twitch":return`https://twitch.tv/${i}`;case"telegram":return`https://t.me/${i}`;case"whatsapp":return`https://wa.me/${i.replace(/[^\d]/g,"")}`;case"threads":return`https://threads.net/@${i}`;case"messenger":return`https://m.me/${i}`;case"snapchat":return`https://snapchat.com/add/${i}`;case"reddit":return`https://reddit.com/user/${i}`;case"vimeo":return`https://vimeo.com/${i}`;case"yelp":case"google":case"discord":case"signal":case"tripadvisor":return/^https?:\/\//i.test(i)?i:`https://${i}`}},p1=l=>{if(!l)return"";const r=l.match(/(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{11})/);if(r)return`https://www.youtube.com/embed/${r[1]}`;const i=l.match(/vimeo\.com\/(?:video\/)?(\d+)/);return i?`https://player.vimeo.com/video/${i[1]}`:""},Na=l=>{const r=l.trim();if(!r)return null;let i;try{i=new URL(r)}catch{return"Enter a valid URL (e.g., https://example.com)"}return i.protocol!=="http:"&&i.protocol!=="https:"?"URL must start with http:// or https://":i.hostname.includes(".")?null:"Enter a valid domain"},P5=l=>{const r=l.trim();if(!r)return null;const i=Na(r);
497return i||(p1(r)?null:"Paste a YouTube or Vimeo link")},F5=l=>{const r=Na(l);if(r)return r;const i=l.trim().toLowerCase();return i&&!i.includes(".pdf")?"Link should point to a .pdf file":null},Q5=/^[A-Za-z0-9._-]{1,50}$/,Jt=(l,r=!1)=>i=>{const o=Zo(i);return o?/^https?:\/\//i.test(o)?r?Na(o):`Enter just your ${l} username, not a URL`:Q5.test(o)?null:`Invalid ${l} username`:null},Wa=l=>l.replace(/[\\;,]/g,r=>`\\${r}`).replace(/\n/g,"\\n"),X5=l=>{var y,v,E,R,N,k,w;const r=A=>l.find(O=>O.type===A),i=((y=r("name"))==null?void 0:y.data.value)??"",o=((v=r("jobTitle"))==null?void 0:v.data.value)??"",c=((E=r("company"))==null?void 0:E.data.value)??"",m=((R=r("call"))==null?void 0:R.data.phone)??"",f=((N=r("email"))==null?void 0:N.data.email)??"",h=((k=r("website"))==null?void 0:k.data.url)??"",p=((w=r("address"))==null?void 0:w.data.query)??"",g=["BEGIN:VCARD","VERSION:3.0"];if(i){g.push(`FN:${Wa(i)}`);const A=i.split(/\s+/),O=A.length>1?A.pop():"";g.push(`N:${Wa(O||"")};${Wa(A.join(" "))};;;`)}o&&g.push(`TITLE:${Wa(o)}`),c&&g.push(`ORG:${Wa(c)}`),m&&g.push(`TEL;TYPE=CELL:${Wa(m)}`),f&&g.push(`EMAIL:${Wa(f)}`),h&&g.push(`URL:${Wa(h)}`),p&&g.push(`ADR:;;${Wa(p)};;;;`);for(const A of l)if(["instagram","facebook","linkedin","twitter","youtube","soundcloud","pinterest","behance","dribbble","tiktok","yelp","google","twitch","discord","telegram","whatsapp","threads","messenger","snapchat","signal","reddit","vimeo","tripadvisor"].includes(A.type)){const O=Zo(A.data.handle),z=h1(A.type,O),H=O.replace(/^https?:\/\//i,"").replace(/\/+$/,"").split("/").pop()||O;z&&g.push(`X-SOCIALPROFILE;TYPE=${A.type};x-user=${H}:${Wa(z)}`)}return g.push("END:VCARD"),g.join(`\r 498`)},K5=l=>{var m;const r=new Blob([X5(l)],{type:"text/vcard;charset=utf-8"}),i=URL.createObjectURL(r),o=document.createElement("a");o.href=i;const c=((m=l.find(f=>f.type==="name"))==null?void 0:m.data.value)||"contact";o.download=`${c.replace(/\s+/g,"_")}.vcf`,o.click(),setTimeout(()=>URL.revokeObjectURL(i),1e3)},at=(l,r,i,o="text",c)=>({block:m,onChange:f})=>{const h=m.data[l]??"",p=c?c(h):null;return t.jsxs("div",{className:"space-y-4",children:[t.jsx(Ko,{block:m,onChange:f}),t.jsx(sl,{label:i,error:p,children:t.jsx("input",{type:o,value:h,placeholder:r,onChange:g=>f({data:{...m.data,[l]:g.target.value}}),className:`${al} ${p?Y5:""}`,"aria-invalid":!!p})})]})},fx=({block:l})=>{const r=l.data.value||`Your ${l.title}`;return l.type==="name"?t.jsx("h3",{className:"text-[24px] font-bold text-[#1A202C] leading-tight",children:r}):t.jsx("p",{className:"text-[14px] text-slate-500 font-medium",children:r})},Z5=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Cm=()=>Z5.map(l=>({day:l,open:"09:00",close:"17:00",closed:!1})),J5=({block:l,onChange:r})=>{const i=l.data.days.length?l.data.days:Cm(),o=(c,m)=>{const f=[...i];f[c]={...f[c],...m},r({data:{days:f}})};return t.jsxs("div",{className:"space-y-4",children:[t.jsx(Ko,{block:l,onChange:r}),t.jsx("div",{className:"space-y-2",children:i.map((c,m)=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"w-12 text-[13px] font-bold text-slate-700",children:c.day}),t.jsx("input",{type:"time",value:c.open,disabled:c.closed,onChange:f=>o(m,{open:f.target.value}),className:"flex-1 px-3 py-2 rounded-lg border border-slate-200 text-[13px] disabled:bg-slate-50 disabled:text-slate-300"}),t.jsx("span",{className:"text-slate-400 text-xs",children:"â"}),t.jsx("input",{type:"time",value:c.close,disabled:c.closed,onChange:f=>o(m,{close:f.target.value}),className:"flex-1 px-3 py-2 rounded-lg border border-slate-200 text-[13px] disabled:bg-slate-50 disabled:text-slate-300"}),t.jsxs("label",{className:"flex items-center gap-1.5 text-[12px] font-bold text-slate-500",children:[t.jsx("input",{type:"checkbox",checked:c.closed,onChange:f=>o(m,{closed:f.target.checked})}),"Closed"]})]},c.day))})]})},W5=({block:l})=>{const r=l.data.days.length?l.data.days:Cm();return t.jsxs("div",{className:"space-y-2 border-b border-slate-100 pb-4",children:[t.jsx("p",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-wider",children:l.title||"Hours"}),t.jsx("div",{className:"space-y-1",children:r.map(i=>t.jsxs("div",{className:"flex justify-between text-[13px]",children:[t.jsx("span",{className:"font-semibold text-slate-700",children:i.day}),t.jsx("span",{className:"text-slate-500",children:i.closed?"Closed":`${mx(i.open)} â ${mx(i.close)}`})]},i.day))})]})},e4=({block:l,onChange:r})=>{const i=o=>r({data:{...l.data,...o}});return t.jsxs("div",{className:"space-y-4",children:[t.jsx(sl,{label:"Heading",children:t.jsx("input",{type:"text",value:l.data.heading,onChange:o=>i({heading:o.target.value}),className:al})}),t.jsx(sl,{label:"About",children:t.jsx("textarea",{rows:4,value:l.data.text,onChange:o=>i({text:o.target.value}),className:`${al} resize-none`})})]})},t4=({block:l})=>{const{heading:r,text:i}=l.data;return t.jsxs("div",{className:"space-y-2 border-b border-slate-100 pb-4",children:[t.jsx("p",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-wider",children:l.title||"About"}),r&&t.jsx("h4",{className:"text-[16px] font-bold text-[#1A202C]",children:r}),i&&t.jsx("p",{className:"text-[14px] text-slate-600 leading-relaxed",children:i})]})},a4=({block:l,allBlocks:r})=>t.jsx("button",{type:"button",onClick:()=>K5(r),className:"w-full py-3 bg-[#553C9A] text-white font-bold rounded-xl hover:bg-purple-700 transition-all active:scale-95 text-sm",children:l.title||"Add to Contacts"}),s4=({block:l})=>t.jsx("a",{href:l.data.url||"#",target:"_blank",rel:"noopener noreferrer",className:`block w-full py-3 text-center font-bold rounded-xl transition-all active:scale-95 text-sm ${l.data.url?"bg-white text-[#553C9A] border-2 border-[#553C9A] hover:bg-purple-50":"bg-slate-100 text-slate-400 pointer-events-none"}`,children:l.title||"Schedule Meeting"}),hx=l=>
498{const r=[l.housenumber,l.street].filter(Boolean).join(" ");return[l.name&&l.name!==r?l.name:r,l.city||l.district,l.state,l.postcode,l.country].filter(Boolean).join(", ")},l4=(l,r)=>`${l.properties.osm_type??"?"}-${l.properties.osm_id??r}`,n4=({block:l,onChange:r})=>{const[i,o]=b.useState([]),[c,m]=b.useState(!1),[f,h]=b.useState(!1),[p,g]=b.useState(-1),y=b.useRef(null),v=b.useRef(null),E=b.useRef(null),R=b.useRef(!1),N=b.useRef(!1),k=l.data.query;b.useEffect(()=>{if(R.current){R.current=!1;return}if(N.current){if(!k||k.trim().length<3){o([]),m(!1);return}return E.current&&clearTimeout(E.current),E.current=setTimeout(async()=>{v.current&&v.current.abort();const O=new AbortController;v.current=O,h(!0);try{const z=await fetch(`https://photon.komoot.io/api/?lang=en&limit=10&lat=39.8&lon=-98.6&q=${encodeURIComponent(k)}`,{signal:O.signal,headers:{Accept:"application/json"}});if(!z.ok)throw new Error("Lookup failed");const H=await z.json(),se=(Array.isArray(H.features)?H.features:[]).filter(Z=>{var T;return((T=Z.properties)==null?void 0:T.countrycode)==="US"}).slice(0,5);o(se),m(se.length>0),g(-1)}catch(z){if(z.name==="AbortError")return;o([]),m(!1)}finally{h(!1)}},350),()=>{E.current&&clearTimeout(E.current)}}},[k]),b.useEffect(()=>{if(!c)return;const O=z=>{var H;(H=y.current)!=null&&H.contains(z.target)||m(!1)};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[c]);const w=O=>{R.current=!0,r({data:{query:hx(O.properties)}}),m(!1),o([]),g(-1)},A=O=>{if(O.key==="Escape"){m(!1);return}!c||i.length===0||(O.key==="ArrowDown"?(O.preventDefault(),g(z=>(z+1)%i.length)):O.key==="ArrowUp"?(O.preventDefault(),g(z=>z<=0?i.length-1:z-1)):O.key==="Enter"&&p>=0&&(O.preventDefault(),w(i[p])))};return t.jsxs("div",{className:"space-y-4",children:[t.jsx(Ko,{block:l,onChange:r}),t.jsx(sl,{label:"Address",children:t.jsxs("div",{ref:y,className:"relative",children:[t.jsx("input",{type:"text",value:k,placeholder:"1600 Amphitheatre Pkwy, Mountain Vie
498w, CA",autoComplete:"off",role:"combobox","aria-expanded":c,"aria-autocomplete":"list","aria-controls":"address-suggestions",onChange:O=>{N.current=!0,r({data:{query:O.target.value}})},onFocus:()=>i.length>0&&m(!0),onKeyDown:A,className:al}),f&&t.jsxs("svg",{className:"absolute right-4 top-1/2 -translate-y-1/2 animate-spin w-4 h-4 text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[t.jsx("circle",{cx:"12",cy:"12",r:"9",strokeWidth:"3",strokeOpacity:"0.25"}),t.jsx("path",{strokeLinecap:"round",strokeWidth:"3",d:"M21 12a9 9 0 0 0-9-9"})]}),c&&i.length>0&&t.jsx("ul",{id:"address-suggestions",role:"listbox",className:"absolute z-20 left-0 right-0 mt-1 bg-white border border-slate-200 rounded-xl shadow-lg overflow-hidden max-h-72 overflow-y-auto",children:i.map((O,z)=>t.jsx("li",{role:"option","aria-selected":p===z,onMouseDown:H=>{H.preventDefault(),w(O)},onMouseEnter:()=>g(z),className:`px-4 py-2.5 text-[13px] cursor-pointer border-b border-slate-50 last:border-b-0 ${p===z?"bg-purple-50 text-slate-900":"hover:bg-slate-50 text-slate-700"}`,children:hx(O.properties)},l4(O,z)))})]})})]})},r4=({block:l})=>{const r=l.data.query;return t.jsxs("div",{className:"space-y-2 border-b border-slate-100 pb-4",children:[t.jsx("p",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-wider",children:l.title||"Address"}),r?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-[14px] text-slate-700 font-medium",children:r}),t.jsx("iframe",{title:`map-${r}`,src:`https://www.google.com/maps?q=${encodeURIComponent(r)}&output=embed`,className:"w-full h-40 rounded-xl border border-slate-200",loading:"lazy"})]}):t.jsx("p",{className:"text-[13px] text-slate-400",children:"Add an address to show a map."})]})},i4=({block:l})=>{const r=p1(l.data.url);return t.jsxs("div",{className:"space-y-2 border-b border-slate-100 pb-4",children:[t.jsx("p",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-wider",children:l.title||"Video"}),r?t.jsx("iframe",{title:`video-${r}`,src:r,className:"w-full aspect-video rounded-xl border border-slate-200",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):t.jsx("p",{className:"text-[13px] text-slate-400",children:"Paste a YouTube or Vimeo URL."})]})},o4=({block:l})=>t.jsx(Tn,{label:l.title||"Photo Gallery",value:l.data.url||"Add a gallery URL",href:l.data.url||void 0,icon:Se.gallery}),c4=({block:l})=>t.jsxs("div",{className:"space-y-2 border-b border-slate-100 pb-4",children:[t.jsx("p",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-wider",children:l.title||"PDF"}),l.data.url?t.jsxs(t.Fragment,{children:[t.jsx("iframe",{title:`pdf-${l.data.url}`,src:l.data.url,className:"w-full h-72 rounded-xl border border-slate-200"}),t.jsx("a",{href:l.data.url,target:"_blank",rel:"noopener noreferrer",className:"text-[12px] font-bold text-sleek-purple hover:underline",children:"Open in new tab â"})]}):t.jsx("p",{className:"text-[13px] text-slate-400",children:"Paste a PDF URL."})]}),d4=l=>{switch(l){case"instagram":return Se.instagram;case"facebook":return Se.facebook;case"linkedin":return Se.linkedin;case"twitter":return Se.twitter;case"youtube":return Se.youtube;case"soundcloud":return Se.soundcloud;case"pinterest":return Se.pinterest;case"behance":return Se.behance;case"dribbble":return Se.dribbble;case"tiktok":return Se.tiktok;case"yelp":return Se.yelp;case"google":return Se.google;case"twitch":return Se.twitch;case"discord":return Se.discord;case"telegram":return Se.telegram;case"whatsapp":return Se.whatsapp;case"threads":return Se.threads;case"messenger":return Se.messenger;case"snapchat":return Se.snapchat;case"signal":return Se.signal;case"reddit":return Se.reddit;case"vimeo":return Se.vimeo;case"tripadvisor":return Se.tripadvisor;default:return Se.link}},u4=l=>l.replace(/^https?:\/\//i,"").replace(/\/+$/,""),m4=new Set(["linkedin","yelp","google","discord","signal","tripadvisor"]),Et=({block:l})=>{const r=Zo(l.data.handle||""),i=m4.has(l.type),o=r?i?u4(r):l.type==="whatsapp"?r:`@${r}`:i||l.type==="whatsapp"?"":"@username";return t.jsx(Tn,{label:l.title||l.type,value:o,href:r?h1(l.type,r):void 0,icon:d4(l.type)})},Qt={name:{label:"Name",group:"identity",defaultTitle:"Name",defaultData:{value:""},icon:Se.user,Editor:({block:l,onChange:r})=>t.jsx(sl,{label:"Name",children:t.jsx("input",{type:"text",value:l.data.value??"",placeholder:"Enter your name",onChange:i=>r({data:{...l.data,value:i.target.value}}),className:al})}),Preview:fx},jobTitle:{label:"Title",group:"identity",defaultTitle:"Title",defaultData:{value:""},icon:Se.briefcase,Editor:({block:l,onChange:r})=>t.jsx(sl,{label:"Title",children:t.jsx("input",{type:"text",value:l.data.value??"",placeholder:"Enter your job title",onCh
498ange:i=>r({data:{...l.data,value:i.target.value}}),className:al})}),Preview:fx},company:{label:"Company Name",group:"identity",defaultTitle:"Company",defaultData:{value:""},icon:Se.building,Editor:({block:l,onChange:r})=>t.jsx(sl,{label:"Company Name",children:t.jsx("input",{type:"text",value:l.data.value??"",placeholder:"Enter your company name",onChange:i=>r({data:{...l.data,value:i.target.value}}),className:al})}),Preview:({block:l})=>t.jsx("p",{className:"text-[13px] text-slate-500 font-medium",children:l.data.value||"Your Company"})},call:{label:"Call",group:"contact",defaultTitle:"Call",defaultData:{phone:""},icon:Se.phone,Editor:at("phone","+1 555 555 5555","Phone Number","tel"),Preview:({block:l})=>t.jsx(Tn,{label:l.title||"Call",value:l.data.phone||"Add phone",href:l.data.phone?`tel:${l.data.phone}`:void 0,icon:Se.phone})},email:{label:"Email",group:"contact",defaultTitle:"Email",defaultData:{email:""},icon:Se.email,Editor:at("email","[email protected]","Email","email"),Preview:({block:l})=>t.jsx(Tn,{label:l.title||"Email",value:l.data.email||"[email protected]",href:l.data.email?`mailto:${l.data.email}`:void 0,icon:Se.email})},website:{label:"Website",group:"contact",defaultTitle:"Website",defaultData:{url:""},icon:Se.globe,Editor:at("url","https://example.com","Website","url",Na),Preview:({block:l})=>t.jsx(Tn,{label:l.title||"Website",value:l.data.url||"https://example.com",href:l.data.url||void 0,icon:Se.globe})},about:{label:"About Me",group:"identity",defaultTitle:"About",defaultData:{heading:"",text:""},icon:Se.about,Editor:e4,Preview:t4},addToContact:{label:"Add to Contact",group:"actions",defaultTitle:"Add to Contacts",defaultData:{},icon:Se.contact,Editor:({block:l,onChange:r})=>t.jsxs("div",{className:"space-y-4",children:[t.jsx(Ko,{block:l,onChange:r}),t.jsx("p",{className:"text-[12px] text-slate-400",children:"The contact card is generated from your Name, Title, Company, Call, Email, Website, Address and Social blocks â no extra setup needed."})]}),Preview:a4},scheduleMeeting:{label:"Schedule Meeting",group:"actions",defaultTitle:"Schedule Meeting",defaultData:{url:""},icon:Se.calendar,Editor:at("url","https://cal.com/your-handle","Booking URL","url",Na),Preview:s4},facebook:{label:"Facebook",group:"social",defaultTitle:"Facebook",defaultData:{handle:""},icon:Se.facebook,Editor:at("handle","yourhandle","Handle","text",Jt("Facebook")),Preview:Et},instagram:{label:"Instagram",group:"social",defaultTitle:"Instagram",defaultData:{handle:""},icon:Se.instagram,Editor:at("handle","@yourhandle","Handle","text",Jt("Instagram")),Preview:Et},twitter:{label:"X (Twitter)",group:"social",defaultTitle:"X",defaultData:{handle:""},icon:Se.twitter,Editor:at("handle","@yourhandle","Handle","text",Jt("X")),Preview:Et},pinterest:{label:"Pinterest",group:"social",defaultTitle:"Pinterest",defaultData:{handle:""},icon:Se.pinterest,Editor:at("handle","yourhandle","Handle","text",Jt("Pinterest")),Preview:Et},tiktok:{label:"TikTok",group:"social",defaultTitle:"TikTok",defaultData:{handle:""},icon:Se.tiktok,Editor:at("handle","@yourhandle","Handle","text",Jt("TikTok")),Preview:Et},youtube:{label:"YouTube",group:"social",defaultTitle:"YouTube",defaultData:{handle:""},icon:Se.youtube,Editor:at("handle","yourhandle","Handle","text",Jt("YouTube")),Preview:Et},yelp:{label:"Yelp",group:"social",defaultTitle:"Yelp",defaultData:{handle:""},icon:Se.yelp,Editor:at("handle","https://www.yelp.com/biz/your-business","Business URL","url",Na),Preview:Et},google:{label:"Google",group:"social",defaultTitle:"Google",defaultData:{handle:""},icon:Se.google,Editor:at("handle","https://g.page/your-business","Business or Review URL","url",Na),Preview:Et},twitch:{label:"Twitch",group:"social",defaultTitle:"Twitch",defaultData:{handle:""},icon:Se.twitch,Editor:at("handle","yourhandle","Handle","text",Jt("Twitch")),Preview:Et},discord:{label:"Discord",group:"social",defaultTitle:"Discord",defaultData:{handle:""},icon:Se.discord,Editor:at("handle","https://discord.gg/your-invite","Invite URL","url",Na),Preview:Et},telegram:{label:"Telegram",group:"social",defaultTitle:"Telegram",defaultData:{handle:""},icon:Se.telegram,Editor:at("handle","yourhandle","Handle","text",Jt("Telegram")),Preview:Et},whatsapp:{label:"WhatsApp",group:"social",defaultTitle:"WhatsApp",defaultData:{handle:""},icon:Se.whatsapp,Editor:at("handle","15551234567","Phone Number","tel"),Preview:Et},threads:{label:"Threads",group:"social",defaultTitle:"Threads",defaultData:{handle:""},icon:Se.threads,Editor:at("handle","@yourhandle","Handle","text",Jt("Threads")),Preview:Et},messenger:{label:"Messenger",group:"social",defaultTitle:"Messenger",defaultData:{handle:""},icon:Se.messenger,Editor:at("handle","yourhandle","Handle","text",Jt("Messenger")),Preview:Et},snapchat:{label:"Snapchat",group:"social",defaultTitle:"Snapchat",defaultData:{handle:""},icon:Se.snapchat,Editor:at("handle","yourhandle","Handle","text",Jt("Snapchat")),Preview:Et},linkedin:{label:"LinkedIn",group:"social",defaultTitle:"LinkedIn",defaultData:{handle:""},icon:Se.linkedin,Editor:at("handle","https://www.linkedin.com/in/your-profile","Profile or Company URL","url",Na),Preview:Et},signal:{label:"Signal",group:"social",defaultTitle:"Signal",defaultData:{handle:""},icon:Se.signal,Editor:at("handle","https://signal.me/#p/your-link","Invite URL","url",Na),Preview:Et},reddit:{label:"Reddit",group:"social",defaultTitle:"Reddit",defaultData:{handle:""},icon:Se.reddit,Editor:at("handle","yourhandle","Handle","text",Jt("Reddit")),Preview:Et},vimeo:{label:"Vimeo",group:"social",defaultTitle:"Vimeo",defaultData:{handle:""},icon:Se.vimeo,Editor:at("handle","yourhandle","Handle","text",Jt("Vimeo")),Preview:Et},behance:{label:"Behance",group:"social",defaultTitle:"Behance",defaultData:{handle:""},icon:Se.behance,Editor:at("handle","yourhandle","Handle","text",Jt("Behance")),Preview:Et},tripadvisor:{label:"TripAdvisor",group:"social",defaultTitle:"TripAdvisor",defaultData:{handle:""},icon:Se.tripadvisor,Editor:at("handle","https://www.tripadvisor.com/your-page","Profile URL","url",Na),Preview:Et},dribbble:{label:"Dribbble",group:"social",defaultTitle:"Dribbble",defaultData:{handle:""},icon:Se.dribbble,Editor:at("handle","yourhandle","Handle","text",Jt("Dribbble")),Preview:Et},soundcloud:{label:"SoundCloud",group:"social",defaultTitle:"SoundCloud",defaultData:{handle:""},icon:Se.soundcloud,Editor:at("handle","yourhandle","Handle","text",Jt("SoundCloud")),Preview:Et},address:{label:"Address",group:"location",defaultTitle:"Address",defaultData:{query:""},icon:Se.pin,Editor:n4,Preview:r4},hours:{label:"Hours",group:"location",defaultTitle:"Hours",defaultData:{days:Cm()},icon:Se.clock,Editor:J5,Preview:W5},video:{label:"Video",group:"media",defaultTitle:"Video",defaultData:{url:""},icon:Se.video,Editor:at("url","https://youtube.com/watch?v=â¦","YouTube / Vimeo URL","url",P5),Preview:i4},gallery:{label:"Photo Gallery",group:"media",defaultTitle:"Photo Gallery",defaultData:{url:""},icon:Se.gallery,Editor:at("url","https://â¦","Gallery URL","url",Na),Preview:o4},customLink:{label:"Custom Link",group:"media",defaultTitle:"Link",defaultData:{url:""},icon:Se.link,Editor:at("url","https://â¦","URL","url",Na),Preview:({block:l})=>t.jsx(Tn,{label:l.title||"Link",value:l.data.url||"https://â¦",href:l.data.url||void 0,icon:Se.link})},pdf:{label:"PDF",group:"media",defaultTitle:"PDF",defaultData:{url:""},icon:Se.pdf,Editor:at("url","https://â¦/file.pdf","PDF URL","url",F5),Preview:c4}},f4=[{id:"identity",label:"Identity"},{id:"contact",label:"Contact"},{id:"actions",label:"Actions"},{id:"social",label:"Social"},{id:"location",label:"Location & Hours"},{id:"media",label:"Media"}],px=(l,r)=>{const i=Qt[l];return{type:l,title:i.defaultTitle,sortOrder:r,data:structuredClone(i.defaultData)}},xx=(l,r)=>{const i=Qt[l.type].Editor;return t.jsx(i,{block:l,onChange:r})},Jo=l=>(l||"").replace(/^@+/,"").trim(),gx=l=>{const[r,i="00"]=(l||"").split(":"),o=Number(r);
498if(Number.isNaN(o))return l;const c=o<12?"AM":"PM";return`${o%12===0?12:o%12}:${i.padStart(2,"0")} ${c}`},Em=(l,r)=>{const i=Jo(r);if(!i)return"";switch(l){case"instagram":return`https://instagram.com/${i}`;case"facebook":return`https://facebook.com/${i}`;case"linkedin":return/^https?:\/\//i.test(i)?i:/linkedin\.com/i.test(i)?`https://${i}`:`https://linkedin.com/in/${i}`;case"twitter":return`https://x.com/${i}`;case"youtube":return`https://youtube.com/@${i}`;case"soundcloud":return`https://soundcloud.com/${i}`;case"pinterest":return`https://pinterest.com/${i}`;case"behance":return`https://behance.net/${i}`;case"dribbble":return`https://dribbble.com/${i}`;case"tiktok":return`https://tiktok.com/@${i}`;case"twitch":return`https://twitch.tv/${i}`;case"telegram":return`https://t.me/${i}`;case"whatsapp":return`https://wa.me/${i.replace(/[^\d]/g,"")}`;case"threads":return`https://threads.net/@${i}`;case"messenger":return`https://m.me/${i}`;case"snapchat":return`https://snapchat.com/add/${i}`;case"reddit":return`https://reddit.com/user/${i}`;case"vimeo":return`https://vimeo.com/${i}`;case"yelp":case"google":case"discord":case"signal":case"tripadvisor":return/^https?:\/\//i.test(i)?i:`https://${i}`;default:return""}},h4=l=>{if(!l)return"";const r=l.match(/(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{11})/);if(r)return`https://www.youtube.com/embed/${r[1]}`;const i=l.match(/vimeo\.com\/(?:video\/)?(\d+)/);return i?`https://player.vimeo.com/video/${i[1]}`:""},es=l=>(l||"").replace(/[\\;,]/g,r=>`\\${r}`).replace(/\n/g,"\\n"),p4=l=>{var y,v,E,R,N,k,w,A,O,z,H,se,Z,T,P;const r=q=>l.find(Q=>Q.type===q),i=((v=(y=r("name"))==null?void 0:y.data)==null?void 0:v.value)??"",o=((R=(E=r("jobTitle"))==null?void 0:E.data)==null?void 0:R.value)??"",c=((k=(N=r("company"))==null?void 0:N.data)==null?void 0:k.value)??"",m=((A=(w=r("call"))==null?void 0:w.data)==null?void 0:A.phone)??"",f=((z=(O=r("email"))==null?void 0:O.data)==null?void 0:z.email)??"",h=((se=(H=r("website"))==null?void 0:H.data)==null?void 0:se.url)??"",p=((T=(Z=r("address"))==null?void 0:Z.data)==null?void 0:T.query)??"",g=["BEGIN:VCARD","VERSION:3.0"];if(i){g.push(`FN:${es(i)}`);const q=i.split(/\s+/),Q=q.length>1?q.pop():"";g.push(`N:${es(Q||"")};${es(q.join(" "))};;;`)}o&&g.push(`TITLE:${es(o)}`),c&&g.push(`ORG:${es(c)}`),m&&g.push(`TEL;TYPE=CELL:${es(m)}`),f&&g.push(`EMAIL:${es(f)}`),h&&g.push(`URL:${es(h)}`),p&&g.push(`ADR:;;${es(p)};;;;`);for(const q of l)if(Bo(q.type)){const Q=Jo(((P=q.data)==null?void 0:P.handle)??""),F=Em(q.type,Q),$=Q.replace(/^https?:\/\//i,"").replace(/\/+$/,"").split("/").pop()||Q;F&&g.push(`X-SOCIALPROFILE;TYPE=${q.type};x-user=${$}:${es(F)}`)}return g.push("END:VCARD"),g.join(`\r 499`)},x4=l=>{var f;const r=new Blob([p4(l)],{type:"text/vcard;charset=utf-8"}),i=URL.createObjectURL(r),o=document.createElement("a");o.href=i;const c=l.find(h=>h.type==="name"),m=((f=c==null?void 0:c.data)==null?void 0:f.value)||"contact";o.download=`${String(m).replace(/\s+/g,"_")}.vcf`,o.click(),setTimeout(()=>URL.revokeObjectURL(i),1e3)},pt="w-5 h-5",ct={phone:t.jsx("svg",{className:pt,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.95.68l1.5 4.49a1 1 0 01-.5 1.21l-2.26 1.13a11 11 0 005.52 5.52l1.13-2.26a1 1 0 011.21-.5l4.49 1.5a1 1 0 01.68.95V19a2 2 0 01-2 2h-1C9.72 21 3 14.28 3 6V5z"})}),email:t.jsx("svg",{className:pt,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),globe:t.jsxs("svg",{className:pt,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:[t.jsx("circle",{cx:"12",cy:"12",r:"9"}),t.jsx("path",{strokeLinecap:"round",d:"M3 12h18M12 3a14 14 0 010 18M12 3a14 14 0 000 18"})]}),instagram:t.jsx("img",{src:"/logos/Instagram.svg",alt:"",className:pt}),facebook:t.jsx("img",{src:"/logos/Facebook.svg",alt:"",className:pt}),linkedin:t.jsx("img",{src:"/logos/Linkedin.svg",alt:"",className:pt}),twitter:t.jsx("img",{src:"/logos/X.svg",alt:"",className:pt}),youtube:t.jsx("img",{src:"/logos/Youtube.svg",alt:"",className:pt}),soundcloud:t.jsx("svg",{className:pt,fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M23.999 14.165c-.052 1.796-1.612 3.169-3.409 3.169h-8.07c-.18-.02-.317-.169-.317-.353V6.456c0-.2.135-.298.317-.353 1.027-.346 2.137-.519 3.319-.519 4.291 0 7.704 3.342 7.704 7.586 0 .337-.018.67-.054 1zm-12.7 3.166h-.452c-.18 0-.317-.146-.317-.328V7.114c0-.
49918.137-.328.317-.328h.452c.18 0 .317.146.317.328v9.889c0 .18-.137.327-.317.327zm-2.207 0h-.452c-.18 0-.317-.146-.317-.328V8.151c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v8.852c0 .18-.137.327-.317.327zm-2.207 0H6.43c-.18 0-.317-.146-.317-.328V9.16c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v7.843c0 .18-.137.327-.317.327zm-2.207 0h-.452c-.18 0-.317-.146-.317-.328v-6.39c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v6.39c0 .18-.137.327-.317.327zm-2.208 0h-.452c-.18 0-.317-.146-.317-.328v-5.31c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v5.31c0 .18-.137.327-.317.327zM0 13.987c0-.18.146-.327.327-.327h.452c.18 0 .317.146.317.327v2.554c0 .181-.137.328-.317.328H.327c-.18 0-.327-.146-.327-.328v-2.554z"})}),pinterest:t.jsx("img",{src:"/logos/Pinterest.svg",alt:"",className:pt}),behance:t.jsx("svg",{className:pt,fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"})}),dribbble:t.jsx("svg",{className:pt,fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm9.885 11.441c-2.575-.422-4.943-.445-7.103-.073-.244-.563-.497-1.125-.767-1.68 2.31-1 4.165-2.358 5.548-4.082 1.35 1.594 2.197 3.619 2.322 5.835zm-3.842-7.282c-1.205 1.554-2.868 2.783-4.986 3.68-1.016-1.861-2.178-3.676-3.488-5.438.779-.197 1.591-.314 2.431-.314 2.275 0 4.368.779 6.043 2.072zM7.072 1.985c1.341 1.728 2.521 3.523 3.554 5.381-2.674.71-5.713 1.073-9.099 1.084.426-2.892 2.262-5.319 4.871-6.465zm-5.221 8.43c.06 0 .12.002.18.002 3.92 0 7.412-.504 10.475-1.529.243.491.476.984.692 1.481-3.51 1.063-6.498 3.16-8.97 6.290-1.522-1.567-2.502-3.654-2.679-5.96zm3.681 7.342c2.292-2.957 5.041-4.864 8.31-5.745.916 2.379 1.585 4.811 2.001 7.293-3.483 1.673-7.55 1.106-10.311-1.548zm12.027.561c-.39-2.301-1.011-4.564-1.85-6.789 1.956-.312 4.012-.232 6.158.232-.401 2.682-1.91 5.022-4.308 6.557z"})}),tiktok:t.jsx("img",{src:"/logos/Tiktok.svg",alt:"",className:pt}),yelp:t.jsx("img",{src:"/logos/Ylep.svg",alt:"",className:pt}),google:t.jsx("img",{src:"/logos/Google.svg",alt:"",className:pt}),twitch:t.jsx("img",{src:"/logos/Twitch.svg",alt:"",className:pt}),discord:t.jsx("img",{src:"/logos/Discord.svg",alt:"",className:pt}),telegram:t.jsx("img",{src:"/logos/Telegram.svg",alt:"",className:pt}),whatsapp:t.jsx("img",{src:"/logos/Whatsapp.svg",alt:"",className:pt}),threads:t.jsx("img",{src:"/logos/Threads.svg",alt:"",className:pt}),messenger:t.jsx("img",{src:"/logos/Messenger.svg",alt:"",className:pt}),snapchat:t.jsx("img",{src:"/logos/Snapchat.svg",alt:"",className:pt}),signal:t.jsx("img",{src:"/logos/Signal.svg",alt:"",className:pt}),reddit:t.jsx("img",{src:"/logos/Reddit.svg",alt:"",className:pt}),vimeo:t.jsx("img",{src:"/logos/Vimeo.svg",alt:"",className:pt}),tripadvisor:t.jsx("img",{src:"/logos/Tripadvisor.svg",alt:"",className:pt}),link:t.jsx("svg",{className:pt,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),gallery:t.jsx("svg",{className:pt,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})},x1=l=>{switch(l){case"instagram":return ct.instagram;case"facebook":return ct.facebook;case"linkedin":return ct.linkedin;case"twitter":return ct.twitter;case"youtube":return ct.youtube;case"soundcloud":return ct.soundcloud;case"pinterest":return ct.pinterest;case"behance":return ct.behance;case"dribbble":return ct.dribbble;case"tiktok":return ct.tiktok;case"yelp":return ct.yelp;case"google":return ct.google;case"twitch":return ct.twitch;case"discord":return ct.discord;case"telegram":return ct.telegram;case"whatsapp":return ct.whatsapp;case"threads":return ct.threads;case"messenger":return ct.messenger;case"snapchat":return ct.snapchat;case"signal":return ct.signal;case"reddit":return ct.reddit;case"vimeo":return ct.vimeo;case"tripadvisor":return ct.tripadvisor;default:return ct.link}},g4=["instagram","facebook","linkedin","twitter","youtube","soundcloud","pinterest","behance","dribbble","tiktok","yelp","google","twitch","discord","telegram","whatsapp","threads","messenger","snapchat","signal","reddit","vimeo","tripadvisor"],Bo=l=>g4.includes(l),b4=["linkedin","yelp","google","discord","signal","tripadvisor"],y4=(l,r)=>r?b4.includes(l)?r.replace(/^https?:\/\//i,"").replace(/\/+$/,""):l==="whatsapp"?r:`@${r}`:"",v4=({blocks:l})=>{const r=l.map(i=>{var o;return{b:i,handle:Jo(((o=i.data)==null?void 0:o.handle)||"")}}).filter(i=>i.handle);return r.length?t.jsx("div",{className:"flex flex-wrap items-center justify-center gap-3 py-1",children:r.map(({b:i,handle:o})=>t.jsx("a",{href:Em(i.type,o),target:"_blank",rel:"noopener noreferrer","aria-label":i.title||i.type,title:i.title||i.type,className:"w-11 h-11 rounded-full bg-primary/10 text-primary flex items-center justify-center hover:bg-primary/20 transition-all",children:x1(i.type)},i._id||`${i.type}-${i.sortOrder}`))}):null},jn=({label:l,value:r,href:i,icon:o})=>{const c=t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 text-primary flex items-center justify-center shrink-0",children:o}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l}),t.jsx("p",{className:"text-sm font-semibold text-slate-800 truncate",children:r})]})]});return i?t.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3.5 p-4 rounded-2xl border border-slate-100 hover:border-primary/30 hover:bg-primary/5 transition-all",children:c}):t.jsx("div",{className:"flex items-center gap-3.5 p-4 rounded-2xl border border-slate-100",children:c})},bx=(l,r)=>{const i=l._id||`${l.type}-${l.sortOrder}`,o=l.type,c=l.data||{};if(o==="name")return t.jsx("h2",{className:"text-xl font-bold text-slate-900 text-center",children:c.value||"Your Name"},i);if(o==="jobTitle")return t.jsx("p",{className:"text-sm text-slate-500 text-center",children:c.value||"Your Title"},i);if(o==="company")return t.jsx("p",{className:"text-sm text-slate-500 text-center font-medium",children:c.value||"Your Company"},i);if(o==="call")return t.jsx(jn,{label:l.title||"Call",value:c.phone||"",href:c.phone?`tel:${c.phone}`:void 0,icon:ct.phone},i);if(o==="email")return t.jsx(jn,{label:l.title||"Email",value:c.email||"",href:c.email?`mailto:${c.email}`:void 0,icon:ct.email},i);if(o==="website")return t.jsx(jn,{label:l.title||"Website",value:c.url||"",href:c.url||void 0,icon:ct.globe},i);if(o==="customLink")return t.jsx(jn,{label:l.title||"Link",value:c.url||"",href:c.url||void 0,icon:ct.link},i);if(o==="about")return t.jsxs("div",{className:"px-1 space-y-2",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l.title||"About"}),c.heading&&t.jsx("h4",{className:"text-base font-bold text-slate-900",children:c.heading}),(c.name||c.role)&&t.jsxs("p",{className:"text-sm text-slate-500 font-medium",children:[c.name,c.name&&c.role?" · ":"",c.role]}
499),c.text&&t.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:c.text})]},i);if(o==="addToContact")return null;if(o==="scheduleMeeting")return t.jsx("a",{href:c.url||"#",target:"_blank",rel:"noopener noreferrer",className:`block w-full py-3 text-center font-bold rounded-xl text-sm transition-all active:scale-95 ${c.url?"bg-white text-primary border-2 border-primary hover:bg-primary/5":"bg-slate-100 text-slate-400 pointer-events-none"}`,children:l.title||"Schedule Meeting"},i);if(Bo(o)){const m=Jo(c.handle||""),f=y4(o,m);return t.jsx(jn,{label:l.title||o,value:f,href:m?Em(o,m):void 0,icon:x1(o)},i)}if(o==="address"){if(!c.query)return null;const m=`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(c.query)}`;return t.jsxs("div",{className:"space-y-2 px-1",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l.title||"Address"}),t.jsx("p",{className:"text-sm text-slate-700 font-medium",children:c.query}),t.jsx("iframe",{title:`map-${c.query}`,src:`https://www.google.com/maps?q=${encodeURIComponent(c.query)}&output=embed`,className:"w-full h-40 rounded-xl border border-slate-200",loading:"lazy"}),t.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-bold text-primary hover:underline inline-block",children:"Get Directions â"})]},i)}if(o==="hours"){const m=Array.isArray(c.days)?c.days:[];return m.length?t.jsxs("div",{className:"space-y-2 px-1",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l.title||"Hours"}),t.jsx("div",{className:"space-y-1",children:m.map(f=>t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"font-semibold text-slate-700",children:f.day}),t.jsx("span",{className:"text-slate-500",children:f.closed?"Closed":`${gx(f.open)} â ${gx(f.close)}`})]},f.day))})]},i):null}if(o==="video"){const m=h4(c.url||"");return m?t.jsxs("div",{className:"space-y-2 px-1",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l.title||"Video"}),t.jsx("iframe",{title:`video-${m}`,src:m,className:"w-full aspect-video rounded-xl border border-slate-200",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})]},i):null}return o==="gallery"?t.jsx(jn,{label:l.title||"Photo Gallery",value:c.url||"",href:c.url||void 0,icon:ct.gallery},i):o==="pdf"&&c.url?t.jsxs("div",{className:"space-y-2 px-1",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l.title||"PDF"}),t.jsx("iframe",{title:`pdf-${c.url}`,src:c.url,className:"w-full h-72 rounded-xl border border-slate-200"}),t.jsx("a",{href:c.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-bold text-primary hover:underline inline-block",children:"Open in new tab â"})]},i):null},j4=({profile:l,className:r})=>{const i=l.companyLogoUrl||"";if(!i)return null;const o=l.companyLogoBgColor||"";return t.jsx("div",{className:`flex items-center justify-center px-8 py-14 ${r||""}`,style:o?{backgroundColor:o}:void 0,children:t.jsx("img",{src:i,alt:"",className:"max-h-20 max-w-[70%] object-contain"})})},N4=({profile:l})=>{var f,h;const r=(l.blocks||[]).slice().sort((p,g)=>p.sortOrder-g.sortOrder);if(!r.length)return t.jsx("div",{className:"text-center py-4",children:t.jsx("p",{className:"text-sm text-slate-400",children:"This business card hasn't been set up yet."})});const i=r.find(p=>p.type==="name"),o=r.find(p=>p.type==="about"),c=l.profilePictureUrl||((f=o==null?void 0:o.data)==null?void 0:f.logoUrl)||"",m=(((h=i==null?void 0:i.data)==null?void 0:h.value)||"?").toString().charAt(0).toUpperCase();return t.jsxs("div",{className:"space-y-3",children:[t.jsx("div",{className:"text-center mb-4",children:c?t.jsx("img",{src:c,alt:"",className:"w-20 h-20 rounded-full mx-auto mb-4 object-cover shadow-lg shadow-primary/20 bg-white"}):t.jsx("div",{className:"w-20 h-20 bg-linear-to-br from-primary to-primary/70 rounded-full mx-auto mb-4 flex items-center justify-center text-white text-2xl font-bold shadow-lg shadow-primary/20",children:m})}),(()=>{if(l.socialLayout!=="icons")return r.map(g=>bx(g));let p=!1;return r.map(g=>Bo(g.type)?p?null:(p=!0,t.jsx(v4,{blocks:r.filter(y=>Bo(y.type))},"social-icons")):bx(g))})()]})},w4=l=>new Promise(r=>{try{const i=URL.createObjectURL(l),o=new Image;o.onload=()=>{try{const m=Math.max(1,Math.round(o.height/o.width*64)||64),f=document.createElement("canvas");f.width=64,f.height=m;const h=f.getContext("2d");
499if(!h)return r("");h.drawImage(o,0,0,64,m);const{data:p}=h.getImageData(0,0,64,m);let g=0,y=0;for(let v=0;v<p.length;v+=4){const E=p[v+3]/255;if(E<.1)continue;const R=.2126*p[v]+.7152*p[v+1]+.0722*p[v+2];g+=R*E,y+=E}r(y<1?"":g/y>140?"#070909":"#ffffff")}catch{r("")}finally{URL.revokeObjectURL(i)}},o.onerror=()=>{URL.revokeObjectURL(i),r("")},o.src=i}catch{r("")}}),k4=()=>{const{id:l,categoryId:r}=qa(),i=Ya(),{customerProfile:o,setCustomerProfile:c}=$n(),[m,f]=b.useState("edit"),[h,p]=b.useState(!1),[g,y]=b.useState(null),[v,E]=b.useState("idle"),R=o==null?void 0:o.purchasedProducts.find(we=>we._id===r),N=R==null?void 0:R.businessCardProfile,[k,w]=b.useState([]),[A,O]=b.useState(""),[z,H]=b.useState(""),[se,Z]=b.useState(""),[T,P]=b.useState(!1),[q,Q]=b.useState("list"),[F,$]=b.useState(!1),[G,te]=b.useState(null),ye=b.useRef(null),[U,ce]=b.useState(!1),[C,le]=b.useState(null),de=b.useRef(null),S=b.useRef(!1),B=b.useRef(null),J=b.useRef('{"profilePictureUrl":"","companyLogoUrl":"","companyLogoBgColor":"","leadCaptureEnabled":false,"socialLayout":"list","blocks":[]}'),oe=b.useRef(k),ve=b.useRef(A),Ce=b.useRef(z),Ne=b.useRef(se),ne=b.useRef(T),ge=b.useRef(q);b.useEffect(()=>{oe.current=k},[k]),b.useEffect(()=>{ve.current=A},[A]),b.useEffect(()=>{Ce.current=z},[z]),b.useEffect(()=>{Ne.current=se},[se]),b.useEffect(()=>{ne.current=T},[T]),b.useEffect(()=>{ge.current=q},[q]),b.useEffect(()=>{var wt,L,ue;if(S.current||!N)return;S.current=!0;const we=(wt=N.blocks)!=null&&wt.length?[...N.blocks].sort((pe,Re)=>pe.sortOrder-Re.sortOrder).map((pe,Re)=>({...pe,sortOrder:Re})):[],ke=((ue=(L=we.find(pe=>pe.type==="about"))==null?void 0:L.data)==null?void 0:ue.logoUrl)||"",Be=N.profilePictureUrl||ke||"",Oe=N.companyLogoUrl||"",Je=N.companyLogoBgColor||"",Ct=!!N.leadCaptureEnabled,Nt=N.socialLayout==="icons"?"icons":"list";w(we),O(Be),H(Oe),Z(Je),P(Ct),Q(Nt),J.current=JSON.stringify({profilePictureUrl:Be,companyLogoUrl:Oe,companyLogoBgColor:Je,leadCaptureEnabled:Ct,socialLayout:Nt,blocks:we})},[N]);const ze=(we,ke)=>{w(Be=>Be.map((Oe,Je)=>Je===we?{...Oe,...ke}:Oe))},K=we=>{w(ke=>ke.filter((Be,Oe)=>Oe!==we).map((Be,Oe)=>({...Be,sortOrder:Oe})))},fe=we=>{w(ke=>(ke.some(Je=>Je.type===we)?ke.filter(Je=>Je.type!==we):[...ke,px(we,ke.length)]).map((Je,Ct)=>({...Je,sortOrder:Ct})))},xe=b.useMemo(()=>new Set(k.map(we=>we.type)),[k]),me=()=>{w(we=>{const ke=new Set(we.map(Oe=>Oe.type));return Object.keys(Qt).filter(Oe=>!ke.has(Oe)).reduce((Oe,Je)=>[...Oe,px(Je,Oe.length)],we)})},Te=b.useCallback(async()=>{if(!r)return;const we=oe.current.map((wt,L)=>({...wt,sortOrder:L})),ke=ve.current,Be=Ce.current,Oe=Ne.current,Je=ne.current,Ct=ge.current,Nt=JSON.stringify({profilePictureUrl:ke,companyLogoUrl:Be,companyLogoBgColor:Oe,leadCaptureEnabled:Je,socialLayout:Ct,blocks:we});if(Nt!==J.current){E("saving");try{const wt=await Cs.updateMe({purchasedProducts:[{_id:r,businessCardProfile:{profilePictureUrl:ke,companyLogoUrl:Be,companyLogoBgColor:Oe,leadCaptureEnabled:Je,socialLayout:Ct,blocks:we}}]});wt.success?(c(wt.data),J.current=Nt,E("saved")):E("error")}catch(wt){console.error("Error saving business card profile:",wt),E("error")}}},[r,c]);b.useEffect(()=>{if(!(!S.current||JSON.stringify({profilePictureUrl:A,companyLogoUrl:z,companyLogoBgColor:se,leadCaptureEnabled:T,socialLayout:q,blocks:k.map((ke,Be)=>({...ke,sortOrder:Be}))})===J.current))return B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{B.current=null,Te()},800),()=>{B.current&&(clearTimeout(B.current),B.current=null)}},[k,A,z,se,T,q,Te]),b.useEffect(()=>{if(v!=="saved")return;const we=setTimeout(()=>E("idle"),2e3);return()=>clearTimeout(we)},[v]);const Ue=async we=>{var Be;const ke=(Be=we.target.files)==null?void 0:Be[0];if(we.target.value="",!!ke){te(null),$(!0);try{const Oe=await tl(ke,"customers/profile-pictures");O(Oe)}catch(Oe){te(Oe instanceof Error?Oe.message:"Failed to upload picture.")}finally{$(!1)}}},Le=async we=>{var Oe;const ke=(Oe=we.target.files)==null?void 0:Oe[0];if(we.target.value="",!ke)return;le(null),ce(!0);const Be=await w4(ke);try{const Je=await tl(ke,"customers/brand-logos");H(Je),Be&&Z(Be)}catch(Je){le(Je instanceof Error?Je.message:"Failed to upload logo.")}finally{ce(!1)}},rt=async()=>{B.current&&(clearTimeout(B.current),B.current=null),await Te(),i(`/customers/${l}/products/${r}`)},st=we=>y(we),lt=(we,ke)=>{we.preventDefault(),!(g===null||g===ke)&&(w(Be=>{const Oe=[...Be],[Je]=Oe.splice(g,1);return Oe.splice(ke,0,Je),Oe}),y(ke))},aa=()=>y(null),As=b.useMemo(()=>f4.map(we=>({...we,types:Object.keys(Qt).filter(ke=>Qt[ke].group===we.id)}
499)),[]);return t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-4 mb-10",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[12px] font-bold text-slate-400",children:"Edit your profile"}),t.jsx("h2",{className:"text-[32px] font-bold text-[#281E49]",children:"Business Card"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[v!=="idle"&&t.jsxs("div",{className:`flex items-center gap-2 text-[13px] font-semibold px-4 py-2.5 rounded-xl ${v==="saving"?"text-slate-500 bg-slate-100":v==="saved"?"text-emerald-600 bg-emerald-50":"text-red-600 bg-red-50"}`,"aria-live":"polite",children:[v==="saving"&&t.jsxs(t.Fragment,{children:[t.jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[t.jsx("circle",{cx:"12",cy:"12",r:"9",strokeWidth:"3",strokeOpacity:"0.25"}),t.jsx("path",{strokeLinecap:"round",strokeWidth:"3",d:"M21 12a9 9 0 0 0-9-9"})]}),t.jsx("span",{children:"Savingâ¦"})]}),v==="saved"&&t.jsxs(t.Fragment,{children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M5 13l4 4L19 7"})}),t.jsx("span",{children:"Saved"})]}),v==="error"&&t.jsxs(t.Fragment,{children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"})}),t.jsx("span",{children:"Save failed â retrying on next change"})]})]}),t.jsx("button",{onClick:rt,className:"px-10 py-3 bg-[#553C9A] text-white font-bold rounded-xl hover:bg-purple-700 transition-all shadow-lg active:scale-95 text-sm",children:"Done"})]})]}),t.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-10 flex-1",children:[t.jsxs("div",{className:"space-y-8 max-w-xl",children:[t.jsxs("div",{className:"space-y-3 border border-slate-100 rounded-2xl p-5 bg-white shadow-sm",children:[t.jsx("span",{className:"text-[12px] font-bold uppercase tracking-wider text-slate-400",children:"Profile Picture"}),t.jsxs("div",{className:"flex items-center gap-4",children:[A?t.jsx("img",{src:A,alt:"",className:"w-20 h-20 rounded-full object-cover bg-slate-50 border border-slate-100"}):t.jsx("div",{className:"w-20 h-20 rounded-full bg-slate-100 flex items-center justify-center text-slate-300",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"1.5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}),t.jsxs("div",{className:"flex-1 space-y-2",children:[t.jsx("input",{type:"file",ref:ye,onChange:Ue,accept:"image/*",className:"hidden"}),t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsxs("button",{type:"button",onClick:()=>{var we;return(we=ye.current)==null?void 0:we.click()},disabled:F,className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl border border-slate-200 bg-white text-[13px] font-bold text-slate-700 hover:bg-slate-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"17 8 12 3 7 8"}),t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),F?"Uploadingâ¦":A?"Replace Image":"Upload Image"]}),A&&!F&&t.jsx("button",{type:"button",onClick:()=>O(""),className:"text-[13px] font-bold text-slate-400 hover:text-red-500 transition-colors",children:"Clear"})]}),G&&t.jsx("p",{className:"text-[12px] text-red-500 font-medium",children:G})]})]})]}),t.jsxs("div",{className:"space-y-3 border border-slate-100 rounded-2xl p-5 bg-white shadow-sm",children:[t.jsx("span",{className:"text-[12px] font-bold uppercase tracking-wider text-slate-400",children:"Company Logo"}),t.jsxs("div",{className:"flex items-center gap-4",children:[z?t.jsx("img",{src:z,alt:"",className:"w-20 h-20 rounded-2xl object-contain border border-slate-100 p-2",style:{backgroundColor:se||"#f8fafc"}}):t.jsx("div",{className:"w-20 h-20 rounded-2xl bg-slate-100 flex items-center justify-center text-slate-300",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"1.5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})})}),t.jsxs("div",{className:"flex-1 space-y-2",children:[t.jsx("input",{type:"file",ref:de,onChange:Le,accept:"image/*",className:"hidden"}),t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsxs("button",{type:"button",onClick:()=>{var we;return(we=de.current)==null?void 0:we.click()},disabled:U,className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl border border-slate-200 bg-white text-[13px] font-bold text-slate-700 hover:bg-slate-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"17 8 12 3 7 8"}),t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),U?"Uploadingâ¦":z?"Replace Logo":"Upload Logo"]}),z&&!U&&t.jsx("button",{type:"button",onClick:()=>H(""),className:"text-[13px] font-bold text-slate-400 hover:text-red-500 transition-colors",children:"Clear"})]}),C&&t.jsx("p",{className:"text-[12px] text-red-500 font-medium",children:C})]})]}),z&&t.jsxs("div",{className:"flex items-center gap-3 flex-wrap pt-1",children:[t.jsxs("label",{className:"relative w-10 h-10 rounded-xl border border-slate-200 overflow-hidden shrink-0 cursor-pointer",children:[t.jsx("span",{className:"absolute inset-0",style:se?{backgroundColor:se}:{backgroundColor:"#ffffff",backgroundImage:"linear-gradient(45deg,#e2e8f0 25%,transparent 25%,transparent 75%,#e2e8f0 75%),linear-gradient(45deg,#e2e8f0 25%,transparent 25%,transparent 75%,#e2e8f0 75%)",backgroundSize:"10px 10px",backgroundPosition:"0 0,5px 5px"}}),t.jsx("input",{type:"color",value:se||"#070909",onChange:we=>Z(we.target.value),className:"absolute inset-0 opacity-0 cursor-pointer","aria-label":"Logo header background color"})]}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-[13px] font-bold text-slate-700",children:"Header background"}),t.jsx("p",{className:"text-[11px] text-slate-400 leading-snug",children:"Auto-picked to keep your logo visible. Tap the swatch to change it."})]}),se&&t.jsx("button",{type:"button",onClick:()=>Z(""),className:"text-[13px] font-bold text-slate-400 hover:text-red-500 transition-colors shrink-0",children:"No background"})]})]}),t.jsxs("div",{className:"space-y-3 border border-slate-100 rounded-2xl p-5 bg-white shadow-sm",children:[t.jsx("span",{className:"text-[12px] font-bold uppercase tracking-wider text-slate-400",children:"Connection Capture"}),t.jsxs("div",{className:"flex items-start gap-4",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-[14px] font-bold text-slate-800",children:"Let visitors share their info back"}),t.jsx("p",{className:"text-[12px] text-slate-500 mt-1 leading-relaxed",children:`Shows a "Share Your Info" button on your public card. People who tap it can leave their contact details and you'll see them in your Connections tab, tagged with the city they shared from.`})]}),t.jsx("button",{type:"button",role:"switch","aria-checked":T,"aria-label":"Toggle connection capture",onClick:()=>P(we=>!we),className:`relative shrink-0 w-12 h-7 rounded-full transition-colors duration-200 ${T?"bg-sleek-purple":"bg-slate-200"}`,children:t.jsx("span",{className:`absolute top-0.5 left-0.5 w-6 h-6 rounded-full bg-white shadow-sm transition-transform duration-200 ${T?"translate-x-5":"translate-x-0"}`})})]})]}),t.jsxs("div",{className:"inline-flex p-1.5 bg-[#EDEEF9] rounded-xl w-full",children:[t.jsx("button",{onClick:()=>{f("edit"),p(!1)},className:`flex-1 py-2.5 px-6 rounded-lg font-bold text-[14px] transition-all ${m==="edit"?"bg-white text-slate-900 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"Edit"}),t.jsx("button",{onClick:()=>f("arrange"),className:`flex-1 py-2.5 px-6 rounded-lg font-bold text-[14px] transition-all ${m==="arrange"?"bg-white text-slate-900 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"Arrange"})]}),m==="edit"?t.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-left-4 duration-300",children:[k.length===0&&t.jsx("div",{className:"text-center py-10 border border-dashed border-slate-200 rounded-2xl",children:t.jsxs("p",{className:"text-[13px] text-slate-400 font-medium",children:["No blocks yet. Switch to ",t.jsx("span",{className:"font-bold",children:"Arrange"})," and add some."]})}),(()=>{const we=[];let ke=!1;
499return k.forEach((Be,Oe)=>{if(Qt[Be.type].group==="social"){if(ke)return;ke=!0;const Ct=k.map((Nt,wt)=>({b:Nt,idx:wt})).filter(({b:Nt})=>Qt[Nt.type].group==="social");we.push(t.jsxs("div",{className:"space-y-4 border border-slate-100 rounded-2xl p-5 bg-white shadow-sm",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{className:"text-[12px] font-bold uppercase tracking-wider text-slate-400",children:"Social Links"}),t.jsxs("div",{className:"inline-flex p-1 bg-[#EDEEF9] rounded-lg shrink-0",children:[t.jsx("button",{type:"button",onClick:()=>Q("list"),"aria-pressed":q==="list",className:`px-3 py-1.5 rounded-md text-[11px] font-bold transition-all ${q==="list"?"bg-white text-slate-900 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"List"}),t.jsx("button",{type:"button",onClick:()=>Q("icons"),"aria-pressed":q==="icons",className:`px-3 py-1.5 rounded-md text-[11px] font-bold transition-all ${q==="icons"?"bg-white text-slate-900 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"Icons"})]})]}),t.jsx("p",{className:"text-[11px] text-slate-400 leading-relaxed",children:"Choose how social links show on your card: labelled rows, or a compact row of icons only."}),t.jsx("div",{className:"space-y-6",children:Ct.map(({b:Nt,idx:wt},L)=>t.jsxs("div",{className:`space-y-3 ${L>0?"pt-6 border-t border-slate-100":""}`,children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#EDEEF9] text-sleek-purple flex items-center justify-center",children:Qt[Nt.type].icon}),t.jsx("span",{className:"text-[12px] font-bold uppercase tracking-wider text-slate-400",children:Qt[Nt.type].label})]}),t.jsx("button",{onClick:()=>K(wt),className:"text-[12px] font-bold text-slate-400 hover:text-red-500 transition-colors",children:"Remove"})]}),xx(Nt,ue=>ze(wt,ue))]},Nt._id||`${Nt.type}-${wt}`))})]},"social-group"));return}we.push(t.jsxs("div",{className:"space-y-3 border border-slate-100 rounded-2xl p-5 bg-white shadow-sm",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("div",{className:"w-8 h-8 rounded-lg bg-[#EDEEF9] text-sleek-purple flex items-center justify-center",children:Qt[Be.type].icon}),t.jsx("span",{className:"text-[12px] font-bold uppercase tracking-wider text-slate-400",children:Qt[Be.type].label})]}),t.jsx("button",{onClick:()=>K(Oe),className:"text-[12px] font-bold text-slate-400 hover:text-red-500 transition-colors",children:"Remove"})]}),xx(Be,Ct=>ze(Oe,Ct))]},Be._id||`${Be.type}-${Oe}`))}),we})()]}):h?t.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-left-4 duration-300",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-[18px] font-bold text-[#1A202C]",children:"Add Content Blocks"}),t.jsx("p",{className:"text-[12px] text-slate-400 font-medium",children:"Make your profile shine, just add more."})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[t.jsxs("button",{onClick:me,disabled:xe.size===Object.keys(Qt).length,className:"flex items-center gap-2 px-4 py-2 bg-[#553C9A] text-white rounded-xl hover:bg-purple-700 transition-all text-[13px] font-bold shadow-sm disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-[#553C9A]",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M12 4v16m8-8H4"})}),"Add all"]}),t.jsxs("button",{onClick:()=>p(!1),className:"flex items-center gap-2 px-4 py-2 border border-slate-200 rounded-xl hover:bg-slate-50 transition-all text-[13px] font-bold text-slate-700 shadow-sm",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),"Back"]})]})]}),As.map(we=>t.jsxs("div",{className:"space-y-3",children:[t.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-400",children:we.label}),t.jsx("div",{className:"space-y-2",children:we.types.map(ke=>{const Be=xe.has(ke);return t.jsxs("button",{onClick:()=>fe(ke),"aria-pressed":Be,"aria-label":Be?`Remove ${Qt[ke].label}`:`Add ${Qt[ke].label}`,className:`group w-full flex items-center gap-4 p-3.5 rounded-xl border transition-all text-left ${Be?"bg-emerald-50 border-emerald-200 hover:bg-red-50 hover:border-red-200":"bg-[#F5F5FA] border-slate-100 hover:border-slate-200"}`,children:[t.jsx("div",{className:"w-10 h-10 bg-white rounded-xl flex items-center justify-center text-sleek-purple shadow-sm",children:Qt[ke].icon}),t.jsx("span",{className:`flex-1 font-bold text-[14px] ${Be?"text-slate-500 group-hover:text-red-600":"text-slate-700"}`,children:Qt[ke].label}),Be?t.jsxs(t.Fragment,{children:[t.jsx("svg",{className:"w-5 h-5 text-emerald-500 group-hover:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M5 13l4 4L19 7"})}),t.jsx("svg",{className:"w-5 h-5 text-red-500 hidden group-hover:block",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M6 18L18 6M6 6l12 12"})})]}):t.jsx("span",{className:"text-sleek-purple font-bold text-[14px]",children:"+"})]},ke)})})]},we.id))]}):t.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-left-4 duration-300",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h3",{className:"text-[18px] font-bold text-[#1A202C]",children:"Content Blocks"}),t.jsxs("button",{onClick:()=>p(!0),className:"px-4 py-1.5 bg-white border border-slate-200 text-slate-900 font-bold rounded-lg hover:bg-slate-50 transition-all text-[13px] flex items-center gap-1.5 shadow-sm",children:["Add ",t.jsx("span",{className:"text-[16px] leading-none",children:"+"})]})]}),t.jsx("div",{className:"space-y-3",children:k.map((we,ke)=>t.jsxs("div",{draggable:!0,onDragStart:()=>st(ke),onDragOver:Be=>lt(Be,ke),onDragEnd:aa,className:`flex items-center gap-5 bg-[#F5F5FA] p-4 rounded-xl border border-slate-100 shadow-sm transition-all hover:border-slate-200 group cursor-move ${g===ke?"opacity-40 border-dashed border-sleek-purple scale-[0.98]":""}`,children:[t.jsx("div",{className:"text-slate-300 group-hover:text-slate-400 shrink-0",children:t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:t.jsx("path",{d:"M4 8H20M4 16H20",strokeWidth:"2.5",strokeLinecap:"round"})})}),t.jsx("div",{className:"flex-1 bg-white border border-slate-200 rounded-xl px-5 py-2.5 shadow-sm overflow-hidden",children:t.jsx("input",{type:"text",value:we.title,onChange:Be=>ze(ke,{title:Be.target.value}),className:"w-full bg-transparent text-[#2D3748] font-bold text-[14px] outline-none"})}),t.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-400 shrink-0",children:Qt[we.type].label})]},we._id||`${we.type}-${ke}`))})]})]}),t.jsx("div",{className:"self-start xl:sticky xl:top-0 bg-[#2D2D2D] rounded-[40px] flex items-start justify-center p-8 lg:p-12 shadow-inner overflow-hidden",children:t.jsxs("div",{className:"w-full max-w-90 bg-slate-50 rounded-4xl overflow-hidden shadow-2xl flex flex-col h-fit max-h-[80vh] animate-in fade-in slide-in-from-bottom-4 duration-700",children:[t.jsxs("div",{className:"flex-1 overflow-y-auto overflow-x-hidden pt-6 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[z&&k.length>0&&t.jsx(j4,{profile:{companyLogoUrl:z,companyLogoBgColor:se},className:"-mt-6"}),t.jsx("div",{className:`bg-white shadow-xl shadow-slate-200/60 p-6 border border-slate-100 ${z&&k.length>0?"relative -mt-6 rounded-t-3xl":"mx-4 mb-6 rounded-3xl"}`,children:k.length===0?t.jsx("p",{className:"text-center text-[13px] text-slate-400 py-10",children:"Your card preview will appear here."}):t.jsx(N4,{profile:{profilePictureUrl:A,companyLogoUrl:z,companyLogoBgColor:se,socialLayout:q,blocks:k}})})]}),k.length>0&&(()=>{const we=k.some(ke=>ke.type==="addToContact");return!we&&!T?null:t.jsxs("div",{className:"shrink-0 bg-white border-t border-slate-100 shadow-[0_-4px_16px_
499-8px_rgba(15,23,42,0.12)] px-3 py-3 flex flex-row items-stretch gap-2",children:[we&&t.jsx("button",{type:"button",onClick:()=>x4(k),className:"flex-1 px-3 py-3 bg-primary text-white font-bold rounded-xl hover:bg-primary-hover transition-all active:scale-95 text-sm leading-tight",children:"Add to Contacts"}),T&&t.jsx("button",{type:"button",className:"flex-1 px-3 py-3 bg-white text-primary border-2 border-primary font-bold rounded-xl hover:bg-primary/5 transition-all active:scale-95 text-sm leading-tight",children:"Share Your Info"})]})})()]})})]})]})},yx={small:{padY:9,padX:14,font:13,icon:15,gap:7},medium:{padY:12,padX:18,font:15,icon:17,gap:8},large:{padY:15,padX:24,font:17,icon:20,gap:10}},vx=2,S4=l=>l.variant==="filled"?{background:l.backgroundColor,ink:l.textColor,border:""}:{background:"transparent",ink:l.backgroundColor,border:l.variant==="outline"?l.backgroundColor:""},C4={link:"M10 13a5 5 0 0 0 7.07 0l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.07 0l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",chat:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z",calendar:"M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z",cart:"M9 22a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM20 22a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6",phone:"M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.5 2.8.6a2 2 0 0 1 1.7 2z",mail:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM22 6l-10 7L2 6",star:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14l-5-4.87 6.91-1.01L12 2z",tag:"M20.6 13.4L12 22l-9-9V3h10l7.6 7.6a2 2 0 0 1 0 2.8zM7.5 7.5h.01"},E4=[{key:"none",label:"No icon"},{key:"link",label:"Link"},{key:"chat",label:"Chat"},{key:"calendar",label:"Calendar"},{key:"cart",label:"Cart"},{key:"phone",label:"Phone"},{key:"mail",label:"Mail"},{key:"star",label:"Star"},{key:"tag",label:"Tag"}],T4=[{key:"top-left",label:"Top left"},{key:"top-right",label:"Top right"},{key:"bottom-left",label:"Bottom left"},{key:"bottom-right",label:"Bottom right"}],R4=[{key:"filled",label:"Filled"},{key:"outline",label:"Outline"},{key:"text",label:"Text"}],A4=[{key:"small",label:"Small"},{key:"medium",label:"Medium"},{key:"large",label:"Large"}],_4=[{key:"left",label:"Left"},{key:"center",label:"Center"},{key:"right",label:"Right"}],L4={label:"Get in touch",variant:"filled",backgroundColor:"#5B3DF5",textColor:"#FFFFFF",borderRadius:999,size:"medium",icon:"link",placement:"floating",inlineAlign:"left",position:"bottom-right",offsetX:24,offsetY:24,showOnMobile:!0,openInNewTab:!0},jx=l=>({...L4,...l||{}}),M4="https://sleektap-admin-frontend-skeleton.vercel.app/q",z4=l=>`${M4}/${l}`,U4=(l,r)=>`<script src="${l}/widget/${r}.js" async><\/script>`,D4=l=>`<!-- SleekTap BEGIN --> 500<div data-sleektap-widget="${l}"></div> 501<!-- SleekTap END -->`,Nx=({config:l})=>{const r=yx[l.size]||yx.medium,i=l.icon==="none"?"":C4[l.icon]||"",o=l.label.trim(),c=!o&&!!i,m=S4(l),f=m.border?vx:0,h=r.padY-f,p=r.padX-f;return t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:`${r.gap}px`,padding:c?`${h}px`:`${h}px ${p}px`,borderRadius:`${l.borderRadius}px`,background:m.background,color:m.ink,border:m.border?`${vx}px solid ${m.border}`:"0",fontSize:`${r.font}px`,fontWeight:600,lineHeight:1.2,whiteSpace:"nowrap",boxShadow:l.variant==="filled"?"0 6px 20px rgba(0,0,0,.18)":"none",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"},children:[i&&t.jsx("svg",{width:r.icon,height:r.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"none",display:"block"},"aria-hidden":"true",children:t.jsx("path",{d:i})}),o&&t.jsx("span",{children:o})]})},wx=()=>t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 bg-slate-50 border-b border-slate-200",children:[t.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-red-400"}),t.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-amber-400"}),t.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-400"}),t.jsx("div",{className:"ml-3 flex-1 h-5 rounded-md bg-white border border-slate-200"})]}),Ss=({w:l})=>t.jsx("div",{className:`h-3 ${l} rounded bg-slate-100`}),O4=({config:l})=>
501{if(l.placement==="inline"){const c=l.inlineAlign==="center"?"center":l.inlineAlign==="right"?"flex-end":"flex-start";return t.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white shadow-sm overflow-hidden",children:[t.jsx(wx,{}),t.jsx("div",{className:"h-80 bg-slate-50/60 overflow-hidden",children:t.jsxs("div",{className:"p-6 space-y-3",children:[t.jsx("div",{className:"h-6 w-2/5 rounded bg-slate-200","aria-hidden":"true"}),t.jsx(Ss,{w:"w-4/5"}),t.jsx(Ss,{w:"w-3/5"}),t.jsx("div",{className:"rounded-lg border-2 border-dashed border-primary/40 bg-primary/5 p-3",style:{display:"flex",justifyContent:c},children:t.jsx(Nx,{config:l})}),t.jsx(Ss,{w:"w-2/3"}),t.jsx(Ss,{w:"w-1/2"}),t.jsx(Ss,{w:"w-3/5"})]})})]})}const[i,o]=l.position.split("-");return t.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white shadow-sm overflow-hidden",children:[t.jsx(wx,{}),t.jsxs("div",{className:"relative h-80 bg-slate-50/60 overflow-hidden",children:[t.jsxs("div",{className:"p-6 space-y-3 select-none","aria-hidden":"true",children:[t.jsx("div",{className:"h-6 w-2/5 rounded bg-slate-200"}),t.jsx(Ss,{w:"w-4/5"}),t.jsx(Ss,{w:"w-3/5"}),t.jsx("div",{className:"h-24 w-full rounded-xl bg-slate-100"}),t.jsx(Ss,{w:"w-2/3"}),t.jsx(Ss,{w:"w-1/2"})]}),t.jsx("div",{className:"absolute",style:{[i]:`${l.offsetY}px`,[o]:`${l.offsetX}px`},children:t.jsx(Nx,{config:l})})]})]})},B4=()=>{const{id:l,categoryId:r}=qa(),i=Ya(),{customerProfile:o,setCustomerProfile:c}=$n(),[m,f]=b.useState("idle"),[h,p]=b.useState(null),g=o==null?void 0:o.purchasedProducts.find($=>$._id===r),[y,v]=b.useState(jx()),E=((g==null?void 0:g.destinationUrls)||[]).filter($=>$.destinationUrl).length,R=b.useRef(!1),N=b.useRef(null),k=b.useRef(""),w=b.useRef(y);b.useEffect(()=>{w.current=y},[y]),b.useEffect(()=>{if(R.current||!g)return;R.current=!0;const $=jx(g.sleekWidgetConfig);v($),k.current=JSON.stringify({config:$})},[g]);const A=b.useCallback(async()=>{if(!r)return;const $=w.current,G=JSON.stringify({config:$});if(G!==k.current){f("saving");try{const te=await Cs.updateMe({purchasedProducts:[{_id:r,sleekWidgetConfig:$}]});te.success?(c(te.data),k.current=G,f("saved")):f("error")}catch(te){console.error("Error saving sleek widget config:",te),f("error")}}},[r,c]);b.useEffect(()=>{if(!(!R.current||JSON.stringify({config:y})===k.current))return N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{N.current=null,A()},800),()=>{N.current&&(clearTimeout(N.current),N.current=null)}},[y,A]),b.useEffect(()=>{if(m!=="saved")return;const $=setTimeout(()=>f("idle"),2e3);return()=>clearTimeout($)},[m]),b.useEffect(()=>{if(!h)return;const $=setTimeout(()=>p(null),2e3);return()=>clearTimeout($)},[h]);const O=async()=>{N.current&&(clearTimeout(N.current),N.current=null),await A(),i(`/customers/${l}/products/${r}`)},z=($,G)=>v(te=>({...te,[$]:G})),H=y.placement==="inline",se=y.variant==="filled",Z=r?U4(E5,r):"",T=r?D4(r):"",P=async $=>{const G=$==="script"?Z:T;try{await navigator.clipboard.writeText(G),p($)}catch{const te=document.getElementById($==="script"?"stw-snippet":"stw-placement");te==null||te.select()}};if(!g)return t.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-24 text-center",children:[t.jsx("p",{className:"text-slate-500 font-semibold",children:"This product could not be found."}),t.jsx("button",{onClick:()=>i(`/customers/${l}/products`),className:"mt-6 px-8 py-3 bg-primary text-white font-bold rounded-xl hover:bg-purple-700 transition-all text-sm",children:"Back to Products"})]});const q="text-[12px] font-bold uppercase tracking-wider text-slate-400",Q="space-y-4 border border-slate-100 rounded-2xl p-5 bg-white shadow-sm";return t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-4 mb-10",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[12px] font-bold text-slate-400",children:"Edit your embedded button"}),t.jsx("h2",{className:"text-[32px] font-bold text-[#281E49]",children:"Sleek Widget"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[m!=="idle"&&t.jsxs("div",{className:`flex items-center gap-2 text-[13px] font-semibold px-4 py-2.5 rounded-xl ${m==="saving"?"text-slate-500 bg-slate-100":m==="saved"?"text-emerald-600 bg-emerald-50":"text-red-600 bg-red-50"}`,"aria-live":"polite",children:[m==="saving"&&t.jsxs(t.Fragment,{children:[t.jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[t.jsx("circle",{cx:"12",cy:"12",r:"9",strokeWidth:"3",strokeOpacity:"0.25"}),t.jsx("path",{strokeLinecap:"round",strokeWidth:"3",d:"M21 12a9 9 0 0 0-9-9"})]}),t.jsx("span",{children:"Savingâ¦"})]}),m==="saved"&&t.jsxs(t.Fragment,{children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M5 13l4 4L19 7"})}),t.jsx("span",{children:"Saved"})]}),m==="error"&&t.jsxs(t.Fragment,{children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"})}),t.jsx("span",{children:"Save failed â retrying on next change"})]})]}),t.jsx("button",{onClick:O,className:"px-10 py-3 bg-primary text-white font-bold rounded-xl hover:bg-purple-700 transition-all shadow-lg active:scale-95 text-sm",children:"Done"})]})]}),t.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-10 flex-1",children:[t.jsxs("div",{className:"space-y-6 max-w-xl",children:[t.jsxs("div",{className:Q,children:[t.jsx("span",{className:q,children:"Button"}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("span",{className:"block text-[13px] font-bold text-slate-600",children:"Where this button goes"}),t.jsx("div",{className:"px-4 py-3 bg-slate-50 border border-slate-200 rounded-xl",children:t.jsx("p",{className:"font-mono text-[12px] text-slate-500 break-all",children:r?z4(r):""})}),E>0?t.jsxs("p",{className:"text-[12px] font-medium text-slate-400",children:["Opens the deviceâs SleekTap page, which offers the"," ",t.jsxs("span",{className:"font-bold text-slate-500",children:[E," link",E===1?"":"s"]})," ","set up on this device â exactly what someone gets when they tap the physical product. Links can change any time without touching the code below."]}):t.jsx("p",{className:"text-[12px] font-semibold text-amber-600",children:"No links set up yet. Add at least one on the device page â until then the button won't render on the customer's site."}),t.jsx("button",{type:"button",onClick:()=>i(`/customers/${l}/products/${r}`),className:"text-[12px] font-bold text-primary hover:underline",children:"Manage links â"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{htmlFor:"stw-label",className:"block text-[13px] font-bold text-slate-600",children:"Button text"}),t.jsx("input",{id:"stw-label",type:"text",maxLength:40,value:y.label,onChange:$=>z("label",$.target.value),placeholder:"Get in touch",className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-xl text-slate-900 text-sm font-medium outline-none focus:ring-4 focus:ring-primary/10 focus:border-primary transition-all"}),t.jsx("p",{className:"text-[12px] font-medium text-slate-400",children:y.label.trim()?`${y.label.length}/40 characters`:"Leave empty for an icon-only button."})]})]}),t.jsxs("div",{className:Q,children:[t.jsx("span",{className:q,children:"Appearance"}),t.jsx(ko,{label:"Button style",options:R4,value:y.variant,onChange:$=>z("variant",$)}),se?t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(Nu,{id:"stw-bg",label:"Backgroun
501d",value:y.backgroundColor,onChange:$=>z("backgroundColor",$)}),t.jsx(Nu,{id:"stw-fg",label:"Text",value:y.textColor,onChange:$=>z("textColor",$)})]}):t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"grid grid-cols-2 gap-4",children:t.jsx(Nu,{id:"stw-bg",label:y.variant==="outline"?"Border & text":"Text",value:y.backgroundColor,onChange:$=>z("backgroundColor",$)})}),t.jsx("p",{className:"text-[12px] font-medium text-slate-400",children:y.variant==="outline"?"An outline button is see-through, so the page shows through the middle â pick a color that stands out against it.":"A text button is just the label, with no fill or border â pick a color that stands out against the page."})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{htmlFor:"stw-radius",className:"block text-[13px] font-bold text-slate-600",children:"Corner roundness"}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("input",{id:"stw-radius",type:"range",min:0,max:999,step:1,value:y.borderRadius,onChange:$=>z("borderRadius",Number($.target.value)),className:"flex-1 accent-primary"}),t.jsx("span",{className:"w-20 shrink-0 text-right text-[13px] font-bold text-slate-500 tabular-nums",children:y.borderRadius>=999?"Pill":`${y.borderRadius}px`})]})]}),t.jsx(ko,{label:"Size",options:A4,value:y.size,onChange:$=>z("size",$)}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("span",{className:"block text-[13px] font-bold text-slate-600",children:"Icon"}),t.jsx("div",{className:"grid grid-cols-3 gap-2",children:E4.map($=>t.jsx("button",{type:"button",onClick:()=>z("icon",$.key),"aria-pressed":y.icon===$.key,className:`px-3 py-2.5 rounded-xl border-2 text-[13px] font-bold transition-all ${y.icon===$.key?"border-primary bg-primary/5 text-primary":"border-slate-200 bg-white text-slate-600 hover:border-slate-300"}`,children:$.label},$.key))})]})]}),t.jsxs("div",{className:Q,children:[t.jsx("span",{className:q,children:"Placement"}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("span",{className:"block text-[13px] font-bold text-slate-600",children:"How should the button appear?"}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[t.jsx(kx,{title:"Floating",hint:"Pinned to a corner of every page, above your content.",active:!H,onClick:()=>z("placement","floating")}),t.jsx(kx,{title:"Inline",hint:"Sits inside your page wherever you paste the placement tag.",active:H,onClick:()=>z("placement","inline")})]})]}),H?t.jsxs(t.Fragment,{children:[t.jsx(ko,{label:"Alignment",options:_4,value:y.inlineAlign,onChange:$=>z("inlineAlign",$)}),t.jsx("p",{className:"text-[12px] font-medium text-slate-400",children:"The button fills the spot where you paste the placement tag. Paste it more than once and you get a button in each spot."})]}):t.jsxs(t.Fragment,{children:[t.jsx(ko,{label:"Corner",options:T4,value:y.position,onChange:$=>z("position",$),columns:2}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(Ex,{id:"stw-x",label:"Side spacing",value:y.offsetX,onChange:$=>z("offsetX",$)}),t.jsx(Ex,{id:"stw-y",label:"Top/bottom spacing",value:y.offsetY,onChange:$=>z("offsetY",$)})]})]}),t.jsx(Tx,{label:"Show on mobile",hint:"Hide the button on screens narrower than 640px.",checked:y.showOnMobile,onChange:$=>z("showOnMobile",$)}),t.jsx(Tx,{label:"Open in a new tab",hint:"Keeps your site open behind the destination link.",checked:y.openInNewTab,onChange:$=>z("openInNewTab",$)})]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"space-y-3",children:[t.jsx("span",{className:q,children:"Preview"}),t.jsx(O4,{config:y})]}),t.jsxs("div",{className:Q,children:[t.jsx("span",{className:q,children:"Install on your website"}),t.jsx(Sx,{step:1,title:"Add the loader script",hint:t.jsxs(t.Fragment,{children:["Paste this once, just before the closing"," ",t.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-100 text-slate-700 font-mono text-[12px]",children:"</body>"})," ","tag. Every change made here goes live automatically â it never has to be re-pasted."]}),id:"stw-snippet",value:Z,rows:3,copied:h==="script",onCopy:()=>P("script")}),H&&t.jsx(Sx,{step:2,title:"Add the placement tag",hint:"Paste this wherever the button should appear â inside a section, a column, under a heading. Use it as many times as you like.",id:"stw-placement",value:T,rows:4,copied:h==="tag",onCopy:()=>P("tag")}),E===0&&t.jsx("p",{className:"text-[12px] font-semibold text-amber-600",children:"Add at least one link on the device page to activate the button."})]})]})]})]})},kx=({title:l,hint:r,active:i,onClick:o})=>t.jsxs("button",{type:"button",onClick:o,"aria-pressed":i,className:`p-3.5 rounded-xl border-2 text-left transition-all ${i?"border-primary bg-primary/5":"border-slate-200 bg-white hover:border-slate-300"}`,children:[t.jsxs("div",{className:"flex items-center gap-2.5 mb-1",children:[t.jsx("span",{className:`w-4 h-4 shrink-0 rounded-full border-2 flex items-center justify-center ${i?"border-primary":"border-slate-300"}`,children:i&&t.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"})}),t.jsx("span",{className:"text-[13px] font-bold text-slate-800",children:l})]}),t.jsx("p",{className:"text-[12px] font-medium text-slate-500 leading-snug pl-6.5",children:r})]}),Sx=({step:l,title:r,hint:i,id:o,value:c,rows:m,copied:f,onCopy:h})=>t.jsxs("div",{className:"space-y-2.5",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("span",{className:"w-6 h-6 shrink-0 rounded-full bg-primary/10 text-primary text-[12px] font-bold flex items-center justify-center",children:l}),t.jsx("span",{className:"text-[13px] font-bold text-slate-800",children:r})]}),t.jsx("p",{className:"text-[12px] font-medium text-slate-500 leading-relaxed pl-8.5",children:i}),t.jsx("textarea",{id:o,readOnly:!0,rows:m,value:c,onClick:p=>p.target.select(),spellCheck:!1,className:"w-full px-4 py-3 bg-slate-900 text-slate-100 rounded-xl font-mono text-[12px] leading-relaxed resize-none outline-none focus:ring-4 focus:ring-primary/20"}),t.jsxs("button",{type:"button",onClick:h,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-primary text-white text-[13px] font-bold hover:bg-purple-700 transition-all active:scale-95",children:[t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),t.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),f?"Copied!":"Copy code"]})]}),Cx=/^#([0-9A-F]{3}|[0-9A-F]{6})$/,Nu=({id:l,label:r,value:i,onChange:o})=>{const[c,m]=b.useState(i);b.useEffect(()=>{m(i)},[i]);const f=p=>{const g=p.toUpperCase();m(g),Cx.test(g)&&o(g)},h=Cx.test(c);return t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{htmlFor:l,className:"block text-[13px] font-bold text-slate-600",children:r}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{id:l,type:"color",value:i,onChange:p=>{const g=p.target.value.toUpperCase();m(g),o(g)},className:"w-11 h-11 shrink-0 rounded-xl border border-slate-200 bg-white cursor-pointer p-1"}),t.jsx("input",{type:"text",value:c,onChange:p=>f(p.target.value),onBlur:()=>m(i),spellCheck:!1,"aria-invalid":!h,className:`w-full min-w-0 px-3 py-2.5 bg-slate-50 border rounded-xl text-slate-900 text-[13px] font-mono uppercase outline-none transition-all focus:ring-4 ${h?"border-slate-200 focus:ring-primary/10 focus:border-primary":"border-red-300 focus:ring-red-100 focus:border-red-400"}`})]})]})},Ex=({id:l,label:r,value:i,onChange:o})=>t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{htmlFor:l,className:"block text-[13px] font-bold text-slate-600",children:r}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{id:l,type:"number",min:0,max:200,value:i,onChange:c=>{const m=Number(c.target.value);o(Number.isFinite(m)?Math.min(200,Math.max(0,Math.round(m))):0)},className:"w-full px-4 py-3 pr-10 bg-slate-50 border border-slate-200 rounded-xl text-slate-900 text-sm font-medium outline-none focus:ring-4 focus:ring-primary/10 focus:border-primary transition-all"}),t.jsx("span",{className:"absolute inset-y-0 right-3 flex items-center text-[12px] font-bold text-slate-400 pointer-events-none",children:"px"})]})]});function ko({label:l,options:r,value:i,onChange:o,columns:c=3}){return t.jsxs("div",{className:"space-y-2",children:[t.jsx("span",{className:"block text-[13px] font-bold text-slate-600",children:l}),t.jsx("div",{className:`grid gap-2 ${c===2?"grid-cols-2":"grid-cols-3"}`,children:r.map(m=>t.jsx("button",{type:"button",onClick:()=>o(m.key),"aria-pressed":i===m.key,className:`px-3 py-2.5 rounded-xl border-2 text-[13px] font-bold transition-all ${i===m.key?"border-primary bg-primary/5 text-primary":"border-slate-200 bg-white text-slate-600 hover:border-slate-300"}`,children:m.label},m.key))})]})}const Tx=({label:l,hint:r,checked:i,onChange:o})=>t.jsxs("div",{className:"flex items-start justify-between gap-4 pt-1",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-[13px] font-bold text-slate-600",children:l}),t.jsx("p",{className:"text-[12px] font-medium text-slate-400 mt-0.5",children:r})]}),t.jsx("button",{type:"button",role:"switch","aria-checked":i,"aria-label":l,onClick:()=>o(!i),className:`relative shrink-0 w-12 h-7 rounded-full transition-all duration-300 ${i?"bg-primary":"bg-slate-300"}`,children:t.jsx("span",{className:`absolute top-1 w-5 h-5 rounded-full bg-white shadow-sm transition-all duration-300 ${i?"left-6":"left-1"}`})})]}),Nn={isActive:!0,programName:"Loyalty Program",welcomeMessage:"",capture:{name:{enabled:!0,required:!0},email:{enabled:!0,required:!1},phone:{enabled:!0,required:!0}},visitsRequired:10,reward:{name:"",description:"",valueText:"",expiryDays:30},branding:{logoUrl:"",businessName:"",phone:"",email:"",address:"",website:""},timezone:"UTC",requireCodeOnSignup:!0,codeMode:"daily",codeIntervalMinutes:60,codeGraceSeconds:90},wu=l=>{var r,i,o;return{...Nn,...l||{},capture:{name:{...Nn.capture.name,...((r=l==null?void 0:l.capture)==null?void 0:r.name)||{}},email:{...Nn.capture.email,...((i=l==null?void 0:l.capture)==null?void 0:i.email)||{}},phone:{...Nn.capture.phone,...((o=l==null?void 0:l.capture)==null?void 0:o.phone)||{}}},reward:{...Nn.reward,...(l==null?void 0:l.reward)||{}},branding:{...Nn.branding,...(l==null?void 0:l.branding)||{}}}},H4=[{key:"daily",label:"One code a day",blurb:"A new code every morning when your day rolls over. Staff read out the same three letters all day â simplest to run, and the only one a customer could pass to a friend who isn't here."},{key:"interval",label:"A new code on a timer",blurb:"The code changes on its own every so often. A code someone photographs and shares stops working within the hour, and your staff still only ever read one thing out."},{key:"per-use",label:"A new code after every check-in",blurb:"Eac
501h code admits one person, then a fresh one appears. Nothing to share, because it's spent by the time anyone could pass it on. Staff read the screen for each customer."},{key:"approval",label:"Approve each check-in yourself",blurb:"No code at all. A customer scans and asks; you get a card on this dashboard with their name and tap Approve or Decline. The tightest option, and the only one that needs someone watching a screen."}],q4=[10,15,30,60,120,180,240,360,720],V4=[0,30,60,90,120,300],g1=l=>{if(l<60)return`${l} min`;const r=l/60;return`${r} hour${r===1?"":"s"}`},$4=l=>{if(l<=0)return"Off â the old code stops instantly";if(l<60)return`${l} seconds`;const r=l/60;return`${r} minute${r===1?"":"s"}`},I4=l=>{switch(l.codeMode){case"interval":return`changes every ${g1(l.codeIntervalMinutes||60)}`;case"per-use":return"changes as soon as someone checks in with it";case"approval":return"this program approves check-ins from the dashboard";default:return"changes automatically at midnight"}},G4=({program:l,onChange:r,labelCls:i,inputCls:o})=>{const c=l.codeMode||"daily",m=c==="interval"||c==="per-use";return t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"grid gap-2.5",children:H4.map(f=>{const h=c===f.key;return t.jsxs("label",{className:`flex gap-3 p-4 rounded-2xl border cursor-pointer transition-all ${h?"border-primary bg-primary/5 shadow-sm":"border-slate-200 bg-white hover:border-slate-300"}`,children:[t.jsx("input",{type:"radio",name:"loyalty-code-mode",checked:h,onChange:()=>r({codeMode:f.key}),className:"mt-1 w-4 h-4 shrink-0 text-primary border-slate-300 focus:ring-primary/20"}),t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:"block text-sm font-bold text-slate-800",children:f.label}),t.jsx("span",{className:"block text-[11px] leading-relaxed text-slate-500 font-medium mt-1",children:f.blurb})]})]},f.key)})}),c==="interval"&&t.jsxs("div",{children:[t.jsx("label",{className:i,htmlFor:"lp-code-interval",children:"New code every"}),t.jsx("select",{id:"lp-code-interval",value:l.codeIntervalMinutes||60,onChange:f=>r({codeIntervalMinutes:Number(f.target.value)}),className:`${o} mt-1.5`,children:q4.map(f=>t.jsx("option",{value:f,children:g1(f)},f))}),t.jsx("p",{className:"text-[11px] text-slate-400 font-medium mt-1.5",children:"Codes line up with your day, so a 6-hour code changes at midnight, 6am, noon and 6pm in your timezone â not six hours after you saved this."})]}),m&&t.jsxs("div",{children:[t.jsx("label",{className:i,htmlFor:"lp-code-grace",children:"Keep the previous code working for"}),t.jsx("select",{id:"lp-code-grace",value:l.codeGraceSeconds??90,onChange:f=>r({codeGraceSeconds:Number(f.target.value)}),className:`${o} mt-1.5`,children:V4.map(f=>t.jsx("option",{value:f,children:$4(f)},f))}),t.jsx("p",{className:"text-[11px] text-slate-400 font-medium mt-1.5",children:"For the customer who was given a code a moment before it changed. Only ever the one code it replaced, never anything older â and generating a new code by hand cancels it immediately."})]}),c==="approval"&&t.jsx("p",{className:"text-[11px] text-amber-700 font-semibold bg-amber-50 border border-amber-100 rounded-2xl p-3.5 leading-relaxed",children:"Someone needs this dashboard open while you're trading. A request nobody answers within three minutes lapses on its own and the customer is asked to speak to staff â it is never approved for you."})]})},Y4=()=>{const l=(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}})(),r=["UTC","Europe/London","Europe/Dublin","Europe/Paris","Europe/Berlin","Europe/Madrid","Europe/Rome","Europe/Istanbul","Asia/Dubai","Asia/Karachi","Asia/Kolkata","Asia/Dhaka","Asia/Bangkok","Asia/Singapore","Asia/Hong_Kong","Asia/Tokyo","Australia/Sydney","Pacific/Auckland","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Sao_Paulo","Africa/Johannesburg","Africa/Lagos","Africa/Cairo"];return Array.from(new Set([l,...r]))},b1=l=>{if(!l)return"â";const r=new Date(l);
501return Number.isNaN(r.getTime())?"â":r.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},_n=l=>{if(!l)return"â";const r=new Date(l);return Number.isNaN(r.getTime())?"â":r.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},P4=({children:l})=>t.jsx("p",{className:"text-[12px] leading-snug text-slate-500 font-medium break-words",children:l}),F4=({branding:l})=>{const r=[l.address,l.phone,l.email,l.website].filter(Boolean);return!l.businessName&&r.length===0?null:t.jsxs("div",{className:"pt-4 border-t border-dashed border-slate-200 space-y-0.5",children:[!!l.businessName&&t.jsx("p",{className:"text-[13px] font-bold text-slate-700",children:l.businessName}),r.map(i=>t.jsx(P4,{children:i},i))]})},Q4=({voucher:l,hideQr:r=!1,className:i=""})=>{var m;const o=l.status==="redeemed",c=!o&&l.isExpired;return t.jsxs("div",{className:`relative bg-white rounded-3xl border border-slate-200 shadow-sm overflow-hidden ${i}`,children:[t.jsx("div",{className:`px-5 py-2.5 text-center text-[12px] font-bold uppercase tracking-wider ${o?"bg-slate-100 text-slate-500":c?"bg-amber-50 text-amber-700":"bg-emerald-50 text-emerald-700"}`,children:o?`Redeemed ${b1(l.redeemedAt)}`:c?`Expired ${_n(l.expiresAt)}`:"Valid â ready to redeem"}),t.jsxs("div",{className:"p-5 sm:p-6 space-y-5",children:[!!((m=l.branding)!=null&&m.logoUrl)&&t.jsx("div",{className:"flex justify-center",children:t.jsx("img",{src:l.branding.logoUrl,alt:"",className:"h-14 w-auto max-w-[180px] object-contain",onError:f=>{f.currentTarget.style.display="none"}})}),t.jsxs("div",{className:"text-center space-y-1.5",children:[t.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.14em] text-slate-400",children:"Reward voucher"}),t.jsx("h3",{className:"text-xl font-bold text-slate-900 leading-tight",children:l.rewardName||"Reward"}),!!l.rewardValue&&t.jsx("p",{className:"text-2xl font-black text-primary",children:l.rewardValue}),!!l.rewardDescription&&t.jsx("p",{className:"text-sm text-slate-500 font-medium pt-1",children:l.rewardDescription})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 text-center",children:[t.jsxs("div",{className:"bg-slate-50 rounded-2xl px-3 py-2.5",children:[t.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400",children:"Issued"}),t.jsx("p",{className:"text-[13px] font-bold text-slate-700",children:_n(l.issuedAt)})]}),t.jsxs("div",{className:"bg-slate-50 rounded-2xl px-3 py-2.5",children:[t.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400",children:"Expires"}),t.jsx("p",{className:"text-[13px] font-bold text-slate-700",children:l.expiresAt?_n(l.expiresAt):"Never"})]})]}),!r&&!!l.qrSvg&&t.jsxs("div",{className:"flex flex-col items-center gap-2 pt-1",children:[t.jsx("div",{className:"w-40 h-40 [&>svg]:w-full [&>svg]:h-full",dangerouslySetInnerHTML:{__html:l.qrSvg}}),t.jsx("p",{className:"text-[11px] text-slate-400 font-semibold text-center",children:"Staff: scan to redeem"})]}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400",children:"Voucher code"}),t.jsx("p",{className:"text-lg font-black tracking-[0.18em] text-slate-900 tabular-nums",children:l.code})]}),t.jsx(F4,{branding:l.branding})]})]})},Rx=[{key:"name",label:"Name"},{key:"email",label:"Email"},{key:"phone",label:"Phone"}],X4=()=>{const{id:l,categoryId:r}=qa(),i=Ya(),{customerProfile:o}=$n(),[c,m]=b.useState(wu()),[f,h]=b.useState(""),[p,g]=b.useState(""),[y,v]=b.useState(null),[E,R]=b.useState([]),[N,k]=b.useState([]),[w,A]=b.useState(!0),[O,z]=b.useState("idle"),[H,se]=b.useState(""),[Z,T]=b.useState(!1),[P,q]=b.useState(!1),Q=b.useRef(!1),F=b.useRef(null),$=b.useRef(""),G=b.useRef(c);b.useEffect(()=>{G.current=c},[c]);const te=b.useMemo(()=>Y4(),[]),ye=o==null?void 0:o.purchasedProducts.find(K=>K._id===r);b.useEffect(()=>{Q.current||(Q.current=!0,Promise.all([yn.getProgram(),yn.getReport(30),yn.getMembers(),yn.getVouchers()]).then(([K,fe,xe,me])=>{const Te=wu(K);m(Te),h(K.dailyCode||""),g(K.dailyCodeDate||""),v(fe),R(xe),k(me),$.current=JSON.stringify(So(Te))}).catch(K=>{var fe,xe;return se(((xe=(fe=K==null?void 0:K.response)==null?void 0:fe.data)==null?void 0:xe.error)||"Failed to load the loyalty program.")}).finally(()=>A(!1)))},[]);const U=b.useCallback(async()=>{var xe,me;const K=So(G.current);if(JSON.stringify(K)!==$.current){z("saving"),se("");try{const Te=await yn.updateProgram(K),Ue=wu(Te);m(Ue),Te.dailyCode&&h(Te.dailyCode),$.current=JSON.stringify(So(Ue)),z("saved")}catch(Te){z("error"),se(((me=(xe=Te==null?void 0:Te.response)==null?void 0:xe.data)==null?void 0:me.error)||"Failed to save.")}}},[]);b.useEffect(()=>{if(!(!Q.current||w||JSON.stringify(So(c))===$.current))return F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{F.current=null,U()},800),()=>{F.current&&(clearTimeout(F.current),F.current=null)}},[c,U,w]),b.useEffect(()=>{if(O!=="saved")return;const K=setTimeout(()=>z("idle"),2e3);return()=>clearTimeout(K)},[O]),b.useEffect(()=>{if(!P)return;const K=setTimeout(()=>q(!1),2e3);return()=>clearTimeout(K)},[P]);const ce=(K,fe)=>m(xe=>({...xe,[K]:fe})),C=(K,fe)=>m(xe=>{const me={...xe,capture:{...xe.capture,[K]:{...xe.capture[K],...fe}}};return fe.enabled===!1&&(me.capture[K].required=!1),me}),le=K=>m(fe=>({...fe,reward:{...fe.reward,...K}})),de=c.reward.expiryDays===0,S=b.useRef(c.reward.expiryDays||30);c.reward.expiryDays>0&&(S.current=c.reward.expiryDays);const B=S.current,J=K=>m(fe=>({...fe,branding:{...fe.branding,...K}})),oe=async()=>{var fe,xe;if(!(Z||!window.confirm(`Generate a new code for today on this customer's behalf? 502 503Their current code stops working immediately.`))){T(!0);try{const me=await yn.rotateDailyCode();h(me.dailyCode),g(me.dailyCodeDate)}catch(me){se(((xe=(fe=me==null?void 0:me.response)==null?void 0:fe.data)==null?void 0:xe.error)||"Failed to generate a new code.")}finally{T(!1)}}},ve=async()=>
503{if(f)try{await navigator.clipboard.writeText(f),q(!0)}catch{}},Ce=b.useMemo(()=>{const K=new Date,fe=de?null:new Date(K.getTime()+c.reward.expiryDays*864e5);return{code:"ABCD-1234",rewardName:c.reward.name||"Your reward",rewardDescription:c.reward.description||"",rewardValue:c.reward.valueText||"",branding:c.branding,visitsRequired:c.visitsRequired,issuedAt:K.toISOString(),expiresAt:fe?fe.toISOString():null,status:"issued",redeemedAt:null,isExpired:!1,qrSvg:""}},[c]),Ne=Rx.filter(K=>c.capture[K.key].enabled).length,ne="block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",ge="w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none transition-all font-medium",ze="bg-white rounded-3xl border border-slate-100 p-6 space-y-5";return w?t.jsx("div",{className:"min-h-[400px] flex items-center justify-center",children:t.jsx(yt,{className:"animate-spin text-primary",size:40})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("button",{onClick:()=>i(`/customers/${l}/products/${r}`),className:"flex items-center gap-2 text-xs font-bold text-slate-400 hover:text-primary transition-colors mb-2",children:[t.jsx(Ln,{size:14}),"Back to ",(ye==null?void 0:ye.productName)||"device"]}),t.jsxs("h1",{className:"text-2xl font-bold text-slate-900 flex items-center gap-2",children:[t.jsx(Go,{size:22,className:"text-primary"}),"Loyalty Program"]}),t.jsxs("p",{className:"text-sm text-slate-500 font-medium mt-1",children:[o==null?void 0:o.name," · applies to every loyalty tag on this account"]})]}),t.jsx("span",{className:`text-xs font-bold shrink-0 ${O==="error"?"text-red-500":O==="saved"?"text-emerald-600":"text-slate-400"}`,children:O==="saving"?"Savingâ¦":O==="saved"?"Saved":O==="error"?"Not saved":"Changes save automatically"})]}),!!H&&t.jsx("div",{className:"bg-red-50 border border-red-100 text-red-700 rounded-2xl px-4 py-3 text-sm font-semibold",children:H}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[t.jsxs("div",{className:"lg:col-span-2 rounded-3xl p-6 bg-slate-900 text-white",children:[t.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.14em] text-white/60",children:c.codeMode==="approval"?"Check-in approval":"Current check-in code"}),t.jsx("p",{className:"text-4xl sm:text-5xl font-black uppercase tracking-[0.2em] indent-[0.2em] mt-1.5",children:c.codeMode==="approval"?"â":f||"âââ"}),t.jsx("p",{className:"text-[12px] font-semibold text-white/60 mt-2",children:c.codeMode==="approval"?"This program has no code â the owner approves each check-in from their dashboard.":`${p||"today"} · ${c.timezone} â ${I4(c)}`}),c.codeMode!=="approval"&&t.jsxs("div",{className:"flex gap-2.5 mt-4",children:[t.jsxs("button",{onClick:ve,className:"px-4 py-2 bg-white/10 hover:bg-white/20 rounded-xl text-xs font-bold transition-all flex items-center gap-2",children:[t.jsx(Uo,{size:14}),P?"Copied":"Copy"]}),t.jsxs("button",{onClick:oe,disabled:Z,className:"px-4 py-2 bg-white/10 hover:bg-white/20 rounded-xl text-xs font-bold transition-all disabled:opacity-50 flex items-center gap-2",children:[t.jsx(pN,{size:14,className:Z?"animate-spin":""}),Z?"Generatingâ¦":"New code"]})]})]}),t.jsx("div",{className:"grid grid-cols-2 gap-4",children:[["Members",(y==null?void 0:y.totals.members)??0],["Visits (30d)",(y==null?void 0:y.totals.visitsInWindow)??0],["Vouchers issued",(y==null?void 0:y.totals.vouchersIssued)??0],["Redeemed",(y==null?void 0:y.totals.vouchersRedeemed)??0]].map(([K,fe])=>t.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 p-4 flex flex-col justify-center",children:[t.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400",children:K}),t.jsx("p",{className:"text-2xl font-black text-slate-900 tabular-nums",children:fe})]},String(K)))})]}),t.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-[1fr_340px] gap-6 items-start",children:[t.jsxs("div",{className:"space-y-5",children:[t.jsxs("section",{className:ze,children:[t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsx("h3",{className:"text-base font-bold text-slate-900",children:"Program"}),t.jsxs("label",{className:"flex items-center gap-2.5 shrink-0 cursor-pointer",children:[t.jsx("span",{className:"text-xs font-bold text-slate-500",children:c.isActive?"Active":"Paused"}),t.jsx("button",{type:"button",role:"switch","aria-checked":c.isActive,onClick:()=>ce("isActive",!c.isActive),className:`relative shrink-0 w-12 h-7 rounded-full transition-all ${c.isActive?"bg-primary":"bg-slate-300"}`,children:t.jsx("span",{className:`absolute top-1 w-5 h-5 rounded-full bg-white shadow-sm transition-all ${c.isActive?"left-6":"left-1"}`})})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-name",children:"Program name"}),t.jsx("input",{id:"alp-name",value:c.programName,onChange:K=>ce("programName",K.target.value),maxLength:80,className:ge})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-welcome",children:"Welcome message"}),t.jsx("textarea",{id:"alp-welcome",value:c.welcomeMessage,onChange:K=>ce("welcomeMessage",K.target.value),maxLength:300,rows:2,className:`${ge} resize-none`})]})]}),t.jsxs("section",{className:ze,children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-bold text-slate-900",children:"Sign-up fields"}
503),t.jsx("p",{className:"text-xs text-slate-500 font-medium mt-0.5",children:"At least one must be collected, and at least one must be required."})]}),t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:Rx.map(K=>{const fe=c.capture[K.key],xe=fe.enabled&&Ne===1;return t.jsxs("div",{className:`p-4 rounded-2xl border ${fe.enabled?"border-slate-200":"border-slate-100 bg-slate-50/60"}`,children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("span",{className:"text-sm font-bold text-slate-800",children:K.label}),t.jsx("button",{type:"button",role:"switch","aria-checked":fe.enabled,"aria-label":`Collect ${K.label}`,disabled:xe,onClick:()=>C(K.key,{enabled:!fe.enabled}),className:`relative shrink-0 w-10 h-6 rounded-full transition-all disabled:opacity-50 disabled:cursor-not-allowed ${fe.enabled?"bg-primary":"bg-slate-300"}`,children:t.jsx("span",{className:`absolute top-1 w-4 h-4 rounded-full bg-white shadow-sm transition-all ${fe.enabled?"left-5":"left-1"}`})})]}),fe.enabled&&t.jsxs("label",{className:"mt-3 pt-3 border-t border-slate-100 flex items-center gap-2 cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:fe.required,onChange:me=>C(K.key,{required:me.target.checked}),className:"w-4 h-4 rounded border-slate-300 text-primary"}),t.jsx("span",{className:"text-xs font-bold text-slate-600",children:"Required"})]})]},K.key)})}),c.codeMode!=="approval"&&t.jsxs("label",{className:"flex items-start gap-3 p-4 rounded-2xl bg-slate-50 cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:c.requireCodeOnSignup,onChange:K=>ce("requireCodeOnSignup",K.target.checked),className:"mt-0.5 w-4 h-4 rounded border-slate-300 text-primary"}),t.jsxs("span",{children:[t.jsx("span",{className:"block text-sm font-bold text-slate-800",children:"Require the current code to join"}),t.jsx("span",{className:"block text-[11px] text-slate-500 font-medium mt-0.5",children:"On: only people in the venue can sign up, and joining counts as their first visit. Off: anyone can join from a poster or website."})]})]})]}),t.jsxs("section",{className:ze,children:[t.jsx("h3",{className:"text-base font-bold text-slate-900",children:"Reward"}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-visits",children:"Visits needed"}),t.jsx("input",{id:"alp-visits",type:"number",min:1,max:1e3,value:c.visitsRequired,onChange:K=>{const fe=parseInt(K.target.value,10);ce("visitsRequired",Number.isFinite(fe)?Math.min(1e3,Math.max(1,fe)):1)},className:ge})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-reward-name",children:"Reward name"}),t.jsx("input",{id:"alp-reward-name",value:c.reward.name,onChange:K=>le({name:K.target.value}),maxLength:120,className:ge})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-reward-value",children:"Value / discount"}),t.jsx("input",{id:"alp-reward-value",value:c.reward.valueText,onChange:K=>le({valueText:K.target.value}),maxLength:120,className:ge})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-reward-desc",children:"Description"}),t.jsx("textarea",{id:"alp-reward-desc",value:c.reward.description,onChange:K=>le({description:K.target.value}),maxLength:500,rows:2,className:`${ge} resize-none`})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-expiry",children:"Voucher expires after (days)"}),t.jsx("input",{id:"alp-expiry",type:"number",min:1,max:730,disabled:de,value:de?B:c.reward.expiryDays,onChange:K=>{const fe=parseInt(K.target.value,10);le({expiryDays:Number.isFinite(fe)?Math.min(730,Math.max(1,fe)):30})},className:`${ge} max-w-[160px] disabled:opacity-40 disabled:cursor-not-allowed`}),t.jsxs("label",{className:"flex items-center gap-2 mt-3 cursor-pointer select-none w-fit",children:[t.jsx("input",{type:"checkbox",checked:de,onChange:K=>le({expiryDays:K.target.checked?0:B}),className:"w-4 h-4 rounded accent-primary cursor-pointer"}),t.jsx("span",{className:"text-sm font-semibold text-slate-600",children:"Never expires"})]}),de&&t.jsx("p",{className:"text-xs text-slate-400 font-medium mt
503-1.5",children:"Vouchers stay redeemable until they're used. Ones already issued keep the expiry they were given."})]})]}),t.jsxs("section",{className:ze,children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-bold text-slate-900",children:"Voucher details"}),t.jsx("p",{className:"text-xs text-slate-500 font-medium mt-0.5",children:"Copied onto each voucher when it's issued, so edits don't alter vouchers already handed out."})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-logo",children:"Logo URL"}),t.jsx("input",{id:"alp-logo",value:c.branding.logoUrl,onChange:K=>J({logoUrl:K.target.value}),className:ge})]}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-biz",children:"Business name"}),t.jsx("input",{id:"alp-biz",value:c.branding.businessName,onChange:K=>J({businessName:K.target.value}),maxLength:120,className:ge})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-phone",children:"Phone"}),t.jsx("input",{id:"alp-phone",value:c.branding.phone,onChange:K=>J({phone:K.target.value}),maxLength:40,className:ge})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-email",children:"Email"}),t.jsx("input",{id:"alp-email",type:"email",value:c.branding.email,onChange:K=>J({email:K.target.value}),maxLength:254,className:ge})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-web",children:"Website"}),t.jsx("input",{id:"alp-web",value:c.branding.website,onChange:K=>J({website:K.target.value}),className:ge})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-address",children:"Address"}),t.jsx("textarea",{id:"alp-address",value:c.branding.address,onChange:K=>J({address:K.target.value}),maxLength:300,rows:2,className:`${ge} resize-none`})]}),t.jsxs("div",{children:[t.jsx("p",{className:ne,children:"Check-in code"}),t.jsx(G4,{program:c,onChange:K=>m(fe=>({...fe,...K})),labelCls:ne,inputCls:ge})]}),t.jsxs("div",{children:[t.jsx("label",{className:ne,htmlFor:"alp-tz",children:"Timezone â sets when the code changes and when a visit can be re-counted"}),t.jsx("select",{id:"alp-tz",value:c.timezone,onChange:K=>ce("timezone",K.target.value),className:ge,children:te.map(K=>t.jsx("option",{value:K,children:K},K))})]})]}),t.jsxs("section",{className:"bg-white rounded-3xl border border-slate-100 p-6",children:[t.jsxs("h3",{className:"text-base font-bold text-slate-900 mb-1",children:["Members ",t.jsxs("span",{className:"text-slate-300",children:["(",E.length,")"]})]}),t.jsx("p",{className:"text-xs text-slate-500 font-medium mb-4",children:"Read-only here. The account owner exports contacts and inspects device history from their own dashboard."}),E.length===0?t.jsx("p",{className:"text-sm text-slate-400 font-medium py-6 text-center",children:"Nobody has joined yet."}):t.jsxs("div",{className:"overflow-x-auto",children:[t.jsxs("table",{className:"w-full min-w-[600px] text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"text-left text-[11px] font-bold uppercase tracking-wider text-slate-400 border-b border-slate-100",children:[t.jsx("th",{className:"py-2.5 pr-4",children:"Name"}),t.jsx("th",{className:"py-2.5 pr-4",children:"Email"}),t.jsx("th",{className:"py-2.5 pr-4",children:"Phone"}),t.jsx("th",{className:"py-2.5 pr-4 text-right",children:"Visits"}),t.jsx("th",{className:"py-2.5 pr-4 text-right",children:"Rewards"}),t.jsx("th",{className:"py-2.5 pr-4",children:"Last visit"}),t.jsx("th",{className:"py-2.5",children:"Verified"})]})}),t.jsx("tbody",{children:E.slice(0,50).map(K=>t.jsxs("tr",{className:"border-b border-slate-50",children:[t.jsx("td",{className:"py-2.5 pr-4 font-bold text-slate-800",children:K.name||"â"}),t.jsx("td",{className:"py-2.5 pr-4 text-slate-500 font-medium",children:K.email||"â"}),t.jsx("td",{className:"py-2.5 pr-4 text-slate-500 font-medium",children:K.phone||"â"}),t.jsxs("td",{className:"py-2.5 pr-4 text-right font-bold tabular-nums",children:[K.totalVisits," ",t.jsxs("span",{className:"text-slate-300",children:["(",K.visit
503Count,"/",c.visitsRequired,")"]})]}),t.jsx("td",{className:"py-2.5 pr-4 text-right font-bold tabular-nums",children:K.rewardsEarned}),t.jsx("td",{className:"py-2.5 pr-4 text-slate-500 font-medium whitespace-nowrap",children:_n(K.lastVisitAt)}),t.jsxs("td",{className:"py-2.5 whitespace-nowrap",children:[!!K.lastTrustLevel&&t.jsx("span",{className:`inline-flex px-2 py-0.5 rounded-lg text-[10px] font-black uppercase tracking-wider ${K.lastTrustLevel==="strong"?"bg-emerald-50 text-emerald-700":K.lastTrustLevel==="moderate"?"bg-sky-50 text-sky-700":"bg-amber-50 text-amber-700"}`,children:K.lastTrustLevel==="strong"?"Verified":K.lastTrustLevel==="moderate"?"Partly":"Unverified"}),!!K.sharesDeviceWith&&t.jsxs("span",{title:"Shares a device with another membership",className:"ml-1.5 inline-flex px-2 py-0.5 rounded-lg text-[10px] font-black uppercase tracking-wider bg-purple-50 text-purple-700",children:["Shared Ã",K.sharesDeviceWith]})]})]},K._id))})]}),E.length>50&&t.jsxs("p",{className:"text-[11px] text-slate-400 font-medium mt-3",children:["Showing the 50 most recent of ",E.length,"."]})]})]}),t.jsxs("section",{className:"bg-white rounded-3xl border border-slate-100 p-6",children:[t.jsxs("h3",{className:"text-base font-bold text-slate-900 mb-4",children:["Vouchers ",t.jsxs("span",{className:"text-slate-300",children:["(",N.length,")"]})]}),N.length===0?t.jsx("p",{className:"text-sm text-slate-400 font-medium py-6 text-center",children:"No vouchers issued yet."}):t.jsx("div",{className:"space-y-2",children:N.slice(0,25).map(K=>{const fe=K.status==="redeemed"?"redeemed":K.isExpired?"expired":"valid";return t.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-2xl border border-slate-100",children:[t.jsx("span",{className:`shrink-0 px-2.5 py-1 rounded-lg text-[10px] font-black uppercase tracking-wider ${fe==="valid"?"bg-emerald-50 text-emerald-700":fe==="redeemed"?"bg-slate-100 text-slate-500":"bg-amber-50 text-amber-700"}`,children:fe}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-black tracking-[0.12em] text-slate-900",children:K.code}),t.jsxs("p",{className:"text-[11px] text-slate-400 font-medium truncate",children:[K.memberName||K.memberEmail||K.memberPhone||"Member"," ·"," ",K.rewardName||"Reward"]})]}),t.jsxs("p",{className:"text-[11px] font-bold text-slate-500 shrink-0 text-right",children:[K.status==="redeemed"?`Redeemed ${_n(K.redeemedAt)}`:K.expiresAt?`Expires ${_n(K.expiresAt)}`:"No expiry",t.jsx("br",{}),t.jsxs("span",{className:"font-medium text-slate-400",children:["Issued ",b1(K.issuedAt)]})]})]},K.code)})})]})]}),t.jsxs("aside",{className:"xl:sticky xl:top-4 space-y-3",children:[t.jsx("p",{className:"text-xs font-bold uppercase tracking-wider text-slate-400 px-1",children:"Voucher preview"}),t.jsx(Q4,{voucher:Ce,hideQr:!0}),t.jsx("p",{className:"text-[11px] text-slate-400 font-medium px-1",children:"The real voucher carries a QR the owner scans to redeem it, once only."})]})]})]})};function So(l){return{isActive:l.isActive,programName:l.programName,welcomeMessage:l.welcomeMessage,capture:l.capture,visitsRequired:l.visitsRequired,reward:l.reward,branding:l.branding,timezone:l.timezone,requireCodeOnSignup:l.requireCodeOnSignup,codeMode:l.codeMode,codeIntervalMinutes:l.codeIntervalMinutes,codeGraceSeconds:l.codeGraceSeconds}}const K4=()=>{const[l,r]=b.useState([]),[i,o]=b.useState([]),[c,m]=b.useState(!0);return b.useEffect(()=>{(async()=>{var h;try{const[p,g]=await Promise.all([qe.get("/dashboard/stats"),qe.get("/dashboard/recent-orders")]);if(p.data.success){const y=p.data.data;r([{title:"Total Revenue",value:`$${((h=y.totalRevenue)==null?void 0:h.toLocaleString())||0}`,trend:"+0%",isUp:!0,icon:t.jsx(DN,{className:"text-emerald-600",size:24}),bg:"bg-emerald-50"},{title:"Total Orders",value:y.totalOrders||0,trend:"+0%",isUp:!0,icon:t.jsx(vm,{className:"text-primary",size:24}),bg:"bg-indigo-50"},{title:"Categories",value:y.totalCategories||0,trend:"+0%",isUp:!0,icon:t.jsx(qg,{className:"text-blue-600",size:24}),bg:"bg-blue-50"},{title:"Total Products",value:y.totalProducts||0,trend:"+0%",isUp:!0,icon:t.jsx(Jj,{className:"text-orange-600",size:24}),bg:"bg-orange-50"}])}g.data.success&&o(g.data.data)}catch(p){console.error("Error fetching dashboard data:",p)}finally{m(!1)}})()},[]),c?t.jsx("div",{className:"min-h-[400px] flex items-center justify-center",children:t.jsx(yt,{className:"animate-spin text-primary",size:40})}):t.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",children:[t.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Dashboard Overview"}),t.jsx("p",{className:"text-slate-500 mt-1",children:"Here's what's happening with SleekTap today."})]}),t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[t.jsxs("select",{className:"w-full sm:w-auto bg-white border border-slate-200 px-4 py-2 rounded-lg text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-primary/20 cursor-pointer",children:[t.jsx("option",{children:"Last 7 days"}),t.jsx("option",{children:"Last 30 days"}),t.jsx("option",{children:"Last 90 days"})]}),t.jsx("button",{className:"w-full sm:w-auto bg-primary hover:bg-primary-hover text-white px-4 py-2 rounded-lg text-sm font-semibold transition-all shadow-md",children:"Download Report"})]})]}),t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:l.map((f,h)=>t.jsxs("div",{className:"bg-white p-6 rounded-2xl shadow-sm border border-slate-100 group hover:shadow-md transition-all",children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsx("div",{className:`${f.bg} p-3 rounded-xl transition-transform group-hover:scale-110`,children:f.icon}),t.jsxs("div",{className:`flex items-center gap-1 text-sm font-medium ${f.isUp?"text-emerald-600":"text-red-600"}`,children:[f.trend,f.isUp?t.jsx(qv,{size:16}):t.jsx(Ov,{size:16})]})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx("p",{className:"text-sm font-medium text-slate-500",children:f.title}),t.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-1",children:f.value})]})]},h))}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[t.jsxs("div",{className:"lg:col-span-2 bg-white p-6 rounded-2xl shadow-sm border border-slate-100",children:[t.jsxs("div",{className:"flex items-center justify-between mb-8",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-bold text-slate-900",children:"Sales Statistics"}),t.jsx("p",{className:"text-sm text-slate-500",children:"Performance across all regions"})]}),t.jsx("button",{className:"p-2 hover:bg-slate-50 rounded-lg text-slate-400",children:t.jsx(ij,{size:20})})]}),t.jsx("div",{className:"h-[300px] w-full flex items-center justify-center text-slate-400 italic",children:"Chart data integration in progress..."})]}),t.jsxs("div",{className:"bg-white p-6 rounded-2xl shadow-sm border border-slate-100 flex flex-col",children:[t.jsx("h3",{className:"text-lg font-bold text-slate-900 mb-6",children:"Recent Orders"}),t.jsx("div",{className:"space-y-5 flex-1 overflow-y-auto max-h-[350px]",children:i.length>0?i.map(f=>{var h;return t.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl hover:bg-slate-50 transition-colors cursor-pointer border border-transparent hover:border-slate-100",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-slate-100 flex items-center justify-center text-slate-600",children:t.jsx(Uv,{size:18})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-semibold text-slate-800",children:((h=f.customer)==null?void 0:h.name)||(f==null?void 0:f.customerName)||"Unknown Customer"}),t.jsx("p",{className:"text-xs text-slate-500",children:new Date(f.createdAt).toLocaleDateString()})]})]}),t.jsxs("div",{className:"text-right",children:[t.jsxs("p",{className:"text-sm font-bold text-slate-900",children:["$",f.total]}),t.jsx("span",{className:`text-[10px] font-bold px-2 py-0.5 rounded-full ${f.status==="Delivered"?"bg-emerald-100 text-emerald-700":f.status==="Pending"?"bg-amber-100 text-amber-700":"bg-slate-100 text-slate-600"}`,children:f.status})]})]},f._id)}):t.jsx("div",{className:"text-center py-10 text-slate-500",children:"No recent orders"})}),t.jsx("button",{className:"mt-6 w-full py-2.5 text-sm font-semibold text-primary bg-primary/5 hover:bg-primary/10 rounded-xl transition-colors",children:"View All Orders"})]})]})]})},Ft=({onClick:l,title:r,children:i})=>t.jsx("button",{type:"button",title:r,onMouseDown:o=>{o.preventDefault(),l()},className:"w-8 h-8 flex items-center justify-center rounded-lg text-slate-500 hover:text-primary hover:bg-primary/10 transition-all active:scale-95",children:i}),qr=()=>t.jsx("span",{className:"w-px h-5 bg-slate-200 mx-1"}
503),Z4=({value:l,onChange:r,placeholder:i="Full, detailed description shown on the product pageâ¦",minHeight:o=220})=>{const c=b.useRef(null),m=b.useRef(!1);b.useEffect(()=>{const v=c.current;v&&(l||"")!==v.innerHTML&&(v.innerHTML=l||"")},[l]);const f=b.useCallback((v,E)=>{const R=c.current;R&&(R.focus(),document.execCommand(v,!1,E),r(R.innerHTML))},[r]),h=()=>{if(m.current)return;const v=c.current;v&&r(v.innerHTML)},p=()=>{const v=window.prompt("Enter URL (include https://)");v&&f("createLink",v)},g=()=>{f("removeFormat"),f("formatBlock","p")},y=v=>{v.preventDefault();const E=v.clipboardData.getData("text/plain");document.execCommand("insertText",!1,E)};return t.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 focus-within:ring-4 focus-within:ring-primary/5 focus-within:border-primary transition-all overflow-hidden",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 px-3 py-2 border-b border-slate-200 bg-white",children:[t.jsx(Ft,{onClick:()=>f("bold"),title:"Bold (Ctrl+B)",children:t.jsx(Gv,{size:15})}),t.jsx(Ft,{onClick:()=>f("italic"),title:"Italic (Ctrl+I)",children:t.jsx(kj,{size:15})}),t.jsx(Ft,{onClick:()=>f("underline"),title:"Underline (Ctrl+U)",children:t.jsx(VN,{size:15})}),t.jsx(Ft,{onClick:()=>f("strikeThrough"),title:"Strikethrough",children:t.jsx(EN,{size:15})}),t.jsx(qr,{}),t.jsx(Ft,{onClick:()=>f("formatBlock","h1"),title:"Heading 1",children:t.jsx(pj,{size:16})}),t.jsx(Ft,{onClick:()=>f("formatBlock","h2"),title:"Heading 2",children:t.jsx(gj,{size:16})}),t.jsx(Ft,{onClick:()=>f("formatBlock","h3"),title:"Heading 3",children:t.jsx(yj,{size:16})}),t.jsx(Ft,{onClick:()=>f("formatBlock","blockquote"),title:"Blockquote",children:t.jsx(cN,{size:15})}),t.jsx(qr,{}),t.jsx(Ft,{onClick:()=>f("insertUnorderedList"),title:"Bulleted list",children:t.jsx(qj,{size:16})}),t.jsx(Ft,{onClick:()=>f("insertOrderedList"),title:"Numbered list",children:t.jsx(Bj,{size:16})}),t.jsx(qr,{}),t.jsx(Ft,{onClick:()=>f("justifyLeft"),title:"Align left",children:t.jsx(MN,{size:15})}),t.jsx(Ft,{onClick:()=>f("justifyCenter"),title:"Align center",children:t.jsx(RN,{size:15})}),t.jsx(Ft,{onClick:()=>f("justifyRight"),title:"Align right",children:t.jsx(_N,{size:15})}),t.jsx(qr,{}),t.jsx(Ft,{onClick:p,title:"Insert link",children:t.jsx(Dj,{size:15})}),t.jsx(Ft,{onClick:g,title:"Clear formatting",children:t.jsx(cj,{size:15})}),t.jsx(qr,{}),t.jsx(Ft,{onClick:()=>f("undo"),title:"Undo (Ctrl+Z)",children:t.jsx(IN,{size:15})}),t.jsx(Ft,{onClick:()=>f("redo"),title:"Redo (Ctrl+Shift+Z)",children:t.jsx(fN,{size:15})})]}),t.jsx("div",{ref:c,contentEditable:!0,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","data-placeholder":i,onInput:h,onPaste:y,onCompositionStart:()=>{m.current=!0},onCompositionEnd:()=>{m.current=!1,h()},className:"rich-text-editor px-5 py-4 bg-white text-slate-900 outline-none font-medium text-sm leading-relaxed prose-like overflow-auto",style:{minHeight:o}}),t.jsx("style",{children:` 504 .rich-text-editor:empty:before { 505 content: attr(data-placeholder); 506 color: rgb(148 163 184); 507 pointer-events: none; 508 } 509 .rich-text-editor h1 { font-size: 1.5rem; font-weight: 700; margin: 0.6em 0 0.3em; } 510 .rich-text-editor h2 { font-size: 1.25rem; font-weight: 700; margin: 0.6em 0 0.3em; } 511 .rich-text-editor h3 { font-size: 1.1rem; font-weight: 600; margin: 0.6em 0 0.3em; } 512 .rich-text-editor p { margin: 0.4em 0; } 513 .rich-text-editor ul { list-style: disc; padding-left: 1.5rem; margin: 0.4em 0; } 514 .rich-text-editor ol { list-style: decimal; padding-left: 1.5rem; margin: 0.4em 0; } 515 .rich-text-editor blockquote { 516 border-left: 3px solid rgb(203 213 225); 517 padding-left: 0.9rem; 518 color: rgb(71 85 105); 519 margin: 0.5em 0; 520 font-style: italic; 521 } 522 .rich-text-editor a { color: rgb(79 70 229); text-decoration: underline; } 523 `})]})},J4=[{key:"facebook",label:"Facebook",domains:["facebook.com","fb.com"]},{key:"x",label:"X",domains:["x.com","twitter.com","t.co"]},{key:"youtube",label:"YouTube",domains:["youtube.com","youtu.be"]},{key:"instagram",label:"Instagram",domains:["instagram.com"]},{key:"tiktok",label:"TikTok",domains:["tiktok.com"]},{key:"pinterest",label:"Pinterest",domains:["pinterest.com","pin.it"]},{key:"yelp",label:"Yelp Review",domains:["yelp.com","yelp.to"]},{key:"tripadvisor",label:"TripAdvisor Review",domains:["tripadvisor.com","tripadvisor.co.uk","tripadvisor.in","tripadvisor.ca","tripadvisor.com.au"]},{key:"googleReview",label:"Google Review",domains:["g.page","search.google.com","maps.app.goo.gl","goo.gl","google.com"]},{key:"facebookReview",label:"Facebook Review",domains:["facebook.com","fb.com"]},{key:"linkedin",label:"LinkedIn",domains:["linkedin.com","lnkd.in"]}],y1="custom",W4={key:y1,label:"Custom URL",domains:[]},v1=[...J4,W4],e3={facebook:"/logos/Facebook.svg",x:"/logos/X.svg",youtube:"/logos/Youtube.svg",instagram:"/logos/Instagram.svg",tiktok:"/logos/Tiktok.svg",pinterest:"/logos/Pinterest.svg",yelp:"/logos/Ylep.svg",tripadvisor:"/logos/Tripadvisor.svg",googleReview:"/logos/Google.svg",facebookReview:"/logos/Facebook.svg",linkedin:"/logos/Linkedin.svg"};function Ho(l){if(l)return e3[l]}
523const t3=Object.fromEntries(v1.map(l=>[l.key,l]));function a3(l){if(!l)return"";const r=t3[l];return r?r.label:l}const Vr=["1x","2x","5x","10x"],s3=[{key:"single",label:"Single URL",description:"Customer sets one destination URL for the product"},{key:"multiple",label:"Multiple URLs",description:"Customer sets a separate URL for each unit purchased"},{key:"business-card",label:"Business Card",description:"Customer edits a profile (name, job title, socials) via card editor"},{key:"sleek-widget",label:"Sleek Widget",description:"Customer sets multiple URLs plus an embeddable button for their own website"},{key:"loyalty",label:"Loyalty Program",description:"Visitors scan to join and log visits with a daily code; rewards are issued automatically"}],l3=()=>{const[l,r]=b.useState([]),[i,o]=b.useState([]),[c,m]=b.useState([]),[f,h]=b.useState(""),[p,g]=b.useState(!1),[y,v]=b.useState(null),[E,R]=b.useState(!0),[N,k]=b.useState(!1),[w,A]=b.useState(1),[O,z]=b.useState(0),[H,se]=b.useState(0),Z=10,[T,P]=b.useState({name:"",category:"",useCase:"",description:"",longDescription:"",sku:"",slug:"",stock:0,hasDesignVariation:!1,isActive:!0,isReview:!1,isCustomizable:!1,printMockupImage:"",printAreaX:25,printAreaY:25,printAreaWidth:50,printAreaHeight:50,printWidthMm:40,printHeightMm:40,printMinDpi:300,html:"",urlType:"single",allowedUrls:[]}),[q,Q]=b.useState(null),[F,$]=b.useState(""),[G,te]=b.useState(null),[ye,U]=b.useState(""),[ce,C]=b.useState([]),[le,de]=b.useState([]),[S,B]=b.useState(Vr.map(L=>({quantity:L,price:0,image:""}))),[J,oe]=b.useState([]),[ve,Ce]=b.useState([]),Ne=L=>(L==null?void 0:L._id)||(L==null?void 0:L.id),ne=b.useCallback(async()=>{var L,ue,pe;R(!0);try{const Re={page:w,limit:Z};f&&(Re.search=f);const Ye=await qe.get("/products",{params:Re});Ye.data.success&&(r(Ye.data.data),z(((L=Ye.data.pagination)==null?void 0:L.total)??Ye.data.data.length),se(((ue=Ye.data.pagination)==null?void 0:ue.pages)??Math.ceil((((pe=Ye.data.pagination)==null?void 0:pe.total)??Ye.data.data.length)/Z)))}catch(Re){console.error("Error fetching products:",Re)}finally{R(!1)}},[w,f]),ge=b.useCallback(async()=>{try{const L=await qe.get("/categories");L.data.success&&o(L.data.data)}catch(L){console.error("Error fetching categories:",L)}},[]),ze=b.useCallback(async()=>{try{const L=await qe.get("/use-cases");L.data.success&&m(L.data.data)}catch(L){console.error("Error fetching use cases:",L)}},[]);b.useEffect(()=>{ne()},[ne]),b.useEffect(()=>{ge()},[ge]),b.useEffect(()=>{ze()},[ze]);const K=L=>{var pe;const ue=(pe=L.target.files)==null?void 0:pe[0];ue&&(te(ue),U(URL.createObjectURL(ue)))},fe=L=>{var pe;const ue=(pe=L.target.files)==null?void 0:pe[0];ue&&(Q(ue),$(URL.createObjectURL(ue)))},xe=L=>
523{const ue=Array.from(L.target.files||[]),pe=5-le.length,Re=ue.slice(0,pe);C(Pe=>[...Pe,...Re]);const Ye=Re.map(Pe=>URL.createObjectURL(Pe));de(Pe=>[...Pe,...Ye])},me=L=>{de(ue=>ue.filter((pe,Re)=>Re!==L)),C(ue=>ue.filter((pe,Re)=>Re!==L))},Te=(L,ue)=>{const pe=[...S];pe[L].price=ue,B(pe)},Ue=(L,ue)=>{const pe=[...S];pe[L].image=URL.createObjectURL(ue),pe[L].imageFile=ue,B(pe)},Le=()=>{oe(L=>[...L,{groupName:"",pricing:Vr.map(ue=>({quantity:ue,price:0,image:""}))}])},rt=L=>{oe(ue=>ue.filter((pe,Re)=>Re!==L))},st=(L,ue)=>{const pe=[...J];pe[L].groupName=ue,oe(pe)},lt=(L,ue,pe)=>{const Re=[...J];Re[L].pricing[ue].image=URL.createObjectURL(pe),Re[L].pricing[ue].imageFile=pe,oe(Re)},aa=()=>{Ce(L=>[...L,{question:"",answer:""}])},As=L=>{Ce(ue=>ue.filter((pe,Re)=>Re!==L))},we=(L,ue,pe)=>{Ce(Re=>{const Ye=[...Re];return Ye[L]={...Ye[L],[ue]:pe},Ye})},ke=b.useCallback(()=>{P({name:"",category:i.length>0?Ne(i[0]):"",useCase:"",description:"",longDescription:"",sku:"",slug:"",stock:0,hasDesignVariation:!1,isActive:!0,isReview:!1,isCustomizable:!1,printMockupImage:"",printAreaX:25,printAreaY:25,printAreaWidth:50,printAreaHeight:50,printWidthMm:40,printHeightMm:40,printMinDpi:300,html:"",urlType:"single",allowedUrls:[]}),Q(null),$(""),U(""),te(null),C([]),de([]),B(Vr.map(L=>({quantity:L,price:0,image:""}))),oe([]),Ce([]),v(null)},[i]),Be=L=>{var Re,Ye,Pe,sa,rs,la,ut,Ot,Vt,ha,ka,Fa,ll;v(L);let ue="";if(typeof L.category=="object")ue=Ne(L.category);else{const $t=i.find(Xt=>Ne(Xt)===L.category||Xt.name===L.category);ue=$t?Ne($t):L.category}const pe=typeof L.useCase=="object"&&L.useCase!==null?Ne(L.useCase):L.useCase||"";if(P({name:L.name,category:ue||"",useCase:pe||"",description:L.description||"",longDescription:L.longDescription||"",sku:L.sku||"",slug:L.slug||"",stock:L.stock,hasDesignVariation:L.hasDesignVariation,isActive:L.isActive,isReview:L.isReview??!1,isCustomizable:L.isCustomizable??!1,printMockupImage:((Re=L.printSpec)==null?void 0:Re.mockupImage)??"",printAreaX:((Ye=L.printSpec)==null?void 0:Ye.areaX)??25,printAreaY:((Pe=L.printSpec)==null?void 0:Pe.areaY)??25,printAreaWidth:((sa=L.printSpec)==null?void 0:sa.areaWidth)??50,printAreaHeight:((rs=L.printSpec)==null?void 0:rs.areaHeight)??50,printWidthMm:((la=L.printSpec)==null?void 0:la.widthMm)??40,printHeightMm:((ut=L.printSpec)==null?void 0:ut.heightMm)??40,printMinDpi:((Ot=L.printSpec)==null?void 0:Ot.minDpi)??300,html:L.html||"",urlType:L.urlType||"single",allowedUrls:L.allowedUrls||[]}),$(L.featuredImage),U(((Vt=L.printSpec)==null?void 0:Vt.mockupImage)??""),te(null),de(L.gallery||[]),L.hasDesignVariation){const $t=(Fa=(ka=(ha=L.designVariationGroups)==null?void 0:ha[0])==null?void 0:ka.pricing)==null?void 0:Fa.map(Xt=>({quantity:Xt.quantity,price:Xt.price,image:""}));oe(L.designVariationGroups||[]),B((ll=L.pricing)!=null&&ll.length?L.pricing:$t||Vr.map(Xt=>({quantity:Xt,price:0,image:""})))}else B(L.pricing||Vr.map($t=>({quantity:$t,price:0,image:""}))),oe([]);Ce((L.faqs||[]).map($t=>({question:$t.question||"",answer:$t.answer||"",sortOrder:$t.sortOrder,_id:$t._id}))),g(!0)},Oe=T.urlType==="single",Je=T.urlType==="multiple"||T.urlType==="sleek-widget",Ct=T.urlType==="business-card"||T.urlType==="loyalty",Nt=async L=>{var ue,pe;if(L.preventDefault(),Oe&&T.allowedUrls.length!==1){alert("Single-URL products must have exactly one allowed platform selected.");return}if(Je&&T.allowedUrls.length===0){alert(T.urlType==="sleek-widget"?"Sleek Widget products must have at least one allowed platform selected.":"Multiple-URL products must have at least one allowed platform selected.");return}k(!0);try{let Re=ye;G&&(Re=await tl(G,"products/featured"));let Ye=F;q&&(Ye=await tl(q,"products/featured"));const Pe=[];let sa=0;for(const ut of le)if(ut.startsWith("blob:")){const Ot=await tl(ce[sa],"products/gallery");Pe.push(Ot),sa++}else Pe.push(ut);const rs=T.stock<=0?"Out of Stock":T.stock<20?"Low Stock":"In Stock",la={name:T.name,category:T.category,useCase:T.useCase||null,description:T.description,longDescription:T.longDescription,sku:T.sku,stock:T.stock,hasDesignVariation:T.hasDesignVariation,isActive:T.isActive,isReview:T.isReview,isCustomizable:T.isCustomizable,printSpec:{mockupImage:Re.startsWith("blob:")?"":Re,areaX:Number(T.printAreaX),areaY:Number(T.printAreaY),areaWidth:Number(T.printAreaWidth),areaHeight:Number(T.printAreaHeight),widthMm:Number(T.printWidthMm),heightMm:Number(T.printHeightMm),minDpi:Number(T.printMinDpi)},html:T.html,urlType:T.urlType,allowedUrls:Ct?[]:T.allowedUrls,availability:rs,featuredImage:Ye,gallery:Pe};
523if(T.slug&&(la.slug=T.slug),la.faqs=ve.filter(ut=>ut.question.trim()&&ut.answer.trim()).map((ut,Ot)=>({question:ut.question.trim(),answer:ut.answer.trim(),sortOrder:Ot})),!T.hasDesignVariation)la.pricing=await Promise.all(S.map(async ut=>({quantity:ut.quantity,price:ut.price,image:ut.imageFile?await tl(ut.imageFile,"products/pricing"):ut.image})));else{const ut=new Map(S.map(Ot=>[Ot.quantity,Ot.price]));la.designVariationGroups=await Promise.all(J.map(async Ot=>({groupName:Ot.groupName,pricing:await Promise.all(Ot.pricing.map(async Vt=>({quantity:Vt.quantity,price:ut.get(Vt.quantity)??Vt.price,image:Vt.imageFile?await tl(Vt.imageFile,"products/variations"):Vt.image})))})))}y?await qe.put(`/products/${Ne(y)}`,la):await qe.post("/products",la),ne(),g(!1),ke()}catch(Re){console.error("Error saving product:",Re),alert(((pe=(ue=Re.response)==null?void 0:ue.data)==null?void 0:pe.error)||"An error occurred while saving the product. Please check all fields.")}finally{k(!1)}},wt=async L=>{if(confirm(`Delete ${L.name}?`))try{await qe.delete(`/products/${Ne(L)}`);const ue=[L.featuredImage,...L.gallery||[]].filter(Boolean);await M5(ue),ne()}catch{alert("Delete failed")}};return t.jsxs("div",{className:"animate-in fade-in slide-in-from-bottom-4 duration-500",children:[t.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 mb-8",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-extrabold text-slate-900 tracking-tight",children:"Products"}),t.jsx("p",{className:"text-slate-500 mt-1",children:"Manage designs, pricing tiers, and stock levels"})]}),t.jsxs("button",{onClick:()=>{ke(),g(!0)},className:"flex items-center justify-center gap-2 bg-primary hover:bg-primary-hover text-white px-6 py-3 rounded-2xl font-bold transition-all shadow-xl shadow-primary/20 active:scale-95",children:[t.jsx(Tl,{size:20,strokeWidth:3}),"Add Product"]})]}),t.jsxs("div",{className:"bg-white rounded-3xl shadow-sm border border-slate-100 overflow-hidden",children:[t.jsx("div",{className:"p-6 border-b border-slate-100 flex flex-col sm:flex-row items-center justify-between gap-4",children:t.jsxs("div",{className:"relative w-full sm:w-96",children:[t.jsx("span",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none text-slate-400",children:t.jsx(Al,{size:18})}),t.jsx("input",{type:"text",placeholder:"Search SKU or Product Name...",value:f,onChange:L=>{h(L.target.value),A(1)},className:"w-full pl-11 pr-4 py-3 bg-slate-50 border-transparent rounded-2xl text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:bg-white transition-all border border-slate-200"})]})}),t.jsxs("div",{className:"overflow-x-auto",children:[t.jsxs("table",{className:"w-full text-left",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-slate-50/50 text-slate-400 text-[10px] font-bold uppercase tracking-[0.1em]",children:[t.jsx("th",{className:"px-8 py-4",children:"Product Detail (Click Name to Edit)"}),t.jsx("th",{className:"px-8 py-4",children:"Category"}),t.jsx("th",{className:"px-8 py-4 text-center",children:"Design Var"}),t.jsx("th",{className:"px-8 py-4",children:"Base Price"}),t.jsx("th",{className:"px-8 py-4",children:"Stock"}),t.jsx("th",{className:"px-8 py-4 text-right",children:"Actions"})]})}),t.jsx("tbody",{className:"divide-y divide-slate-50",children:E?Array.from({length:5}).map((L,ue)=>t.jsxs("tr",{className:"animate-pulse bg-slate-50/10",children:[t.jsx("td",{className:"px-8 py-5",children:t.jsxs("div",{className:"flex items-center gap-5",children:[t.jsx("div",{className:"w-14 h-14 rounded-2xl bg-slate-200 shrink-0"}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"h-4 bg-slate-200 rounded w-32"}),t.jsx("div",{className:"h-3 bg-slate-200 rounded w-20"})]})]})}),t.jsx("td",{className:"px-8 py-5",children:t.jsx("div",{className:"h-6 bg-slate-200 rounded-lg w-20"})}),t.jsx("td",{className:"px-8 py-5 text-center",children:t.jsx("div",{className:"h-8 w-8 bg-slate-200 rounded-full mx-auto"})}),t.jsx("td",{className:"px-8 py-5",children:t.jsx("div",{className:"h-4 bg-slate-200 rounded w-16"})}),t.jsx("td",{className:"px-8 py-5",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"h-4 bg-slate-200 rounded w-8"}),t.jsx("div",{className:"h-3 bg-slate-200 rounded w-16"})]})}),t.jsx("td",{className:"px-8 py-5 text-right",children:t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("div",{className:"h-9 w-9 bg-slate-200 rounded-xl"}),t.jsx("div",{className:"h-9 w-9 bg-slate-200 rounded-xl"})]})})]},ue)):l.map(L=>{var ue;return t.jsxs("tr",{className:"hover:bg-slate-50/30 transition-colors group",children:[t.jsx("td",{className:"px-8 py-5 cursor-pointer group/name",onClick:()=>Be(L),title:`Edit ${L.name}`,children:t.jsxs("div",{className:"flex items-center gap-5",children:[t.jsx("div",{className:"w-14 h-14 roun
523ded-2xl bg-white border border-slate-100 p-1 flex items-center justify-center shadow-sm shrink-0 group-hover/name:border-primary/50 transition-all",children:t.jsx("img",{src:L.featuredImage,alt:L.name,className:"max-w-full max-h-full object-contain rounded-lg"})}),t.jsxs("div",{children:[t.jsxs("p",{className:"text-sm font-bold text-slate-900 group-hover/name:text-primary transition-colors flex items-center gap-2",children:[L.name,t.jsx(Un,{size:12,className:"opacity-0 group-hover/name:opacity-100 transition-opacity text-primary"})]}),t.jsxs("p",{className:"text-[10px] font-medium text-slate-400 mt-0.5",children:["SKU: ",L.sku]})]})]})}),t.jsx("td",{className:"px-8 py-5",children:t.jsx("span",{className:"text-xs font-semibold text-slate-600 bg-slate-100 px-3 py-1.5 rounded-lg",children:typeof L.category=="object"?L.category.name:L.category})}),t.jsx("td",{className:"px-8 py-5 text-center",children:L.hasDesignVariation?t.jsx("span",{className:"inline-flex items-center justify-center w-8 h-8 rounded-full bg-indigo-50 text-indigo-600",children:t.jsx(lm,{size:14})}):t.jsx("span",{className:"text-slate-300",children:"â"})}),t.jsxs("td",{className:"px-8 py-5 font-bold text-slate-900 text-sm",children:["$",((ue=L.basePrice)==null?void 0:ue.toFixed(2))||"0.00"]}),t.jsx("td",{className:"px-8 py-5",children:t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-sm font-bold text-slate-700",children:L.stock}),t.jsx("span",{className:`text-[10px] font-bold uppercase ${L.availability==="In Stock"?"text-emerald-500":L.availability==="Low Stock"?"text-amber-500":"text-rose-500"}`,children:L.availability})]})}),t.jsx("td",{className:"px-8 py-5 text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx("button",{onClick:()=>Be(L),className:"p-2.5 text-slate-400 hover:text-primary hover:bg-primary/10 rounded-xl transition-all",children:t.jsx(Un,{size:16})}),t.jsx("button",{onClick:()=>wt(L),className:"p-2.5 text-slate-400 hover:text-rose-600 hover:bg-rose-50 rounded-xl transition-all",children:t.jsx(_l,{size:16})})]})})]},Ne(L))})})]}),!l.length&&!E&&t.jsxs("div",{className:"p-20 text-center",children:[t.jsx("div",{className:"inline-flex p-6 bg-slate-50 rounded-full text-slate-300 mb-4",children:t.jsx(zn,{size:48})}),t.jsx("p",{className:"text-slate-400 font-medium",children:"No products found matching your search."})]})]})]}),O>0&&t.jsxs("div",{className:"mt-4 bg-white rounded-2xl shadow-sm border border-slate-100 px-4 sm:px-6 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-3 sm:gap-4",children:[t.jsxs("p",{className:"text-sm text-slate-500",children:["Showing"," ",t.jsxs("span",{className:"font-semibold text-slate-700",children:[(w-1)*Z+1,"â",Math.min(w*Z,O)]})," ","of"," ",t.jsx("span",{className:"font-semibold text-slate-700",children:O})," ","products"]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-1",children:[t.jsx("button",{onClick:()=>A(L=>Math.max(1,L-1)),disabled:w===1,className:"w-9 h-9 flex items-center justify-center text-slate-600 bg-slate-100 rounded-lg hover:bg-slate-200 disabled:opacity-40 disabled:cursor-not-allowed transition-all",children:t.jsx(Fv,{size:16})}),Array.from({length:H},(L,ue)=>ue+1).filter(L=>L===1||L===H||Math.abs(L-w)<=1).reduce((L,ue,pe,Re)=>(pe>0&&ue-Re[pe-1]>1&&L.push("..."),L.push(ue),L),[]).map((L,ue)=>L==="..."?t.jsx("span",{className:"px-2 text-slate-400 text-sm",children:"â¦"},`ellipsis-${ue}`):t.jsx("button",{onClick:()=>A(L),className:`w-9 h-9 text-sm font-semibold rounded-lg transition-all ${w===L?"bg-primary text-white shadow-sm":"text-slate-600 hover:bg-slate-100"}`,children:L},L)),t.jsx("button",{onClick:()=>A(L=>Math.min(H,L+1)),disabled:w===H,className:"w-9 h-9 flex items-center justify-center text-slate-600 bg-slate-100 rounded-lg hover:bg-slate-200 disabled:opacity-40 disabled:cursor-not-allowed transition-all",children:t.jsx(ls,{size:16})})]})]}),p&&t.jsx("div",{className:"fixed inset-0 z-[100] flex justify-center items-start overflow-y-auto p-4 bg-slate-900/60 backdrop-blur-md",onClick:L=>L.target===L.currentTarget&&g(!1),children:t.jsxs("div",{className:"bg-white rounded-[2rem] w-full max-w-4xl shadow-2xl animate-in zoom-in-95 duration-200 my-8 sm:my-12 relative overflow-hidden",children:[t.jsxs("div",{className:"px-4 sm:px-8 py-5 sm:py-6 border-b border-slate-100 flex items-center justify-between sticky top-0 bg-white/95 backdrop-blur-md rounded-t-[2rem] z-[110]",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-xl flex items-center justify-center text-primary",children:t.jsx(zn,{size:20})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-xl font-bold text-slate-900",children:y?"Edit Product":"New Product"}),t.jsx("p",{className:"text-xs text-slate-500 font-medium",children:"Complete product specifications and pricing"})]})]}),t.jsx("button",{onClick:()=>g(!1),className:"p-2 rounded-full transition-all bg-slate-100 text-slate-600 sm:bg-transparent sm:text-slate-400 hover:text-slate-900 hover:bg-slate-100",children:t.jsx(ns,{size:20})})]}),t.jsxs("form",{onSubmit:Nt,className:"p-4 sm:p-8 pt-6 sm:pt-10 space-y-8 sm:space-y-12",children:[t.jsxs("section",{className:"space-y-6 scroll-mt-24",children:[t.jsxs("div",{className:"flex items-center gap-2 text-slate-900",children:[t.jsx(Vp,{size:18,className:"text-primary"}),t.jsx("h4",{className:"font-bold uppercase tracking-widest text-[10px]",children:"Core Information"})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Product Name"}),t.jsx("input",{required:!0,type:"text",value:T.name,onChange:L=>P({...T,name:L.target.value}),className:"w-full px-5 py-4 bg-slate-50 border border-slate-200 rounded-2xl text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none transition-all font-medium",placeholder:"SleekTap Neo Wristband"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Category"}),t.jsxs("div",{className:"relative",children:[t.jsxs("select",{required:!0,className:"w-full px-5 py-4 bg-slate-50 border border-slate-200 rounded-2xl text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none transition-all font-medium appearance-none",value:T.category,onChange:L=>{var Ye;const ue=L.target.value,pe=i.find(Pe=>Ne(Pe)===ue),Re=((Ye=pe==null?void 0:pe.name)==null?void 0:Ye.toLowerCase().includes("business card"))??!1;P({...T,category:ue,urlType:Re?"business-card":T.urlType==="business-card"?"single":T.urlType})},children:[t.jsx("option",{value:"",disabled:!0,children:"Choose Category"}),i.map(L=>t.jsx("option",{value:Ne(L),children:L.name},Ne(L)))]}),t.jsx("div",{className:"absolute inset-y-0 right-4 flex items-center pointer-events-none text-slate-400",children:t.jsx(vo,{size:14,className:"rotate-45"})})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Use Case (Optional)"}),t.jsxs("div",{className:"relative",children:[t.jsxs("select",{className:"w-full px-5 py-4 bg-slate-50 border border-slate-200 rounded-2xl text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none transition-all font-medium appearance-none",value:T.useCase,onChange:L=>P({...T,useCase:L.target.value}),children:[t.jsx("option",{value:"",children:"No Use Case"}),c.map(L=>t.jsx("option",{value:Ne(L),children:L.name},Ne(L)))]}),t.jsx("div",{className:"absolute inset-y-0 right-4 flex items-center pointer-events-none text-slate-400",children:t.jsx(vo,{size:14,className:"rotate-45"})})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"SKU (Optional)"}),t.jsx("input",{type:"text",value:T.sku,onChange:L=>P({...T,sku:L.target.value}),className:"w-full px-5 py-4 bg-slate-50 border border-slate-200 rounded-2xl text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none transition-all font-medium",placeholder:"Auto-generated if empty"})]}),t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Custom Slug (Optional)"}),t.jsx("input",{type:"text",value:T.slug,onChange:L=>P({...T,slug:L.target.value}),className:"w-full px-5 py-4 bg-slate-50 border border-slate-200 rounded-2xl text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none transition-all font-medium",placeholder:"custom-product-url"})]}),t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Short Description"}),t.jsx("textarea",{rows:3,value:T.description,onChange:L=>P({...T,description:L.target.value}),className:"w-full px-5 py-4 bg-slate-50 border border-slate-200 rounded-2xl text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none transition-all font-medium resize-none",placeholder:"Brief tagline or summary shown in product cards..."})]}),t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Long Description"}),t.jsx(Z4,{value:T.longDescription,onChange:L=>P({...T,longDescription:L}),placeholder:"Full, detailed description shown on the product pageâ¦"})]})]})]}),t.jsxs("section",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center gap-2 text-slate-900",children:[t.jsx(jj,{size:18,className:"text-primary"}),t.jsx("h4",{className:"font-bold uppercase tracking-widest text-[10px]",children:"Media Assets"})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-3",children:"Featured Image (Required)"}),t.jsx("div",{className:"relative group aspect-video rounded-3xl bg-slate-50 border-2 border-dashed border-slate-200 flex items-center justify-center overflow-hidden transition-all hover:border-primary/50",children:F?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:F,alt:"Featured",className:"w-full h-full object-contain p-4"}),t.jsx("div",{className:"absolute inset-0 bg-slate-900/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity",children:t.jsxs("label",{className:"px-5 py-2.5 bg-white rounded-xl text-primary font-bold cursor-pointer hover:scale-105 transition-transform",children:["Change Image",t.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:fe})]})})]}):t.jsxs("label",{className:"flex flex-col items-center gap-3 cursor-pointer p-10 w-full h-full",children:[t.jsx("div",{className:"w-12 h-12 rounded-2xl bg-white shadow-sm border border-slate-100 flex items-center justify-center text-slate-400 group-hover:text-primary transition-colors",children:t.jsx(Oa,{size:24})}),t.jsx("span",{className:"text-sm font-semibold text-slate-400",children:"Click to upload featured image"}),t.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:fe})]})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-3",children:"Gallery (Max 5)"}),t.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[le.map((L,ue)=>t.jsxs("div",{className:"relative aspect-square rounded-2xl bg-slate-50 border border-slate-100 overflow-hidden group",children:[t.jsx("img",{src:L,className:"w-full h-full object-cover"}),t.jsx("button",{type:"button",onClick:()=>me(ue),className:"absolute top-1 right-1 p-1 bg-white/90 rounded-lg text-rose-500 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ns,{size:14})})]},ue)),le.length<5&&t.jsxs("label",{className:"aspect-square rounded-2xl border-2 border-dashed border-slate-200 flex items-center justify-center text-slate-400 hover:border-primary/50 hover:bg-slate-50 cursor-pointer transition-all",children:[t.jsx(Tl,{size:20}),t.jsx("input",{type:"file",multiple:!0,className:"hidden",accept:"image/*",onChange:xe})]})]})]})]})]}),t.jsx("section",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:`p-3 rounded-2xl transition-all ${T.hasDesignVariation?"bg-primary text-white":"bg-slate-200 text-slate-500"}`,children:t.jsx(lm,{size:20})}),t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-bold text-slate-900",children:"Enable Design Variations"}),t.jsx("p",{className:"text-xs text-slate-500 font-medium",children:"Allow customers to choose between different designs"})]})]}),t.jsx("button",{type:"button",onClick:()=>P({...T,hasDesignVariation:!T.hasDesignVariation}),className:`relative shrink-0 w-14 h-8 rounded-full transition-all duration-300 ${T.hasDesignVariation?"bg-primary shadow-lg shadow-primary/20":"bg-slate-300"}`,children:t.jsx("div",{className:`absolute top-1 w-6 h-6 rounded-full bg-white transition-all duration-300 transform shadow-sm ${T.hasDesignVariation?"left-7":"left-1"}`})})]})}),t.jsxs("section",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[t.jsxs("div",{className:"flex items-center gap-4 mb-5",children:[t.jsx("div",{className:"p-3 bg-primary/10 rounded-2xl text-primary",children:t.jsx(nm,{size:20})}),t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-bold text-slate-900",children:"Destination URL Type"}),t.jsx("p",{className:"text-xs text-slate-500 font-medium",children:"Choose how customers assign destination URLs after purchase"})]})]}),t.jsx("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(15rem,1fr))] gap-3 sm:gap-4",children:s3.map(L=>{const ue=T.urlType===L.key;return t.jsxs("button",{type:"button",onClick:()=>P(pe=>({...pe,urlType:L.key,allowedUrls:L.key==="single"?pe.allowedUrls.slice(0,1):L.key==="business-card"||L.key==="loyalty"?[]:pe.allowedUrls})),className:`p-4 sm:p-5 rounded-2xl border-2 text-left transition-all ${ue?"border-primary bg-white shadow-sm":"border-slate-200 bg-white/50 hover:border-slate-300"}`,children:[t.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[t.jsx("div",{className:`w-4 h-4 shrink-0 rounded-full border-2 flex items-center justify-center ${ue?"border-primary":"border-slate-300"}`,children:ue&&t.jsx("div",{className:"w-2 h-2 rounded-full bg-primary"})}),t.jsx("span",{className:"text-sm font-bold text-slate-900 leading-tight",children:L.label})]}),t.jsx("p",{className:"text-xs text-slate-500 leading-relaxed pl-7",children:L.description})]},L.key)})}),!Ct&&t.jsxs("div",{className:"mt-6 pt-6 border-t border-slate-200",children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("h5",{className:"text-sm font-bold text-slate-900",children:"Allowed URL Platforms"}
523),t.jsx("p",{className:"text-xs text-slate-500 font-medium mt-1",children:Oe?"Pick exactly one platform the customer's URL must point to, or Custom URL to accept any valid link.":"Pick one or more platforms. Customers can add each at most once â including Custom URL, which accepts any valid link."})]}),t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-3 gap-2.5",children:v1.map(L=>{const ue=T.allowedUrls.includes(L.key),pe=Oe;return t.jsxs("button",{type:"button",onClick:()=>{if(pe)P({...T,allowedUrls:ue?[]:[L.key]});else{const Re=ue?T.allowedUrls.filter(Ye=>Ye!==L.key):[...T.allowedUrls,L.key];P({...T,allowedUrls:Re})}},className:`flex items-center gap-2.5 px-3 sm:gap-3 sm:px-4 py-3 rounded-xl border-2 text-left transition-all ${ue?"border-primary bg-primary/5":"border-slate-200 bg-white hover:border-slate-300"}`,children:[t.jsx("div",{className:`shrink-0 w-4 h-4 ${pe?"rounded-full":"rounded"} border-2 flex items-center justify-center ${ue?"border-primary bg-primary":"border-slate-300"}`,children:ue&&(pe?t.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white"}):t.jsx("svg",{className:"w-2.5 h-2.5 text-white",viewBox:"0 0 20 20",fill:"currentColor",children:t.jsx("path",{fillRule:"evenodd",d:"M16.7 5.3a1 1 0 010 1.4l-7.5 7.5a1 1 0 01-1.4 0L3.3 9.7a1 1 0 011.4-1.4l3.8 3.8 6.8-6.8a1 1 0 011.4 0z",clipRule:"evenodd"})}))}),Ho(L.key)?t.jsx("img",{src:Ho(L.key),alt:"",className:"shrink-0 w-5 h-5"}):t.jsx(nm,{size:20,className:"shrink-0 text-slate-400"}),t.jsx("span",{className:"min-w-0 break-words text-sm font-semibold text-slate-700 leading-tight",children:L.label})]},L.key)})}),T.allowedUrls.includes(y1)&&t.jsx("p",{className:"mt-3 text-xs text-slate-500 font-medium",children:Oe?"Customers can point this product at any link â only basic URL validation (http:// or https://) is applied.":"The Custom URL slot accepts any link â only basic URL validation (http:// or https://) is applied."}),Oe&&T.allowedUrls.length!==1&&t.jsx("p",{className:"mt-3 text-xs text-amber-600 font-medium",children:"Select exactly one platform for single-URL products."}),Je&&T.allowedUrls.length===0&&t.jsx("p",{className:"mt-3 text-xs text-amber-600 font-medium",children:T.urlType==="sleek-widget"?"Select at least one platform for Sleek Widget products.":"Select at least one platform for multi-URL products."})]})]}),t.jsxs("section",{className:"space-y-8",children:[t.jsxs("div",{className:"flex items-center gap-2 text-slate-900",children:[t.jsx(lj,{size:18,className:"text-primary"}),t.jsx("h4",{className:"font-bold uppercase tracking-widest text-[10px]",children:"Pricing & Quantity Tiers"})]}),t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:S.map((L,ue)=>t.jsxs("div",{className:"bg-white p-5 rounded-3xl border border-slate-100 shadow-sm space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest",children:[L.quantity," Order"]}),t.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"})]}),t.jsxs("div",{className:"relative",children:[t.jsx("span",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-slate-400",children:"$"}),t.jsx("input",{type:"number",step:"0.01",value:L.price,onWheel:pe=>pe.currentTarget.blur(),onChange:pe=>Te(ue,parseFloat(pe.target.value)),className:"w-full pl-8 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-xl text-sm font-bold text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none transition-all"})]}),!T.hasDesignVariation&&t.jsxs("label",{className:"relative block group aspect-square rounded-2xl bg-slate-50 border-2 border-dashed border-slate-200 overflow-hidden cursor-pointer transition-all hover:border-primary/50",children:[L.image?t.jsx("img",{src:L.image,className:"w-full h-full object-contain p-2"}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-slate-400",children:[t.jsx(Oa,{size:20}),t.jsx("span",{className:"text-[10px] font-bold mt-1",children:"Upload Image"})]}),t.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:pe=>{var Re;return((Re=pe.target.files)==null?void 0:Re[0])&&Ue(ue,pe.target.files[0])}})]})]},L.quantity))}),T.hasDesignVariation&&t.jsxs("div",{className:"space-y-12",children:[J.map((L,ue)=>t.jsxs("div",{className:"p-8 bg-slate-50/50 rounded-[2.5rem] border border-slate-100 space-y-8 relative group",children:[t.jsx("button",{type:"button",onClick:()=>rt(ue),className:"absolute -top-3 -right-3 w-10 h-10 bg-white shadow-lg border border-slate-100 rounded-full flex items-center justify-center text-rose-500 hover:scale-110 transition-transform",children:t.jsx(Hp,{size:20})}),t.jsxs("div",{className:"flex items-center gap-4 max-w-sm",children:[t.jsx("div",{className:"p-3 bg-white rounded-2xl shadow-sm",children:t.jsx(_j,{size:18,className:"text-primary"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("label",{className:"block text-[10px] font-bold text-slate-400 uppercase tracking-widest mb-1.5",children:"Design Group Name"}),t.jsx("input",{required:!0,type:"text",value:L.groupName,onChange:pe=>st(ue,pe.target.value),placeholder:"e.g. Classic Edition",className:"w-full px-4 py-3 bg-white border border-slate-200 rounded-xl text-sm font-bold text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none"})]})]}),t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:L.pricing.map((pe,Re)=>
523{var Ye;return t.jsxs("div",{className:"bg-white p-5 rounded-3xl border border-slate-100 shadow-sm space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:[pe.quantity," Design"]}),t.jsxs("span",{className:"text-primary font-black text-xs opacity-20",children:["VAR ",ue+1]})]}),t.jsxs("p",{className:"text-[11px] font-bold text-slate-500",children:["$",(((Ye=S.find(Pe=>Pe.quantity===pe.quantity))==null?void 0:Ye.price)??0).toFixed(2)]}),t.jsxs("label",{className:"relative block group aspect-square rounded-2xl bg-slate-50 border-2 border-dashed border-slate-200 overflow-hidden cursor-pointer transition-all hover:border-primary/50",children:[pe.image?t.jsx("img",{src:pe.image,className:"w-full h-full object-contain p-2"}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-slate-400",children:[t.jsx(Oa,{size:18}),t.jsx("span",{className:"text-[9px] font-bold mt-1",children:"Design Image"})]}),t.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:Pe=>{var sa;return((sa=Pe.target.files)==null?void 0:sa[0])&<(ue,Re,Pe.target.files[0])}})]})]},pe.quantity)})})]},ue)),t.jsxs("button",{type:"button",onClick:Le,className:"w-full py-6 bg-slate-50 border-2 border-dashed border-slate-200 rounded-3xl text-slate-400 font-bold flex items-center justify-center gap-3 hover:bg-slate-100 hover:border-primary/30 transition-all hover:text-primary",children:[t.jsx(vo,{size:24}),"Add Design Group"]})]})]}),t.jsxs("section",{className:"pt-6 border-t border-slate-100 grid grid-cols-1 md:grid-cols-2 gap-8",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Inventory Count"}),t.jsx("input",{type:"number",value:T.stock,onWheel:L=>L.currentTarget.blur(),onChange:L=>P({...T,stock:parseInt(L.target.value)}),className:"w-full px-5 py-4 bg-slate-50 border border-slate-200 rounded-2xl text-slate-900 font-bold focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none"})]}),t.jsx("div",{className:"flex items-center gap-6",children:t.jsxs("div",{className:"flex-1",children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Publish Status"}),t.jsx("button",{type:"button",onClick:()=>P({...T,isActive:!T.isActive}),className:`w-full py-4 rounded-2xl font-bold flex items-center justify-center gap-2 transition-all ${T.isActive?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-slate-100 text-slate-500 border border-slate-200"}`,children:T.isActive?"Active / Visible":"Hidden / Inactive"})]})}),t.jsx("div",{className:"md:col-span-2",children:t.jsxs("label",{className:"flex items-center gap-3 p-4 bg-slate-50 border border-slate-200 rounded-2xl cursor-pointer hover:border-primary/40 transition-all select-none",children:[t.jsx("input",{type:"checkbox",checked:T.isReview,onChange:L=>P({...T,isReview:L.target.checked}),className:"w-5 h-5 rounded-md border-slate-300 text-primary focus:ring-2 focus:ring-primary/30 cursor-pointer"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-bold text-slate-900",children:"Is Review"}),t.jsx("p",{className:"text-xs text-slate-500 font-medium",children:"Mark this product as a review product (e.g. a Google or Facebook review tag)."})]})]})}),t.jsx("div",{className:"md:col-span-2",children:t.jsxs("label",{className:"flex items-center gap-3 p-4 bg-slate-50 border border-slate-200 rounded-2xl cursor-pointer hover:border-primary/40 transition-all select-none",children:[t.jsx("input",{type:"checkbox",checked:T.isCustomizable,onChange:L=>P({...T,isCustomizable:L.target.checked}),className:"w-5 h-5 rounded-md border-slate-300 text-primary focus:ring-2 focus:ring-primary/30 cursor-pointer"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-bold text-slate-900",children:"Customizable"}),t.jsx("p",{className:"text-xs text-slate-500 font-medium",children:"Printed to order â the customer can upload their own logo and preview it from their dashboard."})]})]})}),T.isCustomizable&&t.jsxs("div",{className:"md:col-span-2 p-4 bg-slate-50 border border-slate-200 rounded-2xl space-y-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-bold text-slate-900",children:"Print area"}
523),t.jsx("p",{className:"text-xs text-slate-500 font-medium mt-0.5",children:"Drag the box to where the logo may be printed. The customer's preview uses this exact rectangle, so what they approve is what the press produces."})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-[11px] font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Mockup image"}),t.jsx("div",{className:"relative group aspect-video rounded-2xl bg-white border-2 border-dashed border-slate-200 flex items-center justify-center overflow-hidden hover:border-primary/50 transition-all",children:ye?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:ye,alt:"Mockup",className:"w-full h-full object-contain p-3"}),t.jsxs("div",{className:"absolute inset-0 bg-slate-900/40 opacity-0 group-hover:opacity-100 flex items-center justify-center gap-2 transition-opacity",children:[t.jsxs("label",{className:"px-4 py-2 bg-white rounded-xl text-primary text-sm font-bold cursor-pointer hover:scale-105 transition-transform",children:["Change",t.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:K})]}),t.jsx("button",{type:"button",onClick:()=>{U(""),te(null)},className:"px-4 py-2 bg-white rounded-xl text-rose-600 text-sm font-bold hover:scale-105 transition-transform",children:"Remove"})]})]}):t.jsxs("label",{className:"flex flex-col items-center gap-2 cursor-pointer p-6 w-full h-full justify-center",children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-slate-50 border border-slate-100 flex items-center justify-center text-slate-400 group-hover:text-primary transition-colors",children:t.jsx(Oa,{size:20})}),t.jsx("span",{className:"text-xs font-semibold text-slate-400 text-center px-2",children:"Upload a flat, straight-on photo of the blank product"}),t.jsx("span",{className:"text-[11px] text-slate-400",children:"Leave empty to use the featured image"}),t.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:K})]})})]}),t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[["From left (%)","printAreaX"],["From top (%)","printAreaY"],["Width (%)","printAreaWidth"],["Height (%)","printAreaHeight"]].map(([L,ue])=>t.jsxs("div",{children:[t.jsx("label",{className:"block text-[11px] font-bold text-slate-500 uppercase tracking-wider mb-1",children:L}),t.jsx("input",{type:"number",min:0,max:100,value:T[ue],onChange:pe=>P({...T,[ue]:Number(pe.target.value)}),className:"w-full px-3 py-2 border border-slate-200 rounded-lg text-sm outline-none focus:border-primary"})]},ue))}),t.jsx("div",{className:"grid grid-cols-3 gap-3",children:[["Real width (mm)","printWidthMm"],["Real height (mm)","printHeightMm"],["Min DPI","printMinDpi"]].map(([L,ue])=>t.jsxs("div",{children:[t.jsx("label",{className:"block text-[11px] font-bold text-slate-500 uppercase tracking-wider mb-1",children:L}),t.jsx("input",{type:"number",min:1,value:T[ue],onChange:pe=>P({...T,[ue]:Number(pe.target.value)}),className:"w-full px-3 py-2 border border-slate-200 rounded-lg text-sm outline-none focus:border-primary"})]},ue))}),t.jsx("p",{className:"text-xs text-slate-500",children:'The real size drives the "this may print blurry" warning the customer sees, so get it close to the physical product.'})]})]}),t.jsxs("section",{className:"space-y-6 pt-6 border-t border-slate-100 pb-8",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2 text-slate-900",children:[t.jsx(Vp,{size:18,className:"text-primary"}),t.jsx("h4",{className:"font-bold uppercase tracking-widest text-[10px]",children:"FAQ"})]}),t.jsxs("button",{type:"button",onClick:aa,className:"flex items-center gap-2 px-4 py-2 bg-primary/10 hover:bg-primary/20 text-primary font-bold text-xs uppercase tracking-wider rounded-xl transition-all active:scale-95",children:[t.jsx(vo,{size:16}),"Add FAQ"]})]}),ve.length===0?t.jsx("div",{className:"text-center py-8 px-6 bg-slate-50 border border-dashed border-slate-200 rounded-2xl",children:t.jsx("p",{className:"text-sm font-medium text-slate-400",children:'No FAQs added yet. Click "Add FAQ" to create question / answer pairs shown on the product page.'})}):t.jsx("div",{className:"space-y-4",children:ve.map((L,ue)=>t.jsxs("div",{className:"p-5 bg-slate-50 border border-slate-200 rounded-2xl space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs font-bold text-slate-500 uppercase tracking-wider",children:["FAQ #",ue+1]}),t.jsx("button",{type:"button",onClick:()=>As(ue),className:"text-rose-500 hover:text-rose-600 transition-colors","aria-label":`Remove FAQ ${ue+1}`,children:t.jsx(Hp,{size:20})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Question"}),t.jsx("input",{type:"text",value:L.question,onChange:pe=>we(ue,"question",pe.target.value),maxLength:500,className:"w-full px-5 py-3.5 bg-white border border-slate-200 rounded-2xl text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none transition-all font-medium",placeholder:"e.g. How long does shipping take?"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Answer"}),t.jsx("textarea",{rows:3,value:L.answer,onChange:pe=>we(ue,"answer",pe.target.value),maxLength:5e3,className:"w-full px-5 py-3.5 bg-white border border-slate-200 rounded-2xl text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none transition-all font-medium resize-y",placeholder:"Write the answer to this question..."})]})]},ue))})]}),t.jsxs("section",{className:"space-y-6 pt-6 border-t border-slate-100 pb-8",children:[t.jsxs("div",{className:"flex items-center gap-2 text-slate-900",children:[t.jsx(ej,{size:18,className:"text-primary"}),t.jsx("h4",{className:"font-bold uppercase tracking-widest text-[10px]",children:"HTML Dump"})]}),t.jsxs("div",{className:"w-full",children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Raw HTML Content"}),t.jsx("textarea",{rows:6,value:T.html,onChange:L=>P({...T,html:L.target.value}),className:"w-full px-5 py-4 bg-slate-50 border border-slate-200 rounded-2xl text-slate-900 focus:ring-4 focus:ring-primary/5 focus:border-primary outline-none transition-all font-mono text-sm resize-y",placeholder:"Paste your HTML code here..."})]})]}),t.jsxs("div",{className:"flex gap-3 sm:gap-4 pt-4 sticky bottom-0 bg-white/90 backdrop-blur-xl py-6 border-t border-slate-100 -mx-4 sm:-mx-8 px-4 sm:px-8 z-[120] rounded-b-[2rem]",children:[t.jsx("button",{type:"button",onClick:()=>g(!1),disabled:N,className:"flex-1 py-4 px-4 sm:px-6 border border-slate-200 text-slate-600 font-bold rounded-2xl hover:bg-slate-50 transition-all active:scale-95 disabled:opacity-50 whitespace-nowrap",children:"Cancel"}),t.jsx("button",{type:"submit",disabled:N,className:"flex-[2] py-4 px-4 sm:px-6 bg-primary hover:bg-primary-hover text-white font-black rounded-2xl shadow-2xl shadow-primary/30 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50 uppercase tracking-wider sm:tracking-widest text-xs sm:text-sm whitespace-nowrap",children:N?t.jsx(yt,{className:"animate-spin",size:20}):y?"Update Product":"Create Product"})]})]})]})})]})},n3=()=>{const[l,r]=b.useState([]),[i,o]=b.useState(""),[c,m]=b.useState(!1),[f,h]=b.useState(null),[p,g]=b.useState(!0),[y,v]=b.useState(!1),E=b.useRef(null),R=b.useRef(null),[N,k]=b.useState(null),[w,A]=b.useState(null),[O,z]=b.useState(null),[H,se]=b.useState(null),Z=C=>(C==null?void 0:C._id)||(C==null?void 0:C.id),[T,P]=b.useState({name:"",slug:"",status:"Active"});b.useEffect(()=>{q()},[]);const q=async()=>{g(!0);try{const C=await qe.get("/categories");C.data.success&&r(C.data.data)}catch(C){console.error("Error fetching categories:",C)}finally{g(!1)}},Q=C=>{var de;const le=(de=C.target.files)==null?void 0:de[0];if(le){k(le);const S=new FileReader;S.onloadend=()=>{A(S.result)},S.readAsDataURL(le)}},F=C=>{var de;const le=(de=C.target.files)==null?void 0:de[0];if(le){z(le);const S=new FileReader;S.onloadend=()=>{se(S.result)},S.readAsDataURL(le)}},$=async C=>{var de,S;const le=Z(C);if(le&&confirm("Are you sure you want to delete this category?"))try{await qe.delete(`/categories/${le}`),r(l.filter(B=>Z(B)!==le))}catch(B){console.error("Error deleting category:",B),alert(((S=(de=B.response)==null?void 0:de.data)==null?void 0:S.error)||"Failed to delete category")}},G=C=>{h(C),P({name:C.name,slug:C.slug||"",status:C.status}),A(C.image),k(null),se(C.thumbnail||null),z(null),m(!0)},te=()=>{h(null),P({name:"",slug:"",status:"Active"}),A(null),k(null),se(null),z(null),m(!0)},ye=async C=>{var de,S;C.preventDefault(),v(!0);const le=new FormData;Object.keys(T).forEach(B=>{const J=T[B];J!=null&&le.append(B,J)}),N&&le.append("image",N),O&&le.append("thumbnail",O);try{if(f){const B=Z(f);await qe.put(`/categories/${B}`,le,{headers:{"Content-Type":"multipart/form-data"}})}else await qe.post("/categories",le,{headers:{"Content-Type":"multipart/form-data"}});q(),m(!1)}catch(B){console.error("Error saving category:",B);const J=((S=(de=B.response)==null?void 0:de.data)==null?void 0:S.error)||"Failed to save category. Please check the network tab.";alert(J)}finally{v(!1)}},U=C=>{C.target===C.currentTarget&&m(!1)},ce=l.filter(C=>C.name.toLowerCase().includes(i.toLowerCase()));return t.jsxs("div",{className:"animate-in fade-in duration-500",children:[t.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 mb-6",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Product Categories"}),t.jsx("p",{className:"text-slate-500",children:"Organize your products into logical groups"})]}),t.jsxs("button",{onClick:te,className:"flex items-center justify-center gap-2 bg-primary hover:bg-primary-hover text-white px-5 py-2.5 rounded-xl font-semibold transition-all shadow-lg shadow-primary/20",children:[t.jsx(Tl,{size:20}),"Add Category"]})]}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:[t.jsxs("div",{className:"lg:col-span-full flex items-center justify-between gap-4 bg-white p-4 rounded-xl border border-slate-100 shadow-sm",children:[t.jsxs("div",{className:"relative flex-1 max-w-sm",children:[t.jsx("span",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-slate-400",children:t.jsx(Al,{size:18})}),t.jsx("input",{type:"text",placeholder:"Search categories...",value:i,onChange:C=>o(C.target.value),className:"w-full pl-10 pr-4 py-2 bg-white border border-slate-200 rounded-lg text-sm text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none"})]}),t.jsxs("p",{className:"shrink-0 whitespace-nowrap text-sm text-slate-500",children:["Total:"," ",t.jsx("span",{className:"font-bold text-slate-900",children:l.length})]})]}),p?Array.from({length:8}).map((C,le)=>t.jsxs("div",{className:"bg-white rounded-2xl p-4 border border-slate-100 shadow-sm animate-pulse flex flex-col",children:[t.jsx("div",{className:"w-full aspect-video rounded-xl bg-slate-200 mb-4"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"h-4 bg-slate-200 rounded w-24"}),t.jsx("div",{className:"h-3 bg-slate-200 rounded w-16"})]}),t.jsx("div",{className:"h-4 bg-slate-200 rounded-full w-12"})]})]},le)):ce.map(C=>t.jsxs("div",{className:"bg-white rounded-2xl p-4 border border-slate-100 shadow-sm hover:shadow-md transition-all group flex flex-col",children:[t.jsxs("div",{className:"relative aspect-video rounded-xl overflow-hidden mb-4 bg-slate-50 border border-slate-100 flex items-center justify-center",children:[t.jsx("img",{src:C.image,alt:C.name,className:"w-full h-full object-contain p-2 transition-transform duration-500 group-hover:scale-105"}),t.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx("button",{onClick:()=>G(C),className:"p-1.5 bg-white/90 backdrop-blur rounded-lg text-slate-600 hover:text-primary shadow-sm",children:t.jsx(Un,{size:14})}),t.jsx("button",{onClick:()=>$(C),className:"p-1.5 bg-white/90 backdrop-blur rounded-lg text-slate-600 hover:text-red-600 shadow-sm",children:t.jsx(_l,{size:14})})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-bold text-slate-900",children:C.name}),t.jsxs("p",{className:"text-xs text-slate-500 mt-0.5",children:[C.productC
523ount," Products"]})]}),t.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-bold uppercase ${C.status==="Active"?"bg-emerald-100 text-emerald-700":"bg-slate-100 text-slate-500"}`,children:C.status})]})]},Z(C)))]}),c&&t.jsx("div",{className:"fixed inset-0 z-[100] flex justify-center items-start overflow-y-auto p-4 bg-slate-900/40 backdrop-blur-sm",onClick:U,children:t.jsxs("div",{className:"bg-white rounded-2xl w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-200 my-8 sm:my-12 relative overflow-hidden",children:[t.jsxs("div",{className:"px-6 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/50 sticky top-0 z-[110] backdrop-blur-md rounded-t-2xl",children:[t.jsx("h3",{className:"text-lg font-bold text-slate-900",children:f?"Edit Category":"New Category"}),t.jsx("button",{onClick:()=>m(!1),className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-200 rounded-full transition-colors",children:t.jsx(ns,{size:20})})]}),t.jsxs("form",{onSubmit:ye,className:"p-6 space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-1",children:"Category Name"}),t.jsx("input",{required:!0,type:"text",value:T.name,onChange:C=>P({...T,name:C.target.value}),className:"w-full px-4 py-2 bg-white border border-slate-200 rounded-xl text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none",placeholder:"e.g. Smart Wristbands"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-1",children:"Custom Slug (Optional)"}),t.jsx("input",{type:"text",value:T.slug||"",onChange:C=>P({...T,slug:C.target.value}),className:"w-full px-4 py-2 bg-white border border-slate-200 rounded-xl text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none",placeholder:"custom-category-url"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-1",children:"Status"}),t.jsxs("select",{value:T.status,onChange:C=>P({...T,status:C.target.value}),className:"w-full px-4 py-2 bg-white border border-slate-200 rounded-xl text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none cursor-pointer",children:[t.jsx("option",{value:"Active",children:"Active"}),t.jsx("option",{value:"Inactive",children:"Inactive"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Category Banner"}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("div",{onClick:()=>{var C;return(C=E.current)==null?void 0:C.click()},className:"group relative cursor-pointer flex flex-col items-center justify-center w-full h-40 border-2 border-dashed border-slate-200 rounded-2xl hover:border-primary hover:bg-slate-50 transition-all overflow-hidden bg-white",children:w?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:w,alt:"Preview",className:"w-full h-full object-contain p-4"}),t.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity",children:t.jsxs("div",{className:"flex items-center gap-2 text-white font-semibold text-sm",children:[t.jsx(Oa,{size:18}),"Change Image"]})})]}):t.jsxs("div",{className:"flex flex-col items-center gap-2 text-slate-400",children:[t.jsx(Oa,{size:32}),t.jsx("span",{className:"text-sm font-medium",children:"Click to upload category image"})]})}),t.jsx("input",{type:"file",ref:E,onChange:Q,accept:"image/*",className:"hidden"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Thumbnail (Optional)"}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("div",{onClick:()=>{var C;return(C=R.current)==null?void 0:C.click()},className:"group relative cursor-pointer flex flex-col items-center justify-center w-full h-40 border-2 border-dashed border-slate-200 rounded-2xl hover:border-primary hover:bg-slate-50 transition-all overflow-hidden bg-white",children:H?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:H,alt:"Thumbnail Preview",className:"w-full h-full object-contain p-4"}),t.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity",children:t.jsxs("div",{className:"flex items-center gap-2 text-white font-semibold text-sm",children:[t.jsx(Oa,{size:18}),"Change Thumbnail"]})})]}):t.jsxs("div",{className:"flex flex-col items-center gap-2 text-slate-400",children:[t.jsx(Oa,{size:32}),t.jsx("span",{className:"text-sm font-medium",children:"Click to upload thumbnail"})]})}),t.jsx("input",{type:"file",ref:R,onChange:F,accept:"image/*",className:"hidden"})]})]}),t.jsxs("button",{type:"submit",disabled:y,className:"w-full py-3 bg-primary hover:bg-primary-hover text-white font-bold rounded-xl shadow-lg transition-all mt-4 active:scale-95 flex items-center justify-center gap-2 disabled:opacity-50",children:[y&&t.jsx(yt,{className:"animate-spin",size:20}),f?"Save Changes":"Create Category"]})]})]})})]})},r3=()=>{const[l,r]=b.useState([]),[i,o]=b.useState(""),[c,m]=b.useState(!1),[f,h]=b.useState(null),[p,g]=b.useState(!0),[y,v]=b.useState(!1),E=b.useRef(null),R=b.useRef(null),[N,k]=b.useState(null),[w,A]=b.useState(null),[O,z]=b.useState(null),[H,se]=b.useState(null),Z=C=>(C==null?void 0:C._id)||(C==null?void 0:C.id),[T,P]=b.useState({name:"",slug:"",status:"Active"});b.useEffect(()=>{q()},[]);const q=async()=>{g(!0);try{const C=await qe.get("/use-cases");C.data.success&&r(C.data.data)}catch(C){console.error("Error fetching use cases:",C)}finally{g(!1)}},Q=C=>{var de;const le=(de=C.target.files)==null?void 0:de[0];if(le){k(le);const S=new FileReader;S.onloadend=()=>{A(S.result)},S.readAsDataURL(le)}},F=C=>{var de;const le=(de=C.target.files)==null?void 0:de[0];if(le){z(le);const S=new FileReader;S.onloadend=()=>{se(S.result)},S.readAsDataURL(le)}},$=async C=>{var de,S;const le=Z(C);if(le&&confirm("Are you sure you want to delete this use case?"))try{await qe.delete(`/use-cases/${le}`),r(l.filter(B=>Z(B)!==le))}catch(B){console.error("Error deleting use case:",B),alert(((S=(de=B.response)==null?void 0:de.data)==null?void 0:S.error)||"Failed to delete use case")}},G=C=>{h(C),P({name:C.name,slug:C.slug||"",status:C.status}),A(C.image),k(null),se(C.thumbnail||null),z(null),m(!0)},te=()=>{h(null),P({name:"",slug:"",status:"Active"}),A(null),k(null),se(null),z(null),m(!0)},ye=async C=>{var de,S;C.preventDefault(),v(!0);const le=new FormData;Object.keys(T).forEach(B=>{const J=T[B];J!=null&&J!==""&&le.append(B,J)}),N&&le.append("image",N),O&&le.append("thumbnail",O);try{if(f){const B=Z(f);await qe.put(`/use-cases/${B}`,le,{headers:{"Content-Type":"multipart/form-data"}})}else await qe.post("/use-cases",le,{headers:{"Content-Type":"multipart/form-data"}});q(),m(!1)}catch(B){console.error("Error saving use case:",B);const J=((S=(de=B.response)==null?void 0:de.data)==null?void 0:S.error)||"Failed to save use case. Please check the network tab.";alert(J)}finally{v(!1)}},U=C=>{C.target===C.currentTarget&&m(!1)},ce=l.filter(C=>C.name.toLowerCase().includes(i.toLowerCase()));return t.jsxs("div",{className:"animate-in fade-in duration-500",children:[t.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 mb-6",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Product Use Cases"}),t.jsx("p",{className:"text-slate-500",children:"Group your products by what customers use them for"})]}),t.jsxs("button",{onClick:te,className:"flex items-center justify-center gap-2 bg-primary hover:bg-primary-hover text-white px-5 py-2.5 rounded-xl font-semibold transition-all shadow-lg shadow-primary/20",children:[t.jsx(Tl,{size:20}),"Add Use Case"]})]}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:[t.jsxs("div",{className:"lg:col-span-full flex items-center justify-between gap-4 bg-white p-4 rounded-xl border border-slate-100 shadow-sm",children:[t.jsxs("div",{className:"relative flex-1 max-w-sm",children:[t.jsx("span",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-slate-400",children:t.jsx(Al,{size:18})}),t.jsx("input",{type:"text",placeholder:"Search use cases...",value:i,onChange:C=>o(C.target.value),className:"w-full pl-10 pr-4 py-2 bg-white border border-slate-200 rounded-lg text-sm text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none"})]}),t.jsxs("p",{className:"shrink-0 whitespace-nowrap text-sm text-slate-500",children:["Total:"," ",t.jsx("span",{className:"font-bold text-slate-900",children:l.length})]})]}),p?Array.from({length:8}).map((C,le)=>t.jsxs("div",{className:"bg-white rounded-2xl p-4 border border-slate-100 shadow-sm animate-pulse flex flex-col",children:[t.jsx("div",{className:"w-full aspect-video rounded-xl bg-slate-200 mb-4"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"h-4 bg-slate-200 rounded w-24"}),t.jsx("div",{className:"h-3 bg-slate-200 rounded w-16"})]}),t.jsx("div",{className:"h-4 bg-slate-200 rounded-full w-12"})]})]},le)):ce.map(C=>t.jsxs("div",{className:"bg-white rounded-2xl p-4 border border-slate-100 shadow-sm hover:shadow-md transition-all group flex flex-col",children:[t.jsxs("div",{className:"relative aspect-video rounded-xl overflow-hidden mb-4 bg-slate-50 border border-slate-100 flex items-center justify-center",children:[t.jsx("img",{src:C.image,alt:C.name,className:"w-full h-full object-contain p-2 transition-transform duration-500 group-hover:scale-105"}),t.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx("button",{onClick:()=>G(C),className:"p-1.5 bg-white/90 backdrop-blur rounded-lg text-slate-600 hover:text-primary shadow-sm",children:t.jsx(Un,{size:14})}),t.jsx("button",{onClick:()=>$(C),className:"p-1.5 bg-white/90 backdrop-blur rounded-lg text-slate-600 hover:text-red-600 shadow-sm",children:t.jsx(_l,{size:14})})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-bold text-slate-900",children:C.name}),t.jsxs("p",{className:"text-xs text-slate-500 mt-0.5",children:[C.productC
523ount," Products"]})]}),t.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-bold uppercase ${C.status==="Active"?"bg-emerald-100 text-emerald-700":"bg-slate-100 text-slate-500"}`,children:C.status})]})]},Z(C)))]}),c&&t.jsx("div",{className:"fixed inset-0 z-[100] flex justify-center items-start overflow-y-auto p-4 bg-slate-900/40 backdrop-blur-sm",onClick:U,children:t.jsxs("div",{className:"bg-white rounded-2xl w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-200 my-8 sm:my-12 relative overflow-hidden",children:[t.jsxs("div",{className:"px-6 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/50 sticky top-0 z-[110] backdrop-blur-md rounded-t-2xl",children:[t.jsx("h3",{className:"text-lg font-bold text-slate-900",children:f?"Edit Use Case":"New Use Case"}),t.jsx("button",{onClick:()=>m(!1),className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-200 rounded-full transition-colors",children:t.jsx(ns,{size:20})})]}),t.jsxs("form",{onSubmit:ye,className:"p-6 space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-1",children:"Use Case Name"}),t.jsx("input",{required:!0,type:"text",value:T.name,onChange:C=>P({...T,name:C.target.value}),className:"w-full px-4 py-2 bg-white border border-slate-200 rounded-xl text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none",placeholder:"e.g. Restaurant Tables"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-1",children:"Custom Slug (Optional)"}),t.jsx("input",{type:"text",value:T.slug||"",onChange:C=>P({...T,slug:C.target.value}),className:"w-full px-4 py-2 bg-white border border-slate-200 rounded-xl text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none",placeholder:"custom-use-case-url"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-1",children:"Status"}),t.jsxs("select",{value:T.status,onChange:C=>P({...T,status:C.target.value}),className:"w-full px-4 py-2 bg-white border border-slate-200 rounded-xl text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none cursor-pointer",children:[t.jsx("option",{value:"Active",children:"Active"}),t.jsx("option",{value:"Inactive",children:"Inactive"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Use Case Banner"}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("div",{onClick:()=>{var C;return(C=E.current)==null?void 0:C.click()},className:"group relative cursor-pointer flex flex-col items-center justify-center w-full h-40 border-2 border-dashed border-slate-200 rounded-2xl hover:border-primary hover:bg-slate-50 transition-all overflow-hidden bg-white",children:w?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:w,alt:"Preview",className:"w-full h-full object-contain p-4"}),t.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity",children:t.jsxs("div",{className:"flex items-center gap-2 text-white font-semibold text-sm",children:[t.jsx(Oa,{size:18}),"Change Image"]})})]}):t.jsxs("div",{className:"flex flex-col items-center gap-2 text-slate-400",children:[t.jsx(Oa,{size:32}),t.jsx("span",{className:"text-sm font-medium",children:"Click to upload use case image"})]})}),t.jsx("input",{type:"file",ref:E,onChange:Q,accept:"image/*",className:"hidden"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Thumbnail (Optional)"}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("div",{onClick:()=>{var C;return(C=R.current)==null?void 0:C.click()},className:"group relative cursor-pointer flex flex-col items-center justify-center w-full h-40 border-2 border-dashed border-slate-200 rounded-2xl hover:border-primary hover:bg-slate-50 transition-all overflow-hidden bg-white",children:H?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:H,alt:"Thumbnail Preview",className:"w-full h-full object-contain p-4"}),t.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity",children:t.jsxs("div",{className:"flex items-center gap-2 text-white font-semibold text-sm",children:[t.jsx(Oa,{size:18}),"Change Thumbnail"]})})]}):t.jsxs("div",{className:"flex flex-col items-center gap-2 text-slate-400",children:[t.jsx(Oa,{size:32}),t.jsx("span",{className:"text-sm font-medium",children:"Click to upload thumbnail"})]})}),t.jsx("input",{type:"file",ref:R,onChange:F,accept:"image/*",className:"hidden"})]})]}),t.jsxs("button",{type:"submit",disabled:y,className:"w-full py-3 bg-primary hover:bg-primary-hover text-white font-bold rounded-xl shadow-lg transition-all mt-4 active:scale-95 flex items-center justify-center gap-2 disabled:opacity-50",children:[y&&t.jsx(yt,{className:"animate-spin",size:20}),f?"Save Changes":"Create Use Case"]})]})]})})]})},i3=()=>{const l=Ya(),[r,i]=b.useState([]),[o,c]=b.useState("All"),[m,f]=b.useState(!0),[h,p]=b.useState(""),g=["All","Pending","Shipped","Delivered","Cancelled"],y=N=>
523(N==null?void 0:N._id)||(N==null?void 0:N.id);b.useEffect(()=>{v()},[]);const v=async()=>{f(!0);try{const N=await qe.get("/orders");N.data.success&&i(N.data.data)}catch(N){console.error("Error fetching orders:",N)}finally{f(!1)}},E=async(N,k)=>{const w=y(N);if(w)try{await qe.patch(`/orders/${w}/status`,{status:k}),v()}catch(A){console.error("Error updating order status:",A),alert("Failed to update status")}};if(m)return t.jsx("div",{className:"min-h-[400px] flex items-center justify-center",children:t.jsx(yt,{className:"animate-spin text-primary",size:40})});const R=r.filter(N=>{var O;const k=o==="All"||N.status===o,w=y(N),A=(((O=N.customer)==null?void 0:O.name)||N.customerName||"").toLowerCase().includes(h==null?void 0:h.toLowerCase())||(w==null?void 0:w.toLowerCase().includes(h==null?void 0:h.toLowerCase()));return k&&A});return t.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[t.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Order Management"}),t.jsx("p",{className:"text-slate-500",children:"View and manage customer orders and fulfillment"})]}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 bg-white border border-slate-200 text-slate-900 rounded-xl hover:bg-slate-50 transition-all font-medium",children:[t.jsx(Fr,{size:18}),"Export CSV"]})})]}),t.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 overflow-hidden",children:[t.jsx("div",{className:"border-b border-slate-100 px-6 overflow-x-auto",children:t.jsx("div",{className:"flex items-center gap-8 min-w-max",children:g.map(N=>t.jsxs("button",{onClick:()=>c(N),className:`py-4 text-sm font-semibold transition-all relative ${o===N?"text-primary":"text-slate-400 hover:text-slate-600"}`,children:[N,o===N&&t.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary rounded-full"})]},N))})}),t.jsx("div",{className:"p-6 border-b border-slate-100 flex flex-col sm:flex-row items-center justify-between gap-4",children:t.jsxs("div",{className:"relative w-full sm:w-80",children:[t.jsx("span",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-slate-400",children:t.jsx(Al,{size:18})}),t.jsx("input",{type:"text",placeholder:"Search orders...",value:h,onChange:N=>p(N.target.value),className:"w-full pl-10 pr-4 py-2 bg-white border border-slate-200 rounded-lg text-sm text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none"})]})}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-left",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-slate-50/50 text-slate-500 text-xs font-semibold uppercase tracking-wider",children:[t.jsx("th",{className:"px-6 py-4",children:"Order ID"}),t.jsx("th",{className:"px-6 py-4",children:"Customer"}),t.jsx("th",{className:"px-6 py-4",children:"Date"}),t.jsx("th",{className:"px-6 py-4",children:"Amount"}),t.jsx("th",{className:"px-6 py-4",children:"Status"}),t.jsx("th",{className:"px-6 py-4 text-right",children:"Action"})]})}),t.jsx("tbody",{className:"divide-y divide-slate-100",children:R.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:6,className:"px-6 py-16 text-center text-slate-400",children:h?"No orders match your search.":o==="All"?"No orders yet.":`No ${o.toLowerCase()} orders.`})}):R.map(N=>{var k,w;return t.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:"text-sm font-bold text-primary",children:y(N)})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("p",{className:"text-sm font-semibold text-slate-900",children:((k=N.customer)==null?void 0:k.name)||N.customerName||"Unknown"})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("p",{className:"text-sm text-slate-600",children:new Date(N.createdAt||N.date||"").toLocaleDateString()})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("p",{className:"text-sm font-bold text-slate-900",children:["$",(w=N.total)==null?void 0:w.toFixed(2)]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("select",{value:N.status,onChange:A=>E(N,A.target.value),className:`px-2.5 py-1 rounded-full text-[11px] font-bold uppercase transition-colors cursor-pointer outline-none focus:ring-2 focus:ring-primary/20 ${N.status==="Delivered"?"bg-emerald-100 text-emerald-700":N.status==="Shipped"?"bg-blue-100 text-blue-700":N.status==="Pending"?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:g.slice(1).map(A=>t.jsx("option",{value:A,children:A},A))})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right",children:t.jsx("button",{onClick:()=>l(`/orders/${y(N)}`),className:"p-2 text-slate-400 hover:text-primary transition-colors",children:t.jsx(Xr,{size:18})})})]},y(N))})})]})})]})]})},o3=l=>!l||!(l.line1||l.line2||l.city||l.state||l.postal_code||l.country),ku=(l,r)=>
523{if(l&&!o3(l)){const i=[l.city,l.state,l.postal_code].filter(Boolean).join(", ");return[l.line1,l.line2,i,l.country].filter(o=>!!o&&o.trim()!=="")}return r&&r.trim()?r.split(/\s*,\s*|\n/).filter(Boolean):[]},c3=["Pending","Shipped","Delivered","Cancelled"],d3={Pending:"bg-amber-100 text-amber-700",Shipped:"bg-blue-100 text-blue-700",Delivered:"bg-emerald-100 text-emerald-700",Cancelled:"bg-rose-100 text-rose-700"},Ax={paid:"bg-emerald-100 text-emerald-700",pending:"bg-amber-100 text-amber-700",failed:"bg-rose-100 text-rose-700"},u3=()=>{var $;const{id:l}=qa(),r=Ya(),[i,o]=b.useState(null),[c,m]=b.useState(!0),[f,h]=b.useState(!1),[p,g]=b.useState(!1),[y,v]=b.useState(""),[E,R]=b.useState(""),[N,k]=b.useState(""),[w,A]=b.useState(!1),[O,z]=b.useState(null),[H,se]=b.useState(null),Z=async(G,te)=>{try{await navigator.clipboard.writeText(G),se(te),setTimeout(()=>se(ye=>ye===te?null:ye),1500)}catch{}};b.useEffect(()=>{T()},[l]);const T=async()=>{m(!0);try{const G=await qe.get(`/orders/${l}`);if(G.data.success){const te=G.data.data;o(te),v(te.status),R(te.carrier||""),k(te.trackingNumber||"")}}catch(G){console.error("Error fetching order:",G)}finally{m(!1)}},P=async()=>{var G,te;if(i){A(!0),z(null);try{const ye=await qe.patch(`/orders/${l}/status`,{carrier:E.trim(),trackingNumber:N.trim()}),U=(G=ye.data)==null?void 0:G.data;U&&o(U),U!=null&&U.status&&v(U.status),z((te=ye.data)!=null&&te.emailSent?"Saved â the customer has been emailed their tracking link.":"Saved. (No email sent: the customer was already notified for this order.)")}catch(ye){console.error("Error saving tracking:",ye),z("Failed to save tracking. Please try again.")}finally{A(!1)}}},q=async()=>{if(!(!i||y===i.status)){h(!0);try{await qe.patch(`/orders/${l}/status`,{status:y}),o(G=>G&&{...G,status:y})}catch(G){console.error("Error updating status:",G),alert("Failed to update status."),v(i.status)}finally{h(!1)}}},Q=async()=>{if(confirm("Delete this order? This cannot be undone.")){g(!0);try{await qe.delete(`/orders/${l}`),r("/orders")}catch(G){console.error("Error deleting order:",G),alert("Failed to delete order."),g(!1)}}};if(c)return t.jsx("div",{className:"min-h-[400px] flex items-center justify-center",children:t.jsx(yt,{className:"animate-spin text-primary",size:40})});if(!i)return t.jsxs("div",{className:"min-h-[400px] flex flex-col items-center justify-center gap-4 text-slate-400",children:[t.jsx(zn,{size:48}),t.jsx("p",{className:"text-lg font-semibold",children:"Order not found."}),t.jsxs("button",{onClick:()=>r("/orders"),className:"flex items-center gap-2 px-4 py-2 text-sm font-semibold text-primary hover:underline",children:[t.jsx(Ln,{size:16}),"Back to Orders"]})]});const F=i.items.reduce((G,te)=>G+te.price*te.quantity,0);return t.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500 max-w-4xl mx-auto",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[t.jsxs("button",{onClick:()=>r("/orders"),className:"flex items-center gap-1 hover:text-primary transition-colors font-medium",children:[t.jsx(Ln,{size:15}),"Orders"]}),t.jsx(ls,{size:14}),t.jsx("span",{className:"text-slate-700 font-semibold",children:i.orderId})]}),t.jsx("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 p-6",children:t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:i.orderId}),t.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["Placed on ",new Date(i.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]})]}),t.jsxs("div",{className:"flex flex-col sm:items-end gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-[11px] font-semibold text-slate-400 uppercase tracking-wider",children:"Fulfillment"}),t.jsx("span",{className:`px-3 py-1.5 rounded-full text-xs font-bold uppercase ${d3[i.status]}`,children:i.status})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-[11px] font-semibold text-slate-400 uppercase tracking-wider",children:"Payment"}),t.jsx("span",{className:`px-3 py-1.5 rounded-full text-xs font-bold uppercase ${Ax[i.paymentStatus]}`,children:i.paymentStatus})]})]})]})}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[t.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[t.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 overflow-hidden",children:[t.jsx("div",{className:"px-4 sm:px-6 py-4 border-b border-slate-100",children:t.jsx("h2",{className:"font-semibold text-slate-900",children:"Order Items"})}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full min-w-120 text-left",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-slate-50/50 text-slate-500 text-xs font-semibold uppercase tracking-wider",children:[t.jsx("th",{className:"px-4 sm:px-6 py-3",children:"Product"}),t.jsx("th",{className:"px-4 sm:px-6 py-3 text-center",children:"Qty"}),t.jsx("th",{className:"px-4 sm:px-6 py-3 text-right",children:"Price"}),t.jsx("th",{className:"px-4 sm:px-6 py-3 text-right",children:"Total"})]})}),t.jsx("tbody",{className:"divide-y divide-slate-100",children:i.items.map((G,te)=>{var ye,U;return t.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[t.jsx("td",{className:"px-4 sm:px-6 py-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[(ye=G.product)!=null&&ye.featuredImage?t.jsx("img",{src:G.product.featuredImage,alt:G.product.name,className:"w-10 h-10 rounded-lg object-cover border border-slate-100 shrink-0"}):t.jsx("div",{className:"w-10 h-10 rounded-lg bg-slate-100 flex items-center justify-center shrink-0",children:t.jsx(zn,{size:16,className:"text-slate-300"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-semibold text-slate-900",children:(U=G.product)==null?void 0:U.name}),G.variant&&t.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:G.variant}),G.quantityOption&&t.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 mt-1 bg-amber-100 text-amber-700 text-[10px] font-bold rounded-full uppercase tracking-wider",title:"Quantity option from checkout",children:["Qty: ",G.quantityOption]})]})]})}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-center",children:t.jsx("span",{className:"text-sm text-slate-700",children:G.quantity})}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-right",children:t.jsxs("span",{className:"text-sm text-slate-700 whitespace-nowrap",children:["$",G.price.toFixed(2)]})}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-right",children:t.jsxs("span",{className:"text-sm font-bold text-slate-900 whitespace-nowrap",children:["$",(G.price*G.quantity).toFixed(2)]})})]},te)})})]})}),t.jsxs("div",{className:"px-6 py-4 border-t border-slate-100 space-y-2",children:[t.jsxs("div",{className:"flex justify-between text-sm text-slate-600",children:[t.jsx("span",{children:"Subtotal"}),t.jsxs("span",{children:["$",(i.subtotal??F).toFixed(2)]})]}),!!(($=i.shippingMethod)!=null&&$.label)&&t.jsxs("div",{className:"flex justify-between text-sm text-slate-600",children:[t.jsxs("span",{children:["Shipping",t.jsxs("span",{className:"text-slate-400",children:[" · ",i.shippingMethod.label]})]}),t.jsx("span",{children:i.freeShippingApplied?"Free":`$${(i.shippingCost??0).toFixed(2)}`})]}),t.jsxs("div",{className:"flex justify-between text-base font-bold text-slate-900 pt-2 border-t border-slate-100",children:[t.jsx("span",{children:"Total"}),t.jsxs("span",{children:["$",i.total.toFixed(2)]})]})]})]}),t.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 p-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(An,{size:16,className:"text-slate-400"}),t.jsx("h2",{className:"font-semibold text-slate-900",children:"Customer"})]}),t.jsxs("div",{className:"space-y-1.5 text-sm",children:[t.jsx("p",{className:"font-semibold text-slate-900",children:i.customerName}),t.jsx("p",{className:"text-slate-500",children:i.customerEmail}),i.customerPhone&&t.jsx("p",{className:"text-slate-500",children:i.customerPhone})]})]}),t.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 p-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(Qj,{size:16,className:"text-slate-400"}),t.jsx("h2",{className:"font-semibold text-slate-900",children:"Shipping Address"})]}),(()=>{const G=ku(i.shippingAddress,i.shippingAddressFormatted);return G.length>0?t.jsx("div",{className:"text-sm text-slate-600 space-y-0.5",children:G.map((te,ye)=>t.jsx("p",{children:te},ye))}):t.jsx("span",{className:"text-sm text-slate-300",children:"No address provided"})})()]}),t.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 p-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(uN,{size:16,className:"text-slate-400"}),t.jsx("h2",{className:"font-semibold text-slate-900",children:"Billing Address"})]}),(()=>{const G=ku(i.billingAddress,i.billingAddressFormatted),te=ku(i.shippingAddress,i.shippingAddressFormatted),ye=G.length>0&&te.length>0&&G.join("|")===te.join("|");return G.length===0?t.jsx("span",{className:"text-sm text-slate-300",children:"No billing address on file"}):t.jsxs("div",{className:"text-sm text-slate-600 space-y-0.5",children:[ye&&t.jsx("p",{className:"text-xs text-slate-400 mb-2 italic",children:"Same as shipping"}),G.map((U,ce)=>t.jsx("p",{children:U},ce))]})})()]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 p-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(Ug,{size:16,className:"text-slate-400"}),t.jsx("h2",{className:"font-semibold text-slate-900",children:"Payment"})]}),t.jsxs("div",{className:"space-y-3 text-sm",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-slate-500",children:"Method"}),t.jsx("span",{className:"font-semibold text-slate-900 capitalize",children:i.paymentMethod||"â"})]}),t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-slate-500",children:"Status"}),t.jsx("span",{className:`px-2.5 py-1 rounded-full text-[11px] font-bold uppercase ${Ax[i.paymentStatus]}`,children:i.paymentStatus})]}),t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-slate-500",children:"Amount"}),t.jsxs("span",{className:"font-semibold text-slate-900",children:["$",i.total.toFixed(2)]})]}),i.paymentStatus==="paid"&&i.updatedAt&&t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-slate-500",children:"Paid on"}),t.jsx("span",{className:"text-slate-700",children:new Date(i.updatedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})})]}),i.stripePaymentIntentId&&t.jsxs("div",{className:"pt-3 mt-1 border-t border-slate-100 space-y-2",children:[t.jsx("span",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wider",children:"Stripe Payment Intent"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("code",{title:i.stripePaymentIntentId,className:"flex-1 min-w-0 px-2.5 py-1.5 rounded-lg bg-slate-50 border border-slate-100 text-[11px] font-mono text-slate-700 truncate",children:i.stripePaymentIntentId}),t.jsx("button",{onClick:()=>Z(i.stripePaymentIntentId,"pi"),title:H==="pi"?"Copied!":"Copy","aria-label":"Copy Stripe payment intent ID",className:"shrink-0 p-1.5 text-slate-400 hover:text-primary hover:bg-slate-50 rounded-md transition-colors",children:H==="pi"?t.jsx(Mn,{size:14,className:"text-emerald-600"}):t.jsx(Uo,{size:14})})]}),t.jsxs("a",{href:`https://dashboard.stripe.com/payments/${i.stripePaymentIntentId}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-[12px] font-semibold text-primary hover:underline",children:["Open in Stripe to refund",t.jsx(Xr,{size:12})]})]})]})]}),t.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 p-6",children:[t.jsx("h2",{className:"font-semibold text-slate-900 mb-1",children:"Shipment"}),t.jsx("p",{className:"text-xs text-slate-500 mb-4",children:"Adding a tracking number marks the order shipped and emails the customer their link â once."}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-[11px] font-bold text-slate-500 uppercase tracking-wider mb-1",children:"Carrier"}),t.jsxs("select",{value:E,onChange:G=>R(G.target.value),className:"w-full px-3 py-2.5 border border-slate-200 rounded-xl text-sm text-slate-900 outline-none focus:ring-2 focus:ring-primary/20",children:[t.jsx("option",{value:"",children:"Selectâ¦"}),t.jsx("option",{value:"usps",children:"USPS"}),t.jsx("option",{value:"ups",children:"UPS"}),t.jsx("option",{value:"fedex",children:"FedEx"}),t.jsx("option",{value:"dhl",children:"DHL"}),t.jsx("option",{value:"other",children:"Other"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-[11px] font-bold text-slate-500 uppercase tracking-wider mb-1",children:"Tracking number"}),t.jsx("input",{value:N,onChange:G=>k(G.target.value),placeholder:"9400 1118 9900 0000 0000 00",className:"w-full px-3 py-2.5 border border-slate-200 rounded-xl text-sm text-slate-900 font-mono outline-none focus:ring-2 focus:ring-primary/20"})]}),i.shippedAt&&t.jsxs("p",{className:"text-xs text-slate-500",children:["Shipped ",new Date(i.shippedAt).toLocaleDateString(),i.trackingEmailSentAt&&" · customer emailed"]}),t.jsxs("button",{onClick:P,disabled:w||!N.trim(),className:"w-full py-2.5 px-4 bg-primary hover:bg-primary-hover text-white text-sm font-bold rounded-xl shadow-lg shadow-primary/20 transition-all flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:[w&&t.jsx(yt,{size:15,className:"animate-spin"}),"Save Tracking"]}),O&&t.jsx("p",{className:"text-xs text-slate-600",children:O})]})]}),t.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 p-6",children:[t.jsx("h2",{className:"font-semibold text-slate-900 mb-4",children:"Update Status"}),t.jsxs("div",{className:"space-y-3",children:[t.jsx("select",{value:y,onChange:G=>v(G.target.value),className:"w-full px-3 py-2.5 border border-slate-200 rounded-xl text-sm text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none",children:c3.map(G=>t.jsx("option",{value:G,children:G},G))}),t.jsxs("button",{onClick:q,disabled:f||y===i.status,className:"w-full py-2.5 px-4 bg-primary hover:bg-primary-hover text-white text-sm font-bold rounded-xl shadow-lg shadow-primary/20 transition-all flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:[f&&t.jsx(yt,{size:15,className:"animate-spin"}),"Save Status"]})]})]}),t.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-rose-100 p-6",children:[t.jsx("h2",{className:"font-semibold text-rose-600 mb-3",children:"Danger Zone"}),t.jsxs("button",{onClick:Q,disabled:p,className:"w-full py-2.5 px-4 bg-rose-50 hover:bg-rose-100 text-rose-600 text-sm font-bold rounded-xl transition-all flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:[p?t.jsx(yt,{size:15,className:"animate-spin"}):t.jsx(_l,{size:15}),"Delete Order"]})]})]})]})]})},m3=()=>{const l=Ya(),[r,i]=b.useState([]),[o,c]=b.useState(!0),[m,f]=b.useState(""),[h,p]=b.useState(null),g=R=>(R==null?void 0:R._id)||(R==null?void 0:R.id);b.useEffect(()=>{y()},[]);const y=async()=>{c(!0);try{const R=await qe.get("/customers");R.data.success&&i(R.data.data)}catch(R){console.error("Error fetching customers:",R)}finally{c(!1)}},v=async R=>{if(!confirm(`Delete customer "${R.name}"? This cannot be undone.`))return;const N=g(R);p(N);try{await qe.delete(`/customers/${N}`),i(k=>k.filter(w=>g(w)!==N))}catch(k){console.error("Error deleting customer:",k),alert("Failed to delete customer.")}finally{p(null)}},E=r.filter(R=>{var k,w,A;const N=m.toLowerCase();return((k=R.name)==null?void 0:k.toLowerCase().includes(N))||((w=R.email)==null?void 0:w.toLowerCase().includes(
523N))||((A=R.phone)==null?void 0:A.toLowerCase().includes(N))});return o?t.jsx("div",{className:"min-h-[400px] flex items-center justify-center",children:t.jsx(yt,{className:"animate-spin text-primary",size:40})}):t.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[t.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Customers"}),t.jsx("p",{className:"text-slate-500",children:"Manage your customer accounts"})]}),t.jsxs("div",{className:"text-sm text-slate-500 bg-white border border-slate-200 rounded-xl px-4 py-2",children:[r.length," total customers"]})]}),t.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 overflow-hidden",children:[t.jsx("div",{className:"p-6 border-b border-slate-100",children:t.jsxs("div",{className:"relative w-full sm:w-80",children:[t.jsx("span",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-slate-400",children:t.jsx(Al,{size:18})}),t.jsx("input",{type:"text",placeholder:"Search customers...",value:m,onChange:R=>f(R.target.value),className:"w-full pl-10 pr-4 py-2 bg-white border border-slate-200 rounded-lg text-sm text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none"})]})}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-left",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-slate-50/50 text-slate-500 text-xs font-semibold uppercase tracking-wider",children:[t.jsx("th",{className:"px-6 py-4",children:"Customer"}),t.jsx("th",{className:"px-6 py-4",children:"Phone"}),t.jsx("th",{className:"px-6 py-4",children:"Orders"}),t.jsx("th",{className:"px-6 py-4",children:"Total Spend"}),t.jsx("th",{className:"px-6 py-4 text-right",children:"Actions"})]})}),t.jsx("tbody",{className:"divide-y divide-slate-100",children:E.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:5,className:"px-6 py-16 text-center text-slate-400",children:"No customers found."})}):E.map(R=>{const N=!!R.isGuest;return t.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:`w-9 h-9 rounded-full flex items-center justify-center shrink-0 ${N?"bg-slate-100":"bg-primary/10"}`,children:t.jsx(An,{size:16,className:N?"text-slate-400":"text-primary"})}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-semibold text-slate-900",children:R.name}),N&&t.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider bg-slate-100 text-slate-500",title:"Paid order(s) without a registered customer account",children:"Guest"})]}),t.jsx("p",{className:"text-xs text-slate-400",children:R.email})]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-slate-600",children:R.phone||t.jsx("span",{className:"text-slate-300",children:"â"})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:"text-sm font-semibold text-slate-900",children:R.totalOrders??0})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("span",{className:"text-sm font-bold text-slate-900",children:["$",(R.totalSpend??0).toFixed(2)]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right",children:t.jsx("div",{className:"flex items-center justify-end gap-1",children:N?t.jsx("span",{className:"text-xs text-slate-300 italic pr-2",children:"No account"}):t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:()=>l(`/customers/${g(R)}`),className:"p-2 text-slate-400 hover:text-primary hover:bg-primary/5 rounded-lg transition-colors",title:"View Details",children:t.jsx(vm,{size:17})}),t.jsx("button",{onClick:()=>l(`/customers/${g(R)}/account`),className:"p-2 text-slate-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",title:"Edit Account Details",children:t.jsx(Un,{size:17})}),t.jsx("button",{onClick:()=>v(R),disabled:h===g(R),className:"p-2 text-slate-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors disabled:opacity-50",title:"Delete",children:h===g(R)?t.jsx(yt,{size:17,className:"animate-spin"}):t.jsx(_l,{size:17})})]})})})]},g(R))})})]})})]})]})},f3=()=>{var h;const{id:l}=qa(),r=Ya(),[i,o]=b.useState(null),[c,m]=b.useState(!0);if(b.useEffect(()=>{(async()=>{m(!0);try{const g=await qe.get(`/customers/${l}`);g.data.success&&o(g.data.data)}catch(g){console.error("Error fetching customer:",g)}finally{m(!1)}})()},[l]),c)return t.jsx("div",{className:"min-h-[400px] flex items-center justify-center",children:t.jsx(yt,{className:"animate-spin text-primary",size:40})});if(!i)return t.jsxs("div",{className:"min-h-[400px] flex flex-col items-center justify-center gap-4 text-slate-400",children:[t.jsx(An,{size:48}),t.jsx("p",{className:"text-lg font-semibold",children:"Customer not found."}),t.jsxs("button",{onClick:()=>r("/customers"),className:"flex items-center gap-2 px-4 py-2 text-sm font-semibold text-primary hover:underline",children:[t.jsx(Ln,{size:16}),"Back to Customers"]})]});const f=((h=i.purchasedProducts)==null?void 0:h.length)??0;return t.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500 max-w-4xl mx-auto",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[t.jsxs("button",{onClick:()=>r("/customers"),className:"flex items-center gap-1 hover:text-primary transition-colors font-medium",children:[t.jsx(Ln,{size:15}),"Customers"]}),t.jsx(ls,{size:14}),t.jsx("span",{className:"text-slate-700 font-semibold",children:i.name})]}),t.jsx("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 p-6",children:t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6",children:[t.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:t.jsx(An,{size:28,className:"text-primary"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:i.name}),t.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 mt-1.5 text-sm text-slate-500",children:[t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx(Bg,{size:13}),i.email]}),i.phone&&t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx(sN,{size:13}),i.phone]})]})]}),t.jsxs("div",{className:"flex gap-3 shrink-0",children:[t.jsxs("div",{className:"text-center bg-slate-50 rounded-xl px-5 py-3",children:[t.jsx("p",{className:"text-2xl font-bold text-slate-900",children:i.totalOrders}),t.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Orders"})]}),t.jsxs("div",{className:"text-center bg-slate-50 rounded-xl px-5 py-3",children:[t.jsxs("p",{className:"text-2xl font-bold text-slate-900",children:["$",i.totalSpend.toFixed(2)]}),t.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Total Spend"})]})]})]})}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:[t.jsxs("button",{onClick:()=>r(`/customers/${l}/account`),className:"group text-left bg-white rounded-2xl shadow-sm border border-slate-100 p-7 hover:border-primary/30 hover:shadow-md transition-all",children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsx("div",{className:"w-14 h-14 roun
523ded-2xl bg-primary/10 flex items-center justify-center text-primary",children:t.jsx(An,{size:26})}),t.jsx(ls,{size:20,className:"text-slate-300 group-hover:text-primary group-hover:translate-x-0.5 transition-all"})]}),t.jsx("h2",{className:"mt-5 text-lg font-bold text-slate-900",children:"Account Details"}),t.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Name, phone, brand logo, and billing / shipping addresses â the same settings the customer manages on their own account page."})]}),t.jsxs("button",{onClick:()=>r(`/customers/${l}/products`),className:"group text-left bg-white rounded-2xl shadow-sm border border-slate-100 p-7 hover:border-primary/30 hover:shadow-md transition-all",children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary/10 flex items-center justify-center text-primary",children:t.jsx(vm,{size:26})}),t.jsx(ls,{size:20,className:"text-slate-300 group-hover:text-primary group-hover:translate-x-0.5 transition-all"})]}),t.jsxs("h2",{className:"mt-5 text-lg font-bold text-slate-900 flex items-center gap-2",children:["Product Details",t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold text-slate-400 bg-slate-100 rounded-full px-2.5 py-0.5",children:[t.jsx(zn,{size:11}),f]})]}),t.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Purchased products, destination URLs, QR codes, and the business-card editor â the full customer product experience."})]})]})]})},h3=[{code:"standard",label:"Standard Shipping",description:"Arrives in 2-4 business days after processing",price:4.95,minDays:2,maxDays:4,isActive:!0,sortOrder:0},{code:"expedited",label:"Expedited Shipping",description:"Arrives in 1-2 business days after processing",price:14.95,minDays:1,maxDays:2,isActive:!0,sortOrder:1}],Su={get:async()=>(await qe.get("/settings")).data.data,update:async l=>(await qe.put("/settings",l)).data.data},p3=()=>{const[l,r]=b.useState("live"),[i,o]=b.useState(!0),[c,m]=b.useState(!1),[f,h]=b.useState(null),[p,g]=b.useState(null),[y,v]=b.useState([]),[E,R]=b.useState("0"),[N,k]=b.useState(!1),[w,A]=b.useState(null),[O,z]=b.useState(null),H=(q,Q)=>v(F=>F.map(($,G)=>G===q?{...$,...Q}:$)),se=()=>v(q=>[...q,{code:"",label:"",description:"",price:0,minDays:null,maxDays:null,isActive:!0,sortOrder:q.length}]),Z=async()=>{const q=y.map((F,$)=>({...F,code:F.code.trim().toLowerCase(),label:F.label.trim(),sortOrder:$}));if(q.some(F=>!F.code||!F.label)){A("Every rate needs a code and a label.");return}if(q.some(F=>!/^[a-zA-Z0-9_-]+$/.test(F.code))){A("Codes may only contain letters, numbers, hyphens and underscores.");return}const Q=q.map(F=>F.code);if(new Set(Q).size!==Q.length){A("Two rates share a code. Each one needs its own.");return}if(q.some(F=>!Number.isFinite(F.price)||F.price<0)){A("Every rate needs a price of zero or more.");return}k(!0),A(null);try{const F=await Su.update({shippingMethods:q,freeShippingThreshold:Number(E)||0});v(F.shippingMethods||[]),R(String(F.freeShippingThreshold??0)),z(Date.now())}catch(F){console.error("Error saving shipping rates:",F),A("Failed to save. Please try again.")}finally{k(!1)}};b.useEffect(()=>{let q=!1;return(async()=>{try{const Q=await Su.get();q||(r(Q.stripeMode==="test"?"test":"live"),v(Q.shippingMethods||[]),R(String(Q.freeShippingThreshold??0)))}catch(Q){console.error("Error loading settings:",Q),q||h("Failed to load settings.")}finally{q||o(!1)}})(),()=>{q=!0}},[]);const T=async()=>{const q=l==="live"?"test":"live",Q=l;r(q),m(!0),h(null);try{const F=await Su.update({stripeMode:q});r(F.stripeMode==="test"?"test":"live"),g(Date.now())}catch(F){console.error("Error saving settings:",F),r(Q),h("Failed to save. Please try again.")}finally{m(!1)}},P=l==="live";return t.jsxs("div",{className:"max-w-3xl",children:[t.jsxs("div",{className:"mb-8",children:[t.jsx("h1",{className:"text-2xl font-bold text-slate-800",children:"Settings"}),t.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Manage store-wide configuration."})]}),t.jsx("div",{className:"bg-white border border-slate-200 rounded-2xl p-6 shadow-sm",children:t.jsxs("div",{className:"flex items-start gap-4",children:[t.jsx("div",{className:"w-11 h-11 rounded-xl bg-primary/10 text-primary flex items-center justify-center shrink-0",children:t.jsx(Ug,{size:22})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h2",{className:"text-lg font-bold text-slate-800",children:"Payment environment"}),t.jsxs("p",{className:"text-sm text-slate-500 mt-1",children:["Controls which Stripe environment the customer checkout charges against. ",t.jsx("strong",{children:"Live"})," charges real cards;"," ",t.jsx("strong",{children:"Test"})," accepts Stripe test cards only (no real charge). This applies to every customer immediately."]}),i?t.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mt-6",children:[t.jsx(yt,{size:18,className:"animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loadingâ¦"})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mt-6 flex items-center justify-between gap-4 roun
523ded-xl border border-slate-100 bg-slate-50 px-5 py-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:`text-sm font-semibold ${P?"text-slate-400":"text-primary"}`,children:"Test"}),t.jsx("button",{type:"button",role:"switch","aria-checked":P,"aria-label":"Toggle Stripe live mode",disabled:c,onClick:T,className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:opacity-60 disabled:cursor-not-allowed ${P?"bg-primary":"bg-slate-300"}`,children:t.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ${P?"translate-x-6":"translate-x-1"}`})}),t.jsx("span",{className:`text-sm font-semibold ${P?"text-primary":"text-slate-400"}`,children:"Live"})]}),t.jsx("div",{className:"flex items-center gap-2 text-sm",children:c?t.jsxs("span",{className:"flex items-center gap-1.5 text-slate-400",children:[t.jsx(yt,{size:15,className:"animate-spin"})," Savingâ¦"]}):p?t.jsxs("span",{className:"flex items-center gap-1.5 text-green-600",children:[t.jsx(Mn,{size:15})," Saved"]}):null})]}),P?t.jsxs("div",{className:"mt-4 flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:[t.jsx(Do,{size:16,className:"mt-0.5 shrink-0"}),t.jsx("span",{children:"Live mode is on â customers are charged real money at checkout."})]}):t.jsxs("div",{className:"mt-4 flex items-start gap-2 rounded-xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm text-slate-600",children:[t.jsx(Do,{size:16,className:"mt-0.5 shrink-0"}),t.jsx("span",{children:"Test mode is on â checkout only accepts Stripe test cards and no real charges are made."})]}),f&&t.jsx("p",{className:"mt-3 text-sm text-red-600",children:f})]})]})]})}),t.jsx("div",{className:"bg-white border border-slate-200 rounded-2xl p-6 shadow-sm mt-6",children:t.jsxs("div",{className:"flex items-start gap-4",children:[t.jsx("div",{className:"w-11 h-11 rounded-xl bg-primary/10 text-primary flex items-center justify-center shrink-0",children:t.jsx(HN,{size:22})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h2",{className:"text-lg font-bold text-slate-800",children:"Shipping rates"}),t.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"What customers can choose at checkout, and what it costs them. With no rates here, checkout charges nothing for shipping."}),i?t.jsxs("div",{className:"mt-4 flex items-center gap-2 text-sm text-slate-500",children:[t.jsx(yt,{size:16,className:"animate-spin"})," Loadingâ¦"]}):t.jsxs(t.Fragment,{children:[y.length===0&&t.jsxs("div",{className:"mt-4 rounded-xl border border-slate-200 bg-slate-50 px-4 py-4",children:[t.jsx("p",{className:"text-sm text-slate-600",children:"No rates configured â shipping is free for every order."}),t.jsx("button",{onClick:()=>v(h3),className:"mt-3 text-sm font-semibold text-primary hover:underline",children:"Use recommended rates"}),t.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Placeholder prices â review them before saving. Nothing is charged until you press Save."})]}),y.length>0&&t.jsxs("div",{className:"mt-4 space-y-3",children:[y.map((q,Q)=>t.jsxs("div",{className:"rounded-xl border border-slate-200 p-4",children:[t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-12 gap-3",children:[t.jsxs("div",{className:"sm:col-span-5",children:[t.jsx("label",{className:"block text-[11px] font-bold text-slate-500 uppercase tracking-wider mb-1",children:"Label"}),t.jsx("input",{value:q.label,onChange:F=>H(Q,{label:F.target.value}),placeholder:"Standard Shipping",className:"w-full px-3 py-2 border border-slate-200 rounded-lg text-sm outline-none focus:border-primary"})]}),t.jsxs("div",{className:"sm:col-span-4",children:[t.jsx("label",{className:"block text-[11px] font-bold text-slate-500 uppercase tracking-wider mb-1",children:"Code"}),t.jsx("input",{value:q.code,onChange:F=>H(Q,{code:F.target.value}),placeholder:"standard",className:"w-full px-3 py-2 border border-slate-200 rounded-lg text-sm font-mono outline-none focus:border-primary"})]}),t.jsxs("div",{className:"sm:col-span-3",children:[t.jsx("label",{className:"block text-[11px] font-bold text-slate-500 uppercase tracking-wider mb-1",children:"Price ($)"}),t.jsx("input",{type:"number",min:0,step:"0.01",value:q.price,onChange:F=>H(Q,{price:Number(F.target.value)}),className:"w-full px-3 py-2 border border-slate-200 rounded-lg text-sm outline-none focus:border-primary"})]}),t.jsxs("div",{className:"sm:col-span-12",children:[t.jsx("label",{className:"block text-[11px] font-bold text-slate-500 uppercase tracking-wider mb-1",children:"Description"}),t.jsx("input",{value:q.description,onChange:F=>H(Q,{description:F.target.value}),placeholder:"Arrives in 2-4 business days after processing",className:"w-full px-3 py-2 border border-slate-200 rounded-lg text-sm outline-none focus:border-primary"})]})]}),t.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t border-slate-100",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-600 cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:q.isActive,onChange:F=>H(Q,{isActive:F.target.checked}),className:"accent-primary"}),"Offered at checkout"]}),t.jsxs("button",{onClick:()=>v(F=>F.filter(($,G)=>G!==Q)),className:"flex items-center gap-1.5 text-sm text-red-600 hover:underline",children:[t.jsx(_l,{size:14})," Remove"]})]})]},Q)),t.jsxs("button",{onClick:se,className:"flex items-center gap-1.5 text-sm font-semibold text-primary hover:underline",children:[t.jsx(Tl,{size:15})," Add a rate"]})]}),t.jsxs("div",{className:"mt-5 pt-5 border-t border-slate-100",children:[t.jsx("label",{className:"block text-[11px] font-bold text-slate-500 uppercase tracking-wider mb-1",children:"Free shipping over ($)"}),t.jsx("input",{type:"number",min:0,step:"0.01",value:E,onChange:q=>R(q.target.value),className:"w-40 px-3 py-2 border border-slate-200 rounded-lg text-sm outline-none focus:border-primary"}),t.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Order subtotal at or above which shipping costs nothing. Leave at 0 to always charge."})]}),t.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[t.jsx("button",{onClick:Z,disabled:N,className:"px-5 py-2.5 bg-primary text-white font-bold rounded-xl text-sm disabled:opacity-50",children:N?"Savingâ¦":"Save shipping rates"}),O&&!N&&!w&&t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-emerald-600",children:[t.jsx(Mn,{size:15})," Saved"]})]}),w&&t.jsx("p",{className:"mt-3 text-sm text-red-600",children:w})]})]})]})})]})};var wn={},Cu,_x;function x3(){return _x||(_x=1,Cu=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Cu}var Eu={},el={},Lx;function Ll(){if(Lx)return el;Lx=1;let l;const r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];
vendor: 18,029 bytes, lines 523-526
523return el.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},el.getSymbolTotalCodewords=function(o){return r[o]},el.getBCHDigit=function(i){let o=0;for(;i!==0;)o++,i>>>=1;return o},el.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');l=o},el.isKanjiModeEnabled=function(){return typeof l<"u"},el.toSJIS=function(o){return l(o)},el}var Tu={},Mx;function Tm(){return Mx||(Mx=1,(function(l){l.L={bit:1},l.M={bit:0},l.Q={bit:3},l.H={bit:2};function r(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return l.L;case"m":case"medium":return l.M;case"q":case"quartile":return l.Q;case"h":case"high":return l.H;default:throw new Error("Unknown EC Level: "+i)}}l.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},l.from=function(o,c){if(l.isValid(o))return o;try{return r(o)}catch{return c}}})(Tu)),Tu}var Ru,zx;function g3(){if(zx)return Ru;zx=1;function l(){this.buffer=[],this.length=0}return l.prototype={get:function(r){const i=Math.floor(r/8);return(this.buffer[i]>>>7-r%8&1)===1},put:function(r,i){for(let o=0;o<i;o++)this.putBit((r>>>i-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),r&&(this.buffer[i]|=128>>>this.length%8),this.length++}},Ru=l,Ru}var Au,Ux;function b3(){if(Ux)return Au;Ux=1;function l(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}return l.prototype.set=function(r,i,o,c){const m=r*this.size+i;this.data[m]=o,c&&(this.reservedBit[m]=!0)},l.prototype.get=function(r,i){return this.data[r*this.size+i]},l.prototype.xor=function(r,i,o){this.data[r*this.size+i]^=o},l.prototype.isReserved=function(r,i){return this.reservedBit[r*this.size+i]},Au=l,Au}var _u={},Dx;function y3(){return Dx||(Dx=1,(function(l){const r=Ll().getSymbolSize;l.getRowColCoords=function(o){if(o===1)return[];const c=Math.floor(o/7)+2,m=r(o),f=m===145?26:Math.ceil((m-13)/(2*c-2))*2,h=[m-7];for(let p=1;p<c-1;p++)h[p]=h[p-1]-f;return h.push(6),h.reverse()},l.getPositions=function(o){const c=[],m=l.getRowColCoords(o),f=m.length;for(let h=0;h<f;h++)for(let p=0;p<f;p++)h===0&&p===0||h===0&&p===f-1||h===f-1&&p===0||c.push([m[h],m[p]]);return c}})(_u)),_u}var Lu={},Ox;function v3(){if(Ox)return Lu;Ox=1;const l=Ll().getSymbolSize,r=7;return Lu.getPositions=function(o){const c=l(o);return[[0,0],[c-r,0],[0,c-r]]},Lu}var Mu={},Bx;function j3(){return Bx||(Bx=1,(function(l){l.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const r={N1:3,N2:3,N3:40,N4:10};l.isValid=function(c){return c!=null&&c!==""&&!isNaN(c)&&c>=0&&c<=7},l.from=function(c){return l.isValid(c)?parseInt(c,10):void 0},l.getPenaltyN1=function(c){const m=c.size;let f=0,h=0,p=0,g=null,y=null;for(let v=0;v<m;v++){h=p=0,g=y=null;for(let E=0;E<m;E++){let R=c.get(v,E);R===g?h++:(h>=5&&(f+=r.N1+(h-5)),g=R,h=1),R=c.get(E,v),R===y?p++:(p>=5&&(f+=r.N1+(p-5)),y=R,p=1)}h>=5&&(f+=r.N1+(h-5)),p>=5&&(f+=r.N1+(p-5))}return f},l.getPenaltyN2=function(c){const m=c.size;let f=0;for(let h=0;h<m-1;h++)for(let p=0;p<m-1;p++){const g=c.get(h,p)+c.get(h,p+1)+c.get(h+1,p)+c.get(h+1,p+1);(g===4||g===0)&&f++}return f*r.N2},l.getPenaltyN3=function(c){const m=c.size;let f=0,h=0,p=0;for(let g=0;g<m;g++){h=p=0;for(let y=0;y<m;y++)h=h<<1&2047|c.get(g,y),y>=10&&(h===1488||h===93)&&f++,p=p<<1&2047|c.get(y,g),y>=10&&(p===1488||p===93)&&f++}return f*r.N3},l.getPenaltyN4=function(c){let m=0;const f=c.data.length;for(let p=0;p<f;p++)m+=c.data[p];return Math.abs(Math.ceil(m*100/f/5)-10)*r.N4};function i(o,c,m){switch(o){case l.Patterns.PATTERN000:return(c+m)%2===0;case l.Patterns.PATTERN001:return c%2===0;case l.Patterns.PATTERN010:return m%3===0;case l.Patterns.PATTERN011:return(c+m)%3===0;case l.Patterns.PATTERN100:return(Math.floor(c/2)+Math.floor(m/3))%2===0;case l.Patterns.PATTERN101:return c*m%2+c*m%3===0;case l.Patterns.PATTERN110:return(c*m%2+c*m%3)%2===0;case l.Patterns.PATTERN111:return(c*m%3+(c+m)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}l.applyMask=function(c,m){const f=m.size;for(let h=0;h<f;h++)for(let p=0;p<f;p++)m.isReserved(p,h)||m.xor(p,h,i(c,p,h))},l.getBestMask=function(c,m){const f=Object.keys(l.Patterns).length;let h=0,p=1/0;for(let g=0;g<f;g++){m(g),l.applyMask(g,c);const y=l.getPenaltyN1(c)+l.getPenaltyN2(c)+l.getPenaltyN3(c)+l.getPenaltyN4(c);l.applyMask(g,c),y<p&&(p=y,h=g)}return h}})(Mu)),Mu}var Co={},Hx;function j1(){if(Hx)return Co;Hx=1;const l=Tm(),r=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Co.getBlocksCount=function(c,m){switch(m){case l.L:return r[(c-1)*4+0];case l.M:return r[(c-1)*4+1];case l.Q:return r[(c-1)*4+2];case l.H:return r[(c-1)*4+3];default:return}},Co.getTotalCodewordsCount=function(c,m){switch(m){case l.L:return i[(c-1)*4+0];case l.M:return i[(c-1)*4+1];case l.Q:return i[(c-1)*4+2];case l.H:return i[(c-1)*4+3];default:return}},Co}var zu={},$r={},qx;function N3(){if(qx)return $r;qx=1;const l=new Uint8Array(512),r=new Uint8Array(256);return(function(){let o=1;for(let c=0;c<255;c++)l[c]=o,r[o]=c,o<<=1,o&256&&(o^=285);for(let c=255;c<512;c++)l[c]=l[c-255]})(),$r.log=function(o){if(o<1)throw new Error("log("+o+")");return r[o]},$r.exp=function(o){return l[o]},$r.mul=function(o,c){return o===0||c===0?0:l[r[o]+r[c]]},$r}var Vx;function w3(){return Vx||(Vx=1,(function(l){const r=N3();l.mul=function(o,c){const m=new Uint8Array(o.length+c.length-1);for(let f=0;f<o.length;f++)for(let h=0;h<c.length;h++)m[f+h]^=r.mul(o[f],c[h]);return m},l.mod=function(o,c){let m=new Uint8Array(o);for(;m.length-c.length>=0;){const f=m[0];for(let p=0;p<c.length;p++)m[p]^=r.mul(c[p],f);let h=0;for(;h<m.length&&m[h]===0;)h++;m=m.slice(h)}return m},l.generateECPolynomial=function(o){let c=new Uint8Array([1]);for(let m=0;m<o;m++)c=l.mul(c,new Uint8Array([1,r.exp(m)]));return c}})(zu)),zu}var Uu,$x;function k3(){if($x)return Uu;$x=1;const l=w3();function r(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return r.prototype.initialize=function(o){this.degree=o,this.genPoly=l.generateECPolynomial(this.degree)},r.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const c=new Uint8Array(o.length+this.degree);c.set(o);const m=l.mod(c,this.genPoly),f=this.degree-m.length;if(f>0){const h=new Uint8Array(this.degree);return h.set(m,f),h}return m},Uu=r,Uu}var Du={},Ou={},Bu={},Ix;function N1(){return Ix||(Ix=1,Bu.isValid=function(r){return!isNaN(r)&&r>=1&&r<=40}),Bu}var ts={},Gx;function w1(){if(Gx)return ts;Gx=1;const l="[0-9]+",r="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r 524]))+`;ts.KANJI=new RegExp(i,"g"),ts.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ts.BYTE=new RegExp(o,"g"),ts.NUMERIC=new RegExp(l,"g"),ts.ALPHANUMERIC=new RegExp(r,"g");const c=new RegExp("^"+i+"$"),m=new RegExp("^"+l+"$"),f=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ts.testKanji=function(p){return c.test(p)},ts.testNumeric=function(p){return m.test(p)},ts.testAlphanumeric=function(p){return f.test(p)},ts}var Yx;function Ml(){return Yx||(Yx=1,(function(l){const r=N1(),i=w1();l.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},l.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},l.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},l.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},l.MIXED={bit:-1},l.getCharCountIndicator=function(m,f){if(!m.ccBits)throw new Error("Invalid mode: "+m);if(!r.isValid(f))throw new Error("Invalid version: "+f);return f>=1&&f<10?m.ccBits[0]:f<27?m.ccBits[1]:m.ccBits[2]},l.getBestModeForData=function(m){return i.testNumeric(m)?l.NUMERIC:i.testAlphanumeric(m)?l.ALPHANUMERIC:i.testKanji(m)?l.KANJI:l.BYTE},l.toString=function(m){if(m&&m.id)return m.id;throw new Error("Invalid mode")},l.isValid=function(m){return m&&m.bit&&m.ccBits};function o(c){if(typeof c!="string")throw new Error("Param is not a string");switch(c.toLowerCase()){case"numeric":return l.NUMERIC;case"alphanumeric":return l.ALPHANUMERIC;case"kanji":return l.KANJI;case"byte":return l.BYTE;default:throw new Error("Unknown mode: "+c)}}l.from=function(m,f){if(l.isValid(m))return m;try{return o(m)}catch{return f}}})(Ou)),Ou}var Px;function S3(){return Px||(Px=1,(function(l){const r=Ll(),i=j1(),o=Tm(),c=Ml(),m=N1(),f=7973,h=r.getBCHDigit(f);function p(E,R,N){for(let k=1;k<=40;k++)if(R<=l.getCapacity(k,N,E))return k}function g(E,R){return c.getCharCountIndicator(E,R)+4}function y(E,R){let N=0;return E.forEach(function(k){const w=g(k.mode,R);N+=w+k.getBitsLength()}),N}function v(E,R){for(let N=1;N<=40;N++)if(y(E,N)<=l.getCapacity(N,R,c.MIXED))return N}l.from=function(R,N){return m.isValid(R)?parseInt(R,10):N},l.getCapacity=function(R,N,k){if(!m.isValid(R))throw new Error("Invalid QR Code version");typeof k>"u"&&(k=c.BYTE);const w=r.getSymbolTotalCodewords(R),A=i.getTotalCodewordsCount(R,N),O=(w-A)*8;if(k===c.MIXED)return O;const z=O-g(k,R);switch(k){case c.NUMERIC:return Math.floor(z/10*3);case c.ALPHANUMERIC:return Math.floor(z/11*2);case c.KANJI:return Math.floor(z/13);case c.BYTE:default:return Math.floor(z/8)}},l.getBestVersionForData=function(R,N){let k;const w=o.from(N,o.M);if(Array.isArray(R)){if(R.length>1)return v(R,w);if(R.length===0)return 1;k=R[0]}else k=R;return p(k.mode,k.getLength(),w)},l.getEncodedBits=function(R){if(!m.isValid(R)||R<7)throw new Error("Invalid QR Code version");let N=R<<12;for(;r.getBCHDigit(N)-h>=0;)N^=f<<r.getBCHDigit(N)-h;return R<<12|N}})(Du)),Du}var Hu={},Fx;function C3(){if(Fx)return Hu;Fx=1;const l=Ll(),r=1335,i=21522,o=l.getBCHDigit(r);return Hu.getEncodedBits=function(m,f){const h=m.bit<<3|f;let p=h<<10;for(;l.getBCHDigit(p)-o>=0;)p^=r<<l.getBCHDigit(p)-o;return(h<<10|p)^i},Hu}var qu={},Vu,Qx;function E3(){if(Qx)return Vu;Qx=1;const l=Ml();function r(i){this.mode=l.NUMERIC,this.data=i.toString()}return r.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let c,m,f;for(c=0;c+3<=this.data.length;c+=3)m=this.data.substr(c,3),f=parseInt(m,10),o.put(f,10);const h=this.data.length-c;h>0&&(m=this.data.substr(c),f=parseInt(m,10),o.put(f,h*3+1))},Vu=r,Vu}var $u,Xx;function T3(){if(Xx)return $u;Xx=1;const l=Ml(),r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(o){this.mode=l.ALPHANUMERIC,this.data=o}return i.getBitsLength=function(c){return 11*Math.floor(c/2)+6*(c%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(c){let m;for(m=0;m+2<=this.data.length;m+=2){let f=r.indexOf(this.data[m])*45;f+=r.indexOf(this.data[m+1]),c.put(f,11)}this.data.length%2&&c.put(r.indexOf(this.data[m]),6)},$u=i,$u}var Iu,Kx;function R3(){if(Kx)return Iu;Kx=1;const l=Ml();function r(i){this.mode=l.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return r.getBitsLength=function(o){return o*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(i){for(let o=0,c=this.data.length;o<c;o++)i.put(this.data[o],8)},Iu=r,Iu}var Gu,Zx;function A3(){if(Zx)return Gu;Zx=1;const l=Ml(),r=Ll();function i(o){this.mode=l.KANJI,this.data=o}return i.getBitsLength=function(c){return c*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(o){let c;for(c=0;c<this.data.length;c++){let m=r.toSJIS(this.data[c]);if(m>=33088&&m<=40956)m-=33088;else if(m>=57408&&m<=60351)m-=49472;else throw new Error("Invalid SJIS character: "+this.data[c]+` 525Make sure your charset is UTF-8`);m=(m>>>8&255)*192+(m&255),o.put(m,13)}},Gu=i,Gu}var Yu={exports:{}},Jx;function _3(){return Jx||(Jx=1,(function(l){var r={single_source_shortest_paths:function(i,o,c){var m={},f={};f[o]=0;var h=r.PriorityQueue.make();h.push(o,0);for(var p,g,y,v,E,R,N,k,w;!h.empty();){p=h.pop(),g=p.value,v=p.cost,E=i[g]||{};for(y in E)E.hasOwnProperty(y)&&(R=E[y],N=v+R,k=f[y],w=typeof f[y]>"u",(w||k>N)&&(f[y]=N,h.push(y,N),m[y]=g))}if(typeof c<"u"&&typeof f[c]>"u"){var A=["Could not find a path from ",o," to ",c,"."].join("");throw new Error(A)}return m},extract_shortest_path_from_predecessor_list:function(i,o){for(var c=[],m=o;m;)c.push(m),i[m],m=i[m];return c.reverse(),c},find_path:function(i,o,c){var m=r.single_source_shortest_paths(i,o,c);return r.extract_shortest_path_from_predecessor_list(m,c)},PriorityQueue:{make:function(i){var o=r.PriorityQueue,c={},m;i=i||{};for(m in o)o.hasOwnProperty(m)&&(c[m]=o[m]);return c.queue=[],c.sorter=i.sorter||o.default_sorter,c},default_sorter:function(i,o){return i.cost-o.cost},push:function(i,o){var c={value:i,cost:o};this.queue.push(c),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};l.exports=r})(Yu)),Yu.exports}var Wx;function L3(){return Wx||(Wx=1,(function(l){const r=Ml(),i=E3(),o=T3(),c=R3(),m=A3(),f=w1(),h=Ll(),p=_3();function g(A){return unescape(encodeURIComponent(A)).length}function y(A,O,z){const H=[];let se;for(;(se=A.exec(z))!==null;)H.push({data:se[0],index:se.index,mode:O,length:se[0].length});return H}function v(A){const O=y(f.NUMERIC,r.NUMERIC,A),z=y(f.ALPHANUMERIC,r.ALPHANUMERIC,A);let H,se;return h.isKanjiModeEnabled()?(H=y(f.BYTE,r.BYTE,A),se=y(f.KANJI,r.KANJI,A)):(H=y(f.BYTE_KANJI,r.BYTE,A),se=[]),O.concat(z,H,se).sort(function(T,P){return T.index-P.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function E(A,O){switch(O){case r.NUMERIC:return i.getBitsLength(A);case r.ALPHANUMERIC:return o.getBitsLength(A);case r.KANJI:return m.getBitsLength(A);case r.BYTE:return c.getBitsLength(A)}}function R(A){return A.reduce(function(O,z){const H=O.length-1>=0?O[O.length-1]:null;return H&&H.mode===z.mode?(O[O.length-1].data+=z.data,O):(O.push(z),O)},[])}function N(A){const O=[];for(let z=0;z<A.length;z++){const H=A[z];switch(H.mode){case r.NUMERIC:O.push([H,{data:H.data,mode:r.ALPHANUMERIC,length:H.length},{data:H.data,mode:r.BYTE,length:H.length}]);break;case r.ALPHANUMERIC:O.push([H,{data:H.data,mode:r.BYTE,length:H.length}]);break;case r.KANJI:O.push([H,{data:H.data,mode:r.BYTE,length:g(H.data)}]);break;case r.BYTE:O.push([{data:H.data,mode:r.BYTE,length:g(H.data)}])}}return O}function k(A,O){const z={},H={start:{}};let se=["start"];for(let Z=0;Z<A.length;Z++){const T=A[Z],P=[];for(let q=0;q<T.length;q++){const Q=T[q],F=""+Z+q;P.push(F),z[F]={node:Q,lastCount:0},H[F]={};for(let $=0;$<se.length;$++){const G=se[$];z[G]&&z[G].node.mode===Q.mode?(H[G][F]=E(z[G].lastCount+Q.length,Q.mode)-E(z[G].lastCount,Q.mode),z[G].lastCount+=Q.length):(z[G]&&(z[G].lastCount=Q.length),H[G][F]=E(Q.length,Q.mode)+4+r.getCharCountIndicator(Q.mode,O))}}se=P}for(let Z=0;Z<se.length;Z++)H[se[Z]].end=0;return{map:H,table:z}}function w(A,O){let z;const H=r.getBestModeForData(A);if(z=r.from(O,H),z!==r.BYTE&&z.bit<H.bit)throw new Error('"'+A+'" cannot be encoded with mode '+r.toString(z)+`. 526 Suggested mode is: `+r.toString(H));switch(z===r.KANJI&&!h.isKanjiModeEnabled()&&(z=r.BYTE),z){case r.NUMERIC:return new i(A);case r.ALPHANUMERIC:return new o(A);case r.KANJI:return new m(A);case r.BYTE:return new c(A)}}l.fromArray=function(O){return O.reduce(function(z,H){return typeof H=="string"?z.push(w(H,null)):H.data&&z.push(w(H.data,H.mode)),z},[])},l.fromString=function(O,z){const H=v(O,h.isKanjiModeEnabled()),se=N(H),Z=k(se,z),T=p.find_path(Z.map,"start","end"),P=[];for(let q=1;q<T.length-1;q++)P.push(Z.table[T[q]].node);return l.fromArray(R(P))},l.rawSplit=function(O){return l.fromArray(v(O,h.isKanjiModeEnabled()))}})(qu)),qu}var eg;function M3(){if(eg)return Eu;eg=1;const l=Ll(),r=Tm(),i=g3(),o=b3(),c=y3(),m=v3(),f=j3(),h=j1(),p=k3(),g=S3(),y=C3(),v=Ml(),E=L3();function R(Z,T){const P=Z.size,q=m.getPositions(T);for(let Q=0;Q<q.length;Q++){const F=q[Q][0],$=q[Q][1];for(let G=-1;G<=7;G++)if(!(F+G<=-1||P<=F+G))for(let te=-1;te<=7;te++)$+te<=-1||P<=$+te||(G>=0&&G<=6&&(te===0||te===6)||te>=0&&te<=6&&(G===0||G===6)||G>=2&&G<=4&&te>=2&&te<=4?Z.set(F+G,$+te,!0,!0):Z.set(F+G,$+te,!1,!0))}}function N(Z){const T=Z.size;
vendor: 2,630 bytes, lines 526-529
526for(let P=8;P<T-8;P++){const q=P%2===0;Z.set(P,6,q,!0),Z.set(6,P,q,!0)}}function k(Z,T){const P=c.getPositions(T);for(let q=0;q<P.length;q++){const Q=P[q][0],F=P[q][1];for(let $=-2;$<=2;$++)for(let G=-2;G<=2;G++)$===-2||$===2||G===-2||G===2||$===0&&G===0?Z.set(Q+$,F+G,!0,!0):Z.set(Q+$,F+G,!1,!0)}}function w(Z,T){const P=Z.size,q=g.getEncodedBits(T);let Q,F,$;for(let G=0;G<18;G++)Q=Math.floor(G/3),F=G%3+P-8-3,$=(q>>G&1)===1,Z.set(Q,F,$,!0),Z.set(F,Q,$,!0)}function A(Z,T,P){const q=Z.size,Q=y.getEncodedBits(T,P);let F,$;for(F=0;F<15;F++)$=(Q>>F&1)===1,F<6?Z.set(F,8,$,!0):F<8?Z.set(F+1,8,$,!0):Z.set(q-15+F,8,$,!0),F<8?Z.set(8,q-F-1,$,!0):F<9?Z.set(8,15-F-1+1,$,!0):Z.set(8,15-F-1,$,!0);Z.set(q-8,8,1,!0)}function O(Z,T){const P=Z.size;let q=-1,Q=P-1,F=7,$=0;for(let G=P-1;G>0;G-=2)for(G===6&&G--;;){for(let te=0;te<2;te++)if(!Z.isReserved(Q,G-te)){let ye=!1;$<T.length&&(ye=(T[$]>>>F&1)===1),Z.set(Q,G-te,ye),F--,F===-1&&($++,F=7)}if(Q+=q,Q<0||P<=Q){Q-=q,q=-q;break}}}function z(Z,T,P){const q=new i;P.forEach(function(te){q.put(te.mode.bit,4),q.put(te.getLength(),v.getCharCountIndicator(te.mode,Z)),te.write(q)});const Q=l.getSymbolTotalCodewords(Z),F=h.getTotalCodewordsCount(Z,T),$=(Q-F)*8;for(q.getLengthInBits()+4<=$&&q.put(0,4);q.getLengthInBits()%8!==0;)q.putBit(0);const G=($-q.getLengthInBits())/8;for(let te=0;te<G;te++)q.put(te%2?17:236,8);return H(q,Z,T)}function H(Z,T,P){const q=l.getSymbolTotalCodewords(T),Q=h.getTotalCodewordsCount(T,P),F=q-Q,$=h.getBlocksCount(T,P),G=q%$,te=$-G,ye=Math.floor(q/$),U=Math.floor(F/$),ce=U+1,C=ye-U,le=new p(C);let de=0;const S=new Array($),B=new Array($);let J=0;const oe=new Uint8Array(Z.buffer);for(let ge=0;ge<$;ge++){const ze=ge<te?U:ce;S[ge]=oe.slice(de,de+ze),B[ge]=le.encode(S[ge]),de+=ze,J=Math.max(J,ze)}const ve=new Uint8Array(q);let Ce=0,Ne,ne;for(Ne=0;Ne<J;Ne++)for(ne=0;ne<$;ne++)Ne<S[ne].length&&(ve[Ce++]=S[ne][Ne]);for(Ne=0;Ne<C;Ne++)for(ne=0;ne<$;ne++)ve[Ce++]=B[ne][Ne];return ve}function se(Z,T,P,q){let Q;if(Array.isArray(Z))Q=E.fromArray(Z);else if(typeof Z=="string"){let ye=T;if(!ye){const U=E.rawSplit(Z);ye=g.getBestVersionForData(U,P)}Q=E.fromString(Z,ye||40)}else throw new Error("Invalid data");const F=g.getBestVersionForData(Q,P);if(!F)throw new Error("The amount of data is too big to be stored in a QR Code");if(!T)T=F;else if(T<F)throw new Error(` 527The chosen QR Code version cannot contain this amount of data. 528Minimum version required to store current data is: `+F+`. 529`);const $=z(T,P,Q),G=l.getSymbolSize(T),te=new o(G);return R(te,T),N(te),k(te,T),A(te,P,0),T>=7&&w(te,T),O(te,$),isNaN(q)&&(q=f.getBestMask(te,A.bind(null,te,P))),f.applyM
vendor: 4,474 bytes, lines 529-530
529ask(q,te),A(te,P,q),{modules:te,version:T,errorCorrectionLevel:P,maskPattern:q,segments:Q}}return Eu.create=function(T,P){if(typeof T>"u"||T==="")throw new Error("No input text");let q=r.M,Q,F;return typeof P<"u"&&(q=r.from(P.errorCorrectionLevel,r.M),Q=g.from(P.version),F=f.from(P.maskPattern),P.toSJISFunc&&l.setToSJISFunction(P.toSJISFunc)),se(T,Q,q,F)},Eu}var Pu={},Fu={},tg;function k1(){return tg||(tg=1,(function(l){function r(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let o=i.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+i);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(m){return[m,m]}))),o.length===6&&o.push("F","F");const c=parseInt(o.join(""),16);return{r:c>>24&255,g:c>>16&255,b:c>>8&255,a:c&255,hex:"#"+o.slice(0,6).join("")}}l.getOptions=function(o){o||(o={}),o.color||(o.color={});const c=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,m=o.width&&o.width>=21?o.width:void 0,f=o.scale||4;return{width:m,scale:m?4:f,margin:c,color:{dark:r(o.color.dark||"#000000ff"),light:r(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},l.getScale=function(o,c){return c.width&&c.width>=o+c.margin*2?c.width/(o+c.margin*2):c.scale},l.getImageWidth=function(o,c){const m=l.getScale(o,c);return Math.floor((o+c.margin*2)*m)},l.qrToImageData=function(o,c,m){const f=c.modules.size,h=c.modules.data,p=l.getScale(f,m),g=Math.floor((f+m.margin*2)*p),y=m.margin*p,v=[m.color.light,m.color.dark];for(let E=0;E<g;E++)for(let R=0;R<g;R++){let N=(E*g+R)*4,k=m.color.light;if(E>=y&&R>=y&&E<g-y&&R<g-y){const w=Math.floor((E-y)/p),A=Math.floor((R-y)/p);k=v[h[w*f+A]?1:0]}o[N++]=k.r,o[N++]=k.g,o[N++]=k.b,o[N]=k.a}}})(Fu)),Fu}var ag;function z3(){return ag||(ag=1,(function(l){const r=k1();function i(c,m,f){c.clearRect(0,0,m.width,m.height),m.style||(m.style={}),m.height=f,m.width=f,m.style.height=f+"px",m.style.width=f+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}l.render=function(m,f,h){let p=h,g=f;typeof p>"u"&&(!f||!f.getContext)&&(p=f,f=void 0),f||(g=o()),p=r.getOptions(p);const y=r.getImageWidth(m.modules.size,p),v=g.getContext("2d"),E=v.createImageData(y,y);return r.qrToImageData(E.data,m,p),i(v,g,y),v.putImageData(E,0,0),g},l.renderToDataURL=function(m,f,h){let p=h;typeof p>"u"&&(!f||!f.getContext)&&(p=f,f=void 0),p||(p={});const g=l.render(m,f,p),y=p.type||"image/png",v=p.rendererOpts||{};return g.toDataURL(y,v.quality)}})(Pu)),Pu}var Qu={},sg;function U3(){if(sg)return Qu;sg=1;const l=k1();function r(c,m){const f=c.a/255,h=m+'="'+c.hex+'"';return f<1?h+" "+m+'-opacity="'+f.toFixed(2).slice(1)+'"':h}function i(c,m,f){let h=c+m;return typeof f<"u"&&(h+=" "+f),h}function o(c,m,f){let h="",p=0,g=!1,y=0;for(let v=0;v<c.length;v++){const E=Math.floor(v%m),R=Math.floor(v/m);!E&&!g&&(g=!0),c[v]?(y++,v>0&&E>0&&c[v-1]||(h+=g?i("M",E+f,.5+R+f):i("m",p,0),p=0,g=!1),E+1<m&&c[v+1]||(h+=i("h",y),y=0)):p++}return h}return Qu.render=function(m,f,h){const p=l.getOptions(f),g=m.modules.size,y=m.modules.data,v=g+p.margin*2,E=p.color.light.a?"<path "+r(p.color.light,"fill")+' d="M0 0h'+v+"v"+v+'H0z"/>':"",R="<path "+r(p.color.dark,"stroke")+' d="'+o(y,g,p.margin)+'"/>',N='viewBox="0 0 '+v+" "+v+'"',w='<svg xmlns="http://www.w3.org/2000/svg" '+(p.width?'width="'+p.width+'" height="'+p.width+'" ':"")+N+' shape-rendering="crispEdges">'+E+R+`</svg> 530`;return typeof h=="function"&&h(null,w),w},Qu}var lg;function D3(){if(lg)return wn;lg=1;const l=x3(),r=M3(),i=z3(),o=U3();function c(m,f,h,p,g){const y=[].slice.call(arguments,1),v=y.length,E=typeof y[v-1]=="function";if(!E&&!l())throw new Error("Callback required as last argument");if(E){if(v<2)throw new Error("Too few arguments provided");v===2?(g=h,h=f,f=p=void 0):v===3&&(f.getContext&&typeof g>"u"?(g=p,p=void 0):(g=p,p=h,h=f,f=void 0))}else{if(v<1)throw new Error("Too few arguments provided");return v===1?(h=f,f=p=void 0):v===2&&!f.getContext&&(p=h,h=f,f=void 0),new Promise(function(R,N){try{const k=r.create(h,p);R(m(k,f,p))}catch(k){N(k)}})}try{const R=r.create(h,p);g(null,m(R,f,p))}catch(R){g(R)}}return wn.create=r.create,wn.toCanvas=c.bind(null,i.render),wn.toDataURL=c.bind(null,i.renderToDataURL),wn.toString=c.bind(null,function(m,f,h){return o.render(m,h)}),wn}var O3=D3();const B3=um(O3),H3=1024,q3=l=>
530{try{const r=new URL(l.trim());return r.protocol==="http:"||r.protocol==="https:"}catch{return!1}},ng=(l,r)=>`${l.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"qr-code"}-${r}`,V3=l=>{if(!l)return"â";const r=new Date(l);return Number.isNaN(r.getTime())?"â":r.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},$3=()=>{const[l,r]=b.useState([]),[i,o]=b.useState(!0),[c,m]=b.useState(""),[f,h]=b.useState(null),[p,g]=b.useState(!1),[y,v]=b.useState(null),[E,R]=b.useState(""),[N,k]=b.useState(""),[w,A]=b.useState(!0),[O,z]=b.useState(""),[H,se]=b.useState(!1),[Z,T]=b.useState(null);b.useEffect(()=>{P()},[]);const P=async()=>{o(!0);try{const C=await qe.get("/qr-codes");C.data.success&&r(C.data.data)}catch(C){console.error("Error fetching QR codes:",C)}finally{o(!1)}},q=(C,le)=>{navigator.clipboard.writeText(C).then(()=>{h(le),setTimeout(()=>h(de=>de===le?null:de),1800)})},Q=()=>{v(null),R(""),k(""),A(!0),z(""),g(!0)},F=C=>{v(C),R(C.name),k(C.destinationUrl),A(C.isActive),z(""),g(!0)},$=async C=>{var S,B;C.preventDefault();const le=E.trim(),de=N.trim();if(!le){z("Give this code a name so you can find it later.");return}if(!q3(de)){z("Enter a full destination URL starting with http:// or https://");return}z(""),se(!0);try{if(y){const J=await qe.put(`/qr-codes/${y._id}`,{name:le,destinationUrl:de,isActive:w});if(J.data.success){const oe=J.data.data;r(ve=>ve.map(Ce=>Ce._id===oe._id?oe:Ce)),T(ve=>ve&&ve._id===oe._id?oe:ve)}}else{const J=await qe.post("/qr-codes",{name:le,destinationUrl:de});J.data.success&&r(oe=>[J.data.data,...oe])}g(!1)}catch(J){z(((B=(S=J.response)==null?void 0:S.data)==null?void 0:B.error)||"Something went wrong. Please try again.")}finally{se(!1)}},G=async C=>{var de,S;if(confirm(`Delete "${C.name}"? 531 532Any printed copies of this QR code will stop working. This cannot be undone.`))try{await qe.delete(`/qr-codes/${C._id}`),r(B=>B.filter(J=>J._id!==C._id)),T(B=>B&&B._id===C._id?null:B)}catch(B){alert(((S=(de=B.response)==null?void 0:de.data)==null?void 0:S.error)||"Failed to delete QR code.")}},te=C=>{const le=new Blob([C.qrSvg],{type:"image/svg+xml"}),de=URL.createObjectURL(le),S=document.createElement("a");S.href=de,S.download=`${ng(C.name,C.slug)}.svg`,S.click(),URL.revokeObjectURL(de)},ye=async C=>{try{const le=await B3.toDataURL(C.shortUrl,{width:H3,margin:4}),de=document.createElement("a");de.href=le,de.download=`${ng(C.name,C.slug)}.png`,de.click()}catch(le){console.error("Error rendering PNG:",le),alert("Could not render the PNG. Try the SVG download instead.")}},U=b.useMemo(()=>{const C=c.trim().toLowerCase();return C?l.filter(le=>le.name.toLowerCase().includes(C)||le.destinationUrl.toLowerCase().includes(C)||le.slug.toLowerCase().includes(C)):l},[l,c]),ce=b.useMemo(()=>l.reduce((C,le)=>C+(le.scanCount||0),0),[l]);return t.jsxs("div",{className:"animate-in fade-in duration-500",children:[t.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 mb-6",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"QR Generator"}),t.jsx("p",{className:"text-slate-500",children:"Create QR codes whose destination you can change at any time â the printed code never has to be reissued."})]}),t.jsxs("button",{onClick:Q,className:"flex items-center justify-center gap-2 bg-primary hover:bg-primary-hover text-white px-5 py-2.5 rounded-xl font-semibold transition-all shadow-lg shadow-primary/20",children:[t.jsx(Tl,{size:20}),"Create QR Code"]})]}),t.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-4 bg-white p-4 rounded-xl border border-slate-100 shadow-sm mb-6",children:[t.jsxs("div",{className:"relative flex-1 max-w-sm",children:[t.jsx("span",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-slate-400",children:t.jsx(Al,{size:18})}),t.jsx("input",{type:"text",placeholder:"Search by name, link or code...",value:c,onChange:C=>m(C.target.value),className:"w-full pl-10 pr-4 py-2 bg-white border border-slate-200 rounded-lg text-sm text-slate-900 focus:ring-2 focus:ring-primary/20 outline-none"})]}),t.jsxs("div",{className:"flex items-center gap-6 shrink-0 px-1",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-slate-400",children:"Codes"}),t.jsx("p",{className:"text-lg font-bold text-slate-900",children:l.length})]}),t.jsx("div",{className:"h-8 w-px bg-slate-200"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-slate-400",children:"Total scans"}),t.jsx("p",{className:"text-lg font-bold text-slate-900",children:ce})]})]})]}),i?t.jsx("div",{className:"flex items-center justify-center py-24 text-slate-400",children:t.jsx(yt,{size:28,className:"animate-spin"})}):U.length===0?t.jsxs("div",{className:"bg-white border border-slate-100 rounded-2xl shadow-sm py-20 px-6 text-center",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-primary/10 rounded-2xl mb-5",children:t.jsx(Dn,{size:30,className:"text-primary"})}),t.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-1",children:l.length===0?"N
532o QR codes yet":"No matches"}),t.jsx("p",{className:"text-slate-500 text-sm max-w-md mx-auto",children:l.length===0?"Create your first code, print it, and re-point it whenever the campaign behind it changes.":"No QR code matches that search. Try a different name or link."}),l.length===0&&t.jsxs("button",{onClick:Q,className:"mt-6 inline-flex items-center gap-2 bg-primary hover:bg-primary-hover text-white px-5 py-2.5 rounded-xl font-semibold transition-all shadow-lg shadow-primary/20",children:[t.jsx(Tl,{size:20}),"Create QR Code"]})]}):t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-6",children:U.map(C=>t.jsxs("div",{className:"bg-white border border-slate-100 rounded-2xl shadow-sm hover:shadow-md transition-shadow flex flex-col overflow-hidden",children:[t.jsxs("div",{className:"p-5 flex gap-4",children:[t.jsx("button",{onClick:()=>T(C),title:"View full size",className:"shrink-0 w-24 h-24 p-1.5 bg-white border border-slate-200 rounded-xl hover:border-primary/40 transition-colors [&>svg]:w-full [&>svg]:h-full",dangerouslySetInnerHTML:{__html:C.qrSvg}}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("h3",{title:C.name,className:"flex-1 min-w-0 truncate font-bold text-slate-900",children:C.name}),t.jsx("span",{className:`shrink-0 text-[10px] font-bold uppercase tracking-wider px-2 py-0.5 rounded-full ${C.isActive?"bg-emerald-50 text-emerald-600":"bg-slate-100 text-slate-500"}`,children:C.isActive?"Active":"Paused"})]}),t.jsxs("p",{className:"mt-1 text-xs text-slate-400",children:[C.scanCount," ",C.scanCount===1?"scan":"scans"," · created ",V3(C.createdAt)]}),t.jsxs("div",{className:"mt-3 flex items-center gap-1.5 bg-slate-50 border border-slate-200 rounded-lg px-2.5 py-1.5",children:[t.jsx("span",{className:"flex-1 min-w-0 truncate text-xs font-medium text-primary",children:C.shortUrl}),t.jsx("button",{onClick:()=>q(C.shortUrl,C._id),title:f===C._id?"Copied!":"Copy QR link","aria-label":"Copy QR link",className:"shrink-0 p-1 text-slate-400 hover:text-primary hover:bg-slate-200 rounded transition-colors",children:f===C._id?t.jsx(Mn,{size:14,className:"text-emerald-600"}):t.jsx(Uo,{size:14})})]}),t.jsxs("a",{href:C.destinationUrl,target:"_blank",rel:"noopener noreferrer",title:C.destinationUrl,className:"mt-2 flex items-center gap-1.5 text-xs text-slate-500 hover:text-primary transition-colors",children:[t.jsx(Xr,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:C.destinationUrl})]})]})]}),t.jsxs("div",{className:"mt-auto flex items-center border-t border-slate-100 divide-x divide-slate-100",children:[t.jsxs("button",{onClick:()=>F(C),className:"flex-1 flex items-center justify-center gap-1.5 py-3 text-xs font-semibold text-slate-600 hover:bg-slate-50 hover:text-primary transition-colors",children:[t.jsx(Un,{size:14}),"Edit link"]}),t.jsxs("button",{onClick:()=>T(C),className:"flex-1 flex items-center justify-center gap-1.5 py-3 text-xs font-semibold text-slate-600 hover:bg-slate-50 hover:text-primary transition-colors",children:[t.jsx(Fr,{size:14}),"Download"]}),t.jsx("button",{onClick:()=>G(C),className:"flex items-center justify-center gap-1.5 py-3 px-4 text-xs font-semibold text-slate-400 hover:bg-red-50 hover:text-red-600 transition-colors","aria-label":"Delete QR code",children:t.jsx(_l,{size:14})})]})]},C._id))}),p&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 backdrop-blur-[2px] p-4",onClick:C=>{C.target===C.currentTarget&&!H&&g(!1)},children:t.jsxs("div",{className:"bg-white w-full max-w-md rounded-2xl shadow-2xl overflow-hidden",children:[t.jsxs("div",{className:"px-6 py-5 border-b border-slate-100 flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-bold text-slate-900",children:y?"Edit QR Code":"Create QR Code"}),t.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:y?"The code image stays exactly as printed.":"The image is generated once and never changes."})]}),t.jsx("button",{onClick:()=>!H&&g(!1),disabled:H,className:"p-2 text-slate-400 hover:text-slate-900 hover:bg-slate-100 rounded-full transition-all disabled:opacity-40","aria-label":"Close",children:t.jsx(ns,{size:18})})]}),t.jsxs("form",{onSubmit:$,className:"p-6 space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Name"}),t.jsx("input",{type:"text",value:E,onChange:C=>R(C.target.value),maxLength:120,autoFocus:!0,placeholder:"e.g. Summer flyer â table tents",className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-xl text-sm text-slate-900 focus:ring-4 focus:ring-primary/10 focus:border-primary outline-none transition-all"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Destination URL"}),t.jsx("input",{type:"url",value:N,onChange:C=>k(C.target.value),placeholder:"https://example.com/landing-page",className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-xl text-sm text-slate-900 focus:ring-4 focus:ring-primary/10 focus:border-primary outline-none transition-all"}),t.jsx("p",{className:"mt-1.5 text-[11px] text-slate-400",children:"You can change this later without reprinting the code."})]}),y&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none",children:[t.jsx("input",{type:"checkbox",checked:w,onChange:C=>A(C.target.checked),className:"w-4 h-4 accent-primary"}),t.jsx("span",{className:"text-sm text-slate-700",children:"Active â scans redirect to the destination"})]}),t.jsxs("div",{className:"flex items-center gap-2 bg-slate-50 border border-slate-200 rounded-xl px-3 py-2.5",children:[t.jsx("span",{className:"flex-1 min-w-0 truncate text-xs font-medium text-slate-500",children:y.shortUrl}),t.jsx("span",{className:"shrink-0 text-[10px] font-bold uppercase tracking-wider text-slate-400",children:"Permanent"})]})]}),O&&t.jsx("p",{className:"text-xs text-rose-600 font-medium",children:O}),t.jsxs("div",{className:"flex gap-3 pt-2",children:[t.jsx("button",{type:"button",onClick:()=>g(!1),disabled:H,className:"flex-1 py-3 px-4 border border-slate-200 text-slate-600 font-bold rounded-xl hover:bg-slate-50 transition-all disabled:opacity-50 text-sm",children:"Cancel"}),t.jsx("button",{type:"submit",disabled:H,className:"flex-1 py-3 px-4 bg-primary hover:bg-primary-hover text-white font-bold rounded-xl transition-all disabled:opacity-60 flex items-center justify-center gap-2 text-sm shadow-lg shadow-primary/20",children:H?t.jsx(yt,{size:16,className:"animate-spin"}):y?"Save changes":"Generate"})]})]})]})}),Z&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 backdrop-blur-[2px] p-4",onClick:C=>{C.target===C.currentTarget&&T(null)},children:t.jsxs("div",{className:"bg-white w-full max-w-sm rounded-2xl shadow-2xl p-8 flex flex-col items-center gap-6",children:[t.jsxs("div",{className:"flex items-start justify-between w-full gap-3",children:[t.jsx("h3",{className:"text-lg font-bold text-slate-900 min-w-0 break-words",children:Z.name}),t.jsx("button",{onClick:()=>T(null),className:"shrink-0 w-8 h-8 flex items-center justify-center bg-slate-100 text-slate-500 rounded-full hover:bg-slate-200 transition-colors","aria-label":"Close",children:t.jsx(ns,{size:16})})]}),t.jsx("div",{className:"w-56 h-56 [&>svg]:w-full [&>svg]:h-full",dangerouslySetInnerHTML:{__html:Z.qrSvg}}),t.jsxs("div",{className:"w-full flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:"Encoded link (permanent)"}),t.jsxs("div",{className:"flex items-center gap-2 w-full bg-slate-50 border border-slate-200 rounded-xl px-3 py-2.5",children:[t.jsx("span",{className:"flex-1 min-w-0 truncate text-sm font-medium text-primary",children:Z.shortUrl}),t.jsx("button",{onClick:()=>q(Z.shortUrl,"preview"),title:f==="preview"?"Copied!":"Copy link","aria-label":"Copy QR link",className:"shrink-0 p-1.5 text-slate-400 hover:text-primary hover:bg-slate-200 rounded-md transition-colors",children:f==="preview"?t.jsx(Mn,{size:16,className:"text-emerald-600"}):t.jsx(Uo,{size:16})})]})]}),t.jsxs("div",{className:"w-full flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:"Currently points to"}),t.jsx("a",{href:Z.destinationUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-slate-600 hover:text-primary break-all transition-colors",children:Z.destinationUrl})]}),t.jsxs("div",{className:"w-full flex gap-3",children:[t.jsxs("button",{onClick:()=>te(Z),className:"flex-1 py-3 bg-primary hover:bg-primary-hover text-white font-bold rounded-xl transition-all shadow-lg shadow-primary/20 text-sm flex items-center justify-center gap-2",children:[t.jsx(Fr,{size:16}),"SVG"]}),t.jsxs("button",{onClick:()=>ye(Z),className:"flex-1 py-3 border border-slate-200 text-slate-700 font-bold rounded-xl hover:bg-slate-50 transition-all text-sm flex items-center justify-center gap-2",children:[t.jsx(Fr,{size:16}),"PNG"]})]})]})})]})},Nl=(l,r)=>typeof l=="number"&&Number.isFinite(l)?l:r,I3=({area:l,artwork:r,alt:i="Product",showGuideWhenEmpty:o=!0,className:c=""})=>{const m=l||{},f=!!(r!=null&&r.url);return t.jsxs("div",{className:`relative w-full overflow-hidden bg-slate-50 ${c}`,children:[m.mockupImage?t.jsx("img",{src:m.mockupImage,alt:i,className:"w-full block"}):t.jsx("div",{className:"aspect-square"}),t.jsx("div",{className:"absolute overflow-hidden",style:{left:`${Nl(m.areaX,25)}%`,top:`${Nl(m.areaY,25)}%`,width:`${Nl(m.areaWidth,50)}%`,height:`${Nl(m.areaHeight,50)}%`,backgroundColor:(r==null?void 0:r.backgroundColor)||"transparent",outline:!f&&o?"2px dashed rgba(107,70,193,0.5)":"none",outlineOffset:"-2px"},children:f&&t.jsx("img",{src:r.url,alt:"Artwork",className:"absolute",style:{width:`${Nl(r.scale,100)}
532%`,left:`${50+Nl(r.offsetX,0)}%`,top:`${50+Nl(r.offsetY,0)}%`,transform:"translate(-50%, -50%)",objectFit:"contain"}})})]})},G3=["submitted","approved","rejected","draft"],Y3=l=>{var m;if(l.artwork.isVector)return null;const r=l.artwork.widthPx,i=((m=l.printSpec)==null?void 0:m.widthMm)??40;if(!r||!i)return null;const o=Math.min(Math.max(l.artwork.scale||100,10),100)/100,c=i*o/25.4;return c>0?Math.round(r/c):null},P3=()=>{const[l,r]=b.useState("submitted"),[i,o]=b.useState([]),[c,m]=b.useState(!0),[f,h]=b.useState(null),[p,g]=b.useState(null),[y,v]=b.useState(null),[E,R]=b.useState(""),N=b.useCallback(async()=>{var w;m(!0),g(null);try{const A=await qe.get(`/customers/artwork/pending?status=${l}`);o(((w=A.data)==null?void 0:w.data)||[])}catch(A){console.error("Error loading artwork queue:",A),g("Failed to load the queue.")}finally{m(!1)}},[l]);b.useEffect(()=>{N()},[N]);const k=async(w,A,O)=>{h(w.deviceId),g(null);try{await qe.patch(`/customers/${w.customerId}/devices/${w.deviceId}/artwork/review`,{status:A,reviewNote:O||""}),o(z=>z.filter(H=>H.deviceId!==w.deviceId)),v(null),R("")}catch(z){console.error("Error reviewing artwork:",z),g("Failed to save that decision. Please try again.")}finally{h(null)}};return t.jsxs("div",{children:[t.jsxs("div",{className:"mb-8 flex flex-wrap items-end justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-slate-800",children:"Artwork Queue"}),t.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Customer designs waiting to be approved for printing."})]}),t.jsx("div",{className:"flex gap-1.5",children:G3.map(w=>t.jsx("button",{onClick:()=>r(w),className:`px-3.5 py-1.5 rounded-full text-[13px] font-semibold capitalize transition-all border ${l===w?"bg-primary text-white border-primary":"bg-white text-slate-600 border-slate-200 hover:border-slate-400"}`,children:w},w))})]}),p&&t.jsxs("div",{className:"mb-5 flex items-center gap-2 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:[t.jsx(Do,{size:16})," ",p]}),c?t.jsx("div",{className:"min-h-[300px] flex items-center justify-center",children:t.jsx(yt,{className:"animate-spin text-primary",size:36})}):i.length===0?t.jsxs("div",{className:"min-h-[280px] flex flex-col items-center justify-center gap-3 text-slate-400 bg-white rounded-2xl border border-slate-100",children:[t.jsx(Hg,{size:44}),t.jsxs("p",{className:"text-base font-semibold",children:["Nothing ",l,"."]})]}):t.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:i.map(w=>{const A=w.printSpec||{},O=Y3(w),z=A.minDpi??300,H=O!==null&&O<z;return t.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-100 overflow-hidden",children:[t.jsxs("div",{className:"p-5 flex items-start justify-between gap-4 border-b border-slate-100",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"font-bold text-slate-900 truncate",children:w.productName}),t.jsxs("p",{className:"text-xs text-slate-500 mt-0.5 truncate",children:[w.customerName," · ",w.customerEmail]}),w.deviceName&&t.jsx("p",{className:"text-xs text-slate-400 mt-0.5 truncate",children:w.deviceName})]}),w.artwork.submittedAt&&t.jsx("span",{className:"text-[11px] text-slate-400 shrink-0",children:new Date(w.artwork.submittedAt).toLocaleDateString()})]}),t.jsx(I3,{area:{mockupImage:w.mockupImage,areaX:A.areaX??25,areaY:A.areaY??25,areaWidth:A.areaWidth??50,areaHeight:A.areaHeight??50},artwork:w.artwork.url?w.artwork:null,alt:w.productName,showGuideWhenEmpty:!1}),t.jsxs("div",{className:"p-5 space-y-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-slate-500",children:[t.jsx("span",{children:w.artwork.isVector?"Vector (SVG)":`${w.artwork.widthPx}Ã${w.artwork.heightPx}px`}),O!==null&&t.jsxs("span",{className:H?"text-amber-600 font-semibold":"",children:[O," DPI ",H&&`(under ${z})`]}),w.artwork.url&&t.jsxs("a",{href:w.artwork.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-primary font-semibold hover:underline",children:[t.jsx(Fr,{size:12})," Original file"]})]}),H&&t.jsxs("div",{className:"flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-[12px] text-amber-800",children:[t.jsx(Do,{size:14,className:"mt-0.5 shrink-0"}),t.jsx("span",{children:"This will print soft. The customer was warned and chose to continue â reject it if you'd rather not print it."})]}),w.artwork.status==="rejected"&&w.artwork.reviewNote&&t.jsx("p",{className:"text-[12px] text-rose-700 bg-rose-50 border border-rose-100 rounded-xl px-3 py-2",children:w.artwork.reviewNote}),l==="submitted"&&(y===w.deviceId?t.jsxs("div",{className:"space-y-2",children:[t.jsx("textarea",{autoFocus:!0,rows:2,value:E,onChange:se=>R(se.target.value),placeholder:"What does the customer need to change?",className:"w-full px-3 py-2 border border-slate-200 rounded-xl text-sm outline-none focus:border-primary resize-y"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{onClick:()=>{v(null),R("")},className:"flex-1 py-2 px-3 border border-slate-200 text-slate-600 text-sm font-bold rounded-xl hover:bg-slate-50",children:"Cancel"}),t.jsx("button",{onClick:()=>k(w,"rejected",E),disabled:f===w.deviceId||!E.trim(),className:"flex-1 py-2 px-3 bg-rose-600 text-white text-sm font-bold rounded-xl disabled:opacity-50",children:"Send back"})]})]}):t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:()=>v(w.deviceId),disabled:f===w.deviceId,className:"flex-1 py-2.5 px-3 border border-rose-200 text-rose-600 text-sm font-bold rounded-xl hover:bg-rose-50 flex items-center justify-center gap-1.5 disabled:opacity-50",children:[t.jsx(ns,{size:15})," Request changes"]}),t.jsxs("button",{onClick:()=>k(w,"approved"),disabled:f===w.deviceId,className:"flex-1 py-2.5 px-3 bg-primary text-white text-sm font-bold rounded-xl flex items-center justify-center gap-1.5 disabled:opacity-50",children:[f===w.deviceId?t.jsx(yt,{size:15,className:"animate-spin"}):t.jsx(Mn,{size:15}),"Approve for print"]})]}))]})]},w.deviceId)})})]})},Wo=l=>(l||"").replace(/^@+/,"").trim(),rg=l=>{const[r,i="00"]=(l||"").split(":"),o=Number(r);
532if(Number.isNaN(o))return l;const c=o<12?"AM":"PM";return`${o%12===0?12:o%12}:${i.padStart(2,"0")} ${c}`},Rm=(l,r)=>{const i=Wo(r);if(!i)return"";switch(l){case"instagram":return`https://instagram.com/${i}`;case"facebook":return`https://facebook.com/${i}`;case"linkedin":return/^https?:\/\//i.test(i)?i:/linkedin\.com/i.test(i)?`https://${i}`:`https://linkedin.com/in/${i}`;case"twitter":return`https://x.com/${i}`;case"youtube":return`https://youtube.com/@${i}`;case"soundcloud":return`https://soundcloud.com/${i}`;case"pinterest":return`https://pinterest.com/${i}`;case"behance":return`https://behance.net/${i}`;case"dribbble":return`https://dribbble.com/${i}`;case"tiktok":return`https://tiktok.com/@${i}`;case"twitch":return`https://twitch.tv/${i}`;case"telegram":return`https://t.me/${i}`;case"whatsapp":return`https://wa.me/${i.replace(/[^\d]/g,"")}`;case"threads":return`https://threads.net/@${i}`;case"messenger":return`https://m.me/${i}`;case"snapchat":return`https://snapchat.com/add/${i}`;case"reddit":return`https://reddit.com/user/${i}`;case"vimeo":return`https://vimeo.com/${i}`;case"yelp":case"google":case"discord":case"signal":case"tripadvisor":return/^https?:\/\//i.test(i)?i:`https://${i}`;default:return""}},F3=l=>{if(!l)return"";const r=l.match(/(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{11})/);if(r)return`https://www.youtube.com/embed/${r[1]}`;const i=l.match(/vimeo\.com\/(?:video\/)?(\d+)/);return i?`https://player.vimeo.com/video/${i[1]}`:""},as=l=>(l||"").replace(/[\\;,]/g,r=>`\\${r}`).replace(/\n/g,"\\n"),Q3=l=>{var y,v,E,R,N,k,w,A,O,z,H,se,Z,T,P;const r=q=>l.find(Q=>Q.type===q),i=((v=(y=r("name"))==null?void 0:y.data)==null?void 0:v.value)??"",o=((R=(E=r("jobTitle"))==null?void 0:E.data)==null?void 0:R.value)??"",c=((k=(N=r("company"))==null?void 0:N.data)==null?void 0:k.value)??"",m=((A=(w=r("call"))==null?void 0:w.data)==null?void 0:A.phone)??"",f=((z=(O=r("email"))==null?void 0:O.data)==null?void 0:z.email)??"",h=((se=(H=r("website"))==null?void 0:H.data)==null?void 0:se.url)??"",p=((T=(Z=r("address"))==null?void 0:Z.data)==null?void 0:T.query)??"",g=["BEGIN:VCARD","VERSION:3.0"];if(i){g.push(`FN:${as(i)}`);const q=i.split(/\s+/),Q=q.length>1?q.pop():"";g.push(`N:${as(Q||"")};${as(q.join(" "))};;;`)}o&&g.push(`TITLE:${as(o)}`),c&&g.push(`ORG:${as(c)}`),m&&g.push(`TEL;TYPE=CELL:${as(m)}`),f&&g.push(`EMAIL:${as(f)}`),h&&g.push(`URL:${as(h)}`),p&&g.push(`ADR:;;${as(p)};;;;`);for(const q of l)if(qo(q.type)){const Q=Wo(((P=q.data)==null?void 0:P.handle)??""),F=Rm(q.type,Q),$=Q.replace(/^https?:\/\//i,"").replace(/\/+$/,"").split("/").pop()||Q;F&&g.push(`X-SOCIALPROFILE;TYPE=${q.type};x-user=${$}:${as(F)}`)}return g.push("END:VCARD"),g.join(`\r 533`)},X3=l=>{var m,f;const r=new Blob([Q3(l)],{type:"text/vcard;charset=utf-8"}),i=URL.createObjectURL(r),o=document.createElement("a");o.href=i;const c=((f=(m=l.find(h=>h.type==="name"))==null?void 0:m.data)==null?void 0:f.value)||"contact";o.download=`${String(c).replace(/\s+/g,"_")}.vcf`,o.click(),setTimeout(()=>URL.revokeObjectURL(i),1e3)},xt="w-5 h-5",dt={phone:t.jsx("svg",{className:xt,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.95.68l1.5 4.49a1 1 0 01-.5 1.21l-2.26 1.13a11 11 0 005.52 5.52l1.13-2.26a1 1 0 011.21-.5l4.49 1.5a1 1 0 01.68.95V19a2 2 0 01-2 2h-1C9.72 21 3 14.28 3 6V5z"})}),email:t.jsx("svg",{className:xt,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),globe:t.jsxs("svg",{className:xt,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:[t.jsx("circle",{cx:"12",cy:"12",r:"9"}),t.jsx("path",{strokeLinecap:"round",d:"M3 12h18M12 3a14 14 0 010 18M12 3a14 14 0 000 18"})]}),instagram:t.jsx("img",{src:"/logos/Instagram.svg",alt:"",className:xt}),facebook:t.jsx("img",{src:"/logos/Facebook.svg",alt:"",className:xt}),linkedin:t.jsx("img",{src:"/logos/Linkedin.svg",alt:"",className:xt}),twitter:t.jsx("img",{src:"/logos/X.svg",alt:"",className:xt}),youtube:t.jsx("img",{src:"/logos/Youtube.svg",alt:"",className:xt}),soundcloud:t.jsx("svg",{className:xt,fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M23.999 14.165c-.052 1.796-1.612 3.169-3.409 3.169h-8.07c-.18-.02-.317-.169-.317-.353V6.456c0-.2.135-.298.317-.353 1.027-.346 2.137-.519 3.319-.519 4.291 0 7.704 3.342 7.704 7.586 0 .337-.018.67-.054 1zm-12.7 3.166h-.452c-.18 0-.317-.146-.317-.328V7.114c0-.
53318.137-.328.317-.328h.452c.18 0 .317.146.317.328v9.889c0 .18-.137.327-.317.327zm-2.207 0h-.452c-.18 0-.317-.146-.317-.328V8.151c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v8.852c0 .18-.137.327-.317.327zm-2.207 0H6.43c-.18 0-.317-.146-.317-.328V9.16c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v7.843c0 .18-.137.327-.317.327zm-2.207 0h-.452c-.18 0-.317-.146-.317-.328v-6.39c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v6.39c0 .18-.137.327-.317.327zm-2.208 0h-.452c-.18 0-.317-.146-.317-.328v-5.31c0-.181.137-.328.317-.328h.452c.18 0 .317.146.317.328v5.31c0 .18-.137.327-.317.327zM0 13.987c0-.18.146-.327.327-.327h.452c.18 0 .317.146.317.327v2.554c0 .181-.137.328-.317.328H.327c-.18 0-.327-.146-.327-.328v-2.554z"})}),pinterest:t.jsx("img",{src:"/logos/Pinterest.svg",alt:"",className:xt}),behance:t.jsx("svg",{className:xt,fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"})}),dribbble:t.jsx("svg",{className:xt,fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm9.885 11.441c-2.575-.422-4.943-.445-7.103-.073-.244-.563-.497-1.125-.767-1.68 2.31-1 4.165-2.358 5.548-4.082 1.35 1.594 2.197 3.619 2.322 5.835zm-3.842-7.282c-1.205 1.554-2.868 2.783-4.986 3.68-1.016-1.861-2.178-3.676-3.488-5.438.779-.197 1.591-.314 2.431-.314 2.275 0 4.368.779 6.043 2.072zM7.072 1.985c1.341 1.728 2.521 3.523 3.554 5.381-2.674.71-5.713 1.073-9.099 1.084.426-2.892 2.262-5.319 4.871-6.465zm-5.221 8.43c.06 0 .12.002.18.002 3.92 0 7.412-.504 10.475-1.529.243.491.476.984.692 1.481-3.51 1.063-6.498 3.16-8.97 6.290-1.522-1.567-2.502-3.654-2.679-5.96zm3.681 7.342c2.292-2.957 5.041-4.864 8.31-5.745.916 2.379 1.585 4.811 2.001 7.293-3.483 1.673-7.55 1.106-10.311-1.548zm12.027.561c-.39-2.301-1.011-4.564-1.85-6.789 1.956-.312 4.012-.232 6.158.232-.401 2.682-1.91 5.022-4.308 6.557z"})}),tiktok:t.jsx("img",{src:"/logos/Tiktok.svg",alt:"",className:xt}),yelp:t.jsx("img",{src:"/logos/Ylep.svg",alt:"",className:xt}),google:t.jsx("img",{src:"/logos/Google.svg",alt:"",className:xt}),twitch:t.jsx("img",{src:"/logos/Twitch.svg",alt:"",className:xt}),discord:t.jsx("img",{src:"/logos/Discord.svg",alt:"",className:xt}),telegram:t.jsx("img",{src:"/logos/Telegram.svg",alt:"",className:xt}),whatsapp:t.jsx("img",{src:"/logos/Whatsapp.svg",alt:"",className:xt}),threads:t.jsx("img",{src:"/logos/Threads.svg",alt:"",className:xt}),messenger:t.jsx("img",{src:"/logos/Messenger.svg",alt:"",className:xt}),snapchat:t.jsx("img",{src:"/logos/Snapchat.svg",alt:"",className:xt}),signal:t.jsx("img",{src:"/logos/Signal.svg",alt:"",className:xt}),reddit:t.jsx("img",{src:"/logos/Reddit.svg",alt:"",className:xt}),vimeo:t.jsx("img",{src:"/logos/Vimeo.svg",alt:"",className:xt}),tripadvisor:t.jsx("img",{src:"/logos/Tripadvisor.svg",alt:"",className:xt}),link:t.jsx("svg",{className:xt,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),gallery:t.jsx("svg",{className:xt,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})},S1=l=>{switch(l){case"instagram":return dt.instagram;case"facebook":return dt.facebook;case"linkedin":return dt.linkedin;case"twitter":return dt.twitter;case"youtube":return dt.youtube;case"soundcloud":return dt.soundcloud;case"pinterest":return dt.pinterest;case"behance":return dt.behance;case"dribbble":return dt.dribbble;case"tiktok":return dt.tiktok;case"yelp":return dt.yelp;case"google":return dt.google;case"twitch":return dt.twitch;case"discord":return dt.discord;case"telegram":return dt.telegram;case"whatsapp":return dt.whatsapp;case"threads":return dt.threads;case"messenger":return dt.messenger;case"snapchat":return dt.snapchat;case"signal":return dt.signal;case"reddit":return dt.reddit;case"vimeo":return dt.vimeo;case"tripadvisor":return dt.tripadvisor;default:return dt.link}},K3=["instagram","facebook","linkedin","twitter","youtube","soundcloud","pinterest","behance","dribbble","tiktok","yelp","google","twitch","discord","telegram","whatsapp","threads","messenger","snapchat","signal","reddit","vimeo","tripadvisor"],qo=l=>K3.includes(l),Z3=["linkedin","yelp","google","discord","signal","tripadvisor"],J3=(l,r)=>r?Z3.includes(l)?r.replace(/^https?:\/\//i,"").replace(/\/+$/,""):l==="whatsapp"?r:`@${r}`:"",W3=({blocks:l,onLinkClick:r})=>{const i=l.map(o=>{var c;return{b:o,handle:Wo(((c=o.data)==null?void 0:c.handle)||"")}}).filter(o=>o.handle);return i.length?t.jsx("div",{className:"flex flex-wrap items-center justify-center gap-3 py-1",children:i.map(({b:o,handle:c})=>t.jsx("a",{href:Rm(o.type,c),target:"_blank",rel:"noopener noreferrer","aria-label":o.title||o.type,title:o.title||o.type,onClick:()=>r==null?void 0:r(o.type),className:"w-11 h-11 rounded-full bg-primary/10 text-primary flex items-center justify-center hover:bg-primary/20 transition-all",children:S1(o.type)},o._id||`${o.type}-${o.sortOrder}`))}):null},kn=({label:l,value:r,href:i,icon:o,onClick:c})=>{const m=t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 text-primary flex items-center justify-center shrink-0",children:o}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l}),t.jsx("p",{className:"text-sm font-semibold text-slate-800 truncate",children:r})]})]});return i?t.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",onClick:c,className:"flex items-center gap-3.5 p-4 rounded-2xl border border-slate-100 hover:border-primary/30 hover:bg-primary/5 transition-all",children:m}):t.jsx("div",{className:"flex items-center gap-3.5 p-4 rounded-2xl border border-slate-100",children:m})},Xu=({onInteract:l,...r})=>{const i=Pr.useRef(null),o=Pr.useRef(!1);return Pr.useEffect(()=>{if(!l)return;const c=()=>{setTimeout(()=>{o.current||document.activeElement===i.current&&(o.current=!0,l())},0)};return window.addEventListener("blur",c),()=>window.removeEventListener("blur",c)},[l]),t.jsx("iframe",{ref:i,...r})},ig=(l,r,i)=>{const o=l._id||`${l.type}-${l.sortOrder}`,c=l.type,m=l.data||{},f=()=>i==null?void 0:i(c);if(c==="name")return t.jsx("h2",{className:"text-xl font-bold text-slate-900 text-center",children:m.value||"Your Name"},o);if(c==="jobTitle")return t.jsx("p",{className:"text-sm text-slate-500 text-center",children:m.value||"Your Title"},o);if(c==="company")return t.jsx("p",{className:"text-sm text-slate-500 text-center font-medium",children:m.value||"Your Company"},o);if(c==="call")return t.jsx(kn,{label:l.title||"Call",value:m.phone||"",href:m.phone?`tel:${m.phone}`:void 0,icon:dt.phone,onClick:f},o);if(c==="email")return t.jsx(kn,{label:l.title||"Email",value:m.email||"",href:m.email?`mailto:${m.email}`:void 0,icon:dt.email,onClick:f},o);if(c==="website")return t.jsx(kn,{label:l.title||"Website",value:m.url||"",href:m.url||void 0,icon:dt.globe,onClick:f},o);if(c==="customLink")return t.jsx(kn,{label:l.title||"Link",value:m.url||"",href:m.url||void 0,icon:dt.link,onClick:f},o);if(c==="about")return t.jsxs("div",{className:"px-1 space-y-2",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l.title||"About"}),m.heading&&t.jsx("h4",{className:"text-base font-bold text-slate-900",children:m.heading}),(m.name||m.role)&&t.jsxs("p",{className:"text-sm text-slate-500 font-medium",children:[m.name,m.name&&m.role?" · ":"",m.role]}),m.text&&t.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:m.text})]},o);if(c==="addToContact")return null;if(c==="scheduleMeeting")return t.jsx("a",{href:m.url||"#",target:"_blank",rel:"noopener noreferrer",onClick:f,className:`block w-full py-3 text-center font-bold rounded-xl text-sm transition-all active:scale-95 ${m.url?"bg-white text-primary border-2 border-primary hover:bg-primary/5":"bg-slate-100 text-slate-400 pointer-events-none"}`,children:l.title||"Schedule Meeting"},o);if(qo(c)){const h=Wo(m.handle||""),p=J3(c,h);return t.jsx(kn,{label:l.title||c,value:p,href:h?Rm(c,h):void 0,icon:S1(c),onClick:f},o)}if(c==="address"){if(!m.query)return null;const h=`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(m.query)}`;return t.jsxs("div",{className:"space-y-2 px-1",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l.title||"Address"}),t.jsx("p",{className:"text-sm text-slate-700 font-medium",children:m.query}),t.jsx(Xu,{title:`map-${m.query}`,src:`https://www.google.com/maps?q=${encodeURIComponent(m.query)}&output=embed`,className:"w-full h-40 rounded-xl border border-slate-200",loading:"lazy",onInteract:f}),t.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",onClick:f,className:"text-xs font-bold text-primary hover:underline inline-block",children:"Get Directions â"})]},o)}if(c==="hours"){const h=Array.isArray(m.days)?m.days:[];return h.length?t.jsxs("div",{className:"space-y-2 px-1",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l.title||"Hours"}),t.jsx("div",{className:"space-y-1",children:h.map(p=>t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"font-semibold text-slate-700",children:p.day}),t.jsx("span",{className:"text-slate-500",children:p.closed?"Closed":`${rg(p.open)} â ${rg(p.close)}`})]},p.day))})]},o):null}if(c==="video"){const h=F3(m.url||"");return h?t.jsxs("div",{className:"space-y-2 px-1",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l.title||"Video"}),t.jsx(Xu,{title:`video-${h}`,src:h,className:"w-full aspect-video rounded-xl border border-slate-200",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,onInteract:f})]},o):null}return c==="gallery"?t.jsx(kn,{label:l.title||"Photo Gallery",value:m.url||"",href:m.url||void 0,icon:dt.gallery,onClick:f},o):c==="pdf"&&m.url?t.jsxs("div",{className:"space-y-2 px-1",children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:l.title||"PDF"}),t.jsx(Xu,{title:`pdf-${m.url}`,src:m.url,className:"w-full h-72 rounded-xl border border-slate-200",onInteract:f}),t.jsx("a",{href:m.url,target:"_blank",rel:"noopener noreferrer",onClick:f,className:"text-xs font-bold text-primary hover:underline inline-block",children:"Open in new tab â"})]},o):null},e6=({profile:l,className:r})=>{const i=l.companyLogoUrl||"";if(!i)return null;const o=l.companyLogoBgColor||"";return t.jsx("div",{className:`flex items-center justify-center px-8 py-14 ${r||""}`,style:o?{backgroundColor:o}:void 0,children:t.jsx("img",{src:i,alt:"",className:"max-h-20 max-w-[70%] object-contain"})})},t6=({profile:l,onLinkClick:r})=>{var h,p;const i=(l.blocks||[]).slice().sort((g,y)=>g.sortOrder-y.sortOrder);if(!i.length)return t.jsx("div",{className:"text-center py-4",children:t.jsx("p",{className:"text-sm text-slate-400",children:"This business card hasn't been set up yet."})});const o=i.find(g=>g.type==="name"),c=i.find(g=>g.type==="about"),m=l.profilePictureUrl||((h=c==null?void 0:c.data)==null?void 0:h.logoUrl)||"",f=(((p=o==null?void 0:o.data)==null?void 0:p.value)||"?").toString().charAt(0).toUpperCase();return t.jsxs("div",{className:"space-y-3",children:[t.jsx("div",{className:"text-center mb-4",children:m?t.jsx("img",{src:m,alt:"",className:"w-20 h-20 rounded-full mx-auto mb-4 object-cover shadow-lg shadow-primary/20 bg-white"}):t.jsx("div",{className:"w-20 h-20 bg-linear-to-br from-primary to-primary/70 rounded-full mx-auto mb-4 flex items-center justify-center text-white text-2xl font-bold shadow-lg shadow-primary/20",children:f})}),(()=>{if(l.socialLayout!=="icons")return i.map(y=>ig(y,i,r));let g=!1;return i.map(y=>qo(y.type)?g?null:(g=!0,t.jsx(W3,{blocks:i.filter(v=>qo(v.type)),onLinkClick:r},"social-icons")):ig(y,i,r))})()]})}
533,og={name:"",email:"",phone:"",company:"",jobTitle:"",note:""},a6=/^\w+([.\-]?\w+)*@\w+([.\-]?\w+)*(\.\w{2,3})+$/,s6=({apiUrl:l,customerId:r,productId:i,open:o,onClose:c})=>{const[m,f]=b.useState(og),[h,p]=b.useState(!1),[g,y]=b.useState(!1),[v,E]=b.useState("");b.useEffect(()=>{if(!o)return;const w=O=>{O.key==="Escape"&&c()};document.addEventListener("keydown",w);const A=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",w),document.body.style.overflow=A}},[o,c]),b.useEffect(()=>{o&&y(!1)},[o]);const R=w=>A=>{f(O=>({...O,[w]:A.target.value}))},N=()=>{E(""),c()},k=async w=>{w.preventDefault(),E("");const A=m.name.trim(),O=m.email.trim();if(!A){E("Please enter your name.");return}if(!a6.test(O)){E("Please enter a valid email address.");return}p(!0);try{const z=await fetch(`${l}/leads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({customerId:r,productId:i,name:A,email:O,phone:m.phone.trim(),company:m.company.trim(),jobTitle:m.jobTitle.trim(),note:m.note.trim()})}),H=await z.json().catch(()=>({}));!z.ok||!H.success?E(H.error||"We couldn't send your details. Please try again."):(y(!0),f(og))}catch{E("Network error. Please try again.")}finally{p(!1)}};return t.jsx(t.Fragment,{children:o&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-slate-900/50 backdrop-blur-sm p-0 sm:p-4 animate-in fade-in duration-200",onClick:N,role:"dialog","aria-modal":"true","aria-label":"Share your info",children:t.jsxs("div",{onClick:w=>w.stopPropagation(),className:"w-full sm:max-w-md bg-white rounded-t-3xl sm:rounded-3xl shadow-2xl max-h-[92vh] overflow-hidden flex flex-col animate-in slide-in-from-bottom-4 sm:zoom-in-95 duration-200",children:[t.jsxs("div",{className:"flex items-center justify-between px-6 pt-5 pb-3 border-b border-slate-100",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:"Share Your Info"}),t.jsx("p",{className:"text-sm text-slate-600 mt-0.5",children:"Leave your details so they can get back to you."})]}),t.jsx("button",{type:"button",onClick:N,"aria-label":"Close",className:"text-slate-400 hover:text-slate-700 hover:bg-slate-100 p-2 -mr-2 rounded-lg transition-colors",children:t.jsx(ns,{size:18})})]}),t.jsx("div",{className:"px-6 py-5 overflow-y-auto",children:g?t.jsxs("div",{className:"text-center py-6",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-full bg-emerald-100 mb-4",children:t.jsx(zo,{size:28,className:"text-emerald-600"})}),t.jsx("p",{className:"text-base font-bold text-slate-900",children:"Thanks for sharing!"}),t.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Your details have been sent. They'll be in touch shortly."}),t.jsx("button",{type:"button",onClick:N,className:"mt-6 px-6 py-2.5 bg-primary text-white font-bold rounded-xl hover:bg-primary-hover transition-all text-sm",children:"Done"})]}):t.jsxs("form",{onSubmit:k,className:"space-y-3",children:[t.jsx("input",{type:"text",placeholder:"Your name *",value:m.name,onChange:R("name"),required:!0,autoFocus:!0,className:"w-full px-4 py-2.5 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40"}),t.jsx("input",{type:"email",placeholder:"Email *",value:m.email,onChange:R("email"),required:!0,inputMode:"email",autoComplete:"email",className:"w-full px-4 py-2.5 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40"}),t.jsx("input",{type:"tel",placeholder:"Phone",value:m.phone,onChange:R("phone"),inputMode:"tel",autoComplete:"tel",className:"w-full px-4 py-2.5 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40"}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsx("input",{type:"text",placeholder:"Company",value:m.company,onChange:R("company"),autoComplete:"organization",className:"w-full px-4 py-2.5 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-primary/40 focu
533s:border-primary/40"}),t.jsx("input",{type:"text",placeholder:"Job title",value:m.jobTitle,onChange:R("jobTitle"),autoComplete:"organization-title",className:"w-full px-4 py-2.5 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40"})]}),t.jsx("textarea",{placeholder:"Add a note (optional)",value:m.note,onChange:R("note"),rows:3,className:"w-full px-4 py-2.5 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 placeholder-slate-400 resize-none focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40"}),v&&t.jsx("p",{className:"text-xs text-red-600 font-medium",children:v}),t.jsx("button",{type:"submit",disabled:h,className:"w-full py-3 bg-primary text-white font-bold rounded-xl hover:bg-primary-hover transition-all active:scale-95 text-sm flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed",children:h?"Sendingâ¦":t.jsxs(t.Fragment,{children:[t.jsx(bN,{size:16})," Share My Info"]})})]})})]})})})},l6=l=>{let r=2166136261;for(let i=0;i<l.length;i++)r^=l.charCodeAt(i),r=Math.imul(r,16777619);return(r>>>0).toString(16).padStart(8,"0")},Wt=l=>{try{return l()}catch{return}},n6=()=>Wt(()=>{const l=document.createElement("canvas");l.width=120,l.height=40;const r=l.getContext("2d");if(!r)return;r.textBaseline="top",r.font="14px 'Arial'",r.fillStyle="#f60",r.fillRect(0,0,120,20),r.fillStyle="#069",r.fillText("SleekTap â 0123",2,2),r.fillStyle="rgba(102, 204, 0, 0.6)",r.font="16px 'Times New Roman'",r.fillText("SleekTap â 0123",4,16);const i=l.toDataURL();return i?l6(i):void 0}),r6=()=>Wt(()=>{const l=document.createElement("canvas"),r=l.getContext("webgl")||l.getContext("experimental-webgl");if(!r)return;const i=r.getExtension("WEBGL_debug_renderer_info");if(!i)return;const o=r.getParameter(i.UNMASKED_VENDOR_WEBGL),c=r.getParameter(i.UNMASKED_RENDERER_WEBGL);if(!(!o&&!c))return`${o||""}~${c||""}`.slice(0,120)}),i6=["Arial","Helvetica Neue","Segoe UI","Roboto","SF Pro Text","Cambria","Calibri","Ubuntu","Noto Sans","Tahoma"],o6=()=>Wt(()=>{const r=document.createElement("canvas").getContext("2d");if(!r)return;const i="mmmmmmmmmmlli0O",o=f=>(r.font=`72px ${f}`,r.measureText(i).width),c=o("monospace");let m=0;return i6.forEach((f,h)=>{o(`'${f}', monospace`)!==c&&(m|=1<<h)}),m.toString(16)}),c6=()=>{const l=navigator,r={},i=(o,c)=>{c==null||c===""||(r[o]=String(c).slice(0,400))};return i("platform",Wt(()=>l.platform)),i("screen",Wt(()=>`${screen.width}x${screen.height}`)),i("availScreen",Wt(()=>`${screen.availWidth}x${screen.availHeight}`)),i("colorDepth",Wt(()=>screen.colorDepth)),i("pixelRatio",Wt(()=>window.devicePixelRatio)),i("cores",Wt(()=>l.hardwareConcurrency)),i("memory",Wt(()=>l.deviceMemory)),i("touch",Wt(()=>l.maxTouchPoints)),i("webgl",r6()),i("canvas",n6()),i("fonts",o6()),i("ua",Wt(()=>navigator.userAgent)),i("lang",Wt(()=>navigator.language)),i("langs",Wt(()=>(l.languages||[]).join(","))),i("tz",Wt(()=>Intl.DateTimeFormat().resolvedOptions().timeZone)),i("tzOffset",Wt(()=>new Date().getTimezoneOffset())),r},Rn=3,C1="sleektap_loyalty_device",dm="sleektap_loyalty_request",d6=()=>{try{const l=sessionStorage.getItem(dm);if(!l)return null;const r=JSON.parse(l);return r!=null&&r.id&&(r!=null&&r.token)?{id:r.id,token:r.token}:null}catch{return null}},cg=l=>{try{l?sessionStorage.setItem(dm,JSON.stringify(l)):sessionStorage.removeItem(dm)}catch{}},E1=()=>{try{return localStorage.getItem(C1)||""}catch{return""}},dg=()=>{const l=E1();if(l)return l;const r=new Uint8Array(24);crypto.getRandomValues(r);const i=Array.from(r).map(o=>o.toString(16).padStart(2,"0")).join("");try{localStorage.setItem(C1,i)}catch{}return i},Ku=l=>{if(!l)return"â";const r=new Date(l);return Number.isNaN(r.getTime())?"â":r.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},ug=({count:l,required:r})=>{const i=Math.max(1,r),o=Math.min(l,i),c=Math.round(o/i*100);return i<=12?t.jsx("div",{className:"flex flex-wrap justify-center gap-2",children:Array.from({length:i},(m,f)=>t.jsx("span",{"aria-hidden":"true",className:`w-7 h-7 rounded-full flex items-center justify-center transition-colors ${f<o?"bg-primary text-white":"bg-slate-100 text-slate-300"}`,children:t.jsx(Go,{size:13,fill:f<o?"currentColor":"none"})},f))}):t.jsxs("div",{children:[t.jsx("div",{className:"h-2.5 bg-slate-100 rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${c}%`}})}),t.jsxs("p",{className:"text-xs font-bold text-slate-500 text-center mt-2 tabular-nums",children:[o," / ",i]})]})}
533,Zu=({value:l,onChange:r,autoFocus:i,id:o="loyalty-code",noun:c="today's code"})=>t.jsxs("div",{children:[t.jsx("label",{htmlFor:o,className:"block text-[11px] font-bold uppercase tracking-wider text-slate-400 mb-1.5",children:c==="today's code"?"Today's code":"Current code"}),t.jsx("input",{id:o,value:l,inputMode:"text",autoComplete:"one-time-code",autoCapitalize:"characters",autoCorrect:"off",spellCheck:!1,maxLength:Rn,autoFocus:i,onChange:m=>r(m.target.value.toUpperCase().replace(/[^A-Z]/g,"").slice(0,Rn)),placeholder:"ABC",className:"w-full px-4 py-3.5 bg-slate-50 border border-slate-200 rounded-2xl text-center text-2xl font-black uppercase tracking-[0.4em] indent-[0.4em] text-slate-900 outline-none focus:border-primary focus:ring-4 focus:ring-primary/10 transition-all"}),t.jsxs("p",{className:"text-[11px] text-slate-400 font-medium mt-1.5 text-center",children:["Ask a member of staff for ",c,"."]})]}),Eo=({id:l,label:r,type:i="text",value:o,required:c,onChange:m,autoComplete:f,inputMode:h})=>t.jsxs("div",{children:[t.jsxs("label",{htmlFor:l,className:"block text-[11px] font-bold uppercase tracking-wider text-slate-400 mb-1.5",children:[r,!c&&t.jsx("span",{className:"ml-1.5 normal-case tracking-normal text-slate-300",children:"optional"})]}),t.jsx("input",{id:l,type:i,value:o,required:c,autoComplete:f,inputMode:h,onChange:p=>m(p.target.value),className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl text-slate-900 text-base font-medium outline-none focus:border-primary focus:ring-4 focus:ring-primary/10 transition-all"})]}),Ir=({children:l,onClick:r,type:i="button",disabled:o,busy:c})=>t.jsxs("button",{type:i,onClick:r,disabled:o||c,className:"w-full py-4 bg-primary text-white font-bold rounded-2xl text-[15px] transition-all active:scale-[0.98] disabled:opacity-50 flex items-center justify-center gap-2",children:[c&&t.jsx(yt,{size:16,className:"animate-spin"}),l]}),Gr=({program:l})=>!l.reward.name&&!l.reward.valueText?null:t.jsxs("div",{className:"rounded-2xl bg-primary/5 border border-primary/10 px-4 py-3.5 text-center",children:[t.jsxs("p",{className:"text-[10px] font-bold uppercase tracking-[0.14em] text-primary/70",children:["Your reward at ",l.visitsRequired," visits"]}),t.jsx("p",{className:"text-base font-bold text-slate-900 mt-0.5",children:l.reward.name||l.reward.valueText}),!!l.reward.name&&!!l.reward.valueText&&t.jsx("p",{className:"text-sm font-bold text-primary",children:l.reward.valueText}),!!l.reward.description&&t.jsx("p",{className:"text-xs text-slate-500 font-medium mt-1",children:l.reward.description})]}),T1=({voucher:l})=>{const r=l.status==="redeemed",i=!r&&l.isExpired,o=l.branding||{},c=[o.address,o.phone,o.email,o.website].filter(Boolean);return t.jsxs("div",{className:"space-y-5",children:[t.jsx("div",{className:`rounded-2xl px-4 py-2.5 text-center text-[12px] font-bold uppercase tracking-wider ${r?"bg-slate-100 text-slate-500":i?"bg-amber-50 text-amber-700":"bg-emerald-50 text-emerald-700"}`,children:r?"Already redeemed":i?`Expired ${Ku(l.expiresAt)}`:"Ready to use"}),!!o.logoUrl&&t.jsx("div",{className:"flex justify-center",children:t.jsx("img",{src:o.logoUrl,alt:"",className:"h-16 w-auto max-w-[200px] object-contain",onError:m=>{m.currentTarget.style.display="none"}})}),t.jsxs("div",{className:"text-center space-y-1.5",children:[t.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.14em] text-slate-400",children:"Reward voucher"}),t.jsx("h2",{className:"text-2xl font-bold text-slate-900 leading-tight",children:l.rewardName||"Reward"}),!!l.rewardValue&&t.jsx("p",{className:"text-2xl font-black text-primary",children:l.rewardValue}),!!l.rewardDescription&&t.jsx("p",{className:"text-sm text-slate-500 font-medium pt-1",children:l.rewardDescription})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 text-center",children:[t.jsxs("div",{className:"bg-slate-50 rounded-2xl px-3 py-2.5",children:[t.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400",children:"Issued"}),t.jsx("p",{className:"text-[13px] font-bold text-slate-700",children:Ku(l.issuedAt)})]}),t.jsxs("div",{className:"bg-slate-50 rounded-2xl px-3 py-2.5",children:[t.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400",children:"Expires"}),t.jsx("p",{className:"text-[13px] font-bold text-slate-700",children:l.expiresAt?Ku(l.expiresAt):"Never"})]})]}),!!l.qrSvg&&!r&&!i&&t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[t.jsx("div",{className:"w-44 h-44 [&>svg]:w-full [&>svg]:h-full",dangerouslySetInnerHTML:{__html:l.qrSvg}}),t.jsx("p",{className:"text-[12px] text-slate-500 font-semibold text-center",children:"Show this to staff â they scan it to redeem your reward."})]}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400",children:"Voucher co
533de"}),t.jsx("p",{className:"text-xl font-black tracking-[0.18em] text-slate-900 tabular-nums",children:l.code})]}),(!!o.businessName||c.length>0)&&t.jsxs("div",{className:"pt-4 border-t border-dashed border-slate-200 text-center space-y-0.5",children:[!!o.businessName&&t.jsx("p",{className:"text-[13px] font-bold text-slate-700",children:o.businessName}),c.map(m=>t.jsx("p",{className:"text-[12px] leading-snug text-slate-500 font-medium break-words",children:m},m))]}),t.jsx("p",{className:"text-[11px] text-slate-400 font-medium text-center",children:"Can only be used once. Screenshot it if you like â redeeming is recorded against the code, not the image."})]})},u6=({apiUrl:l,deviceId:r,program:i,logEvent:o})=>{const c=i.codeMode==="approval",m=!i.codeMode||i.codeMode==="daily"?"today's code":"the current code",f=b.useMemo(()=>c?d6():null,[c]),[h,p]=b.useState(i.isActive===!1?"paused":f?"waiting":"identifying"),[g,y]=b.useState(f),[v,E]=b.useState(0),[R,N]=b.useState("expired"),[k,w]=b.useState(null),[A,O]=b.useState(null),[z,H]=b.useState(!1),[se,Z]=b.useState(!1),[T,P]=b.useState(!1),[q,Q]=b.useState(""),[F,$]=b.useState(""),[G,te]=b.useState(""),[ye,U]=b.useState(""),[ce,C]=b.useState(""),[le,de]=b.useState(""),[S,B]=b.useState(!1),J=Math.max(1,i.visitsRequired||10),oe=b.useMemo(()=>c6(),[]),ve=b.useCallback(async(xe,me)=>{const Te=await fetch(`${l}/loyalty/public/${r}/${xe}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...me,deviceSignals:oe})}),Ue=await Te.json().catch(()=>({}));return{ok:Te.ok,status:Te.status,json:Ue}},[l,r,oe]);b.useEffect(()=>{if(h!=="identifying")return;const xe=E1();if(!xe&&!Object.keys(oe).length){p("welcome");return}let me=!1;return ve("identify",{deviceToken:xe}).then(({ok:Te,json:Ue})=>{var Le;me||(Te&&Ue.member?(w(Ue.member),H(!!Ue.checkedInToday),(Le=Ue.prefill)!=null&&Le.phone&&!Ue.checkedInToday?(de(Ue.prefill.phone),B(!0),p("returning")):p("checkin")):p("welcome"))}).catch(()=>{me||p("welcome")}),()=>{me=!0}},[h,ve,oe]);const Ce=(xe,me)=>{if(w(xe.member||null),H(!!xe.alreadyCheckedIn),Z(me==="signup"&&!xe.visitCounted&&!xe.alreadyCheckedIn),xe.voucher){O(xe.voucher),o("loyalty:reward"),p("voucher");return}xe.visitCounted?o(`loyalty:${me}`):me==="signup"&&o("loyalty:signup"),p("done")},Ne=xe=>{var Te,Ue;const me={id:(Te=xe.request)==null?void 0:Te.id,token:xe.requestToken};if(!me.id||!me.token){Q("We couldn't reach the counter. Please ask a member of staff.");return}cg(me),y(me),E(((Ue=xe.request)==null?void 0:Ue.secondsLeft)??0),Q(""),p("waiting")},ne=()=>{cg(null),y(null)};b.useEffect(()=>{if(h!=="waiting"||!g)return;let xe=!1;const me=async()=>{var Ue,Le;try{const rt=await fetch(`${l}/loyalty/public/${r}/request/${g.id}?token=${encodeURIComponent(g.token)}`),st=await rt.json().catch(()=>({}));if(xe)return;if(!rt.ok){ne(),Q("We lost track of that request. Please try again."),p(k?"checkin":"welcome");return}E(((Ue=st.request)==null?void 0:Ue.secondsLeft)??0);const lt=(Le=st.request)==null?void 0:Le.status;if(lt==="approved"){ne(),Ce(st,"checkin");return}(lt==="declined"||lt==="expired")&&(ne(),N(lt),p("turnedAway"))}catch{}};me();const Te=setInterval(me,2500);return()=>{xe=!0,clearInterval(Te)}},[h,g,l,r]);const ge=async xe=>{if(!T){if(!c&&F.length!==Rn){Q(`Enter ${m} â 3 letters.`);return}P(!0),Q("");try{const{ok:me,status:Te,json:Ue}=await ve("checkin",{dailyCode:c?void 0:F,deviceToken:dg(),phone:xe==null?void 0:xe.phone});if(me&&Ue.pendingApproval){Ne(Ue);return}if(me){Ce(Ue,"checkin");return}if(Te===404&&Ue.needsIdentification){if(xe!=null&&xe.phone){C(xe.phone),Q(""),p("join");return}de(""),B(!1),p("returning"),Q("");return}Q(Ue.error||"Could not log your visit.")}catch{Q("Something went wrong. Please try again.")}finally{P(!1)}}},ze=async xe=>{if(xe.preventDefault(),!T){if(!c&&i.requireCodeOnSignup&&F.length!==Rn){Q(`Enter ${m} to join â 3 letters.`);return}P(!0),Q("");try{const{ok:me,json:Te}=await ve("signup",{name:i.capture.name.enabled?G:void 0,email:i.capture.email.enabled?ye:void 0,phone:i.capture.phone.enabled?ce:void 0,dailyCode:c?void 0:F||void 0,deviceToken:dg()});if(me&&Te.pendingApproval){Te.member&&w(Te.member),o("loyalty:signup"),Ne(Te);return}if(me){Ce(Te,"signup");return}Q(Te.error||"Could not complete sign-up.")}catch{Q("Something went wrong. Please try again.")}finally{P(!1)}}},K=async xe=>{if(xe.preventDefault(),!le.trim()){Q("Enter the phone number you signed up with.");return}await ge({phone:le})},fe=i.programName||"Loyalty Program";if(h==="paused")return t.jsxs("div",{className:"text-center py-4 space-y-3",children:[t.jsx("h2",{className:"text-lg font-bold text-slate-900",children:fe}),t.jsx("p",{className:"text-slate-500 text-sm font-medium",children:"This loyalty program isn't accepting sign-ups or check-ins right now. Please ask a member of staff."})]});if(h==="identifying")return t.jsxs("div",{className:"text-center py-6",children:[t.jsx(yt,{size:28,className:"animate-spin text-primary mx-auto mb-4"}),t.jsx("p",{className:"text-slate-500 text-sm font-medium",children:"Checking your membershipâ¦"})]});if(h==="waiting")return t.jsxs("div",{className:"text-center py-4 space-y-5",children:[t.jsx(yt,{size:30,className:"animate-spin text-primary mx-auto"}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-xl font-bold text-slate-900",children:"Just a moment"}
533),t.jsx("p",{className:"text-slate-500 text-sm font-medium mt-1.5 leading-relaxed",children:"We've sent your check-in to the counter. It'll be confirmed in a few seconds â please show this screen to a member of staff if nobody's with you."})]}),v>0&&t.jsxs("p",{className:"text-[11px] font-black uppercase tracking-wider text-slate-400 tabular-nums",children:[v,"s left"]}),!!k&&t.jsxs("p",{className:"text-xs text-slate-400 font-medium",children:["You're on the list",k.maskedName?`, ${k.maskedName}`:""," â only this visit is waiting."]}),t.jsx(Gr,{program:i})]});if(h==="turnedAway")return t.jsxs("div",{className:"text-center py-4 space-y-5",children:[t.jsx("h2",{className:"text-xl font-bold text-slate-900",children:R==="declined"?"Not confirmed":"Nobody answered"}),t.jsx("p",{className:"text-slate-500 text-sm font-medium leading-relaxed",children:R==="declined"?"This visit wasn't confirmed. Please speak to a member of staff â nothing has been added to your card.":"Your request timed out before anyone could confirm it. Nothing has been added to your card. Try again, or ask a member of staff."}),t.jsx(Ir,{onClick:()=>{Q(""),p(k?"checkin":"welcome")},children:"Try again"})]});if(h==="voucher"&&A)return t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-emerald-50 text-emerald-600 mb-3",children:t.jsx(zo,{size:28})}),t.jsx("h2",{className:"text-xl font-bold text-slate-900",children:"You've earned a reward!"}),t.jsxs("p",{className:"text-slate-500 text-sm font-medium mt-1",children:[J," visits complete. Here's your voucher."]})]}),t.jsx(T1,{voucher:A})]});if(h==="done"&&k){const xe=Math.max(0,J-k.visitCount);return t.jsxs("div",{className:"space-y-6 text-center",children:[t.jsxs("div",{children:[t.jsx("div",{className:`inline-flex items-center justify-center w-14 h-14 rounded-2xl mb-3 ${z?"bg-slate-100 text-slate-400":"bg-emerald-50 text-emerald-600"}`,children:t.jsx(zo,{size:28})}),t.jsx("h2",{className:"text-xl font-bold text-slate-900",children:se?"You're in!":z?"Already checked in today":"Visit logged. Thank you!"}),!!k.maskedName&&t.jsx("p",{className:"text-slate-500 text-sm font-medium mt-1",children:k.maskedName})]}),t.jsx(ug,{count:k.visitCount,required:J}),t.jsx("p",{className:"text-sm text-slate-600 font-semibold",children:se?c?"Scan again on your next visit and ask a member of staff to confirm it.":`Scan again on your next visit and enter ${m} to start collecting.`:xe===0?"Your reward is on its way.":`${xe} more ${xe===1?"visit":"visits"} until your reward.`}),z&&t.jsx("p",{className:"text-xs text-slate-400 font-medium",children:"Visits count once a day â see you next time."}),t.jsx(Gr,{program:i}),k.rewardsEarned>0&&t.jsxs("p",{className:"text-xs text-slate-400 font-medium",children:["You've earned ",k.rewardsEarned," ",k.rewardsEarned===1?"reward":"rewards"," ","so far."]})]})}if(h==="checkin"&&k){const xe=Math.max(0,J-k.visitCount);return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"text-center",children:[t.jsxs("h2",{className:"text-xl font-bold text-slate-900",children:["Welcome back",k.maskedName?`, ${k.maskedName}`:""]}),t.jsx("p",{className:"text-slate-500 text-sm font-medium mt-1",children:xe===0?"Your card is full â check in to claim your reward.":`${xe} more ${xe===1?"visit":"visits"} until your reward.`})]}),t.jsx(ug,{count:k.visitCount,required:J}),z?t.jsxs("div",{className:"space-y-4 text-center",children:[t.jsxs("div",{className:"rounded-2xl bg-slate-50 px-4 py-4",children:[t.jsx("p",{className:"text-sm font-bold text-slate-700",children:"You've already checked in today."}),t.jsx("p",{className:"text-xs text-slate-500 font-medium mt-1",children:"Visits count once a day â see you next time."})]}),t.jsx(Gr,{program:i}),t.jsx("button",{type:"button",onClick:()=>{Q(""),w(null),H(!1),de(""),B(!1),p("returning")},className:"w-full text-[13px] font-bold text-slate-500 hover:text-primary transition-colors py-2",children:"Not you? Use your phone number instead"})]}):t.jsxs("form",{onSubmit:me=>{me.preventDefault(),ge()},className:"space-y-4",children:[!c&&t.jsx(Zu,{value:F,onChange:$,autoF
533ocus:!0,noun:m}),!!q&&t.jsx("p",{className:"text-sm font-semibold text-red-600 text-center",children:q}),t.jsx(Ir,{type:"submit",busy:T,disabled:!c&&F.length!==Rn,children:c?"Ask to check in":"Log my visit"}),t.jsx("button",{type:"button",onClick:()=>{Q(""),w(null),de(""),B(!1),p("returning")},className:"w-full text-[13px] font-bold text-slate-500 hover:text-primary transition-colors py-2",children:"Not you? Use your phone number instead"})]})]})}if(h==="returning")return t.jsxs("form",{onSubmit:K,className:"space-y-5",children:[t.jsxs("div",{className:"text-center",children:[t.jsx("h2",{className:"text-xl font-bold text-slate-900",children:"Confirm it's you"}),t.jsx("p",{className:"text-slate-500 text-sm font-medium mt-1",children:c?S?"We've filled in the number you joined with â check it's right and ask to check in.":"Enter the phone number you signed up with. This works from any phone or browser.":S?`We've filled in the number you joined with â just add ${m}.`:`Enter the phone number you signed up with, plus ${m}. This works from any phone or browser.`})]}),t.jsx(Eo,{id:"loyalty-lookup-phone",label:"Phone number",type:"tel",inputMode:"tel",autoComplete:"tel",value:le,required:!0,onChange:de}),!c&&t.jsx(Zu,{value:F,onChange:$,id:"loyalty-code-returning",noun:m}),!!q&&t.jsx("p",{className:"text-sm font-semibold text-red-600 text-center",children:q}),t.jsx(Ir,{type:"submit",busy:T,disabled:!le.trim()||!c&&F.length!==Rn,children:c?"Ask to check in":"Log my visit"}),S&&t.jsx("button",{type:"button",onClick:()=>{Q(""),w(null),de(""),B(!1)},className:"w-full text-[13px] font-bold text-slate-500 hover:text-primary transition-colors py-2",children:"Not you? Use a different number"}),t.jsx("button",{type:"button",onClick:()=>{Q(""),C(le),p("join")},className:"w-full text-xs font-bold text-slate-400 hover:text-primary transition-colors py-1",children:"I haven't joined yet â sign me up"})]});if(h==="join"){const xe=i.capture;return t.jsxs("form",{onSubmit:ze,className:"space-y-5",children:[t.jsxs("div",{className:"text-center",children:[t.jsxs("h2",{className:"text-xl font-bold text-slate-900",children:["Join ",fe]}),t.jsx("p",{className:"text-slate-500 text-sm font-medium mt-1",children:i.requireCodeOnSignup?`A few details and ${m}, and you're in.`:c?"A few details, then a member of staff confirms your first visit.":"Just a few details and you're in."})]}),t.jsx(Gr,{program:i}),t.jsxs("div",{className:"space-y-4",children:[xe.name.enabled&&t.jsx(Eo,{id:"loyalty-name",label:"Name",autoComplete:"name",value:G,required:xe.name.required,onChange:te}),xe.email.enabled&&t.jsx(Eo,{id:"loyalty-email",label:"Email",type:"email",inputMode:"email",autoComplete:"email",value:ye,required:xe.email.required,onChange:U}),xe.phone.enabled&&t.jsx(Eo,{id:"loyalty-phone",label:"Phone",type:"tel",inputMode:"tel",autoComplete:"tel",value:ce,required:xe.phone.required,onChange:C}),i.requireCodeOnSignup&&t.jsx(Zu,{value:F,onChange:$,id:"loyalty-code-join",noun:m})]}),!!q&&t.jsx("p",{className:"text-sm font-semibold text-red-600 text-center",children:q}),t.jsx(Ir,{type:"submit",busy:T,children:"Join"}),t.jsx("button",{type:"button",onClick:()=>{Q(""),p("welcome")},className:"w-full text-xs font-bold text-slate-400 hover:text-primary transition-colors py-1",children:"Back"})]})}return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"text-center",children:[!!i.branding.logoUrl&&t.jsx("img",{src:i.branding.logoUrl,alt:"",className:"h-14 w-auto max-w-[180px] object-contain mx-auto mb-4",onError:xe=>{xe.currentTarget.style.display="none"}}),t.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-primary/10 text-primary mb-3",children:t.jsx(Go,{size:26})}),t.jsx("h2",{className:"text-xl font-bold text-slate-900",children:fe}),!!i.welcomeMessage&&t.jsx("p",{className:"text-slate-500 text-sm font-medium mt-1.5 leading-relaxed",children:i.welcomeMessage})]}),t.jsx(Gr,{program:i}),t.jsxs("div",{className:"space-y-3",children:[t.jsx(Ir,{onClick:()=>{Q(""),p("join")},children:"I'm new â join now"}),t.jsx("button",{type:"button",onClick:()=>{Q(""),de(""),B(!1),p("returning")},className:"w-full py-4 bg-white border border-slate-200 text-slate-700 font-bold rounded-2xl text-[15px] transition-all active:scale-[0.98] hover:bg-slate-50",children:"I'm already a member"})]}),!!i.branding.businessName&&t.jsx("p",{className:"text-[11px] text-slate-400 font-medium text-center",children:i.branding.businessName})]})},Ju={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_VERCEL_BRANCH_URL:"sleektap-admin-frontend-skele-git-fbcd82-xlnc-digitals-projects.vercel.app",VITE_VERCEL_DEPLOYMENT_ID:"dpl_C282w36q8ZAErw7X53pB1iMBFLu6",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"xlncdigitalagency",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"xlncdigitalagency",VITE_VERCEL_GIT_COMMIT_MESSAGE:"Fixed Stuff",VITE_VERCEL_GIT_COMMIT_REF:"main",VITE_VERCEL_GIT_COMMIT_SHA:"c896ab1b83d1847c97436fab23b42f6259ac52d1",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"1159276875",VITE_VERCEL_GIT_REPO_OWNER:"xlncdigitalagency",VITE_VERCEL_GIT_REPO_SLUG:"sleektap-admin-frontend-skeleton",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"18086404b52547dd/script.
533js","viewEndpoint":"18086404b52547dd/view","eventEndpoint":"18086404b52547dd/event","sessionEndpoint":"18086404b52547dd/session"},"speedInsights":{"scriptSrc":"e27c2ad8eef4d90c/script.js","endpoint":"e27c2ad8eef4d90c/vitals"}}',VITE_VERCEL_PROJECT_ID:"prj_4SSojkAOM11wzpj3FijC4wrQTISY",VITE_VERCEL_PROJECT_PRODUCTION_URL:"sleektap-admin-frontend-skeleton.vercel.app",VITE_VERCEL_TARGET_ENV:"production",VITE_VERCEL_URL:"sleektap-admin-frontend-skeleton-512js42ix.vercel.app"},mg={1:"Terrible",2:"Poor",3:"Okay",4:"Good",5:"Great"},m6=()=>{const l="https://sleektap-backend-test.vercel.app/api";try{const r=Ju==null?void 0:Ju.VITE_API_URL;if(r)return r}catch{}return l},fg=l=>{var r;return((r=l.customLabel)==null?void 0:r.trim())||a3(l.label)},wl=l=>{if(!l||typeof l!="string")return!1;try{const r=new URL(l.trim());return r.protocol==="http:"||r.protocol==="https:"}catch{return!1}},Sn=l=>/Edg\//i.test(l)?"Edge":/OPR\//i.test(l)?"Opera":/Chrome\//i.test(l)?"Chrome":/Firefox\//i.test(l)?"Firefox":/Safari\//i.test(l)?"Safari":"Unknown",Cn=l=>/Windows NT/i.test(l)?"Windows":/Mac OS X/i.test(l)?"macOS":/Android/i.test(l)?"Android":/iPhone|iPad|iPod/i.test(l)?"iOS":/Linux/i.test(l)?"Linux":"Unknown",En=l=>/iPad/i.test(l)?"Tablet":/Mobile|Android|iPhone|iPod/i.test(l)?"Mobile":"Desktop",hg=()=>{const[l]=wv(),{productId:r}=qa(),[i,o]=b.useState("loading"),[c,m]=b.useState(""),[f,h]=b.useState([]),[p,g]=b.useState(""),[y,v]=b.useState(!1),[E,R]=b.useState({label:"",url:""}),[N,k]=b.useState("other"),[w,A]=b.useState(null),[O,z]=b.useState(null),[H,se]=b.useState(""),[Z,T]=b.useState(!1),[P,q]=b.useState(!1),[Q,F]=b.useState(""),[$,G]=b.useState(""),[te,ye]=b.useState(""),[U,ce]=b.useState(0),[C,le]=b.useState(""),[de,S]=b.useState(!1),[B,J]=b.useState(""),oe=Pr.useRef({customerId:"",productId:"",apiUrl:""}),ve=ne=>{const{customerId:ge,productId:ze,apiUrl:K}=oe.current;if(!ge||!ze||!K)return;const fe=navigator.userAgent;fetch(`${K}/analytics`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({customerId:ge,productId:ze,destinationUrl:`business-card:click:${ne}`,deviceType:En(fe),os:Cn(fe),browser:Sn(fe),screenResolution:`${screen.width}x${screen.height}`,language:navigator.language,referrer:document.referrer}),keepalive:!0}).catch(()=>{})},Ce=ne=>{const{customerId:ge,productId:ze,apiUrl:K}=oe.current;if(!ge||!ze||!K)return;const fe=navigator.userAgent;fetch(`${K}/analytics`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({customerId:ge,productId:ze,destinationUrl:ne,deviceType:En(fe),os:Cn(fe),browser:Sn(fe),screenResolution:`${screen.width}x${screen.height}`,language:navigator.language,referrer:document.referrer}),keepalive:!0}).catch(()=>{})};b.useEffect(()=>{const ne=document.querySelector('meta[name="viewport"]'),ge=(ne==null?void 0:ne.getAttribute("content"))??null;ne==null||ne.setAttribute("content","width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover");const ze=document.documentElement,K=ze.style.touchAction;ze.style.touchAction="pan-x pan-y";const fe=Ue=>Ue.preventDefault(),xe=Ue=>{Ue.touches.length>1&&Ue.preventDefault()};let me=0;const Te=Ue=>{const Le=Date.now();Le-me<=300&&Ue.preventDefault(),me=Le};return document.addEventListener("gesturestart",fe),document.addEventListener("gesturechange",fe),document.addEventListener("gestureend",fe),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("touchend",Te,{passive:!1}),()=>{ne&&(ge!==null?ne.setAttribute("content",ge):ne.removeAttribute("content")),ze.style.touchAction=K,document.removeEventListener("gesturestart",fe),document.removeEventListener("gesturechange",fe),document.removeEventListener("gestureend",fe),document.removeEventListener("touchmove",xe),document.removeEventListener("touchend",Te)}},[]),b.useEffect(()=>{const ne=r||l.get("productId");let ge=l.get("customerId")||"";if(!ne){o("error");return}const ze=m6();oe.current={customerId:ge,productId:ne,apiUrl:ze};const K=me=>{const Te=navigator.userAgent;return JSON.stringify({customerId:ge,productId:ne,destinationUrl:me,deviceType:En(Te),os:Cn(Te),browser:Sn(Te),screenResolution:`${screen.width}x${screen.height}`,language:navigator.language,referrer:document.referrer})},fe=me=>{const Te=K(me);return fetch(`${ze}/analytics`,{method:"POST",headers:{"Content-Type":"application/json"},body:Te,keepalive:!0}
533).catch(()=>{})},xe=me=>{if(!wl(me)){o("error");return}m(me),o("redirecting"),fe(me),window.location.href=me};fetch(`${ze}/qr/${ne}`).then(me=>me.json()).then(me=>{if(!me.success){o("error");return}if(!ge&&typeof me.customerId=="string"&&(ge=me.customerId,oe.current={...oe.current,customerId:ge}),typeof me.logoUrl=="string"&&wl(me.logoUrl)&&se(me.logoUrl),me.urlType==="deactivated"){fe("device:deactivated-scan"),typeof me.deactivatedReason=="string"&&k(me.deactivatedReason),o("deactivated");return}if(me.urlType==="loyalty"&&me.loyaltyProgram){fe("loyalty:page-view"),z(me.loyaltyProgram),o("loyalty");return}if(me.urlType==="business-card"&&me.businessCardProfile){fe("business-card:profile-view"),A(me.businessCardProfile),o("business-card");return}if((me.urlType==="multiple"||me.urlType==="sleek-widget")&&me.destinationUrls){const Te=me.destinationUrls.filter(Ue=>Ue.destinationUrl&&wl(Ue.destinationUrl));Te.length===0?o("error"):(h(Te),typeof me.deviceName=="string"&&g(me.deviceName),me.isReview?(v(!0),fe("review:multi-choice-view")):fe("multi:"+Te.map(Ue=>Ue.destinationUrl).join(",")),o("choosing"));return}me.destinationUrl?me.isReview&&wl(me.destinationUrl)?(fe("review:choice-view"),m(me.de
533stinationUrl),o("review-choice")):xe(me.destinationUrl):o("error")}).catch(()=>o("error"))},[]);const Ne=i==="business-card"&&!!(w!=null&&w.companyLogoUrl);return t.jsxs("div",{className:"min-h-screen bg-slate-50 flex flex-col",children:[t.jsx("main",{className:`flex-1 flex flex-col items-center w-full ${Ne?"justify-start px-0 pb-4 sm:p-6":"justify-center px-0 py-4 sm:p-6"}`,children:t.jsxs("div",{className:"w-full max-w-none sm:max-w-sm",children:[H&&t.jsx("div",{className:"text-center mb-6 sm:mb-8 px-4 sm:px-0",children:t.jsx("img",{src:H,alt:"",className:"inline-block w-20 h-20 rounded-2xl object-cover shadow-xl shadow-slate-200/60 bg-white",onError:ne=>{ne.currentTarget.style.display="none"}})}),Ne&&w&&t.jsx(e6,{profile:w,className:"sm:rounded-t-3xl"}),t.jsxs("div",{className:Ne?"relative -mt-6 bg-white p-5 sm:p-8 sm:shadow-xl sm:shadow-slate-200/60 sm:border sm:border-slate-100 rounded-t-3xl sm:rounded-b-3xl":"bg-white p-5 sm:rounded-3xl sm:shadow-xl sm:shadow-slate-200/60 sm:p-8 sm:border sm:border-slate-100",children:[i==="loading"&&t.jsxs("div",{className:"text-center py-2",children:[t.jsxs("div",{className:"relative inline-flex items-center justify-center w-16 h-16 mb-5",children:[t.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-slate-100"}),t.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-t-primary animate-spin"}),t.jsx(Dn,{size:24,className:"text-slate-400"})]}),t.jsx("p",{className:"text-slate-600 font-medium",children:"Preparing redirectâ¦"}),t.jsx("p",{className:"text-slate-400 text-sm mt-1",children:"Please wait a moment."})]}),i==="redirecting"&&t.jsxs("div",{className:"text-center",children:[t.jsxs("div",{className:"relative inline-flex items-center justify-center w-20 h-20 mb-6",children:[t.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary/10"}),t.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-t-primary border-r-primary/30 animate-spin"}),t.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-xl flex items-center justify-center",children:t.jsx(Dn,{size:20,className:"text-primary"})})]}),t.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-1",children:"You're being redirected"}),t.jsx("p",{className:"text-slate-500 text-sm mb-6 leading-relaxed",children:"Thank you for your patience. You will be redirected shortly."}),t.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:t.jsx("div",{className:"animate-qr-progress h-full bg-primary rounded-full"})}),t.jsxs("p",{className:"text-xs text-slate-400 mt-5",children:["Not redirecting automatically?"," ",wl(c)?t.jsx("a",{href:c,rel:"noopener noreferrer",className:"text-primary font-semibold hover:underline",children:"Click here"}):t.jsx("span",{className:"text-slate-500",children:"link unavailable"})]})]}),i==="choosing"&&t.jsxs("div",{children:[t.jsxs("div",{className:"text-center mb-6",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-primary/10 rounded-2xl mb-4",children:t.jsx(nm,{size:28,className:"text-primary"})}),t.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-1",children:"Choose a Destination"}),t.jsx("p",{className:"text-slate-500 text-sm",children:"This product has multiple links. Tap one to continue."})]}),t.jsx("div",{className:"space-y-3",children:f.map(ne=>t.jsxs("button",{onClick:()=>{if(!wl(ne.destinationUrl))return;if(y){m(ne.destinationUrl),R({label:fg(ne),url:ne.destinationUrl}),o("review-choice");return}const{customerId:ge,productId:ze,apiUrl:K}=oe.current,fe=navigator.userAgent;fetch(`${K}/analytics`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({customerId:ge,productId:ze,destinationUrl:ne.destinationUrl,deviceType:En(fe),os:Cn(fe),browser:Sn(fe),screenResolution:`${screen.width}x${screen.height}`,language:navigator.language,referrer:document.referrer}),keepalive:!0}).catch(()=>{}),window.location.href=ne.destinationUrl},className:"w-full flex items-center gap-3.5 p-4 rounded-2xl border border-slate-100 hover:border-primary/30 hover:bg-primary/5 transition-all group text-left",children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center shrink-0 group-hover:bg-primary/20 transition-colors",children:Ho(ne.label)?t.jsx("img",{src:Ho(ne.label),alt:"",className:"w-5 h-5"}):t.jsx(Xr,{size:18,className:"text-primary"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-semibold text-slate-900 group-hover:text-primary transition-colors",children:fg(ne)}),t.jsx("p",{className:"text-xs text-slate-400 truncate",children:ne.destinationUrl})]}),t.jsx("svg",{className:"w-4 h-4 text-slate-300 group-hover:text-primary transition-colors shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M9 5l7 7-7 7"})})]},ne._id))})]}),i==="business-card"&&w&&t.jsx(t6,{profile:w,onLinkClick:ve}),i==="loyalty"&&O&&t.jsx(u6,{apiUrl:oe.current.apiUrl,deviceId:oe.current.productId,program:O,logEvent:Ce}),i==="review-choice"&&t.jsxs("div",{children:[t.jsxs("div",{className:"text-center mb-6",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-primary/10 rounded-2xl mb-4",children:t.jsx($p,{size:28,className:"text-primary"})}),t.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-1",children:"Your feedback means everything to us."})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("button",{onClick:()=>
533{if(!wl(c))return;const{customerId:ne,productId:ge,apiUrl:ze}=oe.current,K=navigator.userAgent;fetch(`${ze}/analytics`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({customerId:ne,productId:ge,destinationUrl:c,deviceType:En(K),os:Cn(K),browser:Sn(K),screenResolution:`${screen.width}x${screen.height}`,language:navigator.language,referrer:document.referrer}),keepalive:!0}).catch(()=>{}),window.location.href=c},className:"w-full flex items-center gap-3.5 p-4 rounded-2xl border border-emerald-100 bg-emerald-50 hover:bg-emerald-100 transition-all group text-left",children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-white flex items-center justify-center shrink-0",children:t.jsx($p,{size:20,className:"text-emerald-600"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-semibold text-slate-900",children:"Had a great experience?"}),t.jsx("p",{className:"text-xs text-slate-500",children:"We'd be grateful for a review."})]}),t.jsx(Xr,{size:16,className:"text-emerald-600 shrink-0"})]}),t.jsxs("button",{onClick:()=>{F(""),G(""),ye(""),ce(0),le(""),J(""),q(!0)},className:"w-full flex items-center gap-3.5 p-4 rounded-2xl border border-rose-100 bg-rose-50 hover:bg-rose-100 transition-all group text-left",children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-white flex items-center justify-center shrink-0",children:t.jsx(qp,{size:20,className:"text-rose-600"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-semibold text-slate-900",children:"Have an issue with service?"}),t.jsx("p",{className:"text-xs text-slate-500",children:"Please share your feedback with our management team."})]}),t.jsx("svg",{className:"w-4 h-4 text-rose-600 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M9 5l7 7-7 7"})})]}),y&&t.jsx("button",{onClick:()=>o("choosing"),className:"w-full text-center text-xs font-semibold text-slate-400 hover:text-slate-600 transition-colors pt-1",children:"â Choose a different link"})]})]}),i==="review-submitted"&&t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-emerald-50 rounded-2xl mb-5",children:t.jsx(zo,{size:30,className:"text-emerald-500"})}),t.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-2",children:"Thanks for your feedback"}),t.jsx("p",{className:"text-slate-500 text-sm leading-relaxed",children:"We've passed your message along to the merchant. You can close this page now."})]}),i==="deactivated"&&t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-slate-100 rounded-2xl mb-5",children:t.jsx(rN,{size:30,className:"text-slate-500"})}),t.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-2",children:N==="replaced"?"This tag has been replaced":"This tag is no longer active"}),t.jsx("p",{className:"text-slate-500 text-sm leading-relaxed",children:N==="replaced"?"The owner has moved this tag's links to a new one. Ask them for their current tag or card.":"The owner switched this tag off, so it no longer points anywhere. If you were expecting to reach someone, please contact them directly."})]}),i==="error"&&t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-red-50 rounded-2xl mb-5",children:t.jsx(ym,{size:30,className:"text-red-500"})}),t.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-2",children:"Invalid QR Code"}),t.jsx("p",{className:"text-slate-500 text-sm leading-relaxed",children:"This QR code appears to be incomplete or damaged. Please try scanning again or contact the merchant for a replacement."}),t.jsxs("div",{className:"mt-5 p-4 bg-amber-50 border border-amber-100 rounded-xl text-xs text-amber-700 text-left leading-relaxed",children:[t.jsx("strong",{children:"Tip:"})," Make sure the entire QR code is visible and your camera is in focus before scanning."]})]})]}),i==="choosing"&&p&&t.jsx("div",{className:"mt-5 flex justify-center px-4",children:t.jsx("span",{className:"text-sm text-slate-500",children:p})})]})}),t.jsx("footer",{className:"border-t border-slate-100 bg-white",children:t.jsxs("div",{className:"max-w-300 mx-auto px-6 py-6 sm:py-8",children:[t.jsx("p",{className:"text-xs sm:text-sm text-slate-500 text-center",children:"Copyright © XLNC Digital. All rights Reserved. SleekTap is a product of XLNC Digital."}),t.jsxs("div",{className:"mt-2 flex items-center justify-center gap-4 text-xs sm:text-sm text-slate-500",children:[t.jsx("a",{href:"https://sleektap.com/privacy-policy/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-700 underline",children:"Privacy Policy"}),t.jsx("span",{className:"text-slate-300",children:"|"}),t.jsx("a",{href:"https://sleektap.com/terms-and-conditions/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-700 underline",children:"Terms and Conditions"})]})]})}),i==="business-card"&&w&&(()=>{const ne=w.blocks||[],ge=ne.some(K=>K.type==="addToContact"),ze=!!w.leadCaptureEnabled;return!ge&&!ze?null:t.jsxs(t.Fragment,{children:[t.jsx("div",{"aria-hidden":"true",className:"h-24",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"}}),t.jsx("div",{className:"fixed inset-x-0 bottom-0 z-40 bg-white/95 backdrop-blur border-t border-slate-100 shadow-[0_-4px_16px_
533-8px_rgba(15,23,42,0.12)]",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:t.jsxs("div",{className:"w-full max-w-sm mx-auto px-3 sm:px-4 py-3 flex flex-row items-stretch gap-2 sm:gap-3",children:[ge&&t.jsx("button",{type:"button",onClick:()=>{ve("addToContact"),X3(ne)},className:"flex-1 px-3 py-3 bg-primary text-white font-bold rounded-xl hover:bg-primary-hover transition-all active:scale-95 text-sm leading-tight",children:"Add to Contacts"}),ze&&t.jsx("button",{type:"button",onClick:()=>{ve("leadCapture"),T(!0)},className:"flex-1 px-3 py-3 bg-white text-primary border-2 border-primary font-bold rounded-xl hover:bg-primary/5 transition-all active:scale-95 text-sm leading-tight",children:"Share Your Info"})]})})]})})(),i==="business-card"&&(w==null?void 0:w.leadCaptureEnabled)&&t.jsx(s6,{apiUrl:oe.current.apiUrl,customerId:oe.current.customerId,productId:oe.current.productId,open:Z,onClose:()=>T(!1)}),P&&t.jsx("div",{className:"fixed inset-0 z-200 flex items-end sm:items-center justify-center bg-slate-900/60 backdrop-blur-sm p-0 sm:p-4",onClick:ne=>{ne.target===ne.currentTarget&&!de&&q(!1)},children:t.jsxs("div",{className:"bg-white w-full sm:max-w-md rounded-t-3xl sm:rounded-3xl shadow-2xl overflow-hidden",children:[t.jsxs("div",{className:"px-6 py-5 border-b border-slate-100 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-rose-50 flex items-center justify-center text-rose-600",children:t.jsx(qp,{size:20})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-bold text-slate-900",children:"Tell us what happened"}),t.jsx("p",{className:"text-xs text-slate-500",children:"Only the merchant will see this"})]})]}),t.jsx("button",{type:"button",onClick:()=>!de&&q(!1),disabled:de,className:"p-2 text-slate-400 hover:text-slate-900 hover:bg-slate-100 rounded-full transition-all disabled:opacity-40","aria-label":"Close",children:t.jsx(ns,{size:18})})]}),t.jsxs("form",{onSubmit:async ne=>{ne.preventDefault();const ge=Q.trim(),ze=$.trim(),K=te.trim(),fe=C.trim();if(!ge){J("Please enter your name.");return}if(!ze){J("Please enter your phone number.");return}if(!K||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(K)){J("Please enter a valid email address.");return}if(!U){J("Please pick a rating from 1 to 5 stars.");return}if(!fe){J("Please tell us what went wrong.");return}J(""),S(!0);try{const{customerId:xe,productId:me,apiUrl:Te}=oe.current,Ue=await fetch(`${Te}/qr/${me}/negative-review`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ge,phone:ze,email:K,rating:U,reason:fe,sourceLabel:E.label,sourceUrl:E.url})}),Le=await Ue.json().catch(()=>({}));if(!Ue.ok||!Le.success){J(Le.error||"Something went wrong. Please try again."),S(!1);return}const rt=navigator.userAgent;fetch(`${Te}/analytics`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({customerId:xe,productId:me,destinationUrl:"review:negative",deviceType:En(rt),os:Cn(rt),browser:Sn(rt),screenResolution:`${screen.width}x${screen.height}`,language:navigator.language,referrer:document.referrer}),keepalive:!0}).catch(()=>{}),q(!1),S(!1),F(""),G(""),ye(""),ce(0),le(""),o("review-submitted")}catch{J("Network error. Please try again."),S(!1)}},className:"p-6 space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Your name"}),t.jsx("input",{type:"text",required:!0,maxLength:120,value:Q,onChange:ne=>F(ne.target.value),className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl text-sm text-slate-900 focus:ring-4 focus:ring-primary/10 focus:border-primary outline-none transition-all",placeholder:"Full name",autoFocus:!0})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Phone number"}),t.jsx("input",{type:"tel",required:!0,maxLength:40,value:$,onChange:ne=>G(ne.target.value),className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl text-sm text-slate-900 focus:ring-4 focus:ring-primary/10 focus:border-primary outline-none transition-all",placeholder:"e.g. +1 555 123 4567"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Email address"}),t.jsx("input",{type:"email",required:!0,maxLength:254,value:te,onChange:ne=>ye(ne.target.value),className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl text-sm text-slate-900 focus:ring-4 focus:ring-primary/10 focus:border-primary outline-none transition-all",placeholder:"[email protected]"})]}),t.jsxs("div",{children:[t.jsx("label",{id:"rating-label",className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"How would you rate it?"}),t.jsxs("div",{role:"radiogroup","aria-labelledby":"rating-label",className:"flex flex-wrap items-center gap-1",children:[[1,2,3,4,5].map(ne=>t.jsx("button",{type:"button",role:"radio","aria-checked":U===ne,"aria-label":`${ne} ${ne===1?"star":"stars"} â ${mg[ne]}`,onClick:()=>{ce(ne),J("")},className:"p-1.5 rounded-lg transition-all active:scale-90 hover:bg-amber-50",children:t.jsx(Go,{size:30,className:ne<=U?"text-amber-400":"text-slate-300",fill:ne<=U?"currentColor":"none",strokeWidth:1.75})},ne)),t.jsx("span",{"aria-hidden":"true",className:`ml-2 shrink-0 text-xs font-semibold ${U?"text-slate-600":"text-slate-400"}`,children:U?`${U}/5 · ${mg[U]}`:"Tap to rate"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wider mb-2",children:"Why weren't you satisfied?"}),t.jsx("textarea",{required:!0,rows:5,maxLength:2e3,value:C,onChange:ne=>le(ne.target.value),className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl text-sm text-slate-900 focus:ring-4 focus:ring-primary/10 focus:border-primary outline-none transition-all resize-y",placeholder:"Share as much detail as you'd likeâ¦"}),t.jsxs("p",{className:"mt-1 text-[11px] text-slate-400 text-right",children:[C.length,"/2000"]})]}),B&&t.jsx("p",{className:"text-xs text-rose-600 font-medium",children:B}),t.jsxs("div",{className:"flex gap-3 pt-2",children:[t.jsx("button",{type:"button",onClick:()=>q(!1),disabled:de,className:"flex-1 py-3 px-4 border border-slate-200 text-slate-600 font-bold rounded-2xl hover:bg-slate-50 transition-all active:scale-95 disabled:opacity-50 text-sm",children:"Cancel"}),t.jsx("button",{type:"submit",disabled:de,className:"flex-2 py-3 px-4 bg-rose-600 hover:bg-rose-700 text-white font-bold rounded-2xl transition-all active:scale-95 disabled:opacity-60 flex items-center justify-center gap-2 text-sm",children:de?t.jsx(yt,{size:16,className:"animate-spin"}):"Send feedback"})]})]})]})})]})},Wu={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_VERCEL_BRANCH_URL:"sleektap-admin-frontend-skele-git-fbcd82-xlnc-digitals-projects.vercel.app",VITE_VERCEL_DEPLOYMENT_ID:"dpl_C282w36q8ZAErw7X53pB1iMBFLu6",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"xlncdigitalagency",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"xlncdigitalagency",VITE_VERCEL_GIT_COMMIT_MESSAGE:"Fixed Stuff",VITE_VERCEL_GIT_COMMIT_REF:"main",VITE_VERCEL_GIT_COMMIT_SHA:"c896ab1b83d1847c97436fab23b42f6259ac52d1",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"1159276875",VITE_VERCEL_GIT_REPO_OWNER:"xlncdigitalagency",VITE_VERCEL_GIT_REPO_SLUG:"sleektap-admin-frontend-skeleton",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"18086404b52547dd/script.
533js","viewEndpoint":"18086404b52547dd/view","eventEndpoint":"18086404b52547dd/event","sessionEndpoint":"18086404b52547dd/session"},"speedInsights":{"scriptSrc":"e27c2ad8eef4d90c/script.js","endpoint":"e27c2ad8eef4d90c/vitals"}}',VITE_VERCEL_PROJECT_ID:"prj_4SSojkAOM11wzpj3FijC4wrQTISY",VITE_VERCEL_PROJECT_PRODUCTION_URL:"sleektap-admin-frontend-skeleton.vercel.app",VITE_VERCEL_TARGET_ENV:"production",VITE_VERCEL_URL:"sleektap-admin-frontend-skeleton-512js42ix.vercel.app"},f6=()=>{const l="https://sleektap-backend-test.vercel.app/api";try{const r=Wu==null?void 0:Wu.VITE_API_URL;if(r)return r}catch{}return l},h6=l=>{if(!l||typeof l!="string")return!1;try{const r=new URL(l.trim());return r.protocol==="http:"||r.protocol==="https:"}catch{return!1}},p6=()=>{const{slug:l}=qa(),[r,i]=b.useState("loading"),[o,c]=b.useState(""),[m,f]=b.useState("This QR code appears to be incomplete or damaged. Please try scanning again.");return b.useEffect(()=>{if(!l){i("error");return}fetch(`${f6()}/r/${encodeURIComponent(l)}`).then(h=>h.json()).then(h=>{if(!h.success||!h6(h.destinationUrl)){typeof h.error=="string"&&h.error&&f(h.error),i("error");return}c(h.destinationUrl),i("redirecting"),window.location.href=h.destinationUrl}).catch(()=>i("error"))},[l]),t.jsxs("div",{className:"min-h-screen bg-slate-50 flex flex-col",children:[t.jsx("main",{className:"flex-1 flex flex-col items-center justify-center w-full px-0 py-4 sm:p-6",children:t.jsx("div",{className:"w-full max-w-none sm:max-w-sm",children:t.jsxs("div",{className:"bg-white p-5 sm:rounded-3xl sm:shadow-xl sm:shadow-slate-200/60 sm:p-8 sm:border sm:border-slate-100",children:[r==="loading"&&t.jsxs("div",{className:"text-center py-2",children:[t.jsxs("div",{className:"relative inline-flex items-center justify-center w-16 h-16 mb-5",children:[t.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-slate-100"}),t.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-t-primary animate-spin"}),t.jsx(Dn,{size:24,className:"text-slate-400"})]}),t.jsx("p",{className:"text-slate-600 font-medium",children:"Preparing redirectâ¦"}),t.jsx("p",{className:"text-slate-400 text-sm mt-1",children:"Please wait a moment."})]}),r==="redirecting"&&t.jsxs("div",{className:"text-center",children:[t.jsxs("div",{className:"relative inline-flex items-center justify-center w-20 h-20 mb-6",children:[t.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary/10"}),t.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-t-primary border-r-primary/30 animate-spin"}),t.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-xl flex items-center justify-center",children:t.jsx(Dn,{size:20,className:"text-primary"})})]}),t.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-1",children:"You're being redirected"}),t.jsx("p",{className:"text-slate-500 text-sm mb-6 leading-relaxed",children:"Thank you for your patience. You will be redirected shortly."}),t.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:t.jsx("div",{className:"animate-qr-progress h-full bg-primary rounded-full"})}),t.jsxs("p",{className:"text-xs text-slate-400 mt-5",children:["Not redirecting automatically?"," ",t.jsx("a",{href:o,rel:"noopener noreferrer",className:"text-primary font-semibold hover:underline",children:"Click here"})]})]}),r==="error"&&t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-red-50 rounded-2xl mb-5",children:t.jsx(ym,{size:30,className:"text-red-500"})}),t.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-2",children:"Link unavailable"}),t.jsx("p",{className:"text-slate-500 text-sm leading-relaxed",children:m}),t.jsxs("div",{className:"mt-5 p-4 bg-amber-50 border border-amber-100 rounded-xl text-xs text-amber-700 text-left leading-relaxed",children:[t.jsx("strong",{children:"Tip:"})," Make sure the entire QR code is visible and your camera is in focus before scanning."]})]})]})})}),t.jsx("footer",{className:"border-t border-slate-100 bg-white",children:t.jsxs("div",{className:"max-w-300 mx-auto px-6 py-6 sm:py-8",children:[t.jsx("p",{className:"text-xs sm:text-sm text-slate-500 text-center",children:"Copyright © XLNC Digital. All rights Reserved. SleekTap is a product of XLNC Digital."}),t.jsxs("div",{className:"mt-2 flex items-center justify-center gap-4 text-xs sm:text-sm text-slate-500",children:[t.jsx("a",{href:"https://sleektap.com/privacy-policy/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-700 underline",children:"Privacy Policy"}),t.jsx("span",{className:"text-slate-300",children:"|"}),t.jsx("a",{href:"https://sleektap.com/terms-and-conditions/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-700 underline",children:"Terms and Conditions"})]})]})})]})},em={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_VERCEL_BRANCH_URL:"sleektap-admin-frontend-skele-git-fbcd82-xlnc-digitals-projects.vercel.app",VITE_VERCEL_DEPLOYMENT_ID:"dpl_C282w36q8ZAErw7X53pB1iMBFLu6",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"xlncdigitalagency",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"xlncdigitalagency",VITE_VERCEL_GIT_COMMIT_MESSAGE:"Fixed Stuff",VITE_VERCEL_GIT_COMMIT_REF:"main",VITE_VERCEL_GIT_COMMIT_SHA:"c896ab1b83d1847c97436fab23b42f6259ac52d1",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"1159276875",VITE_VERCEL_GIT_REPO_OWNER:"xlncdigitalagency",VITE_VERCEL_GIT_REPO_SLUG:"sleektap-admin-frontend-skeleton",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"18086404b52547dd/script.
533js","viewEndpoint":"18086404b52547dd/view","eventEndpoint":"18086404b52547dd/event","sessionEndpoint":"18086404b52547dd/session"},"speedInsights":{"scriptSrc":"e27c2ad8eef4d90c/script.js","endpoint":"e27c2ad8eef4d90c/vitals"}}',VITE_VERCEL_PROJECT_ID:"prj_4SSojkAOM11wzpj3FijC4wrQTISY",VITE_VERCEL_PROJECT_PRODUCTION_URL:"sleektap-admin-frontend-skeleton.vercel.app",VITE_VERCEL_TARGET_ENV:"production",VITE_VERCEL_URL:"sleektap-admin-frontend-skeleton-512js42ix.vercel.app"},x6=()=>{const l="https://sleektap-backend-test.vercel.app/api";try{const r=em==null?void 0:em.VITE_API_URL;if(r)return r}catch{}return l},g6=()=>{const{code:l=""}=qa(),[r,i]=b.useState(null),[o,c]=b.useState("loading");return b.useEffect(()=>{const m=l.trim().toUpperCase();if(!m){c("error");return}fetch(`${x6()}/loyalty/public/voucher/${encodeURIComponent(m)}`).then(f=>f.json()).then(f=>{f!=null&&f.success&&f.data?(i(f.data),c("ready")):c("error")}).catch(()=>c("error"))},[l]),t.jsxs("div",{className:"min-h-screen bg-slate-50 flex flex-col",children:[t.jsx("main",{className:"flex-1 flex flex-col items-center justify-center w-full px-0 py-4 sm:p-6",children:t.jsx("div",{className:"w-full max-w-none sm:max-w-sm",children:t.jsxs("div",{className:"bg-white p-5 sm:rounded-3xl sm:shadow-xl sm:shadow-slate-200/60 sm:p-8 sm:border sm:border-slate-100",children:[o==="loading"&&t.jsxs("div",{className:"text-center py-10",children:[t.jsx(yt,{size:28,className:"animate-spin text-primary mx-auto mb-4"}),t.jsx("p",{className:"text-slate-500 text-sm font-medium",children:"Loading your voucherâ¦"})]}),o==="error"&&t.jsxs("div",{className:"text-center py-10 space-y-3",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-amber-50 text-amber-600",children:t.jsx(ym,{size:26})}),t.jsx("h2",{className:"text-lg font-bold text-slate-900",children:"Voucher not found"}),t.jsx("p",{className:"text-slate-500 text-sm font-medium",children:"This voucher code doesn't exist, or it has been removed."})]}),o==="ready"&&r&&t.jsx(T1,{voucher:r})]})})}),t.jsx("footer",{className:"w-full py-5 text-center",children:t.jsxs("div",{className:"text-xs text-slate-400 flex items-center justify-center gap-2",children:[t.jsx("a",{href:"https://sleektap.com/privacy-policy/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-700 underline",children:"Privacy Policy"}),t.jsx("span",{children:"|"}),t.jsx("a",{href:"https://sleektap.com/terms-and-conditions/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-700 underline",children:"Terms and Conditions"})]})})]})},b6=({onLogout:l})=>{const[r,i]=b.useState(()=>typeof window>"u"||window.innerWidth>=768),o=Ga(),c=()=>{typeof window<"u"&&window.innerWidth<768&&i(!1)},m=[{name:"Dashboard",path:"/dashboard",icon:t.jsx(Rj,{size:20})},{name:"Products",path:"/products",icon:t.jsx(zn,{size:20})},{name:"Categories",path:"/categories",icon:t.jsx(lm,{size:20})},{name:"Use Cases",path:"/use-cases",icon:t.jsx(Mj,{size:20})},{name:"Orders",path:"/orders",icon:t.jsx(wN,{size:20})},{name:"Customers",path:"/customers",icon:t.jsx(qg,{size:20})},{name:"QR Generator",path:"/qr-generator",icon:t.jsx(Dn,{size:20})},{name:"Artwork",path:"/artwork",icon:t.jsx(Hg,{size:20})},{name:"Settings",path:"/settings",icon:t.jsx(vN,{size:20})}];return t.jsxs("div",{className:"flex h-screen bg-slate-50 overflow-hidden",children:[r&&t.jsx("div",{onClick:()=>i(!1),className:"fixed inset-0 bg-slate-900/50 z-40 md:hidden","aria-hidden":"true"}),t.jsxs("aside",{className:`fixed inset-y-0 left-0 z-50 md:static md:z-auto bg-white border-r border-slate-200 transition-all duration-300 flex flex-col ${r?"w-64 translate-x-0":"w-64 md:w-20 -translate-x-full md:translate-x-0"}`,children:[t.jsxs("div",{className:"p-6 flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center text-white font-bold text-xl",children:"S"}),r&&t.jsx("span",{className:"font-bold text-xl text-slate-800 tracking-tight",children:"SleekTap"})]}),t.jsx("nav",{className:"flex-1 px-4 mt-6 space-y-2",children:m.map(f=>{const h=o.pathname===f.path;return t.jsxs(Ts,{to:f.path,onClick:c,className:`flex items-center gap-4 px-3 py-3 rounded-xl transition-all duration-200 group ${h?"bg-primary text-white shadow-lg shadow-primary/20":"text-slate-500 hover:bg-slate-100 hover:text-slate-900"}`,children:[t.jsx("span",{className:h?"text-white":"group-hover:text-primary transition-colors",children:f.icon}),r&&t.jsx("span",{className:"font-medium",children:f.name}),h&&r&&t.jsx(ls,{size:16,className:"ml-auto"})]},f.path)})}),t.jsx("div",{className:"p-4 border-t border-slate-100",children:t.jsxs("button",{onClick:l,className:"w-full flex items-center gap-4 px-3 py-3 text-slate-500 hover:bg-red-50 hover:text-red-600 rounded-xl transition-all duration-200",children:[t.jsx(Yj,{size:20}),r&&t.jsx("span",{className:"font-medium",children:"Logout"})]})})]}),t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[t.jsxs("header",{className:"h-16 bg-white border-b border-slate-200 flex items-center justify-between px-4 md:px-8 shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("button",{onClick:()=>i(!r),className:"p-2 hover:bg-slate-100 rounded-lg text-slate-600",children:r?t.jsx(ns,{size:20}):t.jsx(Kj,{size:20})}),t.jsxs("div",{className:"relative hidden md:block",children:[t.jsx("span",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-slate-400",children:t.jsx(Al,{size:18})}),t.jsx("input",{type:"text",placeholder:"Search anything...",className:"pl-10 pr-4 py-2 bg-white border border-slate-200 rounded-lg text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary w-64 transition-all"})]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("button",{className:"relative p-2 hover:bg-slate-100 rounded-lg text-slate-600 transition-colors",children:[t.jsx($v,{size:20}),t.jsx("span",{className:"absolute top-2 right-2 w-2 h-2 bg-red-500 rounded-full border-2 border-white"})]}),t.jsx("div",{className:"h-8 w-px bg-slate-200 mx-2"}),t.jsxs("div",{className:"flex items-center gap-3 cursor-pointer group",children:[t.jsxs("div",{className:"text-right hidden sm:block",children:[t.jsx("p",{className:"text-sm font-semibold text-slate-800 leading-none",children:"Admin User"}),t.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Super Admin"})]}),t.jsx("div",{className:"w-10 h-10 rounded-full bg-slate-200 overflow-hidden ring-2 ring-transparent group-hover:ring-primary/20 transition-all",children:t.jsx("img",{src:"https://picsum.photos/100/100",alt:"Avatar",className:"w-full h-full object-cover"})})]})]})]}),t.jsx("main",{className:"flex-1 overflow-y-auto p-4 md:p-8",children:t.jsx(Tg,{})})]})]})},y6=()=>t.jsx(L5,{children:t.jsx(Tg,{})}),v6=()=>{const[l,r]=b.useState(()=>rx()?!0:(d1(),!1)),i=(c,m)=>{localStorage.setItem("sleektap_token",c),localStorage.setItem("sleektap_user",JSON.stringify(m)),localStorage.setItem("sleektap_auth","true"),r(!0)},o=()=>{localStorage.removeItem("sleektap_token"),localStorage.removeItem("sleektap_user"),localStorage.removeItem("sleektap_auth"),r(!1)};return b.useEffect(()=>{if(!l)return;const c=()=>{rx()||o()},m=()=>{document.visibilityState==="visible"&&c()};document.addEventListener("visibilitychange",m),window.addEventListener("focus",c);const f=window.setInterval(c,6e4);return()=>{document.removeEventListener("visibilitychange",m),window.removeEventListener("focus",c),window.clearInterval(f)}},[l]),t.jsx(yv,{children:t.jsxs(Qy,{children:[t.jsx(bt,{path:"/login",element:l?t.jsx(Yr,{to:"/dashboard"}):t.jsx(R5,{onLogin:i})}),t.jsxs(bt,{element:l?t.jsx(b6,{onLogout:o}):t.jsx(Yr,{to:"/login"}),children:[t.jsx(bt,{path:"/dashboard",element:t.jsx(K4,{})}),t.jsx(bt,{path:"/products",element:t.jsx(l3,{})}),t.jsx(bt,{path:"/categories",element:t.jsx(n3,{})}),t.jsx(bt,{path:"/use-cases",element:t.jsx(r3,{})}),t.jsx(bt,{path:"/orders",element:t.jsx(i3,{})}),t.jsx(bt,{path:"/orders/:id",element:t.jsx(u3,{})}),t.jsx(bt,{path:"/customers",element:t.jsx(m3,{})}),t.jsx(bt,{path:"/customers/:id",element:t.jsx(f3,{})}),t.jsxs(bt,{element:t.jsx(y6,{}),children:[t.jsx(bt,{path:"/customers/:id/account",element:t.jsx(z5,{})}),t.jsx(bt,{path:"/customers/:id/products",element:t.jsx(O5,{})}),t.jsx(bt,{path:"/customers/:id/products/:categoryId",element:t.jsx(G5,{})}),t.jsx(bt,{path:"/customers/:id/products/:categoryId/edit/:deviceId",element:t.jsx(k4,{})}),t.jsx(bt,{path:"/customers/:id/products/:categoryId/widget/:deviceId",element:t.jsx(B4,{})}),t.jsx(bt,{path:"/customers/:id/products/:categoryId/loyalty/:deviceId",element:t.jsx(X4,{})})]}),t.jsx(bt,{path:"/qr-generator",element:t.jsx($3,{})}),t.jsx(bt,{path:"/artwork",element:t.jsx(P3,{})}),t.jsx(bt,{path:"/settings",element:t.jsx(p3,{})}),t.jsx(bt,{path:"/",element:t.jsx(Yr,{to:"/dashboard"})})]}),t.jsx(bt,{path:"/qrcode",element:t.jsx(hg,{})}),t.jsx(bt,{path:"/q/:productId",element:t.jsx(hg,{})}),t.jsx(bt,{path:"/r/:slug",element:t.jsx(p6,{})}),t.jsx(bt,{path:"/v/:code",element:t.jsx(g6,{})}),t.jsx(bt,{path:"*",element:t.jsx(Yr,{to:"/login"})})]})})},R1=document.getElementById("root");
533if(!R1)throw new Error("Could not find root element to mount to");const j6=X2.createRoot(R1);j6.render(t.jsx(Pr.StrictMode,{children:t.jsx(v6,{})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.