vendor: 6,122 bytes, lines 1-9
1var Bm=e=>{throw TypeError(e)};var ed=(e,t,r)=>t.has(e)||Bm("Cannot "+r);var M=(e,t,r)=>(ed(e,t,"read from private field"),r?r.call(e):t.get(e)),Ce=(e,t,r)=>t.has(e)?Bm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),fe=(e,t,r,n)=>(ed(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ft=(e,t,r)=>(ed(e,t,"access private method"),r);var sl=(e,t,r,n)=>({set _(s){fe(e,t,s,r)},get _(){return M(e,t,n)}});function Ek(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(n,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();function Wy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hy={exports:{}},Qc={},Vy={exports:{}},xe={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its 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 Wi=Symbol.for("react.element"),Tk=Symbol.for("react.portal"),Rk=Symbol.for("react.fragment"),Pk=Symbol.for("react.strict_mode"),Ak=Symbol.for("react.profiler"),Ik=Symbol.for("react.provider"),Ok=Symbol.for("react.context"),Dk=Symbol.for("react.forward_ref"),Mk=Symbol.for("react.suspense"),Lk=Symbol.for("react.memo"),$k=Symbol.for("react.lazy"),Wm=Symbol.iterator;function Fk(e){return e===null||typeof e!="object"?null:(e=Wm&&e[Wm]||e["@@iterator"],typeof e=="function"?e:null)}var Gy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qy=Object.assign,Ky={};function ia(e,t,r){this.props=e,this.context=t,this.refs=Ky,this.updater=r||Gy}ia.prototype.isReactComponent={};ia.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ia.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Yy(){}Yy.prototype=ia.prototype;function zf(e,t,r){this.props=e,this.context=t,this.refs=Ky,this.updater=r||Gy}var Bf=zf.prototype=new Yy;Bf.constructor=zf;qy(Bf,ia.prototype);Bf.isPureReactComponent=!0;var Hm=Array.isArray,Jy=Object.prototype.hasOwnProperty,Wf={current:null},Qy={key:!0,ref:!0,__self:!0,__source:!0};function Xy(e,t,r){var n,s={},o=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)Jy.call(t,n)&&!Qy.hasOwnProperty(n)&&(s[n]=t[n]);var l=arguments.length-2;if(l===1)s.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)s[n]===void 0&&(s[n]=l[n]);return{$$typeof:Wi,type:e,key:o,ref:a,props:s,_owner:Wf.current}}function Uk(e,t){return{$$typeof:Wi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Hf(e){return typeof e=="object"&&e!==null&&e.$$typeof===Wi}function zk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Vm=/\/+/g;function td(e,t){return typeof e=="object"&&e!==null&&e.key!=null?zk(""+e.key):t.toString(36)}function Ul(e,t,r,n,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Wi:case Tk:a=!0}}if(a)return a=e,s=s(a),e=n===""?"."+td(a,0):n,Hm(s)?(r="",e!=null&&(r=e.replace(Vm,"$&/")+"/"),Ul(s,t,r,"",function(u){return u})):s!=null&&(Hf(s)&&(s=Uk(s,r+(!s.key||a&&a.key===s.key?"":(""+s.key).replace(Vm,"$&/")+"/")+e)),t.push(s)),1;if(a=0,n=n===""?".":n+":",Hm(e))for(var l=0;l<e.length;l++){o=e[l];var c=n+td(o,l);a+=Ul(o,t,r,c,s)}else if(c=Fk(e),typeof c=="function")for(e=c.call(e),l=0;!(o=e.next()).done;)o=o.value,c=n+td(o,l++),a+=Ul(o,t,r,c,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function ol(e,t,r){if(e==null)return e;var n=[],s=0;return Ul(e,n,"","",function(o){return t.call(r,o,s++)}),n}function Bk(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ct={current:null},zl={transition:null},Wk={ReactCurrentDispatcher:Ct,ReactCurrentBatchConfig:zl,ReactCurrentOwner:Wf};function Zy(){throw Error("act(...) is not supported in production builds of React.")}xe.Children={map:ol,forEach:function(e,t,r){ol(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return ol(e,function(){t++}),t},toArray:function(e){return ol(e,function(t){return t})||[]},only:function(e){if(!Hf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};xe.Component=ia;xe.Fragment=Rk;xe.Profiler=Ak;xe.PureComponent=zf;xe.StrictMode=Pk;xe.Suspense=Mk;
vendor: 7,111 bytes, lines 9-25
9xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Wk;xe.act=Zy;xe.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=qy({},e.props),s=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=Wf.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Jy.call(t,c)&&!Qy.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:Wi,type:e.type,key:s,ref:o,props:n,_owner:a}};xe.createContext=function(e){return e={$$typeof:Ok,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ik,_context:e},e.Consumer=e};xe.createElement=Xy;xe.createFactory=function(e){var t=Xy.bind(null,e);return t.type=e,t};xe.createRef=function(){return{current:null}};xe.forwardRef=function(e){return{$$typeof:Dk,render:e}};xe.isValidElement=Hf;xe.lazy=function(e){return{$$typeof:$k,_payload:{_status:-1,_result:e},_init:Bk}};xe.memo=function(e,t){return{$$typeof:Lk,type:e,compare:t===void 0?null:t}};xe.startTransition=function(e){var t=zl.transition;zl.transition={};try{e()}finally{zl.transition=t}};xe.unstable_act=Zy;xe.useCallback=function(e,t){return Ct.current.useCallback(e,t)};xe.useContext=function(e){return Ct.current.useContext(e)};xe.useDebugValue=function(){};xe.useDeferredValue=function(e){return Ct.current.useDeferredValue(e)};xe.useEffect=function(e,t){return Ct.current.useEffect(e,t)};xe.useId=function(){return Ct.current.useId()};xe.useImperativeHandle=function(e,t,r){return Ct.current.useImperativeHandle(e,t,r)};xe.useInsertionEffect=function(e,t){return Ct.current.useInsertionEffect(e,t)};xe.useLayoutEffect=function(e,t){return Ct.current.useLayoutEffect(e,t)};xe.useMemo=function(e,t){return Ct.current.useMemo(e,t)};xe.useReducer=function(e,t,r){return Ct.current.useReducer(e,t,r)};xe.useRef=function(e){return Ct.current.useRef(e)};xe.useState=function(e){return Ct.current.useState(e)};xe.useSyncExternalStore=function(e,t,r){return Ct.current.useSyncExternalStore(e,t,r)};xe.useTransition=function(){return Ct.current.useTransition()};xe.version="18.3.1";Vy.exports=xe;var h=Vy.exports;const V=Wy(h),Vf=Ek({__proto__:null,default:V},[h]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its 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 Hk=h,Vk=Symbol.for("react.element"),Gk=Symbol.for("react.fragment"),qk=Object.prototype.hasOwnProperty,Kk=Hk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Yk={key:!0,ref:!0,__self:!0,__source:!0};function e0(e,t,r){var n,s={},o=null,a=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)qk.call(t,n)&&!Yk.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:Vk,type:e,key:o,ref:a,props:s,_owner:Kk.current}}Qc.Fragment=Gk;Qc.jsx=e0;Qc.jsxs=e0;Hy.exports=Qc;var i=Hy.exports,t0={exports:{}},Vt={},r0={exports:{}},n0={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its 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 */(function(e){function t(E,N){var z=E.length;E.push(N);e:for(;0<z;){var Y=z-1>>>1,K=E[Y];if(0<s(K,N))E[Y]=N,E[z]=K,z=Y;else break e}}function r(E){return E.length===0?null:E[0]}function n(E){if(E.length===0)return null;var N=E[0],z=E.pop();if(z!==N){E[0]=z;e:for(var Y=0,K=E.length,te=K>>>1;Y<te;){var Z=2*(Y+1)-1,ve=E[Z],pe=Z+1,H=E[pe];if(0>s(ve,z))pe<K&&0>s(H,ve)?(E[Y]=H,E[pe]=z,Y=pe):(E[Y]=ve,E[Z]=z,Y=Z);else if(pe<K&&0>s(H,z))E[Y]=H,E[pe]=z,Y=pe;else break e}}return N}function s(E,N){var z=E.sortIndex-N.sortIndex;return z!==0?z:E.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,m=3,p=!1,x=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(E){for(var N=r(u);N!==null;){if(N.callback===null)n(u);else if(N.startTime<=E)n(u),N.sortIndex=N.expirationTime,t(c,N);else break;N=r(u)}}function S(E){if(g=!1,w(E),!x)if(r(c)!==null)x=!0,A(_);else{var N=r(u);N!==null&&L(S,N.startTime-E)}}function _(E,N){x=!1,g&&(g=!1,y(j),j=-1),p=!0;var z=m;try{for(w(N),f=r(c);f!==null&&(!(f.expirationTime>N)||E&&!F());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,m=f.priorityLevel;var K=Y(f.expirationTime<=N);N=e.unstable_now(),typeof K=="function"?f.callback=K:f===r(c)&&n(c),w(N)}else n(c);f=r(c)}if(f!==null)var te=!0;else{var Z=r(u);Z!==null&&L(S,Z.startTime-N),te=!1}return te}finally{f=null,m=z,p=!1}}var k=!1,C=null,j=-1,P=5,I=-1;function F(){return!(e.unstable_now()-I<P)}function D(){if(C!==null){var E=e.unstable_now();I=E;var N=!0;try{N=C(!0,E)}finally{N?$():(k=!1,C=null)}}else k=!1}var $;if(typeof v=="function")$=function(){v(D)};else if(typeof MessageChannel<"u"){var T=new MessageChannel,O=T.port2;T.port1.onmessage=D,$=function(){O.postMessage(null)}}else $=function(){b(D,0)};function A(E){C=E,k||(k=!0,$())}function L(E,N){j=b(function(){E(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(E){E.callback=null},e.unstable_continueExecution=function(){x||p||(x=!0,A(_))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(E){switch(m){case 1:case 2:case 3:var N=3;break;default:N=m}var z=m;m=N;try{return E()}finally{m=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,N){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var z=m;m=E;try{return N()}finally{m=z}},e.unstable_scheduleCallback=function(E,N,z){var Y=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?Y+z:Y):z=Y,E){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=z+K,E={id:d++,callback:N,priorityLevel:E,startTime:z,expirationTime:K,sortIndex:-1},z>
vendor: 4,519 bytes, lines 25-33
25Y?(E.sortIndex=z,t(u,E),r(c)===null&&E===r(u)&&(g?(y(j),j=-1):g=!0,L(S,z-Y))):(E.sortIndex=K,t(c,E),x||p||(x=!0,A(_))),E},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(E){var N=m;return function(){var z=m;m=N;try{return E.apply(this,arguments)}finally{m=z}}}})(n0);r0.exports=n0;var Jk=r0.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its 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 Qk=h,Ht=Jk;function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s0=new Set,ni={};function Bs(e,t){Jo(e,t),Jo(e+"Capture",t)}function Jo(e,t){for(ni[e]=t,e=0;e<t.length;e++)s0.add(t[e])}var on=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nh=Object.prototype.hasOwnProperty,Xk=/^[: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]*$/,Gm={},qm={};function Zk(e){return nh.call(qm,e)?!0:nh.call(Gm,e)?!1:Xk.test(e)?qm[e]=!0:(Gm[e]=!0,!1)}function eC(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tC(e,t,r,n){if(t===null||typeof t>"u"||eC(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Nt(e,t,r,n,s,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ht[e]=new Nt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ht[t]=new Nt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ht[e]=new Nt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ht[e]=new Nt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ht[e]=new Nt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ht[e]=new Nt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ht[e]=new Nt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ht[e]=new Nt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ht[e]=new Nt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gf=/[\-:]([a-z])/g;function qf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode
33-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Gf,qf);ht[t]=new Nt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Gf,qf);ht[t]=new Nt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Gf,qf);ht[t]=new Nt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ht[e]=new Nt(e,1,!1,e.toLowerCase(),null,!1,!1)});ht.xlinkHref=new Nt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ht[e]=new Nt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Kf(e,t,r,n){var s=ht.hasOwnProperty(t)?ht[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(tC(t,r,s,n)&&(r=null),n||s===null?Zk(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var pn=Qk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,al=Symbol.for("react.element"),yo=Symbol.for("react.portal"),wo=Symbol.for("react.fragment"),Yf=Symbol.for("react.strict_mode"),sh=Symbol.for("react.profiler"),o0=Symbol.for("react.provider"),a0=Symbol.for("react.context"),Jf=Symbol.for("react.forward_ref"),oh=Symbol.for("react.suspense"),ah=Symbol.for("react.suspense_list"),Qf=Symbol.for("react.memo"),Nn=Symbol.for("react.lazy"),i0=Symbol.for("react.offscreen"),Km=Symbol.iterator;function _a(e){return e===null||typeof e!="object"?null:(e=Km&&e[Km]||e["@@iterator"],typeof e=="function"?e:null)}var $e=Object.assign,rd;function Da(e){if(rd===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);rd=t&&t[1]||""}return` 34`+rd+e}var nd=!1;function sd(e,t){if(!e||nd)return"";nd=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var s=u.stack.split(` 35`),o=n.stack.split(` 36`),a=s.length-1,l=o.length-1;1<=a&&0<=l&&s[a]!==o[l];)l--;for(;1<=a&&0<=l;a--,l--)if(s[a]!==o[l]){if(a!==1||l!==1)do if(a--,l--,0>l||s[a]!==o[l]){var c=` 37`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{nd=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Da(e):""}function rC(e){switch(e.tag){case 5:return Da(e.type);case 16:return Da("Lazy");case 13:return Da("Suspense");case 19:return Da("SuspenseList");case 0:case 2:case 15:return e=sd(e.type,!1),e;case 11:return e=sd(e.type.render,!1),e;case 1:return e=sd(e.type,!0),e;default:return""}}function ih(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case wo:return"Fragment";case yo:return"Portal";case sh:return"Profiler";case Yf:return"StrictMode";case oh:return"Suspense";case ah:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case a0:return(e.displayName||"Context")+".Consumer";case o0:return(e._context.displayName||"Context")+".Provider";case Jf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qf:return t=e.displayName||null,t!==null?t:ih(e.type)||"Memo";case Nn:t=e._payload,e=e._init;try{return ih(e(t))}catch{}}return null}function nC(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ih(t);case 8:return t===Yf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Kn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function l0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sC(e){var t=l0(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){n=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function il(e){e._valueTracker||(e._valueTracker=sC(e))}function c0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=l0(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function lc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lh(e,t){var r=t.checked;return $e({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Ym(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Kn(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}
vendor: 1,671 bytes, line 37
37function u0(e,t){t=t.checked,t!=null&&Kf(e,"checked",t,!1)}function ch(e,t){u0(e,t);var r=Kn(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?uh(e,t.type,r):t.hasOwnProperty("defaultValue")&&uh(e,t.type,Kn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Jm(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function uh(e,t,r){(t!=="number"||lc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ma=Array.isArray;function Po(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Kn(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function dh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return $e({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qm(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(B(92));
vendor: 8,593 bytes, line 37
37if(Ma(r)){if(1<r.length)throw Error(B(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Kn(r)}}function d0(e,t){var r=Kn(t.value),n=Kn(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Xm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function h0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function hh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?h0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ll,f0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ll=ll||document.createElement("div"),ll.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ll.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function si(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Wa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oC=["Webkit","ms","Moz","O"];Object.keys(Wa).forEach(function(e){oC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Wa[t]=Wa[e]})});function p0(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Wa.hasOwnProperty(e)&&Wa[e]?(""+t).trim():t+"px"}function m0(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=p0(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var aC=$e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fh(e,t){if(t){if(aC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function ph(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mh=null;function Xf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gh=null,Ao=null,Io=null;function Zm(e){if(e=Gi(e)){if(typeof gh!="function")throw Error(B(280));var t=e.stateNode;t&&(t=ru(t),gh(e.stateNode,e.type,t))}}function g0(e){Ao?Io?Io.push(e):Io=[e]:Ao=e}function v0(){if(Ao){var e=Ao,t=Io;if(Io=Ao=null,Zm(e),t)for(e=0;e<t.length;e++)Zm(t[e])}}function y0(e,t){return e(t)}function w0(){}var od=!1;function x0(e,t,r){if(od)return e(t,r);od=!0;try{return y0(e,t,r)}finally{od=!1,(Ao!==null||Io!==null)&&(w0(),v0())}}function oi(e,t){var r=e.stateNode;if(r===null)return null;var n=ru(r);if(n===null)return null;r=n[t];e:switch(t){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(r&&typeof r!="function")throw Error(B(231,t,typeof r));return r}var vh=!1;if(on)try{var ka={};Object.defineProperty(ka,"passive",{get:function(){vh=!0}}),window.addEventListener("test",ka,ka),window.removeEventListener("test",ka,ka)}catch{vh=!1}function iC(e,t,r,n,s,o,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Ha=!1,cc=null,uc=!1,yh=null,lC={onError:function(e){Ha=!0,cc=e}};function cC(e,t,r,n,s,o,a,l,c){Ha=!1,cc=null,iC.apply(lC,arguments)}function uC(e,t,r,n,s,o,a,l,c){if(cC.apply(this,arguments),Ha){if(Ha){var u=cc;Ha=!1,cc=null}else throw Error(B(198));uc||(uc=!0,yh=u)}}function Ws(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function b0(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function eg(e){if(Ws(e)!==e)throw Error(B(188))}function dC(e){var t=e.alternate;if(!t){if(t=Ws(e),t===null)throw Error(B(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var o=s.alternate;if(o===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===r)return eg(s),e;if(o===n)return eg(s),t;o=o.sibling}throw Error(B(188))}if(r.return!==n.return)r=s,n=o;else{for(var a=!1,l=s.child;l;){if(l===r){a=!0,r=s,n=o;break}if(l===n){a=!0,n=s,r=o;break}l=l.sibling}if(!a){for(l=o.child;l;){if(l===r){a=!0,r=o,n=s;break}if(l===n){a=!0,n=o,r=s;break}l=l.sibling}if(!a)throw Error(B(189))}}if(r.alternate!==n)throw Error(B(190))}if(r.tag!==3)throw Error(B(188));return r.stateNode.current===r?e:t}function S0(e){return e=dC(e),e!==null?_0(e):null}function _0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=_0(e);if(t!==null)return t;e=e.sibling}return null}var k0=Ht.unstable_scheduleCallback,tg=Ht.unstable_cancelCallback,hC=Ht.unstable_shouldYield,fC=Ht.unstable_requestPaint,He=Ht.unstable_now,pC=Ht.unstable_getCurrentPriorityLevel,Zf=Ht.unstable_ImmediatePriority,C0=Ht.unstable_UserBlockingPriority,dc=Ht.unstable_NormalPriority,mC=Ht.unstable_LowPriority,N0=Ht.unstable_IdlePriority,Xc=null,Ur=null;function gC(e){if(Ur&&typeof Ur.onCommitFiberRoot=="function")try{Ur.onCommitFiberRoot(Xc,e,void 0,(e.current.flags&128)===128)}catch{}}var br=Math.clz32?Math.clz32:wC,vC=Math.log,yC=Math.LN2;function wC(e){return e>>>=0,e===0?32:31-(vC(e)/yC|0)|0}var cl=64,ul=4194304;function La(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function hc(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,a=r&268435455;if(a!==0){var l=a&~s;l!==0?n=La(l):(o&=a,o!==0&&(n=La(o)))}else a=r&~s,a!==0?n=La(a):o!==0&&(n=La(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-br(t),s=1<<r,n|=e[r],t&=~s;return n}function xC(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bC(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-br(o),l=1<<a,c=s[a];c===-1?(!(l&r)||l&n)&&(s[a]=xC(l,t)):c<=t&&(e.expiredLanes|=l),o&=~l}}function wh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function j0(){var e=cl;return cl<<=1,!(cl&4194240)&&(cl=64),e}function ad(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 4,087 bytes, line 37
37function Hi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-br(t),e[t]=r}function SC(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-br(r),o=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~o}}function ep(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-br(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var Ne=0;function E0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var T0,tp,R0,P0,A0,xh=!1,dl=[],Un=null,zn=null,Bn=null,ai=new Map,ii=new Map,Tn=[],_C="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 submit".split(" ");function rg(e,t){switch(e){case"focusin":case"focusout":Un=null;break;case"dragenter":case"dragleave":zn=null;break;case"mouseover":case"mouseout":Bn=null;break;case"pointerover":case"pointerout":ai.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ii.delete(t.pointerId)}}function Ca(e,t,r,n,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:o,targetContainers:[s]},t!==null&&(t=Gi(t),t!==null&&tp(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function kC(e,t,r,n,s){switch(t){case"focusin":return Un=Ca(Un,e,t,r,n,s),!0;case"dragenter":return zn=Ca(zn,e,t,r,n,s),!0;case"mouseover":return Bn=Ca(Bn,e,t,r,n,s),!0;case"pointerover":var o=s.pointerId;return ai.set(o,Ca(ai.get(o)||null,e,t,r,n,s)),!0;case"gotpointercapture":return o=s.pointerId,ii.set(o,Ca(ii.get(o)||null,e,t,r,n,s)),!0}return!1}function I0(e){var t=vs(e.target);if(t!==null){var r=Ws(t);if(r!==null){if(t=r.tag,t===13){if(t=b0(r),t!==null){e.blockedOn=t,A0(e.priority,function(){R0(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Bl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=bh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);mh=n,r.target.dispatchEvent(n),mh=null}else return t=Gi(r),t!==null&&tp(t),e.blockedOn=r,!1;t.shift()}return!0}function ng(e,t,r){Bl(e)&&r.delete(t)}function CC(){xh=!1,Un!==null&&Bl(Un)&&(Un=null),zn!==null&&Bl(zn)&&(zn=null),Bn!==null&&Bl(Bn)&&(Bn=null),ai.forEach(ng),ii.forEach(ng)}function Na(e,t){e.blockedOn===t&&(e.blockedOn=null,xh||(xh=!0,Ht.unstable_scheduleCallback(Ht.unstable_NormalPriority,CC)))}function li(e){function t(s){return Na(s,e)}if(0<dl.length){Na(dl[0],e);for(var r=1;r<dl.length;r++){var n=dl[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Un!==null&&Na(Un,e),zn!==null&&Na(zn,e),Bn!==null&&Na(Bn,e),ai.forEach(t),ii.forEach(t),r=0;r<Tn.length;r++)n=Tn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Tn.length&&(r=Tn[0],r.blockedOn===null);)I0(r),r.blockedOn===null&&Tn.shift()}var Oo=pn.ReactCurrentBatchConfig,fc=!0;function NC(e,t,r,n){var s=Ne,o=Oo.transition;Oo.transition=null;try{Ne=1,rp(e,t,r,n)}finally{Ne=s,Oo.transition=o}}function jC(e,t,r,n){var s=Ne,o=Oo.transition;Oo.transition=null;try{Ne=4,rp(e,t,r,n)}finally{Ne=s,Oo.transition=o}}function rp(e,t,r,n){if(fc){var s=bh(e,t,r,n);if(s===null)gd(e,t,n,pc,r),rg(e,n);else if(kC(s,e,t,r,n))n.stopPropagation();else if(rg(e,n),t&4&&-1<_C.indexOf(e)){for(;s!==null;){var o=Gi(s);if(o!==null&&T0(o),o=bh(e,t,r,n),o===null&&gd(e,t,n,pc,r),o===s)break;s=o}s!==null&&n.stopPropagation()}else gd(e,t,n,null,r)}}var pc=null;function bh(e,t,r,n){if(pc=null,e=Xf(n),e=vs(e),e!==null)if(t=Ws(e),t===null)e=null;else if(r=t.tag,r===13){if(e=b0(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return pc=e,null}
vendor: 10,401 bytes, line 37
37function O0(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(pC()){case Zf:return 1;case C0:return 4;case dc:case mC:return 16;case N0:return 536870912;default:return 16}default:return 16}}var Ln=null,np=null,Wl=null;function D0(){if(Wl)return Wl;var e,t=np,r=t.length,n,s="value"in Ln?Ln.value:Ln.textContent,o=s.length;for(e=0;e<r&&t[e]===s[e];e++);var a=r-e;for(n=1;n<=a&&t[r-n]===s[o-n];n++);return Wl=s.slice(e,1<n?1-n:void 0)}function Hl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function hl(){return!0}function sg(){return!1}function Gt(e){function t(r,n,s,o,a){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?hl:sg,this.isPropagationStopped=sg,this}return $e(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=hl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=hl)},persist:function(){},isPersistent:hl}),t}var la={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sp=Gt(la),Vi=$e({},la,{view:0,detail:0}),EC=Gt(Vi),id,ld,ja,Zc=$e({},Vi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:op,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!==ja&&(ja&&e.type==="mousemove"?(id=e.screenX-ja.screenX,ld=e.screenY-ja.screenY):ld=id=0,ja=e),id)},movementY:function(e){return"movementY"in e?e.movementY:ld}}),og=Gt(Zc),TC=$e({},Zc,{dataTransfer:0}),RC=Gt(TC),PC=$e({},Vi,{relatedTarget:0}),cd=Gt(PC),AC=$e({},la,{animationName:0,elapsedTime:0,pseudoElement:0}),IC=Gt(AC),OC=$e({},la,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),DC=Gt(OC),MC=$e({},la,{data:0}),ag=Gt(MC),LC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$C={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"},FC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UC(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=FC[e])?!!t[e]:!1}function op(){return UC}var zC=$e({},Vi,{key:function(e){if(e.key){var t=LC[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$C[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:op,charCode:function(e){return e.type==="keypress"?Hl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),BC=Gt(zC),WC=$e({},Zc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ig=Gt(WC),HC=$e({},Vi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:op}),VC=Gt(HC),GC=$e({},la,{propertyName:0,elapsedTime:0,pseudoElement:0}),qC=Gt(GC),KC=$e({},Zc,{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}),YC=Gt(KC),JC=[9,13,27,32],ap=on&&"CompositionEvent"in window,Va=null;on&&"documentMode"in document&&(Va=document.documentMode);var QC=on&&"TextEvent"in window&&!Va,M0=on&&(!ap||Va&&8<Va&&11>=Va),lg=" ",cg=!1;function L0(e,t){switch(e){case"keyup":return JC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xo=!1;function XC(e,t){switch(e){case"compositionend":return $0(t);case"keypress":return t.which!==32?null:(cg=!0,lg);case"textInput":return e=t.data,e===lg&&cg?null:e;default:return null}}function ZC(e,t){if(xo)return e==="compositionend"||!ap&&L0(e,t)?(e=D0(),Wl=np=Ln=null,xo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return M0&&t.locale!=="ko"?null:t.data;default:return null}}var eN={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 ug(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!eN[e.type]:t==="textarea"}function F0(e,t,r,n){g0(n),t=mc(t,"onChange"),0<t.length&&(r=new sp("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ga=null,ci=null;function tN(e){J0(e,0)}function eu(e){var t=_o(e);if(c0(t))return e}function rN(e,t){if(e==="change")return t}var U0=!1;if(on){var ud;if(on){var dd="oninput"in document;if(!dd){var dg=document.createElement("div");dg.setAttribute("oninput","return;"),dd=typeof dg.oninput=="function"}ud=dd}else ud=!1;U0=ud&&(!document.documentMode||9<document.documentMode)}function hg(){Ga&&(Ga.detachEvent("onpropertychange",z0),ci=Ga=null)}function z0(e){if(e.propertyName==="value"&&eu(ci)){var t=[];F0(t,ci,e,Xf(e)),x0(tN,t)}}function nN(e,t,r){e==="focusin"?(hg(),Ga=t,ci=r,Ga.attachEvent("onpropertychange",z0)):e==="focusout"&&hg()}function sN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return eu(ci)}function oN(e,t){if(e==="click")return eu(t)}function aN(e,t){if(e==="input"||e==="change")return eu(t)}function iN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _r=typeof Object.is=="function"?Object.is:iN;function ui(e,t){if(_r(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!nh.call(t,s)||!_r(e[s],t[s]))return!1}return!0}function fg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pg(e,t){var r=fg(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=fg(r)}}function B0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?B0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function W0(){for(var e=window,t=lc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=lc(e.document)}return t}function ip(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function lN(e){var t=W0(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&B0(r.ownerDocument.documentElement,r)){if(n!==null&&ip(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=pg(r,o);var a=pg(r,n);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var cN=on&&"documentMode"in document&&11>=document.documentMode,bo=null,Sh=null,qa=null,_h=!1;function mg(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;_h||bo==null||bo!==lc(n)||(n=bo,"selectionStart"in n&&ip(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: 4,501 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),qa&&ui(qa,n)||(qa=n,n=mc(Sh,"onSelect"),0<n.length&&(t=new sp("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=bo)))}function fl(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var So={animationend:fl("Animation","AnimationEnd"),animationiteration:fl("Animation","AnimationIteration"),animationstart:fl("Animation","AnimationStart"),transitionend:fl("Transition","TransitionEnd")},hd={},H0={};on&&(H0=document.createElement("div").style,"AnimationEvent"in window||(delete So.animationend.animation,delete So.animationiteration.animation,delete So.animationstart.animation),"TransitionEvent"in window||delete So.transitionend.transition);function tu(e){if(hd[e])return hd[e];if(!So[e])return e;var t=So[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in H0)return hd[e]=t[r];return e}var V0=tu("animationend"),G0=tu("animationiteration"),q0=tu("animationstart"),K0=tu("transitionend"),Y0=new Map,gg="abort auxClick 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(" ");function es(e,t){Y0.set(e,t),Bs(t,[e])}for(var fd=0;fd<gg.length;fd++){var pd=gg[fd],uN=pd.toLowerCase(),dN=pd[0].toUpperCase()+pd.slice(1);es(uN,"on"+dN)}es(V0,"onAnimationEnd");es(G0,"onAnimationIteration");es(q0,"onAnimationStart");es("dblclick","onDoubleClick");es("focusin","onFocus");es("focusout","onBlur");es(K0,"onTransitionEnd");Jo("onMouseEnter",["mouseout","mouseover"]);Jo("onMouseLeave",["mouseout","mouseover"]);Jo("onPointerEnter",["pointerout","pointerover"]);Jo("onPointerLeave",["pointerout","pointerover"]);Bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $a="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(" "),hN=new Set("cancel close invalid load scroll toggle".split(" ").concat($a));function vg(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,uC(n,t,void 0,e),e.currentTarget=null}function J0(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var a=n.length-1;0<=a;a--){var l=n[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==o&&s.isPropagationStopped())break e;vg(s,l,u),o=c}else for(a=0;a<n.length;a++){if(l=n[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==o&&s.isPropagationStopped())break e;vg(s,l,u),o=c}}}if(uc)throw e=yh,uc=!1,yh=null,e}function Ie(e,t){var r=t[Eh];r===void 0&&(r=t[Eh]=new Set);var n=e+"__bubble";r.has(n)||(Q0(t,e,2,!1),r.add(n))}function md(e,t,r){var n=0;t&&(n|=4),Q0(r,e,n,t)}var pl="_reactListening"+Math.random().toString(36).slice(2);function di(e){if(!e[pl]){e[pl]=!0,s0.forEach(function(r){r!=="selectionchange"&&(hN.has(r)||md(r,!1,e),md(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pl]||(t[pl]=!0,md("selectionchange",!1,t))}}function Q0(e,t,r,n){switch(O0(t)){case 1:var s=NC;break;case 4:s=jC;break;default:s=rp}r=s.bind(null,t,r,e),s=void 0,!vh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function gd(e,t,r,n,s){var o=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var l=n.stateNode.containerInfo;
vendor: 2,527 bytes, line 37
37if(l===s||l.nodeType===8&&l.parentNode===s)break;if(a===4)for(a=n.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;a=a.return}for(;l!==null;){if(a=vs(l),a===null)return;if(c=a.tag,c===5||c===6){n=o=a;continue e}l=l.parentNode}}n=n.return}x0(function(){var u=o,d=Xf(r),f=[];e:{var m=Y0.get(e);if(m!==void 0){var p=sp,x=e;switch(e){case"keypress":if(Hl(r)===0)break e;case"keydown":case"keyup":p=BC;break;case"focusin":x="focus",p=cd;break;case"focusout":x="blur",p=cd;break;case"beforeblur":case"afterblur":p=cd;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=og;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=RC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=VC;break;case V0:case G0:case q0:p=IC;break;case K0:p=qC;break;case"scroll":p=EC;break;case"wheel":p=YC;break;case"copy":case"cut":case"paste":p=DC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=ig}var g=(t&4)!==0,b=!g&&e==="scroll",y=g?m!==null?m+"Capture":null:m;g=[];for(var v=u,w;v!==null;){w=v;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,y!==null&&(S=oi(v,y),S!=null&&g.push(hi(v,S,w)))),b)break;v=v.return}0<g.length&&(m=new p(m,x,null,r,d),f.push({event:m,listeners:g}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",m&&r!==mh&&(x=r.relatedTarget||r.fromElement)&&(vs(x)||x[an]))break e;if((p||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,p?(x=r.relatedTarget||r.toElement,p=u,x=x?vs(x):null,x!==null&&(b=Ws(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(p=null,x=u),p!==x)){if(g=og,S="onMouseLeave",y="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=ig,S="onPointerLeave",y="onPointerEnter",v="pointer"),b=p==null?m:_o(p),w=x==null?m:_o(x),m=new g(S,v+"leave",p,r,d),m.target=b,m.relatedTarget=w,S=null,vs(d)===u&&(g=new g(y,v+"enter",x,r,d),g.target=w,g.relatedTarget=b,S=g),b=S,p&&x)t:{for(g=p,y=x,v=0,w=g;w;w=eo(w))v++;for(w=0,S=y;S;S=eo(S))w++;for(;0<v-w;)g=eo(g),v--;for(;0<w-v;)y=eo(y),w--;for(;v--;){if(g===y||y!==null&&g===y.alternate)break t;g=eo(g),y=eo(y)}g=null}else g=null;p!==null&&yg(f,m,p,g,!1),x!==null&&b!==null&&yg(f,b,x,g,!0)}}
vendor: 7,582 bytes, lines 37-38
37e:{if(m=u?_o(u):window,p=m.nodeName&&m.nodeName.toLowerCase(),p==="select"||p==="input"&&m.type==="file")var _=rN;else if(ug(m))if(U0)_=aN;else{_=sN;var k=nN}else(p=m.nodeName)&&p.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(_=oN);if(_&&(_=_(e,u))){F0(f,_,r,d);break e}k&&k(e,m,u),e==="focusout"&&(k=m._wrapperState)&&k.controlled&&m.type==="number"&&uh(m,"number",m.value)}switch(k=u?_o(u):window,e){case"focusin":(ug(k)||k.contentEditable==="true")&&(bo=k,Sh=u,qa=null);break;case"focusout":qa=Sh=bo=null;break;case"mousedown":_h=!0;break;case"contextmenu":case"mouseup":case"dragend":_h=!1,mg(f,r,d);break;case"selectionchange":if(cN)break;case"keydown":case"keyup":mg(f,r,d)}var C;if(ap)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else xo?L0(e,r)&&(j="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(j="onCompositionStart");j&&(M0&&r.locale!=="ko"&&(xo||j!=="onCompositionStart"?j==="onCompositionEnd"&&xo&&(C=D0()):(Ln=d,np="value"in Ln?Ln.value:Ln.textContent,xo=!0)),k=mc(u,j),0<k.length&&(j=new ag(j,e,null,r,d),f.push({event:j,listeners:k}),C?j.data=C:(C=$0(r),C!==null&&(j.data=C)))),(C=QC?XC(e,r):ZC(e,r))&&(u=mc(u,"onBeforeInput"),0<u.length&&(d=new ag("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:u}),d.data=C))}J0(f,t)})}function hi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function mc(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=oi(e,r),o!=null&&n.unshift(hi(e,o,s)),o=oi(e,t),o!=null&&n.push(hi(e,o,s))),e=e.return}return n}function eo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yg(e,t,r,n,s){for(var o=t._reactName,a=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,s?(c=oi(r,o),c!=null&&a.unshift(hi(r,c,l))):s||(c=oi(r,o),c!=null&&a.push(hi(r,c,l)))),r=r.return}a.length!==0&&e.push({event:t,listeners:a})}var fN=/\r\n?/g,pN=/\u0000|\uFFFD/g;function wg(e){return(typeof e=="string"?e:""+e).replace(fN,` 38`).replace(pN,"")}function ml(e,t,r){if(t=wg(t),wg(e)!==t&&r)throw Error(B(425))}function gc(){}var kh=null,Ch=null;function Nh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var jh=typeof setTimeout=="function"?setTimeout:void 0,mN=typeof clearTimeout=="function"?clearTimeout:void 0,xg=typeof Promise=="function"?Promise:void 0,gN=typeof queueMicrotask=="function"?queueMicrotask:typeof xg<"u"?function(e){return xg.resolve(null).then(e).catch(vN)}:jh;function vN(e){setTimeout(function(){throw e})}function vd(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),li(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);li(t)}function Wn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function bg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var ca=Math.random().toString(36).slice(2),Lr="__reactFiber$"+ca,fi="__reactProps$"+ca,an="__reactContainer$"+ca,Eh="__reactEvents$"+ca,yN="__reactListeners$"+ca,wN="__reactHandles$"+ca;function vs(e){var t=e[Lr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[an]||r[Lr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=bg(e);e!==null;){if(r=e[Lr])return r;e=bg(e)}return t}e=r,r=e.parentNode}return null}function Gi(e){return e=e[Lr]||e[an],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function _o(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function ru(e){return e[fi]||null}var Th=[],ko=-1;function ts(e){return{current:e}}function Oe(e){0>ko||(e.current=Th[ko],Th[ko]=null,ko--)}function Pe(e,t){ko++,Th[ko]=e.current,e.current=t}var Yn={},wt=ts(Yn),At=ts(!1),Ps=Yn;function Qo(e,t){var r=e.type.contextTypes;if(!r)return Yn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function It(e){return e=e.childContextTypes,e!=null}function vc(){Oe(At),Oe(wt)}function Sg(e,t,r){if(wt.current!==Yn)throw Error(B(168));Pe(wt,t),Pe(At,r)}function X0(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(B(108,nC(e)||"Unknown",s));return $e({},r,n)}function yc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yn,Ps=wt.current,Pe(wt,e),Pe(At,At.current),!0}function _g(e,t,r){var n=e.stateNode;if(!n)throw Error(B(169));r?(e=X0(e,t,Ps),n.__reactInternalMemoizedMergedChildContext=e,Oe(At),Oe(wt),Pe(wt,e)):Oe(At),Pe(At,r)}var en=null,nu=!1,yd=!1;function Z0(e){en===null?en=[e]:en.push(e)}function xN(e){nu=!0,Z0(e)}function rs(){if(!yd&&en!==null){yd=!0;var e=0,t=Ne;try{var r=en;for(Ne=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}en=null,nu=!1}catch(s){throw en!==null&&(en=en.slice(e+1)),k0(Zf,rs),s}finally{Ne=t,yd=!1}}return null}var Co=[],No=0,wc=null,xc=0,Zt=[],er=0,As=null,rn=1,nn="";function hs(e,t){Co[No++]=xc,Co[No++]=wc,wc=e,xc=t}function ew(e,t,r){Zt[er++]=rn,Zt[er++]=nn,Zt[er++]=As,As=e;var n=rn;e=nn;var s=32-br(n)-1;n&=~(1<<s),r+=1;var o=32-br(t)+s;if(30<o){var a=s-s%5;o=(n&(1<<a)-1).toString(32),n>>=a,s-=a,rn=1<<32-br(t)+s|r<<s|n,nn=o+e}else rn=1<<o|r<<s|n,nn=e}function lp(e){e.return!==null&&(hs(e,1),ew(e,1,0))}function cp(e){for(;e===wc;)wc=Co[--No],Co[No]=null,xc=Co[--No],Co[No]=null;for(;e===As;)As=Zt[--er],Zt[er]=null,nn=Zt[--er],Zt[er]=null,rn=Zt[--er],Zt[er]=null}var Bt=null,zt=null,De=!1,xr=null;function tw(e,t){var r=tr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function kg(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Bt=e,zt=Wn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Bt=e,zt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=As!==null?{id:rn,overflow:nn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=tr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Bt=e,zt=null,!0):!1;default:return!1}}function Rh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ph(e){if(De){var t=zt;if(t){var r=t;if(!kg(e,t)){if(Rh(e))throw Error(B(418));t=Wn(r.nextSibling);var n=Bt;t&&kg(e,t)?tw(n,r):(e.flags=e.flags&-4097|2,De=!1,Bt=e)}}else{if(Rh(e))throw Error(B(418));e.flags=e.flags&-4097|2,De=!1,Bt=e}}}function Cg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Bt=e}function gl(e){if(e!==Bt)return!1;if(!De)return Cg(e),De=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Nh(e.type,e.memoizedProps)),t&&(t=zt)){if(Rh(e))throw rw(),Error(B(418));for(;t;)tw(e,t),t=Wn(t.nextSibling)}if(Cg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317)
vendor: 13,296 bytes, line 38
38);e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){zt=Wn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}zt=null}}else zt=Bt?Wn(e.stateNode.nextSibling):null;return!0}function rw(){for(var e=zt;e;)e=Wn(e.nextSibling)}function Xo(){zt=Bt=null,De=!1}function up(e){xr===null?xr=[e]:xr.push(e)}var bN=pn.ReactCurrentBatchConfig;function Ea(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(B(309));var n=r.stateNode}if(!n)throw Error(B(147,e));var s=n,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var l=s.refs;a===null?delete l[o]:l[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(B(284));if(!r._owner)throw Error(B(290,e))}return e}function vl(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ng(e){var t=e._init;return t(e._payload)}function nw(e){function t(y,v){if(e){var w=y.deletions;w===null?(y.deletions=[v],y.flags|=16):w.push(v)}}function r(y,v){if(!e)return null;for(;v!==null;)t(y,v),v=v.sibling;return null}function n(y,v){for(y=new Map;v!==null;)v.key!==null?y.set(v.key,v):y.set(v.index,v),v=v.sibling;return y}function s(y,v){return y=qn(y,v),y.index=0,y.sibling=null,y}function o(y,v,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<v?(y.flags|=2,v):w):(y.flags|=2,v)):(y.flags|=1048576,v)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,v,w,S){return v===null||v.tag!==6?(v=Cd(w,y.mode,S),v.return=y,v):(v=s(v,w),v.return=y,v)}function c(y,v,w,S){var _=w.type;return _===wo?d(y,v,w.props.children,S,w.key):v!==null&&(v.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Nn&&Ng(_)===v.type)?(S=s(v,w.props),S.ref=Ea(y,v,w),S.return=y,S):(S=Ql(w.type,w.key,w.props,null,y.mode,S),S.ref=Ea(y,v,w),S.return=y,S)}function u(y,v,w,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=Nd(w,y.mode,S),v.return=y,v):(v=s(v,w.children||[]),v.return=y,v)}function d(y,v,w,S,_){return v===null||v.tag!==7?(v=Es(w,y.mode,S,_),v.return=y,v):(v=s(v,w),v.return=y,v)}function f(y,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Cd(""+v,y.mode,w),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case al:return w=Ql(v.type,v.key,v.props,null,y.mode,w),w.ref=Ea(y,null,v),w.return=y,w;case yo:return v=Nd(v,y.mode,w),v.return=y,v;case Nn:var S=v._init;return f(y,S(v._payload),w)}if(Ma(v)||_a(v))return v=Es(v,y.mode,w,null),v.return=y,v;vl(y,v)}return null}function m(y,v,w,S){var _=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return _!==null?null:l(y,v,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case al:return w.key===_?c(y,v,w,S):null;case yo:return w.key===_?u(y,v,w,S):null;case Nn:return _=w._init,m(y,v,_(w._payload),S)}if(Ma(w)||_a(w))return _!==null?null:d(y,v,w,S,null);vl(y,w)}return null}function p(y,v,w,S,_){if(typeof S=="string"&&S!==""||typeof S=="number")return y=y.get(w)||null,l(v,y,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case al:return y=y.get(S.key===null?w:S.key)||null,c(v,y,S,_);case yo:return y=y.get(S.key===null?w:S.key)||null,u(v,y,S,_);case Nn:var k=S._init;return p(y,v,w,k(S._payload),_)}if(Ma(S)||_a(S))return y=y.get(w)||null,d(v,y,S,_,null);vl(v,S)}return null}function x(y,v,w,S){for(var _=null,k=null,C=v,j=v=0,P=null;C!==null&&j<w.length;j++){C.index>j?(P=C,C=null):P=C.sibling;var I=m(y,C,w[j],S);if(I===null){C===null&&(C=P);break}e&&C&&I.alternate===null&&t(y,C),v=o(I,v,j),k===null?_=I:k.sibling=I,k=I,C=P}if(j===w.length)return r(y,C),De&&hs(y,j),_;if(C===null){for(;j<w.length;j++)C=f(y,w[j],S),C!==null&&(v=o(C,v,j),k===null?_=C:k.sibling=C,k=C);return De&&hs(y,j),_}for(C=n(y,C);j<w.length;j++)P=p(C,y,j,w[j],S),P!==null&&(e&&P.alternate!==null&&C.delete(P.key===null?j:P.key),v=o(P,v,j),k===null?_=P:k.sibling=P,k=P);return e&&C.forEach(function(F){return t(y,F)}),De&&hs(y,j),_}function g(y,v,w,S){var _=_a(w);if(typeof _!="function")throw Error(B(150));if(w=_.call(w),w==null)throw Error(B(151));for(var k=_=null,C=v,j=v=0,P=null,I=w.next();C!==null&&!I.done;j++,I=w.next()){C.index>j?(P=C,C=null):P=C.sibling;var F=m(y,C,I.value,S);if(F===null){C===null&&(C=P);break}e&&C&&F.alternate===null&&t(y,C),v=o(F,v,j),k===null?_=F:k.sibling=F,k=F,C=P}if(I.done)return r(y,C),De&&hs(y,j),_;if(C===null){for(;!I.done;j++,I=w.next())I=f(y,I.value,S),I!==null&&(v=o(I,v,j),k===null?_=I:k.sibling=I,k=I);return De&&hs(y,j),_}for(C=n(y,C);!I.done;j++,I=w.next())I=p(C,y,j,I.value,S),I!==null&&(e&&I.alternate!==null&&C.delete(I.key===null?j:I.key),v=o(I,v,j),k===null?_=I:k.sibling=I,k=I);return e&&C.forEach(function(D){return t(y,D)}),De&&hs(y,j),_}function b(y,v,w,S){if(typeof w=="object"&&w!==null&&w.type===wo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case al:e:{for(var _=w.key,k=v;k!==null;){if(k.key===_){if(_=w.type,_===wo){if(k.tag===7){r(y,k.sibling),v=s(k,w.props.children),v.return=y,y=v;break e}}else if(k.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Nn&&Ng(_)===k.type){r(y,k.sibling),v=s(k,w.props),v.ref=Ea(y,k,w),v.return=y,y=v;break e}r(y,k);break}else t(y,k);k=k.sibling}w.type===wo?(v=Es(w.props.children,y.mode,S,w.key),v.return=y,y=v):(S=Ql(w.type,w.key,w.props,null,y.mode,S),S.ref=Ea(y,v,w),S.return=y,y=S)}return a(y);case yo:e:{for(k=w.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){r(y,v.sibling),v=s(v,w.children||[]),v.return=y,y=v;break e}else{r(y,v);break}else t(y,v);v=v.sibling}v=Nd(w,y.mode,S),v.return=y,y=v}return a(y);case Nn:return k=w._init,b(y,v,k(w._payload),S)}if(Ma(w))return x(y,v,w,S);if(_a(w))return g(y,v,w,S);vl(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(r(y,v.sibling),v=s(v,w),v.return=y,y=v):(r(y,v),v=Cd(w,y.mode,S),v.return=y,y=v),a(y)):r(y,v)}return b}var Zo=nw(!0),sw=nw(!1),bc=ts(null),Sc=null,jo=null,dp=null;function hp(){dp=jo=Sc=null}function fp(e){var t=bc.current;Oe(bc),e._currentValue=t}function Ah(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Do(e,t){Sc=e,dp=jo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Pt=!0),e.firstContext=null)}function or(e){var t=e._currentValue;if(dp!==e)if(e={context:e,memoizedValue:t,next:null},jo===null){if(Sc===null)throw Error(B(308));jo=e,Sc.dependencies={lanes:0,firstContext:e}}else jo=jo.next=e;return t}var ys=null;function pp(e){ys===null?ys=[e]:ys.push(e)}function ow(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,pp(t)):(r.next=s.next,s.next=r),t.interleaved=r,ln(e,n)}function ln(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var jn=!1;function mp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function aw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function sn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hn(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ke&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,ln(e,r)}return s=n.interleaved,s===null?(t.next=t,pp(n)):(t.next=s.next,s.next=t),n.interleaved=t,ln(e,r)}function Vl(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ep(e,r)}}function jg(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=a:o=o.next=a,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function _c(e,t,r,n){var s=e.updateQueue;jn=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?o=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(o!==null){var f=s.baseState;a=0,d=u=c=null,l=o;do{var m=l.lane,p=l.eventTime;if((n&m)===m){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,g=l;switch(m=t,p=r,g.tag){case 1:if(x=g.payload,typeof x=="function"){f=x.call(p,f,m);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,m=typeof x=="function"?x.call(p,f,m):x,m==null)break e;f=$e({},f,m);break e;case 2:jn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[l]:m.push(l))}else p={eventTime:p,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,a|=m;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;m=l,l=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(d===null&&(c=f),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Os|=a,e.lanes=a,e.memoizedState=f}}function Eg(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(B(191,s));s.call(n)}}}var qi={},zr=ts(qi),pi=ts(qi),mi=ts(qi);function ws(e){if(e===qi)throw Error(B(174));return e}function gp(e,t){switch(Pe(mi,t),Pe(pi,e),Pe(zr,qi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:hh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=hh(t,e)}Oe(zr),Pe(zr,t)}function ea(){Oe(zr),Oe(pi),Oe(mi)}function iw(e){ws(mi.current);var t=ws(zr.current),r=hh(t,e.type);t!==r&&(Pe(pi,e),Pe(zr,r))}function vp(e){pi.current===e&&(Oe(zr),Oe(pi))}var Me=ts(0);function kc(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var wd=[];function yp(){for(var e=0;e<wd.length;e++)wd[e]._workInProgressVersionPrimary=null;wd.length=0}var Gl=pn.ReactCurrentDispatcher,xd=pn.ReactCurrentBatchConfig,Is=0,Le=null,Qe=null,rt=null,Cc=!1,Ka=!1,gi=0,SN=0;function pt(){throw Error(B(321))}function wp(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!_r(e[r],t[r]))return!1;return!0}function xp(e,t,r,n,s,o){if(Is=o,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Gl.current=e===null||e.memoizedState===null?NN:jN,e=r(n,s),Ka){o=0;do{if(Ka=!1,gi=0,25<=o)throw Error(B(301));o+=1,rt=Qe=null,t.updateQueue=null,Gl.current=EN,e=r(n,s)}while(Ka)}if(Gl.current=Nc,t=Qe!==null&&Qe.next!==null,Is=0,rt=Qe=Le=null,Cc=!1,t)throw Error(B(300));return e}function bp(){var e=gi!==0;return gi=0,e}function Ir(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?Le.memoizedState=rt=e:rt=rt.next=e,rt}function ar(){if(Qe===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=rt===null?Le.memoizedState:rt.next;if(t!==null)rt=t,Qe=e;else{if(e===null)throw Error(B(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},rt===null?Le.memoizedState=rt=e:rt=rt.next=e}return rt}function vi(e,t){return typeof t=="function"?t(e):t}function bd(e){var t=ar(),r=t.queue;if(r===null)throw Error(B(311));r.lastRenderedReducer=e;var n=Qe,s=n.baseQueue,o=r.pending;if(o!==null){if(s!==null){var a=s.next;s.next=o.next,o.next=a}n.baseQueue=s=o,r.pending=null}if(s!==null){o=s.next,n=n.baseState;var l=a=null,c=null,u=o;do{var d=u.lane;if((Is&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,a=n):c=c.next=f,Le.lanes|=d,Os|=d}u=u.next}while(u!==null&&u!==o);c===null?a=n:c.next=l,_r(n,t.memoizedState)||(Pt=!0),t.memoizedState=n,t.baseState=a,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do o=s.lane,Le.lanes|=o,Os|=o,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);
vendor: 1,338 bytes, line 38
38return[t.memoizedState,r.dispatch]}function Sd(e){var t=ar(),r=t.queue;if(r===null)throw Error(B(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,o=t.memoizedState;if(s!==null){r.pending=null;var a=s=s.next;do o=e(o,a.action),a=a.next;while(a!==s);_r(o,t.memoizedState)||(Pt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,n]}function lw(){}function cw(e,t){var r=Le,n=ar(),s=t(),o=!_r(n.memoizedState,s);if(o&&(n.memoizedState=s,Pt=!0),n=n.queue,Sp(hw.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||rt!==null&&rt.memoizedState.tag&1){if(r.flags|=2048,yi(9,dw.bind(null,r,n,s,t),void 0,null),nt===null)throw Error(B(349));Is&30||uw(r,t,s)}return s}function uw(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Le.updateQueue,t===null?(t={lastEffect:null,stores:null},Le.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function dw(e,t,r,n){t.value=r,t.getSnapshot=n,fw(t)&&pw(e)}function hw(e,t,r){return r(function(){fw(t)&&pw(e)})}function fw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!_r(e,r)}catch{return!0}}function pw(e){var t=ln(e,1);t!==null&&Sr(t,e,1,-1)}function Tg(e){var t=Ir();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:e}
vendor: 3,499 bytes, line 38
38,t.queue=e,e=e.dispatch=CN.bind(null,Le,e),[t.memoizedState,e]}function yi(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Le.updateQueue,t===null?(t={lastEffect:null,stores:null},Le.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function mw(){return ar().memoizedState}function ql(e,t,r,n){var s=Ir();Le.flags|=e,s.memoizedState=yi(1|t,r,void 0,n===void 0?null:n)}function su(e,t,r,n){var s=ar();n=n===void 0?null:n;var o=void 0;if(Qe!==null){var a=Qe.memoizedState;if(o=a.destroy,n!==null&&wp(n,a.deps)){s.memoizedState=yi(t,r,o,n);return}}Le.flags|=e,s.memoizedState=yi(1|t,r,o,n)}function Rg(e,t){return ql(8390656,8,e,t)}function Sp(e,t){return su(2048,8,e,t)}function gw(e,t){return su(4,2,e,t)}function vw(e,t){return su(4,4,e,t)}function yw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ww(e,t,r){return r=r!=null?r.concat([e]):null,su(4,4,yw.bind(null,t,e),r)}function _p(){}function xw(e,t){var r=ar();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&wp(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function bw(e,t){var r=ar();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&wp(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Sw(e,t,r){return Is&21?(_r(r,t)||(r=j0(),Le.lanes|=r,Os|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Pt=!0),e.memoizedState=r)}function _N(e,t){var r=Ne;Ne=r!==0&&4>r?r:4,e(!0);var n=xd.transition;xd.transition={};try{e(!1),t()}finally{Ne=r,xd.transition=n}}function _w(){return ar().memoizedState}function kN(e,t,r){var n=Gn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},kw(e))Cw(t,r);else if(r=ow(e,t,r,n),r!==null){var s=kt();Sr(r,e,n,s),Nw(r,t,n)}}function CN(e,t,r){var n=Gn(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(kw(e))Cw(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,l=o(a,r);if(s.hasEagerState=!0,s.eagerState=l,_r(l,a)){var c=t.interleaved;c===null?(s.next=s,pp(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=ow(e,t,s,n),r!==null&&(s=kt(),Sr(r,e,n,s),Nw(r,t,n))}}function kw(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Cw(e,t){Ka=Cc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Nw(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ep(e,r)}}var Nc={readContext:or,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},NN={readContext:or,useCallback:function(e,t){return Ir().memoizedState=[e,t===void 0?null:t],e},useContext:or,useEffect:Rg,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ql(4194308,4,yw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ql(4194308,4,e,t)},useInsertionEffect:function(e,t){return ql(4,2,e,t)},useMemo:function(e,t){var r=Ir();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ir();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}
vendor: 5,985 bytes, lines 38-40
38,n.queue=e,e=e.dispatch=kN.bind(null,Le,e),[n.memoizedState,e]},useRef:function(e){var t=Ir();return e={current:e},t.memoizedState=e},useState:Tg,useDebugValue:_p,useDeferredValue:function(e){return Ir().memoizedState=e},useTransition:function(){var e=Tg(!1),t=e[0];return e=_N.bind(null,e[1]),Ir().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Le,s=Ir();if(De){if(r===void 0)throw Error(B(407));r=r()}else{if(r=t(),nt===null)throw Error(B(349));Is&30||uw(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,Rg(hw.bind(null,n,o,e),[e]),n.flags|=2048,yi(9,dw.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=Ir(),t=nt.identifierPrefix;if(De){var r=nn,n=rn;r=(n&~(1<<32-br(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=gi++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=SN++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},jN={readContext:or,useCallback:xw,useContext:or,useEffect:Sp,useImperativeHandle:ww,useInsertionEffect:gw,useLayoutEffect:vw,useMemo:bw,useReducer:bd,useRef:mw,useState:function(){return bd(vi)},useDebugValue:_p,useDeferredValue:function(e){var t=ar();return Sw(t,Qe.memoizedState,e)},useTransition:function(){var e=bd(vi)[0],t=ar().memoizedState;return[e,t]},useMutableSource:lw,useSyncExternalStore:cw,useId:_w,unstable_isNewReconciler:!1},EN={readContext:or,useCallback:xw,useContext:or,useEffect:Sp,useImperativeHandle:ww,useInsertionEffect:gw,useLayoutEffect:vw,useMemo:bw,useReducer:Sd,useRef:mw,useState:function(){return Sd(vi)},useDebugValue:_p,useDeferredValue:function(e){var t=ar();return Qe===null?t.memoizedState=e:Sw(t,Qe.memoizedState,e)},useTransition:function(){var e=Sd(vi)[0],t=ar().memoizedState;return[e,t]},useMutableSource:lw,useSyncExternalStore:cw,useId:_w,unstable_isNewReconciler:!1};function fr(e,t){if(e&&e.defaultProps){t=$e({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Ih(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:$e({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ou={isMounted:function(e){return(e=e._reactInternals)?Ws(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=kt(),s=Gn(e),o=sn(n,s);o.payload=t,r!=null&&(o.callback=r),t=Hn(e,o,s),t!==null&&(Sr(t,e,s,n),Vl(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=kt(),s=Gn(e),o=sn(n,s);o.tag=1,o.payload=t,r!=null&&(o.callback=r),t=Hn(e,o,s),t!==null&&(Sr(t,e,s,n),Vl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=kt(),n=Gn(e),s=sn(r,n);s.tag=2,t!=null&&(s.callback=t),t=Hn(e,s,n),t!==null&&(Sr(t,e,n,r),Vl(t,e,n))}};function Pg(e,t,r,n,s,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,a):t.prototype&&t.prototype.isPureReactComponent?!ui(r,n)||!ui(s,o):!0}function jw(e,t,r){var n=!1,s=Yn,o=t.contextType;return typeof o=="object"&&o!==null?o=or(o):(s=It(t)?Ps:wt.current,n=t.contextTypes,o=(n=n!=null)?Qo(e,s):Yn),t=new t(r,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ou,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function Ag(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&ou.enqueueReplaceState(t,t.state,null)}function Oh(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},mp(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=or(o):(o=It(t)?Ps:wt.current,s.context=Qo(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Ih(e,t,o,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&ou.enqueueReplaceState(s,s.state,null),_c(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ta(e,t){try{var r="",n=t;do r+=rC(n),n=n.return;while(n);var s=r}catch(o){s=` 39Error generating stack: `+o.message+` 40`+o.stack}return{value:e,source:t,stack:s,digest:null}}function _d(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Dh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var TN=typeof WeakMap=="function"?WeakMap:Map;function Ew(e,t,r){r=sn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Ec||(Ec=!0,Vh=n),Dh(e,t)},r}function Tw(e,t,r){r=sn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){Dh(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){Dh(e,t),typeof n!="function"&&(Vn===null?Vn=new Set([this]):Vn.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),r}function Ig(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new TN;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=WN.bind(null,e,t,r),t.then(e,e))}function Og(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Dg(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=sn(-1,1),t.tag=2,Hn(r,t,1))),r.lanes|=1),e)}var RN=pn.ReactCurrentOwner,Pt=!1;function St(e,t,r,n){t.child=e===null?sw(t,null,r,n):Zo(t,e.child,r,n)}function Mg(e,t,r,n,s){r=r.render;var o=t.ref;
vendor: 4,932 bytes, line 40
40return Do(t,s),n=xp(e,t,r,n,o,s),r=bp(),e!==null&&!Pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,cn(e,t,s)):(De&&r&&lp(t),t.flags|=1,St(e,t,n,s),t.child)}function Lg(e,t,r,n,s){if(e===null){var o=r.type;return typeof o=="function"&&!Pp(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,Rw(e,t,o,n,s)):(e=Ql(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var a=o.memoizedProps;if(r=r.compare,r=r!==null?r:ui,r(a,n)&&e.ref===t.ref)return cn(e,t,s)}return t.flags|=1,e=qn(o,n),e.ref=t.ref,e.return=t,t.child=e}function Rw(e,t,r,n,s){if(e!==null){var o=e.memoizedProps;if(ui(o,n)&&e.ref===t.ref)if(Pt=!1,t.pendingProps=n=o,(e.lanes&s)!==0)e.flags&131072&&(Pt=!0);else return t.lanes=e.lanes,cn(e,t,s)}return Mh(e,t,r,n,s)}function Pw(e,t,r){var n=t.pendingProps,s=n.children,o=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pe(To,$t),$t|=r;else{if(!(r&1073741824))return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Pe(To,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,Pe(To,$t),$t|=n}else o!==null?(n=o.baseLanes|r,t.memoizedState=null):n=r,Pe(To,$t),$t|=n;return St(e,t,s,r),t.child}function Aw(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Mh(e,t,r,n,s){var o=It(r)?Ps:wt.current;return o=Qo(t,o),Do(t,s),r=xp(e,t,r,n,o,s),n=bp(),e!==null&&!Pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,cn(e,t,s)):(De&&n&&lp(t),t.flags|=1,St(e,t,r,s),t.child)}function $g(e,t,r,n,s){if(It(r)){var o=!0;yc(t)}else o=!1;if(Do(t,s),t.stateNode===null)Kl(e,t),jw(t,r,n),Oh(t,r,n,s),n=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=r.contextType;typeof u=="object"&&u!==null?u=or(u):(u=It(r)?Ps:wt.current,u=Qo(t,u));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==n||c!==u)&&Ag(t,a,n,u),jn=!1;var m=t.memoizedState;a.state=m,_c(t,n,a,s),c=t.memoizedState,l!==n||m!==c||At.current||jn?(typeof d=="function"&&(Ih(t,r,d,n),c=t.memoizedState),(l=jn||Pg(t,r,l,n,m,c,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),a.props=n,a.state=c,a.context=u,n=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{a=t.stateNode,aw(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:fr(t.type,l),a.props=u,f=t.pendingProps,m=a.context,c=r.contextType,typeof c=="object"&&c!==null?c=or(c):(c=It(r)?Ps:wt.current,c=Qo(t,c));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==f||m!==c)&&Ag(t,a,n,c),jn=!1,m=t.memoizedState,a.state=m,_c(t,n,a,s);var x=t.memoizedState;l!==f||m!==x||At.current||jn?(typeof p=="function"&&(Ih(t,r,p,n),x=t.memoizedState),(u=jn||Pg(t,r,u,n,m,x,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,x,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,x,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=x),a.props=n,a.state=x,a.context=c,n=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),n=!1)}return Lh(e,t,r,n,o,s)}function Lh(e,t,r,n,s,o){Aw(e,t);var a=(t.flags&128)!==0;if(!n&&!a)return s&&_g(t,r,!1),cn(e,t,o);n=t.stateNode,RN.current=t;var l=a&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&a?(t.child=Zo(t,e.child,null,o),t.child=Zo(t,null,l,o)):St(e,t,l,o),t.memoizedState=n.state,s&&_g(t,r,!0),t.child}function Iw(e){var t=e.stateNode;t.pendingContext?Sg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Sg(e,t.context,!1),gp(e,t.containerInfo)}
vendor: 6,221 bytes, line 40
40function Fg(e,t,r,n,s){return Xo(),up(s),t.flags|=256,St(e,t,r,n),t.child}var $h={dehydrated:null,treeContext:null,retryLane:0};function Fh(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ow(e,t,r){var n=t.pendingProps,s=Me.current,o=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Pe(Me,s&1),e===null)return Ph(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=n.children,e=n.fallback,o?(n=t.mode,o=t.child,a={mode:"hidden",children:a},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=lu(a,n,0,null),e=Es(e,n,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Fh(r),t.memoizedState=$h,e):kp(t,a));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return PN(e,t,a,n,l,s,r);if(o){o=n.fallback,a=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:n.children};return!(a&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=qn(s,c),n.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=qn(l,o):(o=Es(o,a,r,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,n=o,o=t.child,a=e.child.memoizedState,a=a===null?Fh(r):{baseLanes:a.baseLanes|r,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~r,t.memoizedState=$h,n}return o=e.child,e=o.sibling,n=qn(o,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function kp(e,t){return t=lu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function yl(e,t,r,n){return n!==null&&up(n),Zo(t,e.child,null,r),e=kp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function PN(e,t,r,n,s,o,a){if(r)return t.flags&256?(t.flags&=-257,n=_d(Error(B(422))),yl(e,t,a,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=n.fallback,s=t.mode,n=lu({mode:"visible",children:n.children},s,0,null),o=Es(o,s,a,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,t.mode&1&&Zo(t,e.child,null,a),t.child.memoizedState=Fh(a),t.memoizedState=$h,o);if(!(t.mode&1))return yl(e,t,a,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var l=n.dgst;return n=l,o=Error(B(419)),n=_d(o,n,void 0),yl(e,t,a,n)}if(l=(a&e.childLanes)!==0,Pt||l){if(n=nt,n!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|a)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,ln(e,s),Sr(n,e,s,-1))}return Rp(),n=_d(Error(B(421))),yl(e,t,a,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=HN.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,zt=Wn(s.nextSibling),Bt=t,De=!0,xr=null,e!==null&&(Zt[er++]=rn,Zt[er++]=nn,Zt[er++]=As,rn=e.id,nn=e.overflow,As=t),t=kp(t,n.children),t.flags|=4096,t)}function Ug(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Ah(e.return,t,r)}function kd(e,t,r,n,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=s)}function Dw(e,t,r){var n=t.pendingProps,s=n.revealOrder,o=n.tail;if(St(e,t,n.children,r),n=Me.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ug(e,r,t);else if(e.tag===19)Ug(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Pe(Me,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&kc(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),kd(t,!1,s,r,o);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&kc(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}kd(t,!0,r,null,o);break;case"together":kd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Kl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function cn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Os|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,r=qn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=qn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function AN(e,t,r){switch(t.tag){case 3:Iw(t),Xo();break;case 5:iw(t);break;case 1:It(t.type)&&yc(t);break;case 4:gp(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;Pe(bc,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Pe(Me,Me.current&1),t.flags|=128,null):r&t.child.childLanes?Ow(e,t,r):(Pe(Me,Me.current&1),e=cn(e,t,r),e!==null?e.sibling:null);Pe(Me,Me.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Dw(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Pe(Me,Me.current),n)break;return null;case 22:case 23:return t.lanes=0,Pw(e,t,r)}return cn(e,t,r)}var Mw,Uh,Lw,$w;Mw=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Uh=function(){};Lw=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,ws(zr.current);var o=null;switch(r){case"input":s=lh(e,s),n=lh(e,n),o=[];break;case"select":s=$e({},s,{value:void 0}),n=$e({},n,{value:void 0}),o=[];break;
vendor: 4,763 bytes, line 40
40case"textarea":s=dh(e,s),n=dh(e,n),o=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=gc)}fh(r,n);var a;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(a in l)l.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ni.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in n){var c=n[u];if(l=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(r||(r={}),r[a]=c[a])}else r||(o||(o=[]),o.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(o=o||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ni.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Ie("scroll",e),o||l===c||(o=[])):(o=o||[]).push(u,c))}r&&(o=o||[]).push("style",r);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};$w=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ta(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function IN(e,t,r){var n=t.pendingProps;switch(cp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return It(t.type)&&vc(),mt(t),null;case 3:return n=t.stateNode,ea(),Oe(At),Oe(wt),yp(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(gl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xr!==null&&(Kh(xr),xr=null))),Uh(e,t),mt(t),null;case 5:vp(t);var s=ws(mi.current);if(r=t.type,e!==null&&t.stateNode!=null)Lw(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(B(166));return mt(t),null}if(e=ws(zr.current),gl(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[Lr]=t,n[fi]=o,e=(t.mode&1)!==0,r){case"dialog":Ie("cancel",n),Ie("close",n);break;case"iframe":case"object":case"embed":Ie("load",n);break;case"video":case"audio":for(s=0;s<$a.length;s++)Ie($a[s],n);break;case"source":Ie("error",n);break;case"img":case"image":case"link":Ie("error",n),Ie("load",n);break;case"details":Ie("toggle",n);break;case"input":Ym(n,o),Ie("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!o.multiple},Ie("invalid",n);break;case"textarea":Qm(n,o),Ie("invalid",n)}fh(r,o),s=null;for(var a in o)if(o.hasOwnProperty(a)){var l=o[a];a==="children"?typeof l=="string"?n.textContent!==l&&(o.suppressHydrationWarning!==!0&&ml(n.textContent,l,e),s=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&ml(n.textContent,l,e),s=["children",""+l]):ni.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&Ie("scroll",n)}switch(r){case"input":il(n),Jm(n,o,!0);break;case"textarea":il(n),Xm(n);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(n.onclick=gc)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{a=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=h0(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[Lr]=t,e[fi]=n,Mw(e,t,!1,!1),t.stateNode=e;e:{switch(a=ph(r,n),r){case"dialog":Ie("cancel",e),Ie("close",e),s=n;break;case"iframe":case"object":case"embed":Ie("load",e),s=n;break;case"video":case"audio":for(s=0;s<$a.length;s++)Ie($a[s],e);s=n;break;case"source":Ie("error",e),s=n;break;case"img":case"image":case"link":Ie("error",e),Ie("load",e),s=n;break;case"details":Ie("toggle",e),s=n;break;case"input":Ym(e,n),s=lh(e,n),Ie("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=$e({},n,{value:void 0}),Ie("invalid",e);break;
vendor: 30,212 bytes, line 40
40case"textarea":Qm(e,n),s=dh(e,n),Ie("invalid",e);break;default:s=n}fh(r,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var c=l[o];o==="style"?m0(e,c):o==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&f0(e,c)):o==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&si(e,c):typeof c=="number"&&si(e,""+c):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(ni.hasOwnProperty(o)?c!=null&&o==="onScroll"&&Ie("scroll",e):c!=null&&Kf(e,o,c,a))}switch(r){case"input":il(e),Jm(e,n,!1);break;case"textarea":il(e),Xm(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Kn(n.value));break;case"select":e.multiple=!!n.multiple,o=n.value,o!=null?Po(e,!!n.multiple,o,!1):n.defaultValue!=null&&Po(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=gc)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return mt(t),null;case 6:if(e&&t.stateNode!=null)$w(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(B(166));if(r=ws(mi.current),ws(zr.current),gl(t)){if(n=t.stateNode,r=t.memoizedProps,n[Lr]=t,(o=n.nodeValue!==r)&&(e=Bt,e!==null))switch(e.tag){case 3:ml(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ml(n.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Lr]=t,t.stateNode=n}return mt(t),null;case 13:if(Oe(Me),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(De&&zt!==null&&t.mode&1&&!(t.flags&128))rw(),Xo(),t.flags|=98560,o=!1;else if(o=gl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(B(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(B(317));o[Lr]=t}else Xo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;mt(t),o=!1}else xr!==null&&(Kh(xr),xr=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Me.current&1?Xe===0&&(Xe=3):Rp())),t.updateQueue!==null&&(t.flags|=4),mt(t),null);case 4:return ea(),Uh(e,t),e===null&&di(t.stateNode.containerInfo),mt(t),null;case 10:return fp(t.type._context),mt(t),null;case 17:return It(t.type)&&vc(),mt(t),null;case 19:if(Oe(Me),o=t.memoizedState,o===null)return mt(t),null;if(n=(t.flags&128)!==0,a=o.rendering,a===null)if(n)Ta(o,!1);else{if(Xe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=kc(e),a!==null){for(t.flags|=128,Ta(o,!1),n=a.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)o=r,e=n,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Pe(Me,Me.current&1|2),t.child}e=e.sibling}o.tail!==null&&He()>ra&&(t.flags|=128,n=!0,Ta(o,!1),t.lanes=4194304)}else{if(!n)if(e=kc(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ta(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!De)return mt(t),null}else 2*He()-o.renderingStartTime>ra&&r!==1073741824&&(t.flags|=128,n=!0,Ta(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(r=o.last,r!==null?r.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=He(),t.sibling=null,r=Me.current,Pe(Me,n?r&1|2:r&1),t):(mt(t),null);case 22:case 23:return Tp(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?$t&1073741824&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function ON(e,t){switch(cp(t),t.tag){case 1:return It(t.type)&&vc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(),Oe(At),Oe(wt),yp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vp(t),null;case 13:if(Oe(Me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Xo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oe(Me),null;case 4:return ea(),null;case 10:return fp(t.type._context),null;case 22:case 23:return Tp(),null;case 24:return null;default:return null}}var wl=!1,vt=!1,DN=typeof WeakSet=="function"?WeakSet:Set,Q=null;function Eo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Be(e,t,n)}else r.current=null}function zh(e,t,r){try{r()}catch(n){Be(e,t,n)}}var zg=!1;function MN(e,t){if(kh=fc,e=W0(),ip(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var a=0,l=-1,c=-1,u=0,d=0,f=e,m=null;t:for(;;){for(var p;f!==r||s!==0&&f.nodeType!==3||(l=a+s),f!==o||n!==0&&f.nodeType!==3||(c=a+n),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)m=f,f=p;for(;;){if(f===e)break t;if(m===r&&++u===s&&(l=a),m===o&&++d===n&&(c=a),(p=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ch={focusedElem:e,selectionRange:r},fc=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var g=x.memoizedProps,b=x.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:fr(t.type,g),b);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(S){Be(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return x=zg,zg=!1,x}function Ya(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&zh(t,r,o)}s=s.next}while(s!==n)}}function au(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Bh(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Fw(e){var t=e.alternate;t!==null&&(e.alternate=null,Fw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Lr],delete t[fi],delete t[Eh],delete t[yN],delete t[wN])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Uw(e){return e.tag===5||e.tag===3||e.tag===4}function Bg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Uw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=gc));else if(n!==4&&(e=e.child,e!==null))for(Wh(e,t,r),e=e.sibling;e!==null;)Wh(e,t,r),e=e.sibling}function Hh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Hh(e,t,r),e=e.sibling;e!==null;)Hh(e,t,r),e=e.sibling}var ut=null,yr=!1;function bn(e,t,r){for(r=r.child;r!==null;)zw(e,t,r),r=r.sibling}function zw(e,t,r){if(Ur&&typeof Ur.onCommitFiberUnmount=="function")try{Ur.onCommitFiberUnmount(Xc,r)}catch{}switch(r.tag){case 5:vt||Eo(r,t);case 6:var n=ut,s=yr;ut=null,bn(e,t,r),ut=n,yr=s,ut!==null&&(yr?(e=ut,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ut.removeChild(r.stateNode));break;case 18:ut!==null&&(yr?(e=ut,r=r.stateNode,e.nodeType===8?vd(e.parentNode,r):e.nodeType===1&&vd(e,r),li(e)):vd(ut,r.stateNode));break;case 4:n=ut,s=yr,ut=r.stateNode.containerInfo,yr=!0,bn(e,t,r),ut=n,yr=s;break;case 0:case 11:case 14:case 15:if(!vt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&zh(r,t,a),s=s.next}while(s!==n)}bn(e,t,r);break;case 1:if(!vt&&(Eo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Be(r,t,l)}bn(e,t,r);break;case 21:bn(e,t,r);break;case 22:r.mode&1?(vt=(n=vt)||r.memoizedState!==null,bn(e,t,r),vt=n):bn(e,t,r);break;default:bn(e,t,r)}}function Wg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new DN),t.forEach(function(n){var s=VN.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function cr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var o=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:ut=l.stateNode,yr=!1;break e;case 3:ut=l.stateNode.containerInfo,yr=!0;break e;case 4:ut=l.stateNode.containerInfo,yr=!0;break e}l=l.return}if(ut===null)throw Error(B(160));zw(o,a,s),ut=null,yr=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){Be(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Bw(t,e),t=t.sibling}function Bw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(cr(t,e),Ar(e),n&4){try{Ya(3,e,e.return),au(3,e)}catch(g){Be(e,e.return,g)}try{Ya(5,e,e.return)}catch(g){Be(e,e.return,g)}}break;case 1:cr(t,e),Ar(e),n&512&&r!==null&&Eo(r,r.return);break;case 5:if(cr(t,e),Ar(e),n&512&&r!==null&&Eo(r,r.return),e.flags&32){var s=e.stateNode;try{si(s,"")}catch(g){Be(e,e.return,g)}}if(n&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,a=r!==null?r.memoizedProps:o,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&u0(s,o),ph(l,a);var u=ph(l,o);for(a=0;a<c.length;a+=2){var d=c[a],f=c[a+1];d==="style"?m0(s,f):d==="dangerouslySetInnerHTML"?f0(s,f):d==="children"?si(s,f):Kf(s,d,f,u)}switch(l){case"input":ch(s,o);break;case"textarea":d0(s,o);break;case"select":var m=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?Po(s,!!o.multiple,p,!1):m!==!!o.multiple&&(o.defaultValue!=null?Po(s,!!o.multiple,o.defaultValue,!0):Po(s,!!o.multiple,o.multiple?[]:"",!1))}s[fi]=o}catch(g){Be(e,e.return,g)}}break;case 6:if(cr(t,e),Ar(e),n&4){if(e.stateNode===null)throw Error(B(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(g){Be(e,e.return,g)}}break;case 3:if(cr(t,e),Ar(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{li(t.containerInfo)}catch(g){Be(e,e.return,g)}break;case 4:cr(t,e),Ar(e);break;case 13:cr(t,e),Ar(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(jp=He())),n&4&&Wg(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(vt=(u=vt)||d,cr(t,e),vt=u):cr(t,e),Ar(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Q=e,d=e.child;d!==null;){for(f=Q=d;Q!==null;){switch(m=Q,p=m.child,m.tag){case 0:case 11:case 14:case 15:Ya(4,m,m.return);break;case 1:Eo(m,m.return);var x=m.stateNode;if(typeof x.componentWillUnmount=="function"){n=m,r=m.return;try{t=n,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(g){Be(n,r,g)}}break;case 5:Eo(m,m.return);break;case 22:if(m.memoizedState!==null){Vg(f);continue}}p!==null?(p.return=m,Q=p):Vg(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,u?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=f.stateNode,c=f.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=p0("display",a))}catch(g){Be(e,e.return,g)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){Be(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:cr(t,e),Ar(e),n&4&&Wg(e);break;case 21:break;default:cr(t,e),Ar(e)}}function Ar(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Uw(r)){var n=r;break e}r=r.return}throw Error(B(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(si(s,""),n.flags&=-33);var o=Bg(e);Hh(e,o,s);break;case 3:case 4:var a=n.stateNode.containerInfo,l=Bg(e);Wh(e,l,a);break;default:throw Error(B(161))}}catch(c){Be(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function LN(e,t,r){Q=e,Ww(e)}function Ww(e,t,r){for(var n=(e.mode&1)!==0;Q!==null;){var s=Q,o=s.child;if(s.tag===22&&n){var a=s.memoizedState!==null||wl;if(!a){var l=s.alternate,c=l!==null&&l.memoizedState!==null||vt;l=wl;var u=vt;if(wl=a,(vt=c)&&!u)for(Q=s;Q!==null;)a=Q,c=a.child,a.tag===22&&a.memoizedState!==null?Gg(s):c!==null?(c.return=a,Q=c):Gg(s);for(;o!==null;)Q=o,Ww(o),o=o.sibling;Q=s,wl=l,vt=u}Hg(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,Q=o):Hg(e)}}function Hg(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:vt||au(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!vt)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:fr(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Eg(t,o,n);break;case 3:var a=t.updateQueue;if(a!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Eg(t,a,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&li(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}vt||t.flags&512&&Bh(t)}catch(m){Be(t,t.return,m)}}if(t===e){Q=null;break}if(r=t.sibling,r!==null){r.return=t.return,Q=r;break}Q=t.return}}function Vg(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Q=r;break}Q=t.return}}function Gg(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{au(4,t)}catch(c){Be(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(c){Be(t,s,c)}}var o=t.return;try{Bh(t)}catch(c){Be(t,o,c)}break;case 5:var a=t.return;try{Bh(t)}catch(c){Be(t,a,c)}}}catch(c){Be(t,t.return,c)}if(t===e){Q=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Q=l;break}Q=t.return}}var $N=Math.ceil,jc=pn.ReactCurrentDispatcher,Cp=pn.ReactCurrentOwner,rr=pn.ReactCurrentBatchConfig,ke=0,nt=null,Ke=null,dt=0,$t=0,To=ts(0),Xe=0,wi=null,Os=0,iu=0,Np=0,Ja=null,Rt=null,jp=0,ra=1/0,Qr=null,Ec=!1,Vh=null,Vn=null,xl=!1,$n=null,Tc=0,Qa=0,Gh=null,Yl=-1,Jl=0;function kt(){return ke&6?He():Yl!==-1?Yl:Yl=He()}function Gn(e){return e.mode&1?ke&2&&dt!==0?dt&-dt:bN.transition!==null?(Jl===0&&(Jl=j0()),Jl):(e=Ne,e!==0||(e=window.event,e=e===void 0?16:O0(e.type)),e):1}function Sr(e,t,r,n){if(50<Qa)throw Qa=0,Gh=null,Error(B(185));Hi(e,r,n),(!(ke&2)||e!==nt)&&(e===nt&&(!(ke&2)&&(iu|=r),Xe===4&&Rn(e,dt)),Ot(e,n),r===1&&ke===0&&!(t.mode&1)&&(ra=He()+500,nu&&rs()))}function Ot(e,t){var r=e.callbackNode;bC(e,t);var n=hc(e,e===nt?dt:0);if(n===0)r!==null&&tg(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&tg(r),t===1)e.tag===0?xN(qg.bind(null,e)):Z0(qg.bind(null,e)),gN(function(){!(ke&6)&&rs()}),r=null;else{switch(E0(n)){case 1:r=Zf;break;case 4:r=C0;break;case 16:r=dc;break;case 536870912:r=N0;break;default:r=dc}r=Qw(r,Hw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Hw(e,t){if(Yl=-1,Jl=0,ke&6)throw Error(B(327));var r=e.callbackNode;if(Mo()&&e.callbackNode!==r)return null;var n=hc(e,e===nt?dt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Rc(e,n);else{t=n;var s=ke;ke|=2;var o=Gw();(nt!==e||dt!==t)&&(Qr=null,ra=He()+500,js(e,t));do try{zN();break}catch(l){Vw(e,l)}while(!0);hp(),jc.current=o,ke=s,Ke!==null?t=0:(nt=null,dt=0,t=Xe)}if(t!==0){if(t===2&&(s=wh(e),s!==0&&(n=s,t=qh(e,s))),t===1)throw r=wi,js(e,0),Rn(e,n),Ot(e,He()),r;if(t===6)Rn(e,n);else{if(s=e.current.alternate,!(n&30)&&!FN(s)&&(t=Rc(e,n),t===2&&(o=wh(e),o!==0&&(n=o,t=qh(e,o))),t===1))throw r=wi,js(e,0),Rn(e,n),Ot(e,He()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(B(345));case 2:fs(e,Rt,Qr);break;case 3:if(Rn(e,n),(n&130023424)===n&&(t=jp+500-He(),10<t)){if(hc(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){kt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=jh(fs.bind(null,e,Rt,Qr),t);break}fs(e,Rt,Qr);break;case 4:if(Rn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var a=31-br(n);o=1<<a,a=t[a],a>s&&(s=a),n&=~o}if(n=s,n=He()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*$N(n/1960))-n,10<n){e.timeoutHandle=jh(fs.bind(null,e,Rt,Qr),n);break}fs(e,Rt,Qr);break;case 5:fs(e,Rt,Qr);break;default:throw Error(B(329))}}}return Ot(e,He()),e.callbackNode===r?Hw.bind(null,e):null}function qh(e,t){var r=Ja;return e.current.memoizedState.isDehydrated&&(js(e,t).flags|=256),e=Rc(e,t),e!==2&&(t=Rt,Rt=r,t!==null&&Kh(t)),e}function Kh(e){Rt===null?Rt=e:Rt.push.apply(Rt,e)}function FN(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],o=s.getSnapshot;s=s.value;try{if(!_r(o(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Rn(e,t){for(t&=~Np,t&=~iu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-br(t),n=1<<r;e[r]=-1,t&=~n}}function qg(e){if(ke&6)throw Error(B(327));Mo();var t=hc(e,0);if(!(t&1))return Ot(e,He()),null;var r=Rc(e,t);if(e.tag!==0&&r===2){var n=wh(e);n!==0&&(t=n,r=qh(e,n))}if(r===1)throw r=wi,js(e,0),Rn(e,t),Ot(e,He()),r;if(r===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,fs(e,Rt,Qr),Ot(e,He()),null}function Ep(e,t){var r=ke;ke|=1;try{return e(t)}finally{ke=r,ke===0&&(ra=He()+500,nu&&rs())}}function Ds(e){$n!==null&&$n.tag===0&&!(ke&6)&&Mo();var t=ke;ke|=1;var r=rr.transition,n=Ne;try{if(rr.transition=null,Ne=1,e)return e()}finally{Ne=n,rr.transition=r,ke=t,!(ke&6)&&rs()}}function Tp(){$t=To.current,Oe(To)}function js(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,mN(r)),Ke!==null)for(r=Ke.return;r!==null;){var n=r;switch(cp(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&vc();break;case 3:ea(),Oe(At),Oe(wt),yp();break;case 5:vp(n);break;case 4:ea();break;case 13:Oe(Me);break;case 19:Oe(Me);break;case 10:fp(n.type._context);break;case 22:case 23:Tp()}r=r.return}if(nt=e,Ke=e=qn(e.current,null),dt=$t=t,Xe=0,wi=null,Np=iu=Os=0,Rt=Ja=null,ys!==null){for(t=0;t<ys.length;t++)if(r=ys[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,o=r.pending;if(o!==null){var a=o.next;o.next=s,n.next=a}r.pending=n}ys=null}return e}function Vw(e,t){do{var r=Ke;try{if(hp(),Gl.current=Nc,Cc){for(var n=Le.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Cc=!1}if(Is=0,rt=Qe=Le=null,Ka=!1,gi=0,Cp.current=null,r===null||r.return===null){Xe=1,wi=t,Ke=null;break}e:{var o=e,a=r.return,l=r,c=t;if(t=dt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var m=d.alternate;m?(d.updateQueue=m.updateQueue,d.memoizedState=m.memoizedState,d.lanes=m.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Og(a);if(p!==null){p.flags&=-257,Dg(p,a,l,o,t),p.mode&1&&Ig(o,u,t),t=p,c=u;var x=t.updateQueue;if(x===null){var g=new Set;g.add(c),t.updateQueue=g}else x.add(c);break e}else{if(!(t&1)){Ig(o,u,t),Rp();break e}c=Error(B(426))}}else if(De&&l.mode&1){var b=Og(a);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Dg(b,a,l,o,t),up(ta(c,l));break e}}o=c=ta(c,l),Xe!==4&&(Xe=2),Ja===null?Ja=[o]:Ja.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var y=Ew(o,c,t);jg(o,y);break e;case 1:l=c;var v=o.type,w=o.stateNode;if(!(o.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Vn===null||!Vn.has(w)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=Tw(o,l,t);jg(o,S);break e}}o=o.return}while(o!==null)}Kw(r)}catch(_){t=_,Ke===r&&r!==null&&(Ke=r=r.return);continue}break}while(!0)}function Gw(){var e=jc.current;return jc.current=Nc,e===null?Nc:e}function Rp(){(Xe===0||Xe===3||Xe===2)&&(Xe=4),nt===null||!(Os&268435455)&&!(iu&268435455)||Rn(nt,dt)}function Rc(e,t){var r=ke;ke|=2;var n=Gw();(nt!==e||dt!==t)&&(Qr=null,js(e,t));do try{UN();break}catch(s){Vw(e,s)}while(!0);if(hp(),ke=r,jc.current=n,Ke!==null)throw Error(B(261));return nt=null,dt=0,Xe}function UN(){for(;Ke!==null;)qw(Ke)}function zN(){for(;Ke!==null&&!hC();)qw(Ke)}function qw(e){var t=Jw(e.alternate,e,$t);e.memoizedProps=e.pendingProps,t===null?Kw(e):Ke=t,Cp.current=null}function Kw(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=ON(r,t),r!==null){r.flags&=32767,Ke=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xe=6,Ke=null;return}}else if(r=IN(r,t,$t),r!==null){Ke=r;return}if(t=t.sibling,t!==null){Ke=t;return}Ke=t=e}while(t!==null);Xe===0&&(Xe=5)}function fs(e,t,r){var n=Ne,s=rr.transition;try{rr.transition=null,Ne=1,BN(e,t,r,n)}finally{rr.transition=s,Ne=n}return null}function BN(e,t,r,n){do Mo();while($n!==null);if(ke&6)throw Error(B(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if(SC(e,o),e===nt&&(Ke=nt=null,dt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||xl||(xl=!0,Qw(dc,function(){return Mo(),null})),o=(r.flags&15990)!==0,r.subtreeFlags&15990||o){o=rr.transition,rr.transition=null;var a=Ne;Ne=1;var l=ke;ke|=4,Cp.current=null,MN(e,r),Bw(r,e),lN(Ch),fc=!!kh,Ch=kh=null,e.current=r,LN(r),fC(),ke=l,Ne=a,rr.transition=o}else e.current=r;if(xl&&(xl=!1,$n=e,Tc=s),o=e.pendingLanes,o===0&&(Vn=null),gC(r.stateNode),Ot(e,He()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(Ec)throw Ec=!1,e=Vh,Vh=null,e;return Tc&1&&e.tag!==0&&Mo(),o=e.pendingLanes,o&1?e===Gh?Qa++:(Qa=0,Gh=e):Qa=0,rs(),null}function Mo(){if($n!==null){var e=E0(Tc),t=rr.transition,r=Ne;try{if(rr.transition=null,Ne=16>e?16:e,$n===null)var n=!1;else{if(e=$n,$n=null,Tc=0,ke&6)throw Error(B(331));var s=ke;for(ke|=4,Q=e.current;Q!==null;){var o=Q,a=o.child;if(Q.flags&16){var l=o.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(Q=u;Q!==null;){var d=Q;switch(d.tag){case 0:case 11:case 15:Ya(8,d,o)}var f=d.child;if(f!==null)f.return=d,Q=f;else for(;Q!==null;){d=Q;var m=d.sibling,p=d.return;if(Fw(d),d===u){Q=null;break}if(m!==null){m.return=p,Q=m;break}Q=p}}}var x=o.alternate;if(x!==null){var g=x.child;if(g!==null){x.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}Q=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,Q=a;else e:for(;Q!==null;){if(o=Q,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ya(9,o,o.return)}var y=o.sibling;if(y!==null){y.return=o.return,Q=y;break e}Q=o.return}}var v=e.current;for(Q=v;Q!==null;){a=Q;var w=a.child;if(a.subtreeFlags&2064&&w!==null)w.return=a,Q=w;else e:for(a=v;Q!==null;){if(l=Q,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:au(9,l)}}catch(_){Be(l,l.return,_)}if(l===a){Q=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,Q=S;break e}Q=l.return}}if(ke=s,rs(),Ur&&typeof Ur.onPostCommitFiberRoot=="function")try{Ur.onPostCommitFiberRoot(Xc,e)}catch{}n=!0}return n}finally{Ne=r,rr.transition=t}}return!1}function Kg(e,t,r){t=ta(r,t),t=Ew(e,t,1),e=Hn(e,t,1),t=kt(),e!==null&&(Hi(e,1,t),Ot(e,t))}function Be(e,t,r){if(e.tag===3)Kg(e,e,r);else for(;t!==null;){if(t.tag===3){Kg(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Vn===null||!Vn.has(n))){e=ta(r,e),e=Tw(t,e,1),t=Hn(t,e,1),e=kt(),t!==null&&(Hi(t,1,e),Ot(t,e));break}}t=t.return}}function WN(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=kt(),e.pingedLanes|=e.suspendedLanes&r,nt===e&&(dt&r)===r&&(Xe===4||Xe===3&&(dt&130023424)===dt&&500>He()-jp?js(e,0):Np|=r),Ot(e,t)}function Yw(e,t){t===0&&(e.mode&1?(t=ul,ul<<=1,!(ul&130023424)&&(ul=4194304)):t=1);var r=kt();e=ln(e,t),e!==null&&(Hi(e,t,r),Ot(e,r))}function HN(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Yw(e,r)}function VN(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(B(314))}n!==null&&n.delete(t),Yw(e,r)}var Jw;Jw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||At.current)Pt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Pt=!1,AN(e,t,r);Pt=!!(e.flags&131072)}else Pt=!1,De&&t.flags&1048576&&ew(t,xc,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Kl(e,t),e=t.pendingProps;var s=Qo(t,wt.current);Do(t,r),s=xp(null,t,n,e,s,r);var o=bp();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,It(n)?(o=!0,yc(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,mp(t),s.updater=ou,t.stateNode=s,s._reactInternals=t,Oh(t,n,e,r),t=Lh(null,t,n,!0,o,r)):(t.tag=0,De&&o&&lp(t),St(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Kl(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=qN(n),e=fr(n,e),s){case 0:t=Mh(null,t,n,e,r);break e;case 1:t=$g(null,t,n,e,r);break e;case 11:t=Mg(null,t,n,e,r);break e;case 14:t=Lg(null,t,n,fr(n.type,e),r);break e}throw Error(B(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:fr(n,s),Mh(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:fr(n,s),$g(e,t,n,s,r);case 3:e:{if(Iw(t),e===null)throw Error(B(387));n=t.pendingProps,o=t.memoizedState,s=o.element,aw(e,t),_c(t,n,null,r);var a=t.memoizedState;if(n=a.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=ta(Error(B(423)),t),t=Fg(e,t,n,r,s);break e}else if(n!==s){s=ta(Error(B(424)),t),t=Fg(e,t,n,r,s);break e}else for(zt=Wn(t.stateNode.containerInfo.firstChild),Bt=t,De=!0,xr=null,r=sw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Xo(),n===s){t=cn(e,t,r);break e}St(e,t,n,r)}t=t.child}return t;case 5:return iw(t),e===null&&Ph(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,a=s.children,Nh(n,s)?a=null:o!==null&&Nh(n,o)&&(t.flags|=32),Aw(e,t),St(e,t,a,r),t.child;case 6:return e===null&&Ph(t),null;case 13:return Ow(e,t,r);case 4:return gp(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Zo(t,null,n,r):St(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:fr(n,s),Mg(e,t,n,s,r);case 7:return St(e,t,t.pendingProps,r),t.child;case 8:return St(e,t,t.pendingProps.children,r),t.child;case 12:return St(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,a=s.value,Pe(bc,n._currentValue),n._currentValue=a,o!==null)if(_r(o.value,a)){if(o.children===s.children&&!At.current){t=cn(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){a=o.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(o.tag===1){c=sn(-1,r&-r),c.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}o.lanes|=r,c=o.alternate,c!==null&&(c.lanes|=r),Ah(o.return,r,t),l.lanes|=r;break}c=c.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(B(341));a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Ah(a,r,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}St(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Do(t,r),s=or(s),n=n(s),t.flags|=1,St(e,t,n,r),t.child;case 14:return n=t.type,s=fr(n,t.pendingProps),s=fr(n.type,s),Lg(e,t,n,s,r);case 15:return Rw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:fr(n,s),Kl(e,t),t.tag=1,It(n)?(e=!0,yc(t)):e=!1,Do(t,r),jw(t,n,s),Oh(t,n,s,r),Lh(null,t,n,!0,e,r);case 19:return Dw(e,t,r);case 22:return Pw(e,t,r)}throw Error(B(156,t.tag))};function Qw(e,t){return k0(e,t)}function GN(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 7,566 bytes, line 40
40ype=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,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 tr(e,t,r,n){return new GN(e,t,r,n)}function Pp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qN(e){if(typeof e=="function")return Pp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Jf)return 11;if(e===Qf)return 14}return 2}function qn(e,t){var r=e.alternate;return r===null?(r=tr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Ql(e,t,r,n,s,o){var a=2;if(n=e,typeof e=="function")Pp(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case wo:return Es(r.children,s,o,t);case Yf:a=8,s|=8;break;case sh:return e=tr(12,r,t,s|2),e.elementType=sh,e.lanes=o,e;case oh:return e=tr(13,r,t,s),e.elementType=oh,e.lanes=o,e;case ah:return e=tr(19,r,t,s),e.elementType=ah,e.lanes=o,e;case i0:return lu(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case o0:a=10;break e;case a0:a=9;break e;case Jf:a=11;break e;case Qf:a=14;break e;case Nn:a=16,n=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=tr(a,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function Es(e,t,r,n){return e=tr(7,e,n,t),e.lanes=r,e}function lu(e,t,r,n){return e=tr(22,e,n,t),e.elementType=i0,e.lanes=r,e.stateNode={isHidden:!1},e}function Cd(e,t,r){return e=tr(6,e,null,t),e.lanes=r,e}function Nd(e,t,r){return t=tr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function KN(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ad(0),this.expirationTimes=ad(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ad(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Ap(e,t,r,n,s,o,a,l,c){return e=new KN(e,t,r,l,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=tr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},mp(o),e}function YN(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:yo,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Xw(e){if(!e)return Yn;e=e._reactInternals;e:{if(Ws(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(It(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var r=e.type;if(It(r))return X0(e,r,t)}return t}function Zw(e,t,r,n,s,o,a,l,c){return e=Ap(r,n,!0,e,s,o,a,l,c),e.context=Xw(null),r=e.current,n=kt(),s=Gn(r),o=sn(n,s),o.callback=t??null,Hn(r,o,s),e.current.lanes=s,Hi(e,s,n),Ot(e,n),e}function cu(e,t,r,n){var s=t.current,o=kt(),a=Gn(s);return r=Xw(r),t.context===null?t.context=r:t.pendingContext=r,t=sn(o,a),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Hn(s,t,a),e!==null&&(Sr(e,s,a,o),Vl(e,s,a)),a}function Pc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Yg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ip(e,t){Yg(e,t),(e=e.alternate)&&Yg(e,t)}function JN(){return null}var ex=typeof reportError=="function"?reportError:function(e){console.error(e)};function Op(e){this._internalRoot=e}uu.prototype.render=Op.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));cu(e,t,null,null)};uu.prototype.unmount=Op.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ds(function(){cu(null,e,null,null)}),t[an]=null}};function uu(e){this._internalRoot=e}uu.prototype.unstable_scheduleHydration=function(e){if(e){var t=P0();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Tn.length&&t!==0&&t<Tn[r].priority;r++);Tn.splice(r,0,e),r===0&&I0(e)}};function Dp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function du(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Jg(){}function QN(e,t,r,n,s){if(s){if(typeof n=="function"){var o=n;n=function(){var u=Pc(a);o.call(u)}}var a=Zw(t,n,e,0,null,!1,!1,"",Jg);return e._reactRootContainer=a,e[an]=a.current,di(e.nodeType===8?e.parentNode:e),Ds(),a}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var l=n;n=function(){var u=Pc(c);l.call(u)}}var c=Ap(e,0,!1,null,null,!1,!1,"",Jg);return e._reactRootContainer=c,e[an]=c.current,di(e.nodeType===8?e.parentNode:e),Ds(function(){cu(t,c,r,n)}),c}function hu(e,t,r,n,s){var o=r._reactRootContainer;if(o){var a=o;if(typeof s=="function"){var l=s;s=function(){var c=Pc(a);l.call(c)}}cu(t,a,e,s)}else a=QN(r,t,e,s,n);return Pc(a)}T0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=La(t.pendingLanes);r!==0&&(ep(t,r|1),Ot(t,He()),!(ke&6)&&(ra=He()+500,rs()))}break;case 13:Ds(function(){var n=ln(e,1);if(n!==null){var s=kt();Sr(n,e,1,s)}}),Ip(e,1)}};tp=function(e){if(e.tag===13){var t=ln(e,134217728);if(t!==null){var r=kt();Sr(t,e,134217728,r)}Ip(e,134217728)}};R0=function(e){if(e.tag===13){var t=Gn(e),r=ln(e,t);if(r!==null){var n=kt();Sr(r,e,t,n)}Ip(e,t)}};P0=function(){return Ne};A0=function(e,t){var r=Ne;try{return Ne=e,t()}finally{Ne=r}};gh=function(e,t,r){switch(t){case"input":if(ch(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=ru(n);if(!s)throw Error(B(90));c0(n),ch(n,s)}}}break;case"textarea":d0(e,r);break;case"select":t=r.value,t!=null&&Po(e,!!r.multiple,t,!1)}};y0=Ep;w0=Ds;var XN={usingClientEntryPoint:!1,Events:[Gi,_o,ru,g0,v0,Ep]},Ra={findFiberByHostInstance:vs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ZN={bundleType:Ra.bundleType,version:Ra.version,rendererPackageName:Ra.rendererPackageName,rendererConfig:Ra.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:pn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=S0(e),e===null?null:e.stateNode},findFiberByHostInstance:Ra.findFiberByHostInstance||JN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bl.isDisabled&&bl.supportsFiber)try{Xc=bl.inject(ZN),Ur=bl}catch{}}Vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=XN;Vt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dp(t))throw Error(B(200));return YN(e,t,null,r)};Vt.createRoot=function(e,t){if(!Dp(e))throw Error(B(299));var r=!1,n="",s=ex;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Ap(e,1,!1,null,null,r,!1,n,s),e[an]=t.current,di(e.nodeType===8?e.parentNode:e),new Op(t)};Vt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=S0(t),e=e===null?null:e.stateNode,e};Vt.flushSync=function(e){return Ds(e)};Vt.hydrate=function(e,t,r){if(!du(t))throw Error(B(200));return hu(null,e,t,!0,r)};Vt.hydrateRoot=function(e,t,r){if(!Dp(e))throw Error(B(405));var n=r!=null&&r.hydratedSources||null,s=!1,o="",a=ex;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(a=r.onRecoverableError)),t=Zw(t,null,e,1,r??null,s,!1,o,a),e[an]=t.current,di(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new uu(t)};Vt.render=function(e,t,r){if(!du(t))throw Error(B(200));return hu(null,e,t,!1,r)};Vt.unmountComponentAtNode=function(e){if(!du(e))throw Error(B(40));return e._reactRootContainer?(Ds(function(){hu(null,null,e,!1,function(){e._reactRootContainer=null,e[an]=null})}),!0):!1};Vt.unstable_batchedUpdates=Ep;Vt.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!du(r))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return hu(e,t,r,!1,n)};Vt.version="18.3.1-next-f1338f8080-20240426";function tx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tx)}catch(e){console.error(e)}}tx(),t0.exports=Vt;var Hs=t0.exports;const rx=Wy(Hs);var nx,Qg=Hs;nx=Qg.createRoot,Qg.hydrateRoot;const ej=1,tj=1e6;let jd=0;function rj(){return jd=(jd+1)%Number.MAX_SAFE_INTEGER,jd.toString()}const Ed=new Map,Xg=e=>{if(Ed.has(e))return;const t=setTimeout(()=>{Ed.delete(e),Xa({type:"REMOVE_TOAST",toastId:e})},tj);Ed.set(e,t)},nj=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ej)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Xg(r):e.toasts.forEach(n=>{Xg(n.id)}),{...e,toasts:e.toasts.map(n=>
vendor: 13,901 bytes, line 40
40n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Xl=[];let Zl={toasts:[]};function Xa(e){Zl=nj(Zl,e),Xl.forEach(t=>{t(Zl)})}function sj({...e}){const t=rj(),r=s=>Xa({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>Xa({type:"DISMISS_TOAST",toastId:t});return Xa({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function oj(){const[e,t]=h.useState(Zl);return h.useEffect(()=>(Xl.push(t),()=>{const r=Xl.indexOf(t);r>-1&&Xl.splice(r,1)}),[e]),{...e,toast:sj,dismiss:r=>Xa({type:"DISMISS_TOAST",toastId:r})}}function G(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Zg(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fu(...e){return t=>{let r=!1;const n=e.map(s=>{const o=Zg(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():Zg(e[s],null)}}}}function ye(...e){return h.useCallback(fu(...e),e)}function aj(e,t){const r=h.createContext(t),n=o=>{const{children:a,...l}=o,c=h.useMemo(()=>l,Object.values(l));return i.jsx(r.Provider,{value:c,children:a})};n.displayName=e+"Provider";function s(o){const a=h.useContext(r);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,s]}function qt(e,t=[]){let r=[];function n(o,a){const l=h.createContext(a),c=r.length;r=[...r,a];const u=f=>{var y;const{scope:m,children:p,...x}=f,g=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,b=h.useMemo(()=>x,Object.values(x));return i.jsx(g.Provider,{value:b,children:p})};u.displayName=o+"Provider";function d(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[u,d]}const s=()=>{const o=r.map(a=>h.createContext(a));return function(l){const c=(l==null?void 0:l[e])||o;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,ij(s,...t)]}function ij(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(o)[`__scope${u}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Ms(e){const t=cj(e),r=h.forwardRef((n,s)=>{const{children:o,...a}=n,l=h.Children.toArray(o),c=l.find(uj);if(c){const u=c.props.children,d=l.map(f=>f===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...a,ref:s,children:h.isValidElement(u)?h.cloneElement(u,void 0,d):null})}return i.jsx(t,{...a,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var lj=Ms("Slot");function cj(e){const t=h.forwardRef((r,n)=>{const{children:s,...o}=r;if(h.isValidElement(s)){const a=hj(s),l=dj(o,s.props);return s.type!==h.Fragment&&(l.ref=n?fu(n,a):a),h.cloneElement(s,l)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sx=Symbol("radix.slottable");function ox(e){const t=({children:r})=>i.jsx(i.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=sx,t}function uj(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sx}function dj(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...l)=>{const c=o(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function hj(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function pu(e){const t=e+"CollectionProvider",[r,n]=qt(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:b,children:y}=g,v=V.useRef(null),w=V.useRef(new Map).current;return i.jsx(s,{scope:b,itemMap:w,collectionRef:v,children:y})};a.displayName=t;const l=e+"CollectionSlot",c=Ms(l),u=V.forwardRef((g,b)=>{const{scope:y,children:v}=g,w=o(l,y),S=ye(b,w.collectionRef);return i.jsx(c,{ref:S,children:v})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",m=Ms(d),p=V.forwardRef((g,b)=>{const{scope:y,children:v,...w}=g,S=V.useRef(null),_=ye(b,S),k=o(d,y);return V.useEffect(()=>(k.itemMap.set(S,{ref:S,...w}),()=>void k.itemMap.delete(S))),i.jsx(m,{[f]:"",ref:_,children:v})});p.displayName=d;function x(g){const b=o(e+"CollectionConsumer",g);return V.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((k,C)=>w.indexOf(k.ref.current)-w.indexOf(C.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:u,ItemSlot:p},x,n]}var fj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],se=fj.reduce((e,t)=>{const r=Ms(`Primitive.${t}`),n=h.forwardRef((s,o)=>{const{asChild:a,...l}=s,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Mp(e,t){e&&Hs.flushSync(()=>e.dispatchEvent(t))}function Ve(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function pj(e,t=globalThis==null?void 0:globalThis.document){const r=Ve(e);h.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var mj="DismissableLayer",Yh="dismissableLayer.update",gj="dismissableLayer.pointerDownOutside",vj="dismissableLayer.focusOutside",ev,ax=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ua=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=e,u=h.useContext(ax),[d,f]=h.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=h.useState({}),x=ye(t,C=>f(C)),g=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(b),v=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=v>=y,_=wj(C=>{const j=C.target,P=[...u.branches].some(I=>I.contains(j));!S||P||(s==null||s(C),a==null||a(C),C.defaultPrevented||l==null||l())},m),k=xj(C=>{const j=C.target;[...u.branches].some(I=>I.contains(j))||(o==null||o(C),a==null||a(C),C.defaultPrevented||l==null||l())},m);return pj(C=>{v===u.layers.size-1&&(n==null||n(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},m),h.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ev=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),tv(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ev)}},[d,m,r,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),tv())},[d,u]),h.useEffect(()=>{const C=()=>p({});return document.addEventListener(Yh,C),()=>document.removeEventListener(Yh,C)},[]),i.jsx(se.div,{...c,ref:x,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:G(e.onFocusCapture,k.onFocusCapture),onBlurCapture:G(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:G(e.onPointerDownCapture,_.onPointerDownCapture)})});ua.displayName=mj;var yj="DismissableLayerBranch",ix=h.forwardRef((e,t)=>{const r=h.useContext(ax),n=h.useRef(null),s=ye(t,n);return h.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),i.jsx(se.div,{...e,ref:s})});ix.displayName=yj;function wj(e,t=globalThis==null?void 0:globalThis.document){const r=Ve(e),n=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const o=l=>{if(l.target&&!n.current){let c=function(){lx(gj,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function xj(e,t=globalThis==null?void 0:globalThis.document){const r=Ve(e),n=h.useRef(!1);return h.useEffect(()=>{const s=o=>{o.target&&!n.current&&lx(vj,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function tv(){const e=new CustomEvent(Yh);document.dispatchEvent(e)}function lx(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Mp(s,o):s.dispatchEvent(o)}var bj=ua,Sj=ix,tt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},_j="Portal",Ki=h.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[s,o]=h.useState(!1);tt(()=>o(!0),[]);const a=r||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?rx.createPortal(i.jsx(se.div,{...n,ref:t}),a):null});Ki.displayName=_j;function kj(e,t){return h.useReducer((r,n)=>t[r][n]??r,e)}var xt=e=>{const{present:t,children:r}=e,n=Cj(t),s=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),o=ye(n.ref,Nj(s));return typeof r=="function"||n.isPresent?h.cloneElement(s,{ref:o}):null};xt.displayName="Presence";function Cj(e){const[t,r]=h.useState(),n=h.useRef(null),s=h.useRef(e),o=h.useRef("none"),a=e?"mounted":"unmounted",[l,c]=kj(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=Sl(n.current);o.current=l==="mounted"?u:"none"},[l]),tt(()=>{const u=n.current,d=s.current;if(d!==e){const m=o.current,p=Sl(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),tt(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const g=Sl(n.current).includes(p.animationName);if(p.target===t&&g&&(c("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=p=>{p.target===t&&(o.current=Sl(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Sl(e){return(e==null?void 0:e.animationName)||"none"}function Nj(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var jj=Vf[" useInsertionEffect ".trim().toString()]||tt;function un({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,a]=Ej({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:s;{const d=h.useRef(e!==void 0);h.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,n])}const u=h.useCallback(d=>{var f;if(l){const m=Tj(d)?d(e):d;m!==e&&((f=a.current)==null||f.call(a,m))}else o(d)},[l,e,o,a]);return[c,u]}function Ej({defaultProp:e,onChange:t}){const[r,n]=h.useState(e),s=h.useRef(r),o=h.useRef(t);return jj(()=>{o.current=t},[t]),h.useEffect(()=>{var a;s.current!==r&&((a=o.current)==null||a.call(o,r),s.current=r)},[r,s]),[r,n,o]}function Tj(e){return typeof e=="function"}var cx=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Rj="VisuallyHidden",mu=h.forwardRef((e,t)=>i.jsx(se.span,{...e,ref:t,style:{...cx,...e.style}}));mu.displayName=Rj;var Pj=mu,Lp="ToastProvider",[$p,Aj,Ij]=pu("Toast"),[ux,n5]=qt("Toast",[Ij]),[Oj,gu]=ux(Lp),dx=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:a}=e,[l,c]=h.useState(null),[u,d]=h.useState(0),f=h.useRef(!1),m=h.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Lp}\`. Expected non-empty \`string\`.`),i.jsx($p.Provider,{scope:t,children:i.jsx(Oj,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:h.useCallback(()=>d(p=>p+1),[]),onToastRemove:h.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:m,children:a})})};dx.displayName=Lp;var hx="ToastViewport",Dj=["F8"],Jh="toast.viewportPause",Qh="toast.viewportResume",fx=h.forwardRef((e,t)=>
40{const{__scopeToast:r,hotkey:n=Dj,label:s="Notifications ({hotkey})",...o}=e,a=gu(hx,r),l=Aj(r),c=h.useRef(null),u=h.useRef(null),d=h.useRef(null),f=h.useRef(null),m=ye(t,f,a.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=a.toastCount>0;h.useEffect(()=>{const b=y=>{var w;n.length!==0&&n.every(S=>y[S]||y.code===S)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[n]),h.useEffect(()=>{const b=c.current,y=f.current;if(x&&b&&y){const v=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(Jh);y.dispatchEvent(k),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(Qh);y.dispatchEvent(k),a.isClosePausedRef.current=!1}},S=k=>{!b.contains(k.relatedTarget)&&w()},_=()=>{b.contains(document.activeElement)||w()};return b.addEventListener("focusin",v),b.addEventListener("focusout",S),b.addEventListener("pointermove",v),b.addEventListener("pointerleave",_),window.addEventListener("blur",v),window.addEventListener("focus",w),()=>{b.removeEventListener("focusin",v),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",v),b.removeEventListener("pointerleave",_),window.removeEventListener("blur",v),window.removeEventListener("focus",w)}}},[x,a.isClosePausedRef]);const g=h.useCallback(({tabbingDirection:b})=>{const v=l().map(w=>{const S=w.ref.current,_=[S,...Kj(S)];return b==="forwards"?_:_.reverse()});return(b==="forwards"?v.reverse():v).flat()},[l]);return h.useEffect(()=>{const b=f.current;if(b){const y=v=>{var _,k,C;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const j=document.activeElement,P=v.shiftKey;if(v.target===b&&P){(_=u.current)==null||_.focus();return}const D=g({tabbingDirection:P?"backwards":"forwards"}),$=D.findIndex(T=>T===j);Td(D.slice($+1))?v.preventDefault():P?(k=u.current)==null||k.focus():(C=d.current)==null||C.focus()}};return b.addEventListener("keydown",y),()=>b.removeEventListener("keydown",y)}},[l,g]),i.jsxs(Sj,{ref:c,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&i.jsx(Xh,{ref:u,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"forwards"});Td(b)}}),i.jsx($p.Slot,{scope:r,children:i.jsx(se.ol,{tabIndex:-1,...o,ref:m})}),x&&i.jsx(Xh,{ref:d,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"backwards"});Td(b)}})]})});fx.displayName=hx;var px="ToastFocusProxy",Xh=h.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=gu(px,r);return i.jsx(mu,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:a=>{var u;const l=a.relatedTarget;!((u=o.viewport)!=null&&u.contains(l))&&n()}})});Xh.displayName=px;var Yi="Toast",Mj="toast.swipeStart",Lj="toast.swipeMove",$j="toast.swipeCancel",Fj="toast.swipeEnd",mx=h.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...a}=e,[l,c]=un({prop:n,defaultProp:s??!0,onChange:o,caller:Yi});return i.jsx(xt,{present:r||l,children:i.jsx(Bj,{open:l,...a,ref:t,onClose:()=>c(!1),onPause:Ve(e.onPause),onResume:Ve(e.onResume),onSwipeStart:G(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:G(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:G(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:G(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});mx.displayName=Yi;var[Uj,zj]=ux(Yi,{onClose(){}}),Bj=h.forwardRef((e,t)=>
40{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:m,onSwipeEnd:p,...x}=e,g=gu(Yi,r),[b,y]=h.useState(null),v=ye(t,T=>y(T)),w=h.useRef(null),S=h.useRef(null),_=s||g.duration,k=h.useRef(0),C=h.useRef(_),j=h.useRef(0),{onToastAdd:P,onToastRemove:I}=g,F=Ve(()=>{var O;(b==null?void 0:b.contains(document.activeElement))&&((O=g.viewport)==null||O.focus()),a()}),D=h.useCallback(T=>{!T||T===1/0||(window.clearTimeout(j.current),k.current=new Date().getTime(),j.current=window.setTimeout(F,T))},[F]);h.useEffect(()=>{const T=g.viewport;if(T){const O=()=>{D(C.current),u==null||u()},A=()=>{const L=new Date().getTime()-k.current;C.current=C.current-L,window.clearTimeout(j.current),c==null||c()};return T.addEventListener(Jh,A),T.addEventListener(Qh,O),()=>{T.removeEventListener(Jh,A),T.removeEventListener(Qh,O)}}},[g.viewport,_,c,u,D]),h.useEffect(()=>{o&&!g.isClosePausedRef.current&&D(_)},[o,_,g.isClosePausedRef,D]),h.useEffect(()=>(P(),()=>I()),[P,I]);const $=h.useMemo(()=>b?Sx(b):null,[b]);return g.viewport?i.jsxs(i.Fragment,{children:[$&&i.jsx(Wj,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:$}),i.jsx(Uj,{scope:r,onClose:F,children:Hs.createPortal(i.jsx($p.ItemSlot,{scope:r,children:i.jsx(bj,{asChild:!0,onEscapeKeyDown:G(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||F(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(se.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":g.swipeDirection,...x,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:G(e.onKeyDown,T=>{T.key==="Escape"&&(l==null||l(T.nativeEvent),T.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,F()))}),onPointerDown:G(e.onPointerDown,T=>{T.button===0&&(w.current={x:T.clientX,y:T.clientY})}),onPointerMove:G(e.onPointerMove,T=>{if(!w.current)return;const O=T.clientX-w.current.x,A=T.clientY-w.current.y,L=!!S.current,E=["left","right"].includes(g.swipeDirection),N=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,z=E?N(0,O):0,Y=E?0:N(0,A),K=T.pointerType==="touch"?10:2,te={x:z,y:Y},Z={originalEvent:T,delta:te};L?(S.current=te,_l(Lj,f,Z,{discrete:!1})):rv(te,g.swipeDirection,K)?(S.current=te,_l(Mj,d,Z,{discrete:!1}),T.target.setPointerCapture(T.pointerId)):(Math.abs(O)>K||Math.abs(A)>K)&&(w.current=null)}),onPointerUp:G(e.onPointerUp,T=>{const O=S.current,A=T.target;if(A.hasPointerCapture(T.pointerId)&&A.releasePointerCapture(T.pointerId),S.current=null,w.current=null,O){const L=T.currentTarget,E={originalEvent:T,delta:O};rv(O,g.swipeDirection,g.swipeThreshold)?_l(Fj,p,E,{discrete:!0}):_l($j,m,E,{discrete:!0}),L.addEventListener("click",N=>N.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),Wj=e=>{const{__scopeToast:t,children:r,...n}=e,s=gu(Yi,t),[o,a]=h.useState(!1),[l,c]=h.useState(!1);return Gj(()=>a(!0)),h.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:i.jsx(Ki,{asChild:!0,children:i.jsx(mu,{...n,children:o&&i.jsxs(i.Fragment,{children:[s.label," ",r]})})})},Hj="ToastTitle",gx=h.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return i.jsx(se.div,{...n,ref:t})});gx.displayName=Hj;var Vj="ToastDescription",vx=h.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return i.jsx(se.div,{...n,ref:t})});vx.displayName=Vj;var yx="ToastAction",wx=h.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?i.jsx(bx,{altText:r,asChild:!0,children:i.jsx(Fp,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${yx}\`. Expected non-empty \`string\`.`),null)});wx.displayName=yx;var xx="ToastClose",Fp=h.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=zj(xx,r);return i.jsx(bx,{asChild:!0,children:i.jsx(se.button,{type:"button",...n,ref:t,onClick:G(e.onClick,s.onClose)})})});Fp.displayName=xx;var bx=h.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return i.jsx(se.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function Sx(e){const t=[];
vendor: 7,269 bytes, lines 40-105
40return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),qj(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...Sx(n))}}),t}function _l(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Mp(s,o):s.dispatchEvent(o)}var rv=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function Gj(e=()=>{}){const t=Ve(e);tt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function qj(e){return e.nodeType===e.ELEMENT_NODE}function Kj(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Td(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Yj=dx,_x=fx,kx=mx,Cx=gx,Nx=vx,jx=wx,Ex=Fp;function Tx(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Tx(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Rx(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Tx(e))&&(n&&(n+=" "),n+=t);return n}const nv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sv=Rx,vu=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return sv(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(u=>{const d=r==null?void 0:r[u],f=o==null?void 0:o[u];if(d===null)return null;const m=nv(d)||nv(f);return s[u][m]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,m]=d;return m===void 0||(u[f]=m),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:m,...p}=d;return Object.entries(p).every(x=>{let[g,b]=x;return Array.isArray(b)?b.includes({...o,...l}[g]):{...o,...l}[g]===b})?[...u,f,m]:u},[]);return sv(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)};/** 41 * @license lucide-react v0.462.0 - ISC 42 * 43 * This source code is licensed under the ISC license. 44 * See the LICENSE file in the root directory of this source tree. 45 */const Jj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Px=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** 46 * @license lucide-react v0.462.0 - ISC 47 * 48 * This source code is licensed under the ISC license. 49 * See the LICENSE file in the root directory of this source tree. 50 */var Qj={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"};/** 51 * @license lucide-react v0.462.0 - ISC 52 * 53 * This source code is licensed under the ISC license. 54 * See the LICENSE file in the root directory of this source tree. 55 */const Xj=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:a,...l},c)=>h.createElement("svg",{ref:c,...Qj,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Px("lucide",s),...l},[...a.map(([u,d])=>h.createElement(u,d)),...Array.isArray(o)?o:[o]]));/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const X=(e,t)=>{const r=h.forwardRef(({className:n,...s},o)=>h.createElement(Xj,{ref:o,iconNode:t,className:Px(`lucide-${Jj(e)}`,n),...s}));return r.displayName=`${e}`,r};/** 61 * @license lucide-react v0.462.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 Fr=X("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 66 * @license lucide-react v0.462.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 Up=X("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 71 * @license lucide-react v0.462.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 xi=X("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** 76 * @license lucide-react v0.462.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 Zh=X("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 81 * @license lucide-react v0.462.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 */const ov=X("BookmarkPlus",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}],["line",{x1:"12",x2:"12",y1:"7",y2:"13",key:"1cppfj"}],["line",{x1:"15",x2:"9",y1:"10",y2:"10",key:"1gty7f"}]]);/** 86 * @license lucide-react v0.462.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 av=X("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/** 91 * @license lucide-react v0.462.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 Rd=X("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** 96 * @license lucide-react v0.462.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 iv=X("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** 101 * @license lucide-react v0.462.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 Za=X("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
105],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 106 * @license lucide-react v0.462.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 yu=X("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 111 * @license lucide-react v0.462.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 Zj=X("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 116 * @license lucide-react v0.462.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 Br=X("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 121 * @license lucide-react v0.462.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 wu=X("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 126 * @license lucide-react v0.462.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 eE=X("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 131 * @license lucide-react v0.462.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 ef=X("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 136 * @license lucide-react v0.462.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 tE=X("CircleAlert",[["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"}]]);/** 141 * @license lucide-react v0.462.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 rE=X("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 146 * @license lucide-react v0.462.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 nE=X("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 151 * @license lucide-react v0.462.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 sE=X("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 156 * @license lucide-react v0.462.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 oE=X("CloudRain",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M16 14v6",key:"1j4efv"}],["path",{d:"M8 14v6",key:"17c4r9"}],["path",{d:"M12 16v6",key:"c8a4gj"}]]);/** 161 * @license lucide-react v0.462.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 tf=X("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** 166 * @license lucide-react v0.462.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 ec=X("Copy",[["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"}]]);/** 171 * @license lucide-react v0.462.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 zp=X("DollarSign",[["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"}]]);/** 176 * @license lucide-react v0.462.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 Pd=X("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 181 * @license lucide-react v0.462.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 lv=X("ExternalLink",[["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"}]]);/** 186 * @license lucide-react v0.462.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 aE=X("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 191 * @license lucide-react v0.462.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 cv=X("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** 196 * @license lucide-react v0.462.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 Bp=X("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 201 * @license lucide-react v0.462.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 iE=X("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/** 206 * @license lucide-react v0.462.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 bi=X("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 211 * @license lucide-react v0.462.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 Si=X("Image",[["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"}]]);/** 216 * @license lucide-react v0.462.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 lE=X("Lightbulb",[["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"}]]);/** 221 * @license lucide-react v0.462.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 ho=X("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 226 * @license lucide-react v0.462.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 cE=X("Lock",[["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"}]]);/** 231 * @license lucide-react v0.462.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 uE=X("MapPin",[["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"}]]);/** 236 * @license lucide-react v0.462.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 dE=X("MapPinned",[["path",{d:"M18 8c0 3.613-3.869 7.429-5.393 8.795a1 1 0 0 1-1.214 0C9.87 15.429 6 11.613 6 8a6 6 0 0 1 12 0",key:"11u0oz"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M8.714 14h-3.71a1 1 0 0 0-.948.683l-2.004 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .948-1.316l-2-6a1 1 0 0 0-.949-.684h-3.712",key:"q8zwxj"}]]);/** 241 * @license lucide-react v0.462.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 uv=X("MessageSquareQuote",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M8 12a2 2 0 0 0 2-2V8H8",key:"1jfesj"}],["path",{d:"M14 12a2 2 0 0 0 2-2V8h-2",key:"1dq9mh"}]]);/** 246 * @license lucide-react v0.462.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 Ax=X("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** 251 * @license lucide-react v0.462.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 hE=X("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** 256 * @license lucide-react v0.462.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 na=X("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** 261 * @license lucide-react v0.462.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 Ix=X("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 266 * @license lucide-react v0.462.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 fE=X("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 271 * @license lucide-react v0.462.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 Ox=X("Quote",[["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"}]]);/** 276 * @license lucide-react v0.462.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 _i=X("RefreshCw",[["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"}]]);/** 281 * @license lucide-react v0.462.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 pE=X("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 286 * @license lucide-react v0.462.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 Dx=X("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** 291 * @license lucide-react v0.462.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 mE=X("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 296 * @license lucide-react v0.462.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 Mx=X("Shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]]);/** 301 * @license lucide-react v0.462.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 Wp=X("Snowflake",[["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"m20 16-4-4 4-4",key:"rquw4f"}],["path",{d:"m4 8 4 4-4 4",key:"12s3z9"}],["path",{d:"m16 4-4 4-4-4",key:"1tumq1"}],["path",{d:"m8 20 4-4 4 4",key:"9p200w"}]]);/** 306 * @license lucide-react v0.462.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 Ze=X("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 311 * @license lucide-react v0.462.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 dn=X("Star",[["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"}]]);/** 316 * @license lucide-react v0.462.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 rf=X("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** 321 * @license lucide-react v0.462.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 nf=X("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 326 * @license lucide-react v0.462.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 gE=X("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 331 * @license lucide-react v0.462.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 sf=X("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 336 * @license lucide-react v0.462.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 Hp=X("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 341 * @license lucide-react v0.462.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 vE=X("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** 346 * @license lucide-react v0.462.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 yE=X("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/** 351 * @license lucide-react v0.462.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 Ts=X("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 356 * @license lucide-react v0.462.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 Lx=X("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 361 * @license lucide-react v0.462.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 xu=X("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** 366 * @license lucide-react v0.462.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 Ls=X("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 371 * @license lucide-react v0.462.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 Ji=X("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);/** 376 * @license lucide-react v0.462.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 wE=X("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Vp="-",xE=e=>{const t=SE(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const l=a.split(Vp);return l[0]===""&&l.length!==1&&l.shift(),$x(l,t)||bE(a)},getConflictingClassGroupIds:(a,l)=>{const c=r[a]||[];return l&&n[a]?[...c,...n[a]]:c}}},$x=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?$x(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Vp);return(a=t.validators.find(({validator:l})=>l(o)))==null?void 0:a.classGroupId},dv=/^\[(.+)\]$/,bE=e=>{if(dv.test(e)){const t=dv.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},SE=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return kE(Object.entries(e.classGroups),r).forEach(([o,a])=>{of(a,n,o,t)}),n},of=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:hv(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(_E(s)){of(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}
vendor: 4,829 bytes, line 380
380Object.entries(s).forEach(([o,a])=>{of(a,hv(t,o),r,n)})})},hv=(e,t)=>{let r=e;return t.split(Vp).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},_E=e=>e.isThemeGetter,kE=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,l])=>[t+a,l])):o);return[r,s]}):e,CE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return s(o,a),a},set(o,a){r.has(o)?r.set(o,a):s(o,a)}}},Fx="!",NE=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,a=l=>{const c=[];let u=0,d=0,f;for(let b=0;b<l.length;b++){let y=l[b];if(u===0){if(y===s&&(n||l.slice(b,b+o)===t)){c.push(l.slice(d,b)),d=b+o;continue}if(y==="/"){f=b;continue}}y==="["?u++:y==="]"&&u--}const m=c.length===0?l:l.substring(d),p=m.startsWith(Fx),x=p?m.substring(1):m,g=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:g}};return r?l=>r({className:l,parseClassName:a}):a},jE=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},EE=e=>({cache:CE(e.cacheSize),parseClassName:NE(e),...xE(e)}),TE=/\s+/,RE=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(TE);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}=r(u);let x=!!p,g=n(x?m.substring(0,p):m);if(!g){if(!x){l=u+(l.length>0?" "+l:l);continue}if(g=n(m),!g){l=u+(l.length>0?" "+l:l);continue}x=!1}const b=jE(d).join(":"),y=f?b+Fx:b,v=y+g;if(o.includes(v))continue;o.push(v);const w=s(g,x);for(let S=0;S<w.length;++S){const _=w[S];o.push(y+_)}l=u+(l.length>0?" "+l:l)}return l};function PE(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Ux(t))&&(n&&(n+=" "),n+=r);return n}const Ux=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ux(e[n]))&&(r&&(r+=" "),r+=t);return r};function AE(e,...t){let r,n,s,o=a;function a(c){const u=t.reduce((d,f)=>f(d),e());return r=EE(u),n=r.cache.get,s=r.cache.set,o=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=RE(c,r);return s(c,d),d}return function(){return o(PE.apply(null,arguments))}}const Ae=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},zx=/^\[(?:([a-z-]+):)?(.+)\]$/i,IE=/^\d+\/\d+$/,OE=new Set(["px","full","screen"]),DE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ME=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,LE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,$E=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yr=e=>Lo(e)||OE.has(e)||IE.test(e),Sn=e=>da(e,"length",qE),Lo=e=>!!e&&!Number.isNaN(Number(e)),Ad=e=>da(e,"number",Lo),Pa=e=>!!e&&Number.isInteger(Number(e)),UE=e=>e.endsWith("%")&&Lo(e.slice(0,-1)),ge=e=>zx.test(e),_n=e=>DE.test(e),zE=new Set(["length","size","percentage"]),BE=e=>da(e,zE,Bx),WE=e=>da(e,"position",Bx),HE=new Set(["image","url"]),VE=e=>da(e,HE,YE),GE=e=>da(e,"",KE),Aa=()=>!0,da=(e,t,r)=>{const n=zx.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},qE=e=>ME.test(e)&&!LE.test(e),Bx=()=>!1,KE=e=>$E.test(e),YE=e=>FE.test(e),JE=()=>{const e=Ae("colors"),t=Ae("spacing"),r=Ae("blur"),n=Ae("brightness"),s=Ae("borderColor"),o=Ae("borderRadius"),a=Ae("borderSpacing"),l=Ae("borderWidth"),c=Ae("contrast"),u=Ae("grayscale"),d=Ae("hueRotate"),f=Ae("invert"),m=Ae("gap"),p=Ae("gradientColorStops"),x=Ae("gradientColorStopPositions"),g=Ae("inset"),b=Ae("margin"),y=Ae("opacity"),v=Ae("padding"),w=Ae("saturate"),S=Ae("scale"),_=Ae("sepia"),k=Ae("skew"),C=Ae("space"),j=Ae("translate"),P=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",ge,t],D=()=>[ge,t],$=()=>["",Yr,Sn],T=()=>["auto",Lo,ge],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>["start","end","center","between","around","evenly","stretch"],N=()=>["","0",ge],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[Lo,ge];return{cacheSize:500,separator:":",theme:{colors:[Aa],spacing:[Yr,Sn],blur:["none","",_n,ge],brightness:Y(),borderColor:[e],borderRadius:["n
380one","","full",_n,ge],borderSpacing:D(),borderWidth:$(),contrast:Y(),grayscale:N(),hueRotate:Y(),invert:N(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[UE,Sn],inset:F(),margin:F(),opacity:Y(),padding:D(),saturate:Y(),scale:Y(),sepia:N(),skew:Y(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",ge]}],container:["container"],columns:[{columns:[_n]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...O(),ge]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pa,ge]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ge]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",Pa,ge]}],"grid-cols":[{"grid-cols":[Aa]}],"col-start-end":[{col:["auto",{span:["full",Pa,ge]},ge]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[Aa]}],"row-start-end":[{row:["auto",{span:[Pa,ge]},ge]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ge]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ge]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...E()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...E(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...E(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ge,t]}],"min-w":[{"min-w":[ge,t,"min","max","fit"]}],"max-w":[{"max-w":[ge,t,"none","full","min","max","fit","prose",{screen:[_n]},_n]}],h:[{h:[ge,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ge,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ge,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ge,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_n,Sn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ad]}],"font-family":[{font:[Aa]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ge]}],"line-clamp":[{"line-clamp":["none",Lo,Ad]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yr,ge]}],"list-image":[{"list-image":["none",ge]}],"list-style-type":[{list:["none","disc","decimal",ge]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yr,Sn]}],"underline-offset":[{"underline-offset":["auto",Yr,ge]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),WE]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",BE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},VE]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}
380],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...A(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}
vendor: 4,467 bytes, line 380
380],"divide-style":[{divide:A()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[Yr,ge]}],"outline-w":[{outline:[Yr,Sn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Yr,Sn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_n,GE]}],"shadow-color":[{shadow:[Aa]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",_n,ge]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ge]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",ge]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",ge]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Pa,ge]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ge]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Yr,Sn,Ad]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
380none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},QE=AE(JE);function ae(...e){return QE(Rx(e))}function Fa(e){return e.replace(/[^a-zA-Z0-9\s-]/g,"").replace(/\s+/g,"-").toLowerCase().trim()||"graphic"}function af(e){const t=e.replace(/\D/g,"").slice(0,10);return t.length===0?"":t.length<=3?`(${t}`:t.length<=6?`(${t.slice(0,3)}) ${t.slice(3)}`:`(${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6)}`}const XE=Yj,Wx=h.forwardRef(({className:e,...t},r)=>i.jsx(_x,{ref:r,className:ae("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Wx.displayName=_x.displayName;const ZE=vu("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Hx=h.forwardRef(({className:e,variant:t,...r},n)=>i.jsx(kx,{ref:n,className:ae(ZE({variant:t}),e),...r}));Hx.displayName=kx.displayName;const e2=h.forwardRef(({className:e,...t},r)=>i.jsx(jx,{ref:r,className:ae("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));e2.displayName=jx.displayName;const Vx=h.forwardRef(({className:e,...t},r)=>i.jsx(Ex,{ref:r,className:ae("absolute right-2 top-2 rounded-md p-1 text-foreground
380/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:i.jsx(Ls,{className:"h-4 w-4"})}));Vx.displayName=Ex.displayName;const Gx=h.forwardRef(({className:e,...t},r)=>i.jsx(Cx,{ref:r,className:ae("text-sm font-semibold",e),...t}));Gx.displayName=Cx.displayName;const qx=h.forwardRef(({className:e,...t},r)=>i.jsx(Nx,{ref:r,className:ae("text-sm opacity-90",e),...t}));qx.displayName=Nx.displayName;function t2(){const{toasts:e}=oj();return i.jsxs(XE,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return i.jsxs(Hx,{...o,children:[i.jsxs("div",{className:"grid gap-1",children:[r&&i.jsx(Gx,{children:r}),n&&i.jsx(qx,{children:n})]}),s,i.jsx(Vx,{})]},t)}),i.jsx(Wx,{})]})}var Ac=["light","dark"],Gp="(prefers-color-scheme: dark)",r2=typeof window>"u",qp=h.createContext(void 0),n2={setTheme:e=>{},themes:[]},Kx=()=>{var e;return(e=h.useContext(qp))!=null?e:n2},s2=e=>h.useContext(qp)?e.children:h.createElement(a2,{...e}),o2=["light","dark"],a2=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:n=!0,storageKey:s="theme",themes:o=o2,defaultTheme:a=r?"system":"light",attribute:l="data-theme",value:c,children:u,nonce:d})=>{let[f,m]=h.useState(()=>fv(s,a)),[p,x]=h.useState(()=>fv(s)),g=c?Object.values(c):o,b=h.useCallback(S=>{let _=S;if(!_)return;S==="system"&&r&&(_=pv());let k=c?c[_]:_,C=t?l2():null,j=document.documentElement;if(l==="class"?(j.classList.remove(...g),k&&j.classList.add(k)):k?j.setAttribute(l,k):j.removeAttribute(l),n){let P=Ac.includes(a)?a:null,I=Ac.includes(_)?_:P;j.style.colorScheme=I}C==null||C()},[]),y=h.useCallback(S=>{let _=typeof S=="function"?S(S):S;m(_);try{localStorage.setItem(s,_)}catch{}},[e]),v=h.useCallback(S=>{let _=pv(S);x(_),f==="system"&&r&&!e&&b("system")},[f,e]);h.useEffect(()=>{let S=window.matchMedia(Gp);return S.addListener(v),v(S),()=>S.removeListener(v)},[v]),h.useEffect(()=>{let S=_=>{if(_.key!==s)return;let k=_.newValue||a;y(k)};return window.addEventListener("storage",S),()=>window.removeEventListener("storage",S)},[y]),h.useEffect(()=>{b(e??f)},[e,f]);let w=h.useMemo(()=>({theme:f,setTheme:y,forcedTheme:e,resolvedTheme:f==="system"?p:f,themes:r?[...o,"system"]:o,systemTheme:r?p:void 0}),[f,y,e,p,r,o]);return h.createElement(qp.Provider,{value:w},h.createElement(i2,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:r,enableColorScheme:n,storageKey:s,themes:o,defaultTheme:a,attribute:l,value:c,children:u,attrs:g,nonce:d}),u)},i2=h.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:a,attrs:l,nonce:c})=>{let u=o==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(x=>`'${x}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,f=s?Ac.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(x,g=!1,b=!0)=>{let y=a?a[x]:x,v=g?x+"|| ''":`'${y}'`,w="";return s&&b&&!g&&Ac.includes(x)&&(w+=`d.style.colorScheme = '${x}';`),r==="class"?g||y?w+=`c.add(${v})`:w+="null":y&&(w+=`d[s](n,${v})`),w},p=e?`!function(){${d}${m(e)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${Gp}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${m(a?"x[e]":"e",!0)}}${u?"":"else{"+m(o,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${m(a?"x[e]":"e",!0)}}else{${m(o,!1,!1)};}${f}}catch(t){}}();`;return h.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})}),fv=(e,t)=>{if(r2)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},l2=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},pv=e=>
380(e||(e=window.matchMedia(Gp)),e.matches?"dark":"light"),c2=e=>{switch(e){case"success":return h2;case"info":return p2;case"warning":return f2;case"error":return m2;default:return null}},u2=Array(12).fill(0),d2=({visible:e,className:t})=>V.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},V.createElement("div",{className:"sonner-spinner"},u2.map((r,n)=>V.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),h2=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),f2=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},V.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),p2=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),m2=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),g2=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},V.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),V.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),v2=()=>{let[e,t]=V.useState(document.hidden);return V.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},lf=1,y2=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:lf++,o=this.toasts.find(l=>l.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:a,title:r}):l):this.addToast({title:r,...n,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
380this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,o,a=n.then(async c=>{if(o=["resolve",c],V.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(x2(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:d})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:d})}}).catch(async c=>{if(o=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:d})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>a.then(()=>o[0]==="reject"?u(o[1]):c(o[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||lf++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Tt=new y2,w2=(e,t)=>{let r=(t==null?void 0:t.id)||lf++;return Tt.addToast({title:e,...t,id:r}),r},x2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",b2=w2,S2=()=>Tt.toasts,_2=()=>Tt.getActiveToasts(),ne=Object.assign(b2,{success:Tt.success,info:Tt.info,warning:Tt.warning,error:Tt.error,custom:Tt.custom,message:Tt.message,promise:Tt.promise,dismiss:Tt.dismiss,loading:Tt.loading},{getHistory:S2,getToasts:_2});function k2(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}k2(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
380left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
380:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
380--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 381`);function kl(e){return e.label!==void 0}var C2=3,N2="32px",j2="16px",mv=4e3,E2=356,T2=14,R2=20,P2=200;function ur(...e){return e.filter(Boolean).join(" ")}function A2(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var I2=e=>{var t,r,n,s,o,a,l,c,u,d,f;let{invert:m,toast:p,unstyled:x,interacting:g,setHeights:b,visibleToasts:y,heights:v,index:w,toasts:S,expanded:_,removeToast:k,defaultRichColors:C,closeButton:j,style:P,cancelButtonStyle:I,actionButtonStyle:F,className:D="",descriptionClassName:$="",duration:T,position:O,gap:A,loadingIcon:L,expandByDefault:E,classNames:N,icons:z,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:K}=e,[te,Z]=V.useState(null),[ve,pe]=V.useState(null),[H,me]=V.useState(!1),[de,he]=V.useState(!1),[U,re]=V.useState(!1),[be,Fe]=V.useState(!1),[we,Ye]=V.useState(!1),[Kt,Yt]=V.useState(0),[Jt,yn]=V.useState(0),lr=V.useRef(p.duration||T||mv),jr=V.useRef(null),st=V.useRef(null),qs=w===0,ba=w+1<=y,We=p.type,Er=p.dismissible!==!1,qr=p.className||"",Tr=p.descriptionClassName||"",Ge=V.useMemo(()=>v.findIndex(ue=>ue.toastId===p.id)||0,[v,p.id]),Ks=V.useMemo(()=>{var ue;return(ue=p.closeButton)!=null?ue:j},[p.closeButton,j]),Ys=V.useMemo(()=>p.duration||T||mv,[p.duration,T]),Rr=V.useRef(0),Kr=V.useRef(0),Js=V.useRef(0),Pr=V.useRef(null),[Qs,Sa]=O.split("-"),as=V.useMemo(()=>v.reduce((ue,Se,je)=>je>=Ge?ue:ue+Se.height,0),[v,Ge]),is=v2(),W=p.invert||m,ce=We==="loading";Kr.current=V.useMemo(()=>Ge*A+as,[Ge,as]),V.useEffect(()=>{lr.current=Ys},[Ys]),V.useEffect(()=>{me(!0)},[]),V.useEffect(()=>{let ue=st.current;if(ue){let Se=ue.getBoundingClientRect().height;return yn(Se),b(je=>[{toastId:p.id,height:Se,position:p.position},...je]),()=>b(je=>je.filter(at=>at.toastId!==p.id))}},[b,p.id]),V.useLayoutEffect(()=>{if(!H)return;let ue=st.current,Se=ue.style.height;ue.style.height="auto";let je=ue.getBoundingClientRect().height;ue.style.height=Se,yn(je),b(at=>at.find(Et=>Et.toastId===p.id)?at.map(Et=>Et.toastId===p.id?{...Et,height:je}:Et):[{toastId:p.id,height:je,position:p.position},...at])},[H,p.title,p.description,b,p.id]);let ot=V.useCallback(()=>{he(!0),Yt(Kr.current),b(ue=>ue.filter(Se=>Se.toastId!==p.id)),setTimeout(()=>{k(p)},P2)},[p,k,b,Kr]);V.useEffect(()=>{if(p.promise&&We==="loading"||p.duration===1/0||p.type==="loading")return;let ue;return _||g||K&&is?(()=>
381{if(Js.current<Rr.current){let Se=new Date().getTime()-Rr.current;lr.current=lr.current-Se}Js.current=new Date().getTime()})():lr.current!==1/0&&(Rr.current=new Date().getTime(),ue=setTimeout(()=>{var Se;(Se=p.onAutoClose)==null||Se.call(p,p),ot()},lr.current)),()=>clearTimeout(ue)},[_,g,p,We,K,is,ot]),V.useEffect(()=>{p.delete&&ot()},[ot,p.delete]);function wn(){var ue,Se,je;return z!=null&&z.loading?V.createElement("div",{className:ur(N==null?void 0:N.loader,(ue=p==null?void 0:p.classNames)==null?void 0:ue.loader,"sonner-loader"),"data-visible":We==="loading"},z.loading):L?V.createElement("div",{className:ur(N==null?void 0:N.loader,(Se=p==null?void 0:p.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":We==="loading"},L):V.createElement(d2,{className:ur(N==null?void 0:N.loader,(je=p==null?void 0:p.classNames)==null?void 0:je.loader),visible:We==="loading"})}return V.createElement("li",{tabIndex:0,ref:st,className:ur(D,qr,N==null?void 0:N.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,N==null?void 0:N.default,N==null?void 0:N[We],(r=p==null?void 0:p.classNames)==null?void 0:r[We]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:C,"data-styled":!(p.jsx||p.unstyled||x),"data-mounted":H,"data-promise":!!p.promise,"data-swiped":we,"data-removed":de,"data-visible":ba,"data-y-position":Qs,"data-x-position":Sa,"data-index":w,"data-front":qs,"data-swiping":U,"data-dismissible":Er,"data-type":We,"data-invert":W,"data-swipe-out":be,"data-swipe-direction":ve,"data-expanded":!!(_||E&&H),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${de?Kt:Kr.current}px`,"--initial-height":E?"auto":`${Jt}px`,...P,...p.style},onDragEnd:()=>{re(!1),Z(null),Pr.current=null},onPointerDown:ue=>{ce||!Er||(jr.current=new Date,Yt(Kr.current),ue.target.setPointerCapture(ue.pointerId),ue.target.tagName!=="BUTTON"&&(re(!0),Pr.current={x:ue.clientX,y:ue.clientY}))},onPointerUp:()=>{var ue,Se,je,at;if(be||!Er)return;Pr.current=null;let Et=Number(((ue=st.current)==null?void 0:ue.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),R=Number(((Se=st.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),J=new Date().getTime()-((je=jr.current)==null?void 0:je.getTime()),oe=te==="x"?Et:R,_e=Math.abs(oe)/J;if(Math.abs(oe)>=R2||_e>.11){Yt(Kr.current),(at=p.onDismiss)==null||at.call(p,p),pe(te==="x"?Et>0?"right":"left":R>0?"down":"up"),ot(),Fe(!0),Ye(!1);return}re(!1),Z(null)},onPointerMove:ue=>{var Se,je,at,Et;if(!Pr.current||!Er||((Se=window.getSelection())==null?void 0:Se.toString().length)>0)return;let R=ue.clientY-Pr.current.y,J=ue.clientX-Pr.current.x,oe=(je=e.swipeDirections)!=null?je:A2(O);!te&&(Math.abs(J)>1||Math.abs(R)>1)&&Z(Math.abs(J)>Math.abs(R)?"x":"y");let _e={x:0,y:0};te==="y"?(oe.includes("top")||oe.includes("bottom"))&&(oe.includes("top")&&R<0||oe.includes("bottom")&&R>0)&&(_e.y=R):te==="x"&&(oe.includes("left")||oe.includes("right"))&&(oe.includes("left")&&J<0||oe.includes("right")&&J>0)&&(_e.x=J),(Math.abs(_e.x)>0||Math.abs(_e.y)>0)&&Ye(!0),(at=st.current)==null||at.style.setProperty("--swipe-amount-x",`${_e.x}px`),(Et=st.current)==null||Et.style.setProperty("--swipe-amount-y",`${_e.y}px`)}},Ks&&!p.jsx?V.createElement("button",{"aria-label":Y,"data-disabled":ce,"data-close-button":!0,onClick:ce||!Er?()=>{}:()=>{var ue;ot(),(ue=p.onDismiss)==null||ue.call(p,p)},className:ur(N==null?void 0:N.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(o=z==null?void 0:z.close)!=null?o:g2):null,p.jsx||h.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:V.createElement(V.Fragment,null,We||p.icon||p.promise?V.createElement("div",{"data-icon":"",className:ur(N==null?void 0:N.icon,(a=p==null?void 0:p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||wn():null,p.type!=="loading"?p.icon||(z==null?void 0:z[We])||c2(We):null):null,V.createElement("div",{"data-content":"",className:ur(N==null?void 0:N.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},V.createElement("div",{"data-title":"",className:ur(N==null?void 0:N.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?V.createElement("div",{"data-description":"",className:ur($,Tr,N==null?void 0:N.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),h.isValidElement(p.cancel)?p.cancel:p.cancel&&kl(p.cancel)?V.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||I,onClick:ue=>{var Se,je;kl(p.cancel)&&Er&&((je=(Se=p.cancel).onClick)==null||je.call(Se,ue),ot())},className:ur(N==null?void 0:N.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,h.isValidElement(p.action)?p.action:p.action&&kl(p.action)?V.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||F,onClick:ue=>{var Se,je;kl(p.action)&&((je=(Se=p.action).onClick)==null||je.call(Se,ue),!ue.defaultPrevented&&ot())},className:ur(N==null?void 0:N.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};
vendor: 5,404 bytes, line 381
381function gv(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function O2(e,t){let r={};return[e,t].forEach((n,s)=>{let o=s===1,a=o?"--mobile-offset":"--offset",l=o?j2:N2;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${a}-${u}`]=l:r[`${a}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}var D2=h.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:m,style:p,visibleToasts:x=C2,toastOptions:g,dir:b=gv(),gap:y=T2,loadingIcon:v,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:_}=e,[k,C]=V.useState([]),j=V.useMemo(()=>Array.from(new Set([n].concat(k.filter(K=>K.position).map(K=>K.position)))),[k,n]),[P,I]=V.useState([]),[F,D]=V.useState(!1),[$,T]=V.useState(!1),[O,A]=V.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=V.useRef(null),E=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=V.useRef(null),z=V.useRef(!1),Y=V.useCallback(K=>{C(te=>{var Z;return(Z=te.find(ve=>ve.id===K.id))!=null&&Z.delete||Tt.dismiss(K.id),te.filter(({id:ve})=>ve!==K.id)})},[]);return V.useEffect(()=>Tt.subscribe(K=>{if(K.dismiss){C(te=>te.map(Z=>Z.id===K.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{rx.flushSync(()=>{C(te=>{let Z=te.findIndex(ve=>ve.id===K.id);return Z!==-1?[...te.slice(0,Z),{...te[Z],...K},...te.slice(Z+1)]:[K,...te]})})})}),[]),V.useEffect(()=>{if(d!=="system"){A(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A("dark"):A("light")),typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:te})=>{A(te?"dark":"light")})}catch{K.addListener(({matches:Z})=>{try{A(Z?"dark":"light")}catch(ve){console.error(ve)}})}},[d]),V.useEffect(()=>{k.length<=1&&D(!1)},[k]),V.useEffect(()=>{let K=te=>{var Z,ve;s.every(pe=>te[pe]||te.code===pe)&&(D(!0),(Z=L.current)==null||Z.focus()),te.code==="Escape"&&(document.activeElement===L.current||(ve=L.current)!=null&&ve.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[s]),V.useEffect(()=>{if(L.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,z.current=!1)}},[L.current]),V.createElement("section",{ref:t,"aria-label":`${S} ${E}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((K,te)=>{var Z;let[ve,pe]=K.split("-");return k.length?V.createElement("ol",{key:K,dir:b==="auto"?gv():b,tabIndex:-1,ref:L,className:l,"data-sonner-toaster":!0,"data-theme":O,"data-y-position":ve,"data-lifted":F&&k.length>1&&!o,"data-x-position":pe,style:{"--front-toast-height":`${((Z=P[0])==null?void 0:Z.height)||0}px`,"--width":`${E2}px`,"--gap":`${y}px`,...p,...O2(c,u)},onBlur:H=>{z.current&&!H.currentTarget.contains(H.relatedTarget)&&(z.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||z.current||(z.current=!0,N.current=H.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{$||D(!1)},onDragEnd:()=>D(!1),onPointerDown:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||T(!0)},onPointerUp:()=>T(!1)},k.filter(H=>!H.position&&te===0||H.position===K).map((H,me)=>{var de,he;return V.createElement(I2,{key:H.id,icons:w,index:me,toast:H,defaultRichColors:f,duration:(de=g==null?void 0:g.duration)!=null?de:m,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:x,closeButton:(he=g==null?void 0:g.closeButton)!=null?he:a,interacting:$,position:K,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:Y,toasts:k.filter(U=>U.position==H.position),heights:P.filter(U=>U.position==H.position),setHeights:I,expandByDefault:o,gap:y,loadingIcon:v,expanded:F,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const M2=({...e})=>{const{theme:t="system"}=Kx();return i.jsx(D2,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var L2=Vf[" useId ".trim().toString()]||(()=>{}),$2=0;function nr(e){const[t,r]=h.useState(L2());return tt(()=>{e||r(n=>n??String($2++))},[e]),e||(t?`radix-${t}`:"")}const F2=["top","right","bottom","left"],Jn=Math.min,Ft=Math.max,Ic=Math.round,Cl=Math.floor,Qn=e=>({x:e,y:e}
vendor: 11,656 bytes, line 381
381),U2={left:"right",right:"left",bottom:"top",top:"bottom"},z2={start:"end",end:"start"};function cf(e,t,r){return Ft(e,Jn(t,r))}function hn(e,t){return typeof e=="function"?e(t):e}function fn(e){return e.split("-")[0]}function ha(e){return e.split("-")[1]}function Kp(e){return e==="x"?"y":"x"}function Yp(e){return e==="y"?"height":"width"}function Xn(e){return["top","bottom"].includes(fn(e))?"y":"x"}function Jp(e){return Kp(Xn(e))}function B2(e,t,r){r===void 0&&(r=!1);const n=ha(e),s=Jp(e),o=Yp(s);let a=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Oc(a)),[a,Oc(a)]}function W2(e){const t=Oc(e);return[uf(e),t,uf(t)]}function uf(e){return e.replace(/start|end/g,t=>z2[t])}function H2(e,t,r){const n=["left","right"],s=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:n:t?n:s;case"left":case"right":return t?o:a;default:return[]}}function V2(e,t,r,n){const s=ha(e);let o=H2(fn(e),r==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(uf)))),o}function Oc(e){return e.replace(/left|right|bottom|top/g,t=>U2[t])}function G2(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yx(e){return typeof e!="number"?G2(e):{top:e,right:e,bottom:e,left:e}}function Dc(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function vv(e,t,r){let{reference:n,floating:s}=e;const o=Xn(t),a=Jp(t),l=Yp(a),c=fn(t),u=o==="y",d=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,m=n[l]/2-s[l]/2;let p;switch(c){case"top":p={x:d,y:n.y-s.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-s.width,y:f};break;default:p={x:n.x,y:n.y}}switch(ha(t)){case"start":p[a]-=m*(r&&u?-1:1);break;case"end":p[a]+=m*(r&&u?-1:1);break}return p}const q2=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=vv(u,n,c),m=n,p={},x=0;for(let g=0;g<l.length;g++){const{name:b,fn:y}=l[g],{x:v,y:w,data:S,reset:_}=await y({x:d,y:f,initialPlacement:n,placement:m,strategy:s,middlewareData:p,rects:u,platform:a,elements:{reference:e,floating:t}});d=v??d,f=w??f,p={...p,[b]:{...p[b],...S}},_&&x<=50&&(x++,typeof _=="object"&&(_.placement&&(m=_.placement),_.rects&&(u=_.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):_.rects),{x:d,y:f}=vv(u,m,c)),g=-1)}return{x:d,y:f,placement:m,strategy:s,middlewareData:p}};async function ki(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:m=!1,padding:p=0}=hn(t,e),x=Yx(p),b=l[m?f==="floating"?"reference":"floating":f],y=Dc(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(b)))==null||r?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),v=f==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),S=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},_=Dc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(y.top-_.top+x.top)/S.y,bottom:(_.bottom-y.bottom+x.bottom)/S.y,left:(y.left-_.left+x.left)/S.x,right:(_.right-y.right+x.right)/S.x}}const K2=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=hn(e,t)||{};if(u==null)return{};const f=Yx(d),m={x:r,y:n},p=Jp(s),x=Yp(p),g=await a.getDimensions(u),b=p==="y",y=b?"top":"left",v=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=o.reference[x]+o.reference[p]-m[p]-o.floating[x],_=m[p]-o.reference[p],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let C=k?k[w]:0;(!C||!await(a.isElement==null?void 0:a.isElement(k)))&&(C=l.floating[w]||o.floating[x]);const j=S/2-_/2,P=C/2-g[x]/2-1,I=Jn(f[y],P),F=Jn(f[v],P),D=I,$=C-g[x]-F,T=C/2-g[x]/2+j,O=cf(D,T,$),A=!c.arrow&&ha(s)!=null&&T!==O&&o.reference[x]/2-(T<D?I:F)-g[x]/2<0,L=A?T<D?T-D:T-$:0;return{[p]:m[p]+L,data:{[p]:O,centerOffset:T-O-L,...A&&{alignmentOffset:L}},reset:A}}}),Y2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:g=!0,...b}=hn(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const y=fn(s),v=Xn(l),w=fn(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),_=m||(w||!g?[Oc(l)]:W2(l)),k=x!=="none";!m&&k&&_.push(...V2(l,g,x,S));const C=[l,..._],j=await ki(t,b),P=[];let I=((n=o.flip)==null?void 0:n.overflows)||[];if(d&&P.push(j[y]),f){const T=B2(s,a,S);P.push(j[T[0]],j[T[1]])}if(I=[...I,{placement:s,overflows:P}],!P.every(T=>T<=0)){var F,D;const T=(((F=o.flip)==null?void 0:F.index)||0)+1,O=C[T];if(O)return{data:{index:T,overflows:I},reset:{placement:O}};let A=(D=I.filter(L=>L.overflows[0]<=0).sort((L,E)=>L.overflows[1]-E.overflows[1])[0])==null?void 0:D.placement;if(!A)switch(p){case"bestFit":{var $;const L=($=I.filter(E=>{if(k){const N=Xn(E.placement);return N===v||N==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(N=>N>0).reduce((N,z)=>N+z,0)]).sort((E,N)=>E[1]-N[1])[0])==null?void 0:$[0];L&&(A=L);break}case"initialPlacement":A=l;break}if(s!==A)return{reset:{placement:A}}}return{}}}};function yv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wv(e){return F2.some(t=>e[t]>=0)}const J2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=hn(e,t);switch(n){case"referenceHidden":{const o=await ki(t,{...s,elementContext:"reference"}),a=yv(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:wv(a)}}}case"escaped":{const o=await ki(t,{...s,altBoundary:!0}),a=yv(o,r.floating);return{data:{escapedOffsets:a,escaped:wv(a)}}}default:return{}}}}};async function Q2(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=fn(r),l=ha(r),c=Xn(r)==="y",u=["left","top"].includes(a)?-1:1,d=o&&c?-1:1,f=hn(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof x=="number"&&(p=l==="end"?x*-1:x),c?{x:p*d,y:m*u}:{x:m*u,y:p*d}}const X2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:a,middlewareData:l}=t,c=await Q2(t,e);return a===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:a}}}}},Z2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:y,y:v}=b;return{x:y,y:v}}},...c}=hn(e,t),u={x:r,y:n},d=await ki(t,c),f=Xn(fn(s)),m=Kp(f);let p=u[m],x=u[f];if(o){const b=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=p+d[b],w=p-d[y];p=cf(v,p,w)}if(a){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",v=x+d[b],w=x-d[y];x=cf(v,x,w)}const g=l.fn({...t,[m]:p,[f]:x});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:o,[f]:a}}}}}},eT=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=hn(e,t),d={x:r,y:n},f=Xn(s),m=Kp(f);let p=d[m],x=d[f];const g=hn(l,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=m==="y"?"height":"width",S=o.reference[m]-o.floating[w]+b.mainAxis,_=o.reference[m]+o.reference[w]-b.mainAxis;p<S?p=S:p>_&&(p=_)}if(u){var y,v;const w=m==="y"?"width":"height",S=["top","left"].includes(fn(s)),_=o.reference[f]-o.floating[w]+(S&&((y=a.offset)==null?void 0:y[f])||0)+(S?0:b.crossAxis),k=o.reference[f]+o.reference[w]+(S?0:((v=a.offset)==null?void 0:v[f])||0)-(S?b.crossAxis:0);x<_?x=_:x>k&&(x=k)}return{[m]:p,[f]:x}}}},tT=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:a,elements:l}=t,{apply:c=()=>{},...u}=hn(e,t),d=await ki(t,u),f=fn(s),m=ha(s),p=Xn(s)==="y",{width:x,height:g}=o.floating;let b,y;f==="top"||f==="bottom"?(b=f,y=m===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(y=f,b=m==="end"?"top":"bottom");const v=g-d.top-d.bottom,w=x-d.left-d.right,S=Jn(g-d[b],v),_=Jn(x-d[y],w),k=!t.middlewareData.shift;let C=S,j=_;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(j=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=v),k&&!m){const I=Ft(d.left,0),F=Ft(d.right,0),D=Ft(d.top,0),$=Ft(d.bottom,0);p?j=x-2*(I!==0||F!==0?I+F:Ft(d.left,d.right)):C=g-2*(D!==0||$!==0?D+$:Ft(d.top,d.bottom))}await c({...t,availableWidth:j,availableHeight:C});const P=await a.getDimensions(l.floating);return x!==P.width||g!==P.height?{reset:{rects:!0}}:{}}}};function bu(){return typeof window<"u"}function fa(e){return Jx(e)?(e.nodeName||"").toLowerCase():"#document"}function Wt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vr(e){var t;return(t=(Jx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jx(e){return bu()?e instanceof Node||e instanceof Wt(e).Node:!1}function kr(e){return bu()?e instanceof Element||e instanceof Wt(e).Element:!1}function Hr(e){return bu()?e instanceof HTMLElement||e instanceof Wt(e).HTMLElement:!1}function xv(e){return!bu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wt(e).ShadowRoot}function Qi(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Cr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function rT(e){return["table","td","th"].includes(fa(e))}function Su(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Qp(e){const t=Xp(),r=kr(e)?Cr(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function nT(e){let t=Zn(e);for(;Hr(t)&&!sa(t);){if(Qp(t))return t;if(Su(t))return null;t=Zn(t)}return null}function Xp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function sa(e){return["html","body","#document"].includes(fa(e))}function Cr(e){return Wt(e).getComputedStyle(e)}function _u(e){return kr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zn(e){if(fa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xv(e)&&e.host||Vr(e);return xv(t)?t.host:t}function Qx(e){const t=Zn(e);return sa(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hr(t)&&Qi(t)?t:Qx(t)}function Ci(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Qx(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=Wt(s);if(o){const l=df(a);
vendor: 7,125 bytes, line 381
381return t.concat(a,a.visualViewport||[],Qi(s)?s:[],l&&r?Ci(l):[])}return t.concat(s,Ci(s,[],r))}function df(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xx(e){const t=Cr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Hr(e),o=s?e.offsetWidth:r,a=s?e.offsetHeight:n,l=Ic(r)!==o||Ic(n)!==a;return l&&(r=o,n=a),{width:r,height:n,$:l}}function Zp(e){return kr(e)?e:e.contextElement}function $o(e){const t=Zp(e);if(!Hr(t))return Qn(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=Xx(t);let a=(o?Ic(r.width):r.width)/n,l=(o?Ic(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const sT=Qn(0);function Zx(e){const t=Wt(e);return!Xp()||!t.visualViewport?sT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function oT(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Wt(e)?!1:t}function $s(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Zp(e);let a=Qn(1);t&&(n?kr(n)&&(a=$o(n)):a=$o(e));const l=oT(o,r,n)?Zx(o):Qn(0);let c=(s.left+l.x)/a.x,u=(s.top+l.y)/a.y,d=s.width/a.x,f=s.height/a.y;if(o){const m=Wt(o),p=n&&kr(n)?Wt(n):n;let x=m,g=df(x);for(;g&&n&&p!==x;){const b=$o(g),y=g.getBoundingClientRect(),v=Cr(g),w=y.left+(g.clientLeft+parseFloat(v.paddingLeft))*b.x,S=y.top+(g.clientTop+parseFloat(v.paddingTop))*b.y;c*=b.x,u*=b.y,d*=b.x,f*=b.y,c+=w,u+=S,x=Wt(g),g=df(x)}}return Dc({width:d,height:f,x:c,y:u})}function aT(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",a=Vr(n),l=t?Su(t.floating):!1;if(n===a||l&&o)return r;let c={scrollLeft:0,scrollTop:0},u=Qn(1);const d=Qn(0),f=Hr(n);if((f||!f&&!o)&&((fa(n)!=="body"||Qi(a))&&(c=_u(n)),Hr(n))){const m=$s(n);u=$o(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x,y:r.y*u.y-c.scrollTop*u.y+d.y}}function iT(e){return Array.from(e.getClientRects())}function hf(e,t){const r=_u(e).scrollLeft;return t?t.left+r:$s(Vr(e)).left+r}function lT(e){const t=Vr(e),r=_u(e),n=e.ownerDocument.body,s=Ft(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Ft(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+hf(e);const l=-r.scrollTop;return Cr(n).direction==="rtl"&&(a+=Ft(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:a,y:l}}function cT(e,t){const r=Wt(e),n=Vr(e),s=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,l=0,c=0;if(s){o=s.width,a=s.height;const u=Xp();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:o,height:a,x:l,y:c}}function uT(e,t){const r=$s(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=Hr(e)?$o(e):Qn(1),a=e.clientWidth*o.x,l=e.clientHeight*o.y,c=s*o.x,u=n*o.y;return{width:a,height:l,x:c,y:u}}function bv(e,t,r){let n;if(t==="viewport")n=cT(e,r);else if(t==="document")n=lT(Vr(e));else if(kr(t))n=uT(t,r);else{const s=Zx(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return Dc(n)}function eb(e,t){const r=Zn(e);return r===t||!kr(r)||sa(r)?!1:Cr(r).position==="fixed"||eb(r,t)}function dT(e,t){const r=t.get(e);if(r)return r;let n=Ci(e,[],!1).filter(l=>kr(l)&&fa(l)!=="body"),s=null;const o=Cr(e).position==="fixed";let a=o?Zn(e):e;for(;kr(a)&&!sa(a);){const l=Cr(a),c=Qp(a);!c&&l.position==="fixed"&&(s=null),(o?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Qi(a)&&!c&&eb(e,a))?n=n.filter(d=>d!==a):s=l,a=Zn(a)}return t.set(e,n),n}function hT(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[...r==="clippingAncestors"?Su(t)?[]:dT(t,this._c):[].concat(r),n],l=a[0],c=a.reduce((u,d)=>{const f=bv(t,d,s);return u.top=Ft(f.top,u.top),u.right=Jn(f.right,u.right),u.bottom=Jn(f.bottom,u.bottom),u.left=Ft(f.left,u.left),u},bv(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function fT(e){const{width:t,height:r}=Xx(e);return{width:t,height:r}}function pT(e,t,r){const n=Hr(t),s=Vr(t),o=r==="fixed",a=$s(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=Qn(0);if(n||!n&&!o)if((fa(t)!=="body"||Qi(s))&&(l=_u(t)),n){const p=$s(t,!0,o,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else s&&(c.x=hf(s));let u=0,d=0;if(s&&!n&&!o){const p=s.getBoundingClientRect();d=p.top+l.scrollTop,u=p.left+l.scrollLeft-hf(s,p)}const f=a.left+l.scrollLeft-c.x-u,m=a.top+l.scrollTop-c.y-d;return{x:f,y:m,width:a.width,height:a.height}}function Id(e){return Cr(e).position==="static"}function Sv(e,t){if(!Hr(e)||Cr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Vr(e)===r&&(r=r.ownerDocument.body),r}function tb(e,t){const r=Wt(e);if(Su(e))return r;if(!Hr(e)){let s=Zn(e);for(;s&&!sa(s);){if(kr(s)&&!Id(s))return s;s=Zn(s)}return r}let n=Sv(e,t);for(;n&&rT(n)&&Id(n);)n=Sv(n,t);return n&&sa(n)&&Id(n)&&!Qp(n)?r:n||nT(e)||r}const mT=async function(e){const t=this.getOffsetParent||tb,r=this.getDimensions,n=await r(e.floating);return{reference:pT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function gT(e){return Cr(e).direction==="rtl"}const vT={convertOffsetParentRelativeRectToViewportRelativeRect:aT,getDocumentElement:Vr,getClippingRect:hT,getOffsetParent:tb,getElementRects:mT,getClientRects:iT,getDimensions:fT,getScale:$o,isElement:kr,isRTL:gT};function yT(e,t){let r=null,n;const s=Vr(e);function o(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const{left:u,top:d,width:f,height:m}=e.getBoundingClientRect();if(l||t(),!f||!m)return;const p=Cl(d),x=Cl(s.clientWidth-(u+f)),g=Cl(s.clientHeight-(d+m)),b=Cl(u),v={rootMargin:-p+"px "+-x+"px "+-g+"px "+-b+"px",threshold:Ft(0,Jn(1,c))||1};let w=!0;function S(_){const k=_[0].intersectionRatio;if(k!==c){if(!w)return a();k?a(!1,k):n=setTimeout(()=>{a(!1,1e-7)},1e3)}w=!1}try{r=new IntersectionObserver(S,{...v,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,v)}r.observe(e)}return a(!0),o}function wT(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Zp(e),d=s||o?[...u?Ci(u):[],...Ci(t)]:[];d.forEach(y=>{s&&y.addEventListener("scroll",r,{passive:!0}),o&&y.addEventListener("resize",r)});const f=u&&l?yT(u,r):null;let m=-1,p=null;a&&(p=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),r()}),u&&!c&&p.observe(u),p.observe(t));let x,g=c?$s(e):null;c&&b();function b(){const y=$s(e);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&r(),g=y,x=requestAnimationFrame(b)}return r(),()=>{var y;d.forEach(v=>{s&&v.removeEventListener("scroll",r),o&&v.removeEventListener("resize",r)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(x)}}const xT=X2,bT=Z2,ST=Y2,_T=tT,kT=J2,_v=K2,CT=eT,NT=(e,t,r)=>{const n=new Map,s={platform:vT,...r},o={...s.platform,_c:n};return q2(e,t,{...s,platform:o})};var tc=typeof document<"u"?h.useLayoutEffect:h.useEffect;function Mc(e,t){if(e===t)return!0;
vendor: 9,835 bytes, line 381
381if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Mc(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!Mc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function rb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kv(e,t){const r=rb(e);return Math.round(t*r)/r}function Od(e){const t=h.useRef(e);return tc(()=>{t.current=e}),t}function jT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=h.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=h.useState(n);Mc(m,n)||p(n);const[x,g]=h.useState(null),[b,y]=h.useState(null),v=h.useCallback(E=>{E!==k.current&&(k.current=E,g(E))},[]),w=h.useCallback(E=>{E!==C.current&&(C.current=E,y(E))},[]),S=o||x,_=a||b,k=h.useRef(null),C=h.useRef(null),j=h.useRef(d),P=c!=null,I=Od(c),F=Od(s),D=Od(u),$=h.useCallback(()=>{if(!k.current||!C.current)return;const E={placement:t,strategy:r,middleware:m};F.current&&(E.platform=F.current),NT(k.current,C.current,E).then(N=>{const z={...N,isPositioned:D.current!==!1};T.current&&!Mc(j.current,z)&&(j.current=z,Hs.flushSync(()=>{f(z)}))})},[m,t,r,F,D]);tc(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(E=>({...E,isPositioned:!1})))},[u]);const T=h.useRef(!1);tc(()=>(T.current=!0,()=>{T.current=!1}),[]),tc(()=>{if(S&&(k.current=S),_&&(C.current=_),S&&_){if(I.current)return I.current(S,_,$);$()}},[S,_,$,I,P]);const O=h.useMemo(()=>({reference:k,floating:C,setReference:v,setFloating:w}),[v,w]),A=h.useMemo(()=>({reference:S,floating:_}),[S,_]),L=h.useMemo(()=>{const E={position:r,left:0,top:0};if(!A.floating)return E;const N=kv(A.floating,d.x),z=kv(A.floating,d.y);return l?{...E,transform:"translate("+N+"px, "+z+"px)",...rb(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:N,top:z}},[r,l,A.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:$,refs:O,elements:A,floatingStyles:L}),[d,$,O,A,L])}const ET=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?_v({element:n.current,padding:s}).fn(r):{}:n?_v({element:n,padding:s}).fn(r):{}}}},TT=(e,t)=>({...xT(e),options:[e,t]}),RT=(e,t)=>({...bT(e),options:[e,t]}),PT=(e,t)=>({...CT(e),options:[e,t]}),AT=(e,t)=>({...ST(e),options:[e,t]}),IT=(e,t)=>({..._T(e),options:[e,t]}),OT=(e,t)=>({...kT(e),options:[e,t]}),DT=(e,t)=>({...ET(e),options:[e,t]});var MT="Arrow",nb=h.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return i.jsx(se.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});nb.displayName=MT;var LT=nb;function $T(e){const[t,r]=h.useState(void 0);return tt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,l;if("borderBoxSize"in o){const c=o.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.blockSize}else a=e.offsetWidth,l=e.offsetHeight;r({width:a,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var em="Popper",[sb,pa]=qt(em),[FT,ob]=sb(em),ab=e=>{const{__scopePopper:t,children:r}=e,[n,s]=h.useState(null);return i.jsx(FT,{scope:t,anchor:n,onAnchorChange:s,children:r})};ab.displayName=em;var ib="PopperAnchor",lb=h.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=ob(ib,r),a=h.useRef(null),l=ye(t,a);return h.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:i.jsx(se.div,{...s,ref:l})});lb.displayName=ib;var tm="PopperContent",[UT,zT]=sb(tm),cb=h.forwardRef((e,t)=>{var H,me,de,he,U,re;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:x,...g}=e,b=ob(tm,r),[y,v]=h.useState(null),w=ye(t,be=>v(be)),[S,_]=h.useState(null),k=$T(S),C=(k==null?void 0:k.width)??0,j=(k==null?void 0:k.height)??0,P=n+(o!=="center"?"-"+o:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(u)?u:[u],D=F.length>0,$={padding:I,boundary:F.filter(WT),altBoundary:D},{refs:T,floatingStyles:O,placement:A,isPositioned:L,middlewareData:E}=jT({strategy:"fixed",placement:P,whileElementsMounted:(...be)=>wT(...be,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[TT({mainAxis:s+j,alignmentAxis:a}),c&&RT({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?PT():void 0,...$}),c&&AT({...$}),IT({...$,apply:({elements:be,rects:Fe,availableWidth:we,availableHeight:Ye})=>{const{width:Kt,height:Yt}=Fe.reference,Jt=be.floating.style;Jt.setProperty("--radix-popper-available-width",`${we}px`),Jt.setProperty("--radix-popper-available-height",`${Ye}px`),Jt.setProperty("--radix-popper-anchor-width",`${Kt}px`),Jt.setProperty("--radix-popper-anchor-height",`${Yt}px`)}}),S&&DT({element:S,padding:l}),HT({arrowWidth:C,arrowHeight:j}),m&&OT({strategy:"referenceHidden",...$})]}),[N,z]=hb(A),Y=Ve(x);tt(()=>{L&&(Y==null||Y())},[L,Y]);const K=(H=E.arrow)==null?void 0:H.x,te=(me=E.arrow)==null?void 0:me.y,Z=((de=E.arrow)==null?void 0:de.centerOffset)!==0,[ve,pe]=h.useState();return tt(()=>{y&&pe(window.getComputedStyle(y).zIndex)},[y]),i.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:L?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(he=E.transformOrigin)==null?void 0:he.x,(U=E.transformOrigin)==null?void 0:U.y].join(" "),...((re=E.hide)==null?void 0:re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(UT,{scope:r,placedSide:N,onArrowChange:_,arrowX:K,arrowY:te,shouldHideArrow:Z,children:i.jsx(se.div,{"data-side":N,"data-align":z,...g,ref:w,style:{...g.style,animation:L?void 0:"none"}})})})});cb.displayName=tm;var ub="PopperArrow",BT={top:"bottom",right:"left",bottom:"top",left:"right"},db=h.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=zT(ub,n),a=BT[o.placedSide];return i.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i.jsx(LT,{...s,ref:r,style:{...s.style,display:"block"}})})});db.displayName=ub;function WT(e){return e!==null}var HT=e=>({name:"transformOrigin",options:e,fn(t){var b,y,v;const{placement:r,rects:n,middlewareData:s}=t,a=((b=s.arrow)==null?void 0:b.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,d]=hb(r),f={start:"0%",center:"50%",end:"100%"}[d],m=(((y=s.arrow)==null?void 0:y.x)??0)+l/2,p=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let x="",g="";return u==="bottom"?(x=a?f:`${m}px`,g=`${-c}px`):u==="top"?(x=a?f:`${m}px`,g=`${n.floating.height+c}px`):u==="right"?(x=`${-c}px`,g=a?f:`${p}px`):u==="left"&&(x=`${n.floating.width+c}px`,g=a?f:`${p}px`),{data:{x,y:g}}}});function hb(e){const[t,r="center"]=e.split("-");return[t,r]}var rm=ab,nm=lb,sm=cb,om=db,[ku,s5]=qt("Tooltip",[pa]),Cu=pa(),fb="TooltipProvider",VT=700,ff="tooltip.open",[GT,am]=ku(fb),pb=e=>{const{__scopeTooltip:t,delayDuration:r=VT,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,a=h.useRef(!0),l=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),i.jsx(GT,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:h.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(u=>{l.current=u},[]),disableHoverableContent:s,children:o})};pb.displayName=fb;var Ni="Tooltip",[qT,Nu]=ku(Ni),mb=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:o,disableHoverableContent:a,delayDuration:l}=e,c=am(Ni,e.__scopeTooltip),u=Cu(t),[d,f]=h.useState(null),m=nr(),p=h.useRef(0),x=a??c.disableHoverableContent,g=l??c.delayDuration,b=h.useRef(!1),[y,v]=un({prop:n,defaultProp:s??!1,onChange:C=>{C?(c.onOpen(),document.dispatchEvent(new CustomEvent(ff))):c.onClose(),o==null||o(C)},caller:Ni}),w=h.useMemo(()=>y?b.current?"delayed-open":"instant-open":"closed",[y]),S=h.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,v(!0)},[v]),_=h.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),k=h.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,v(!0),p.current=0},g)},[g,v]);return h.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),i.jsx(rm,{...u,children:i.jsx(qT,{scope:t,contentId:m,open:y,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?k():S()},[c.isOpenDelayedRef,k,S]),onTriggerLeave:h.useCallback(()=>{x?_():(window.clearTimeout(p.current),p.current=0)},[_,x]),onOpen:S,onClose:_,disableHoverableContent:x,children:r})})};mb.displayName=Ni;var pf="TooltipTrigger",gb=h.forwardRef((e,t)=>
vendor: 5,617 bytes, line 381
381{const{__scopeTooltip:r,...n}=e,s=Nu(pf,r),o=am(pf,r),a=Cu(r),l=h.useRef(null),c=ye(t,l,s.onTriggerChange),u=h.useRef(!1),d=h.useRef(!1),f=h.useCallback(()=>u.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),i.jsx(nm,{asChild:!0,...a,children:i.jsx(se.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:G(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:G(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:G(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:G(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:G(e.onBlur,s.onClose),onClick:G(e.onClick,s.onClose)})})});gb.displayName=pf;var KT="TooltipPortal",[o5,YT]=ku(KT,{forceMount:void 0}),oa="TooltipContent",vb=h.forwardRef((e,t)=>{const r=YT(oa,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,a=Nu(oa,e.__scopeTooltip);return i.jsx(xt,{present:n||a.open,children:a.disableHoverableContent?i.jsx(yb,{side:s,...o,ref:t}):i.jsx(JT,{side:s,...o,ref:t})})}),JT=h.forwardRef((e,t)=>{const r=Nu(oa,e.__scopeTooltip),n=am(oa,e.__scopeTooltip),s=h.useRef(null),o=ye(t,s),[a,l]=h.useState(null),{trigger:c,onClose:u}=r,d=s.current,{onPointerInTransitChange:f}=n,m=h.useCallback(()=>{l(null),f(!1)},[f]),p=h.useCallback((x,g)=>{const b=x.currentTarget,y={x:x.clientX,y:x.clientY},v=tR(y,b.getBoundingClientRect()),w=rR(y,v),S=nR(g.getBoundingClientRect()),_=oR([...w,...S]);l(_),f(!0)},[f]);return h.useEffect(()=>()=>m(),[m]),h.useEffect(()=>{if(c&&d){const x=b=>p(b,d),g=b=>p(b,c);return c.addEventListener("pointerleave",x),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",g)}}},[c,d,p,m]),h.useEffect(()=>{if(a){const x=g=>{const b=g.target,y={x:g.clientX,y:g.clientY},v=(c==null?void 0:c.contains(b))||(d==null?void 0:d.contains(b)),w=!sR(y,a);v?m():w&&(m(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,d,a,u,m]),i.jsx(yb,{...e,ref:o})}),[QT,XT]=ku(Ni,{isInside:!1}),ZT=ox("TooltipContent"),yb=h.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...l}=e,c=Nu(oa,r),u=Cu(r),{onClose:d}=c;return h.useEffect(()=>(document.addEventListener(ff,d),()=>document.removeEventListener(ff,d)),[d]),h.useEffect(()=>{if(c.trigger){const f=m=>{const p=m.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),i.jsx(ua,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:i.jsxs(sm,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(ZT,{children:n}),i.jsx(QT,{scope:r,isInside:!0,children:i.jsx(Pj,{id:c.contentId,role:"tooltip",children:s||n})})]})})});vb.displayName=oa;var wb="TooltipArrow",eR=h.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Cu(r);return XT(wb,r).isInside?null:i.jsx(om,{...s,...n,ref:t})});eR.displayName=wb;function tR(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function rR(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function nR(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function sR(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],c=t[a],u=l.x,d=l.y,f=c.x,m=c.y;d>n!=m>n&&r<(f-u)*(n-d)/(m-d)+u&&(s=!s)}return s}function oR(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),aR(t)}function aR(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],a=r[r.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var iR=pb,lR=mb,cR=gb,xb=vb;const rc=iR,nc=lR,sc=cR,ei=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>i.jsx(xb,{ref:n,sideOffset:t,className:ae("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
381de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));ei.displayName=xb.displayName;var ju=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Eu=typeof window>"u"||"Deno"in globalThis;function pr(){}function uR(e,t){return typeof e=="function"?e(t):e}function dR(e){return typeof e=="number"&&e>=0&&e!==1/0}function hR(e,t){return Math.max(e+(t||0)-Date.now(),0)}function mf(e,t){return typeof e=="function"?e(t):e}function fR(e,t){return typeof e=="function"?e(t):e}function Cv(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:a,stale:l}=e;if(a){if(n){if(t.queryHash!==im(a,t.options))return!1}else if(!Ei(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||o&&!o(t))}function Nv(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(ji(t.options.mutationKey)!==ji(o))return!1}else if(!Ei(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function im(e,t){return((t==null?void 0:t.queryKeyHashFn)||ji)(e)}function ji(e){return JSON.stringify(e,(t,r)=>gf(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Ei(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Ei(e[r],t[r])):!1}function bb(e,t){if(e===t)return e;const r=jv(e)&&jv(t);if(r||gf(e)&&gf(t)){const n=r?e:Object.keys(e),s=n.length,o=r?t:Object.keys(t),a=o.length,l=r?[]:{},c=new Set(n);let u=0;for(let d=0;d<a;d++){const f=r?d:o[d];(!r&&c.has(f)||r)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=bb(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return s===a&&u===s?e:l}return t}function jv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gf(e){if(!Ev(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Ev(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ev(e){return Object.prototype.toString.call(e)==="[object Object]"}function pR(e){return new Promise(t=>{setTimeout(t,e)})}function mR(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?bb(e,t):t}function gR(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function vR(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var lm=Symbol();function Sb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===lm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var bs,An,Bo,Dy,yR=(Dy=class extends ju{constructor(){super();Ce(this,bs);Ce(this,An);Ce(this,Bo);fe(this,Bo,t=>{if(!Eu&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){M(this,An)||this.setEventListener(M(this,Bo))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,An))==null||t.call(this),fe(this,An,void 0))}setEventListener(t){var r;fe(this,Bo,t),(r=M(this,An))==null||r.call(this),fe(this,An,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){M(this,bs)!==t&&(fe(this,bs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof M(this,bs)=="boolean"?M(this,bs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},bs=new WeakMap,An=new WeakMap,Bo=new WeakMap,Dy),_b=new yR,Wo,In,Ho,My,wR=(My=class extends ju{constructor(){super();Ce(this,Wo,!0);Ce(this,In);Ce(this,Ho);fe(this,Ho,t=>{if(!Eu&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n
vendor: 4,353 bytes, line 381
381)}}})}onSubscribe(){M(this,In)||this.setEventListener(M(this,Ho))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,In))==null||t.call(this),fe(this,In,void 0))}setEventListener(t){var r;fe(this,Ho,t),(r=M(this,In))==null||r.call(this),fe(this,In,t(this.setOnline.bind(this)))}setOnline(t){M(this,Wo)!==t&&(fe(this,Wo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return M(this,Wo)}},Wo=new WeakMap,In=new WeakMap,Ho=new WeakMap,My),Lc=new wR;function xR(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function bR(e){return Math.min(1e3*2**e,3e4)}function kb(e){return(e??"online")==="online"?Lc.isOnline():!0}var Cb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Dd(e){return e instanceof Cb}function Nb(e){let t=!1,r=0,n=!1,s;const o=xR(),a=g=>{var b;n||(m(new Cb(g)),(b=e.abort)==null||b.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>_b.isFocused()&&(e.networkMode==="always"||Lc.isOnline())&&e.canRun(),d=()=>kb(e.networkMode)&&e.canRun(),f=g=>{var b;n||(n=!0,(b=e.onSuccess)==null||b.call(e,g),s==null||s(),o.resolve(g))},m=g=>{var b;n||(n=!0,(b=e.onError)==null||b.call(e,g),s==null||s(),o.reject(g))},p=()=>new Promise(g=>{var b;s=y=>{(n||u())&&g(y)},(b=e.onPause)==null||b.call(e)}).then(()=>{var g;s=void 0,n||(g=e.onContinue)==null||g.call(e)}),x=()=>{if(n)return;let g;const b=r===0?e.initialPromise:void 0;try{g=b??e.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(f).catch(y=>{var k;if(n)return;const v=e.retry??(Eu?0:3),w=e.retryDelay??bR,S=typeof w=="function"?w(r,y):w,_=v===!0||typeof v=="number"&&r<v||typeof v=="function"&&v(r,y);if(t||!_){m(y);return}r++,(k=e.onFail)==null||k.call(e,r,y),pR(S).then(()=>u()?void 0:p()).then(()=>{t?m(y):x()})})};return{promise:o,cancel:a,continue:()=>(s==null||s(),o),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?x():p().then(x),o)}}var SR=e=>setTimeout(e,0);function _R(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=SR;const o=l=>{t?e.push(l):s(()=>{r(l)})},a=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||a()}return c},batchCalls:l=>(...c)=>{o(()=>{l(...c)})},schedule:o,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var _t=_R(),Ss,Ly,jb=(Ly=class{constructor(){Ce(this,Ss)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dR(this.gcTime)&&fe(this,Ss,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Eu?1/0:5*60*1e3))}clearGcTimeout(){M(this,Ss)&&(clearTimeout(M(this,Ss)),fe(this,Ss,void 0))}},Ss=new WeakMap,Ly),Vo,_s,Xt,ks,gt,zi,Cs,gr,Jr,$y,kR=($y=class extends jb{constructor(t){super();Ce(this,gr);Ce(this,Vo);Ce(this,_s);Ce(this,Xt);Ce(this,ks);Ce(this,gt);Ce(this,zi);Ce(this,Cs);fe(this,Cs,!1),fe(this,zi,t.defaultOptions),this.setOptions(t.options),this.observers=[],fe(this,ks,t.client),fe(this,Xt,M(this,ks).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,fe(this,Vo,NR(this.options)),this.state=t.state??M(this,Vo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=M(this,gt))==null?void 0:t.promise}setOptions(t){this.options={...M(this,zi),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&M(this,Xt).remove(this)}setData(t,r){const n=mR(this.state.data,t,this.options);return ft(this,gr,Jr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ft(this,gr,Jr).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=M(this,gt))==null?void 0:n.promise;return(s=M(this,gt))==null||s.cancel(t),r?r.then(pr).catch(pr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(M(this,Vo))}isActive(){return this.observers.some(t=>fR(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lm||this.state.dataUpdateCount+this.state.errorUpdate
381Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>mf(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!hR(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=M(this,gt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=M(this,gt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),M(this,Xt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(M(this,gt)&&(M(this,Cs)?M(this,gt).cancel({revert:!0}):M(this,gt).cancelRetry()),this.scheduleGc()),M(this,Xt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ft(this,gr,Jr).call(this,{type:"invalidate"})}fetch(t,r){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(M(this,gt))return M(this,gt).continueRetry(),M(this,gt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const n=new AbortController,s=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(fe(this,Cs,!0),n.signal)})},o=()=>{const m=Sb(this.options,r),x=(()=>{const g={client:M(this,ks),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return fe(this,Cs,!1),this.options.persister?this.options.persister(m,x,this):m(x)},l=(()=>{const m={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:M(this,ks),state:this.state,fetchFn:o};return s(m),m})();(u=this.options.behavior)==null||u.onFetch(l,this),fe(this,_s,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&ft(this,gr,Jr).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=m=>{var p,x,g,b;Dd(m)&&m.silent||ft(this,gr,Jr).call(this,{type:"error",error:m}),Dd(m)||((x=(p=M(this,Xt).config).onError)==null||x.call(p,m,this),(b=(g=M(this,Xt).config).onSettled)==null||b.call(g,this.state.data,m,this)),this.scheduleGc()};return fe(this,gt,Nb({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:m=>{var p,x,g,b;if(m===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(y){c(y);return}(x=(p=M(this,Xt).config).onSuccess)==null||x.call(p,m,this),(b=(g=M(this,Xt).config).onSettled)==null||b.call(g,m,this.state.error,this),this.scheduleGc()},onError:c,onFail:(m,p)=>{ft(this,gr,Jr).call(this,{type:"failed",failureCount:m,error:p})},onPause:()=>{ft(this,gr,Jr).call(this,{type:"pause"})},onContinue:()=>{ft(this,gr,Jr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),M(this,gt).start()}},Vo=new WeakMap,_s=new WeakMap,Xt=new WeakMap,ks=new WeakMap,gt=new WeakMap,zi=new WeakMap,Cs=new WeakMap,gr=new WeakSet,Jr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...CR(n.data,this.options),fetchMeta:t.meta??null};case"success":return fe(this,_s,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Dd(s)&&s.revert&&M(this,_s)?{...M(this,_s),fetchStatus:"idle"}
vendor: 5,105 bytes, line 381
381:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),_t.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),M(this,Xt).notify({query:this,type:"updated",action:t})})},$y);function CR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function NR(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Or,Fy,jR=(Fy=class extends ju{constructor(t={}){super();Ce(this,Or);this.config=t,fe(this,Or,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??im(s,r);let a=this.get(o);return a||(a=new kR({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){M(this,Or).has(t.queryHash)||(M(this,Or).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=M(this,Or).get(t.queryHash);r&&(t.destroy(),r===t&&M(this,Or).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){_t.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return M(this,Or).get(t)}getAll(){return[...M(this,Or).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Cv(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Cv(t,n)):r}notify(t){_t.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){_t.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){_t.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Or=new WeakMap,Fy),Dr,bt,Ns,Mr,kn,Uy,ER=(Uy=class extends jb{constructor(t){super();Ce(this,Mr);Ce(this,Dr);Ce(this,bt);Ce(this,Ns);this.mutationId=t.mutationId,fe(this,bt,t.mutationCache),fe(this,Dr,[]),this.state=t.state||TR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){M(this,Dr).includes(t)||(M(this,Dr).push(t),this.clearGcTimeout(),M(this,bt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){fe(this,Dr,M(this,Dr).filter(r=>r!==t)),this.scheduleGc(),M(this,bt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){M(this,Dr).length||(this.state.status==="pending"?this.scheduleGc():M(this,bt).remove(this))}continue(){var t;return((t=M(this,Ns))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,l,c,u,d,f,m,p,x,g,b,y,v,w,S,_,k,C,j;const r=()=>{ft(this,Mr,kn).call(this,{type:"continue"})};fe(this,Ns,Nb({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,I)=>{ft(this,Mr,kn).call(this,{type:"failed",failureCount:P,error:I})},onPause:()=>{ft(this,Mr,kn).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>M(this,bt).canRun(this)}));const n=this.state.status==="pending",s=!M(this,Ns).canStart();try{if(n)r();else{ft(this,Mr,kn).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(o=M(this,bt).config).onMutate)==null?void 0:a.call(o,t,this));const I=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));I!==this.state.context&&ft(this,Mr,kn).call(this,{type:"pending",context:I,variables:t,isPaused:s})}const P=await M(this,Ns).start();return await((d=(u=M(this,bt).config).onSuccess)==null?void 0:d.call(u,P,t,this.state.context,this)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,P,t,this.state.context)),await((x=(p=M(this,bt).config).onSettled)==null?void 0:x.call(p,P,null,this.state.variables,this.state.context,this)),await((b=(g=this.options).onSettled)==null?void 0:b.call(g,P,null,t,this.state.context)),ft(this,Mr,kn).call(this,{type:"success",data:P}),P}catch(P){try{throw await((v=(y=M(this,bt).config).onError)==null?void 0:v.call(y,P,t,this.state.context,this)),await((S=(w=this.options).onError)==null?void 0:S.call(w,P,t,this.state.context)),await((k=(_=M(this,bt).config).onSettled)==null?void 0:k.call(_,void 0,P,this.state.variables,this.state.context,this)),await((j=(C=this.options).onSettled)==null?void 0:j.call(C,void 0,P,t,this.state.context)),P}finally{ft(this,Mr,kn).call(this,{type:"error",error:P})}}finally{M(this,bt).runNext(this)}}},Dr=new WeakMap,bt=new WeakMap,Ns=new WeakMap,Mr=new WeakSet,kn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};
381case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),_t.batch(()=>{M(this,Dr).forEach(n=>{n.onMutationUpdate(t)}),M(this,bt).notify({mutation:this,type:"updated",action:t})})},Uy);function TR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tn,vr,Bi,zy,RR=(zy=class extends ju{constructor(t={}){super();Ce(this,tn);Ce(this,vr);Ce(this,Bi);this.config=t,fe(this,tn,new Set),fe(this,vr,new Map),fe(this,Bi,0)}build(t,r,n){const s=new ER({mutationCache:this,mutationId:++sl(this,Bi)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){M(this,tn).add(t);const r=Nl(t);if(typeof r=="string"){const n=M(this,vr).get(r);n?n.push(t):M(this,vr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(M(this,tn).delete(t)){const r=Nl(t);if(typeof r=="string"){const n=M(this,vr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&M(this,vr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Nl(t);if(typeof r=="string"){const n=M(this,vr).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Nl(t);if(typeof r=="string"){const s=(n=M(this,vr).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){_t.batch(()=>{M(this,tn).forEach(t=>{this.notify({type:"removed",mutation:t})}),M(this,tn).clear(),M(this,vr).clear()})}getAll(){return Array.from(M(this,tn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Nv(r,n))}findAll(t={}){return this.getAll().filter(r=>Nv(t,r))}notify(t){_t.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>
vendor: 4,669 bytes, line 381
381r.state.isPaused);return _t.batch(()=>Promise.all(t.map(r=>r.continue().catch(pr))))}},tn=new WeakMap,vr=new WeakMap,Bi=new WeakMap,zy);function Nl(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Tv(e){return{onFetch:(t,r)=>{var d,f,m,p,x;const n=t.options,s=(m=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],a=((x=t.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const b=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},y=Sb(t.options,t.fetchOptions),v=async(w,S,_)=>{if(g)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const C=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:S,direction:_?"backward":"forward",meta:t.options.meta};return b(F),F})(),j=await y(C),{maxPages:P}=t.options,I=_?vR:gR;return{pages:I(w.pages,j,P),pageParams:I(w.pageParams,S,P)}};if(s&&o.length){const w=s==="backward",S=w?PR:Rv,_={pages:o,pageParams:a},k=S(n,_);l=await v(_,k,w)}else{const w=e??o.length;do{const S=c===0?a[0]??n.initialPageParam:Rv(n,l);if(c>0&&S==null)break;l=await v(l,S),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var g,b;return(b=(g=t.options).persister)==null?void 0:b.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Rv(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function PR(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ue,On,Dn,Go,qo,Mn,Ko,Yo,By,AR=(By=class{constructor(e={}){Ce(this,Ue);Ce(this,On);Ce(this,Dn);Ce(this,Go);Ce(this,qo);Ce(this,Mn);Ce(this,Ko);Ce(this,Yo);fe(this,Ue,e.queryCache||new jR),fe(this,On,e.mutationCache||new RR),fe(this,Dn,e.defaultOptions||{}),fe(this,Go,new Map),fe(this,qo,new Map),fe(this,Mn,0)}mount(){sl(this,Mn)._++,M(this,Mn)===1&&(fe(this,Ko,_b.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Ue).onFocus())})),fe(this,Yo,Lc.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Ue).onOnline())})))}unmount(){var e,t;sl(this,Mn)._--,M(this,Mn)===0&&((e=M(this,Ko))==null||e.call(this),fe(this,Ko,void 0),(t=M(this,Yo))==null||t.call(this),fe(this,Yo,void 0))}isFetching(e){return M(this,Ue).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return M(this,On).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=M(this,Ue).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=M(this,Ue).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(mf(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return M(this,Ue).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=M(this,Ue).get(n.queryHash),o=s==null?void 0:s.state.data,a=uR(t,o);if(a!==void 0)return M(this,Ue).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return _t.batch(()=>M(this,Ue).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=M(this,Ue).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=M(this,Ue);_t.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=M(this,Ue);return _t.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=_t.batch(()=>M(this,Ue).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(pr).catch(pr)}invalidateQueries(e,t={}){return _t.batch(()=>(M(this,Ue).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=_t.batch(()=>M(this,Ue).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(pr)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(pr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=M(this,Ue).build(this,t);return r.isStaleByTime(mf(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}
381prefetchQuery(e){return this.fetchQuery(e).then(pr).catch(pr)}fetchInfiniteQuery(e){return e.behavior=Tv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pr).catch(pr)}ensureInfiniteQueryData(e){return e.behavior=Tv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Lc.isOnline()?M(this,On).resumePausedMutations():Promise.resolve()}getQueryCache(){return M(this,Ue)}getMutationCache(){return M(this,On)}getDefaultOptions(){return M(this,Dn)}setDefaultOptions(e){fe(this,Dn,e)}setQueryDefaults(e,t){M(this,Go).set(ji(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...M(this,Go).values()],r={};return t.forEach(n=>{Ei(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){M(this,qo).set(ji(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...M(this,qo).values()],r={};return t.forEach(n=>{Ei(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...M(this,Dn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=im(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===lm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...M(this,Dn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){M(this,Ue).clear(),M(this,On).clear()}},Ue=new WeakMap,On=new WeakMap,Dn=new WeakMap,Go=new WeakMap,qo=new WeakMap,Mn=new WeakMap,Ko=new WeakMap,Yo=new WeakMap,By),IR=h.createContext(void 0),OR=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(IR.Provider,{value:e,children:t}));/** 382 * @remix-run/router v1.23.0 383 * 384 * Copyright (c) Remix Software Inc. 385 * 386 * This source code is licensed under the MIT license found in the 387 * LICENSE.md file in the root directory of this source tree. 388 * 389 * @license MIT 390 */function Ti(){return Ti=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ti.apply(this,arguments)}var Fn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Fn||(Fn={}));const Pv="popstate";function DR(e){e===void 0&&(e={});function t(n,s){let{pathname:o,search:a,hash:l}=n.location;return vf("",{pathname:o,search:a,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:Tb(s)}return LR(t,r,null,e)}function et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Eb(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function MR(){return Math.random().toString(36).substr(2,8)}function Av(e,t){return{usr:e.state,key:e.key,idx:t}}function vf(e,t,r,n){return r===void 0&&(r=null),Ti({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ma(t):t,{state:r,key:t&&t.key||n||MR()})}function Tb(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ma(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function LR(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,a=s.history,l=Fn.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(Ti({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function f(){l=Fn.Pop;let b=d(),y=b==null?null:b-u;u=b,c&&c({action:l,location:g.location,delta:y})}function m(b,y){l=Fn.Push;let v=vf(g.location,b,y);u=d()+1;let w=Av(v,u),S=g.createHref(v);try{a.pushState(w,"",S)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;s.location.assign(S)}o&&c&&c({action:l,location:g.location,delta:1})}function p(b,y){l=Fn.Replace;let v=vf(g.location,b,y);u=d();let w=Av(v,u),S=g.createHref(v);a.replaceState(w,"",S),o&&c&&c({action:l,location:g.location,delta:0})}function x(b){let y=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof b=="string"?b:Tb(b);return v=v.replace(/ $/,"%20"),et(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let g={get action(){return l},get location(){return e(s,a)},listen(b){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Pv,f),c=b,()=>{s.removeEventListener(Pv,f),c=null}},createHref(b){return t(s,b)},createURL:x,encodeLocation(b){let y=x(b);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:m,replace:p,go(b){return a.go(b)}};return g}var Iv;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Iv||(Iv={}));function $R(e,t,r){return r===void 0&&(r="/"),FR(e,t,r,!1)}function FR(e,t,r,n){let s=typeof t=="string"?ma(t):t,o=Ab(s.pathname||"/",r);if(o==null)return null;let a=Rb(e);UR(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let u=QR(o);l=YR(a[c],u,n)}return l}function Rb(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(o,a,l)=>{let c={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};c.relativePath.startsWith("/")&&(et(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not val
390id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Rs([n,c.relativePath]),d=r.concat(c);o.children&&o.children.length>0&&(et(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Rb(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:qR(u,o.index),routesMeta:d})};return e.forEach((o,a)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,a);else for(let c of Pb(o.path))s(o,a,c)}),t}function Pb(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let a=Pb(n.join("/")),l=[];return l.push(...a.map(c=>c===""?o:[o,c].join("/"))),s&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function UR(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:KR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const zR=/^:[\w-]+$/,BR=3,WR=2,HR=1,VR=10,GR=-2,Ov=e=>e==="*";function qR(e,t){let r=e.split("/"),n=r.length;return r.some(Ov)&&(n+=GR),t&&(n+=WR),r.filter(s=>!Ov(s)).reduce((s,o)=>s+(zR.test(o)?BR:o===""?HR:VR),n)}function KR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function YR(e,t,r){let{routesMeta:n}=e,s={},o="/",a=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=o==="/"?t:t.slice(o.length)||"/",f=Dv({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),m=c.route;if(!f&&u&&r&&!n[n.length-1].route.index&&(f=Dv({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;
vendor: 13,635 bytes, lines 390-408
390Object.assign(s,f.params),a.push({params:s,pathname:Rs([o,f.pathname]),pathnameBase:nP(Rs([o,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(o=Rs([o,f.pathnameBase]))}return a}function Dv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=JR(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let o=s[0],a=o.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:n.reduce((u,d,f)=>{let{paramName:m,isOptional:p}=d;if(m==="*"){let g=l[f]||"";a=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"$1")}const x=l[f];return p&&!x?u[m]=void 0:u[m]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:a,pattern:e}}function JR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Eb(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function QR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Eb(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ab(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function XR(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?ma(e):e;return{pathname:r?r.startsWith("/")?r:ZR(r,t):t,search:sP(n),hash:oP(s)}}function ZR(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Md(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function eP(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function tP(e,t){let r=eP(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function rP(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=ma(e):(s=Ti({},e),et(!s.pathname||!s.pathname.includes("?"),Md("?","pathname","search",s)),et(!s.pathname||!s.pathname.includes("#"),Md("#","pathname","hash",s)),et(!s.search||!s.search.includes("#"),Md("#","search","hash",s)));let o=e===""||s.pathname==="",a=o?"/":s.pathname,l;if(a==null)l=r;else{let f=t.length-1;if(!n&&a.startsWith("..")){let m=a.split("/");for(;m[0]==="..";)m.shift(),f-=1;s.pathname=m.join("/")}l=f>=0?t[f]:"/"}let c=XR(s,l),u=a&&a!=="/"&&a.endsWith("/"),d=(o||a===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Rs=e=>e.join("/").replace(/\/\/+/g,"/"),nP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function aP(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ib=["post","put","patch","delete"];new Set(Ib);const iP=["get",...Ib];new Set(iP);/** 391 * React Router v6.30.1 392 * 393 * Copyright (c) Remix Software Inc. 394 * 395 * This source code is licensed under the MIT license found in the 396 * LICENSE.md file in the root directory of this source tree. 397 * 398 * @license MIT 399 */function Ri(){return Ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ri.apply(this,arguments)}const cm=h.createContext(null),lP=h.createContext(null),Tu=h.createContext(null),Ru=h.createContext(null),ga=h.createContext({outlet:null,matches:[],isDataRoute:!1}),Ob=h.createContext(null);function Pu(){return h.useContext(Ru)!=null}function um(){return Pu()||et(!1),h.useContext(Ru).location}function Db(e){h.useContext(Tu).static||h.useLayoutEffect(e)}function Au(){let{isDataRoute:e}=h.useContext(ga);return e?bP():cP()}function cP(){Pu()||et(!1);let e=h.useContext(cm),{basename:t,future:r,navigator:n}=h.useContext(Tu),{matches:s}=h.useContext(ga),{pathname:o}=um(),a=JSON.stringify(tP(s,r.v7_relativeSplatPath)),l=h.useRef(!1);return Db(()=>{l.current=!0}),h.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=rP(u,JSON.parse(a),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Rs([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,a,o,e])}function uP(e,t){return dP(e,t)}function dP(e,t,r,n){Pu()||et(!1);let{navigator:s}=h.useContext(Tu),{matches:o}=h.useContext(ga),a=o[o.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=um(),d;if(t){var f;let b=typeof t=="string"?ma(t):t;c==="/"||(f=b.pathname)!=null&&f.startsWith(c)||et(!1),d=b}else d=u;let m=d.pathname||"/",p=m;if(c!=="/"){let b=c.replace(/^\//,"").split("/");p="/"+m.replace(/^\//,"").split("/").slice(b.length).join("/")}let x=$R(e,{pathname:p}),g=gP(x&&x.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Rs([c,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Rs([c,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),o,r,n);return t&&g?h.createElement(Ru.Provider,{value:{location:Ri({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Fn.Pop}},g):g}function hP(){let e=xP(),t=aP(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:s},r):null,null)}const fP=h.createElement(hP,null);class pP extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?h.createElement(ga.Provider,{value:this.props.routeContext},h.createElement(Ob.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mP(e){let{routeContext:t,match:r,children:n}=e,s=h.useContext(cm);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),h.createElement(ga.Provider,{value:t},n)}function gP(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=n)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,l=(s=r)==null?void 0:s.errors;if(l!=null){let d=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||et(!1),a=a.slice(0,Math.min(a.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<a.length;d++){let f=a[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:m,errors:p}=r,x=f.route.loader&&m[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||x){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,f,m)=>{let p,x=!1,g=null,b=null;r&&(p=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||fP,c&&(u<0&&m===0?(x=!0,b=null):u===m&&(x=!0,b=f.route.hydrateFallbackElement||null)));let y=t.concat(a.slice(0,m+1)),v=()=>{let w;return p?w=g:x?w=b:f.route.Component?w=h.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,h.createElement(mP,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:r!=null},children:w})};return r&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?h.createElement(pP,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var Mb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Mb||{}),$c=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}($c||{});function vP(e){let t=h.useContext(cm);return t||et(!1),t}function yP(e){let t=h.useContext(lP);return t||et(!1),t}function wP(e){let t=h.useContext(ga);return t||et(!1),t}function Lb(e){let t=wP(),r=t.matches[t.matches.length-1];return r.route.id||et(!1),r.route.id}function xP(){var e;let t=h.useContext(Ob),r=yP($c.UseRouteError),n=Lb($c.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function bP(){let{router:e}=vP(Mb.UseNavigateStable),t=Lb($c.UseNavigateStable),r=h.useRef(!1);return Db(()=>{r.current=!0}),h.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Ri({fromRouteId:t},o)))},[e,t])}function SP(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function oc(e){et(!1)}function _P(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Fn.Pop,navigator:o,static:a=!1,future:l}=e;Pu()&&et(!1);let c=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:c,navigator:o,static:a,future:Ri({v7_relativeSplatPath:!1},l)}),[c,l,o,a]);typeof n=="string"&&(n=ma(n));let{pathname:d="/",search:f="",hash:m="",state:p=null,key:x="default"}=n,g=h.useMemo(()=>{let b=Ab(d,c);return b==null?null:{location:{pathname:b,search:f,hash:m,state:p,key:x},navigationType:s}},[c,d,f,m,p,x,s]);return g==null?null:h.createElement(Tu.Provider,{value:u},h.createElement(Ru.Provider,{children:r,value:g}))}function kP(e){let{children:t,location:r}=e;return uP(yf(t),r)}new Promise(()=>{});function yf(e,t){t===void 0&&(t=[]);let r=[];return h.Children.forEach(e,(n,s)=>{if(!h.isValidElement(n))return;let o=[...t,s];if(n.type===h.Fragment){r.push.apply(r,yf(n.props.children,o));return}n.type!==oc&&et(!1),!n.props.index||!n.props.children||et(!1);let a={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=yf(n.props.children,o)),r.push(a)}),r}/** 400 * React Router DOM v6.30.1 401 * 402 * Copyright (c) Remix Software Inc. 403 * 404 * This source code is licensed under the MIT license found in the 405 * LICENSE.md file in the root directory of this source tree. 406 * 407 * @license MIT 408 */const CP="6";try{window.__reactRouterVersion=CP}catch{}const NP="startTransition",Mv=Vf[NP];function jP(e){let{basename:t,children:r,future:n,window:s}=e,o=h.useRef();o.current==null&&(o.current=DR({window:s,v5Compat:!0}));let a=o.current,[l,c]=h.useState({action:a.action,location:a.location}),{v7_startTransition:u}=n||{},d=h.useCallback(f=>{u&&Mv?Mv(()=>c(f)):c(f)},[c,u]);return h.useLayoutEffect(()=>a.listen(d),[a,d]),h.useEffect(()=>SP(n),[n]),h.createElement(_P,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:a,future:n})}var Lv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Lv||(Lv={}));var $v;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})($v||($v={}));const $b=h.createContext(void 0),EP=({children:e})=>i.jsx($b.Provider,{value:{user:null,session:null,isLoading:!1,isAdmin:!1,isSkipped:!0,userSettings:null,signUp:async()=>({error:null}),signIn:async()=>({error:null}),signOut:async()=>{},skipAuth:()=>{},updateUserSettings:async()=>{},refreshUserSettings:async()=>{}},children:e}),Xi=()=>{const e=h.useContext($b);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e};function TP(e,t,r,n){function s(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function l(d){try{u(n.next(d))}catch(f){a(f)}}function c(d){try{u(n.throw(d))}catch(f){a(f)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}const RP=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);
408class dm extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class PP extends dm{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Fv extends dm{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Uv extends dm{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var wf;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(wf||(wf={}));class AP{constructor(t,{headers:r={},customFetch:n,region:s=wf.Any}={}){this.url=t,this.headers=r,this.region=s,this.fetch=RP(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return TP(this,arguments,void 0,function*(r,n={}){var s;let o,a;try{const{headers:l,method:c,body:u,signal:d,timeout:f}=n;let m={},{region:p}=n;p||(p=this.region);const x=new URL(`${this.url}/${r}`);p&&p!=="any"&&(m["x-region"]=p,x.searchParams.set("forceFunctionRegion",p));let g;u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(m["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(m["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(m["Content-Type"]="application/json",g=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?g=JSON.stringify(u):g=u;let b=d;f&&(a=new AbortController,o=setTimeout(()=>a.abort(),f),d?(b=a.signal,d.addEventListener("abort",()=>a.abort())):b=a.signal);const y=yield this.fetch(x.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},m),this.headers),l),body:g,signal:b}).catch(_=>{throw new PP(_)}),v=y.headers.get("x-relay-error");if(v&&v==="true")throw new Fv(y);if(!y.ok)throw new Uv(y);let w=((s=y.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),S;return w==="application/json"?S=yield y.json():w==="application/octet-stream"||w==="application/pdf"?S=yield y.blob():w==="text/event-stream"?S=y:w==="multipart/form-data"?S=yield y.formData():S=yield y.text(),{data:S,error:null,response:y}}catch(l){return{data:null,error:l,response:l instanceof Uv||l instanceof Fv?l.context:void 0}}finally{o&&clearTimeout(o)}})}}var IP=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
408de=e.code}},OP=class{constructor(e){var t,r,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(n=e.urlLengthLimit)!==null&&n!==void 0?n:8e3,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var r=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const n=this.fetch;let s=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{let a=null,l=null,c=null,u=o.status,d=o.statusText;if(o.ok){var f,m;if(r.method!=="HEAD"){var p;const y=await o.text();y===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((p=r.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?l=y:l=JSON.parse(y))}const g=(f=r.headers.get("Prefer"))===null||f===void 0?void 0:f.match(/count=(exact|planned|estimated)/),b=(m=o.headers.get("content-range"))===null||m===void 0?void 0:m.split("/");g&&b&&b.length>1&&(c=parseInt(b[1])),r.isMaybeSingle&&r.method==="GET"&&Array.isArray(l)&&(l.length>1?(a={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,c=null,u=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{var x;const g=await o.text();try{a=JSON.parse(g),Array.isArray(a)&&o.status===404&&(l=[],a=null,u=200,d="OK")}catch{o.status===404&&g===""?(u=204,d="No Content"):a={message:g}}if(a&&r.isMaybeSingle&&(!(a==null||(x=a.details)===null||x===void 0)&&x.includes("0 rows"))&&(a=null,u=200,d="OK"),a&&r.shouldThrowOnError)throw new IP(a)}return{error:a,data:l,count:c,status:u,statusText:d}});return this.shouldThrowOnError||(s=s.catch(o=>{var a;let l="",c="",u="";const d=o==null?void 0:o.cause;if(d){var f,m,p,x;const y=(f=d==null?void 0:d.message)!==null&&f!==void 0?f:"",v=(m=d==null?void 0:d.code)!==null&&m!==void 0?m:"";l=`${(p=o==null?void 0:o.name)!==null&&p!==void 0?p:"FetchError"}: ${o==null?void 0:o.message}`,l+=` 409 410Caused by: ${(x=d==null?void 0:d.name)!==null&&x!==void 0?x:"Error"}: ${y}`,v&&(l+=` (${v})`),d!=null&&d.stack&&(l+=` 411${d.stack}`)}else{var g;l=(g=o==null?void 0:o.stack)!==null&&g!==void 0?g:""}const b=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(u="",c="Request was aborted (timeout or manual cancellation)",b>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${b} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",c="HTTP headers exceeded server limits (typically 16KB)",b>this.urlLengthLimit&&(c+=`. Your request URL is ${b} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{error:{message:`${(a=o==null?void 0:o.name)!==null&&a!==void 0?a:"FetchError"}: ${o==null?void 0:o.message}`,details:l,hint:c,code:u},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}returns(){return this}overrideTypes(){return this}},DP=class extends OP{select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const o=s?`${s}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,o=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(o,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
411explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:o="text"}={}){var a;const l=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${c}"; options=${l};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const zv=new RegExp("[,()]");var fo=class extends DP{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&zv.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&zv.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const o=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${o}.${t}`),this}match(e){return Object.entries(e).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},MP=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:s=8e3}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:n}=t??{},s=r?"HEAD":"GET";let o=!1;const a=(e??"*").split("").map(u=>/\s/.test(u)&&!o?"":(u==='"'&&(o=!o),u)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",a),n&&c.append("Prefer",`count=${n}`),new fo({method:s,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const s="POST",{url:o,headers:a}=this.cloneRequestState();if(t&&a.append("Prefer",`count=${t}`),r||a.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){const c=[...new Set(l)].map(u=>`"${u}"`);o.searchParams.set("columns",c.join(","))}}return new fo({method:s,url:o,headers:a,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var o;const a="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),n&&c.append("Prefer",`count=${n}`),s||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);l.searchParams.set("columns",d.join(","))}}return new fo({method:a,url:l,headers:c,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit})}update(e,{count:t}={}){var r;const n="PATCH",{url:s,headers:o}=this.cloneRequestState();return t&&o.append("Prefer",`count=${t}`),new fo({method:n,url:s,headers:o,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new fo({method:r,url:n,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit})}};function Pi(e){"@babel/helpers - typeof";return Pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pi(e)}function LP(e,t){if(Pi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $P(e){var t=LP(e,"string");return Pi(t)=="symbol"?t:t+""}function FP(e,t,r){return(t=$P(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function jl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
411t%2?Bv(Object(r),!0).forEach(function(n){FP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var UP=class Fb{constructor(t,{headers:r={},schema:n,fetch:s,timeout:o,urlLengthLimit:a=8e3}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=a;const l=s??globalThis.fetch;o!==void 0&&o>0?this.fetch=(c,u)=>{const d=new AbortController,f=setTimeout(()=>d.abort(),o),m=u==null?void 0:u.signal;if(m){if(m.aborted)return clearTimeout(f),l(c,u);const p=()=>{clearTimeout(f),d.abort()};return m.addEventListener("abort",p,{once:!0}),l(c,jl(jl({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(f),m.removeEventListener("abort",p)})}return l(c,jl(jl({},u),{},{signal:d.signal})).finally(()=>clearTimeout(f))}:this.fetch=l}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new MP(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(t){return new Fb(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(t,r={},{head:n=!1,get:s=!1,count:o}={}){var a;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),f=n&&Object.values(r).some(d);f?(l="POST",u=r):n||s?(l=n?"HEAD":"GET",Object.entries(r).filter(([p,x])=>x!==void 0).map(([p,x])=>[p,Array.isArray(x)?`{${x.join(",")}}`:`${x}`]).forEach(([p,x])=>{c.searchParams.append(p,x)})):(l="POST",u=r);const m=new Headers(this.headers);return f?m.set("Prefer",o?`count=${o},return=minimal`:"return=minimal"):o&&m.set("Prefer",`count=${o}`),new fo({method:l,url:c,headers:m,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit})}};class zP{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const s=n.node,o=parseInt(s.replace(/^v/,"").split(".")[0]);return o>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${o} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${o} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 412import ws from "ws" 413new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` 414 415Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){const n=this.getWebSocketConstructor();return new n(t,r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const BP="2.97.0",WP=`realtime-js/${BP}`,HP="1.0.0",Ub="2.0.0",Wv=Ub,xf=1e4,VP=1e3,GP=100;var En;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(En||(En={}));var Je;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Je||(Je={}));var wr;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(wr||(wr={}));var bf;(function(e){e.websocket="websocket"})(bf||(bf={}));var ms;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(ms||(ms={}));class qP{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},a=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(t,r,n){var s,o;const a=t.topic,l=(s=t.ref)!==null&&s!==void 0?s:"",c=(o=t.join_ref)!==null&&o!==void 0?o:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const m=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+a.length+u.length+f.length,p=new ArrayBuffer(this.HEADER_LENGTH+m);let x=new DataView(p),g=0;x.setUint8(g++,this.KINDS.userBroadcastPush),x.setUint8(g++,c.length),x.setUint8(g++,l.length),x.setUint8(g++,a.length),x.setUint8(g++,u.length),x.setUint8(g++,f.length),x.setUint8(g++,r),Array.from(c,y=>
415x.setUint8(g++,y.charCodeAt(0))),Array.from(l,y=>x.setUint8(g++,y.charCodeAt(0))),Array.from(a,y=>x.setUint8(g++,y.charCodeAt(0))),Array.from(u,y=>x.setUint8(g++,y.charCodeAt(0))),Array.from(f,y=>x.setUint8(g++,y.charCodeAt(0)));var b=new Uint8Array(p.byteLength+n.byteLength);return b.set(new Uint8Array(p),0),b.set(new Uint8Array(n),p.byteLength),b.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[s,o,a,l,c]=n;return r({join_ref:s,ref:o,topic:a,event:l,payload:c})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,s)}}_decodeUserBroadcast(t,r,n){const s=r.getUint8(1),o=r.getUint8(2),a=r.getUint8(3),l=r.getUint8(4);let c=this.HEADER_LENGTH+4;const u=n.decode(t.slice(c,c+s));c=c+s;const d=n.decode(t.slice(c,c+o));c=c+o;const f=n.decode(t.slice(c,c+a));c=c+a;const m=t.slice(c,t.byteLength),p=l===this.JSON_ENCODING?JSON.parse(n.decode(m)):m,x={type:this.BROADCAST_EVENT,event:d,payload:p};return a>0&&(x.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:x}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}class zb{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Re;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Re||(Re={}));const Hv=(e,t,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((o,a)=>(o[a]=KP(a,e,t,s),o),{}):{}},KP=(e,t,r,n)=>{const s=t.find(l=>
415l.name===e),o=s==null?void 0:s.type,a=r[e];return o&&!n.includes(o)?Bb(o,a):Sf(a)},Bb=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return XP(t,r)}switch(e){case Re.bool:return YP(t);case Re.float4:case Re.float8:case Re.int2:case Re.int4:case Re.int8:case Re.numeric:case Re.oid:return JP(t);case Re.json:case Re.jsonb:return QP(t);case Re.timestamp:return ZP(t);case Re.abstime:case Re.date:case Re.daterange:case Re.int4range:case Re.int8range:case Re.money:case Re.reltime:case Re.text:case Re.time:case Re.timestamptz:case Re.timetz:case Re.tsrange:case Re.tstzrange:return Sf(t);default:return Sf(t)}},Sf=e=>e,YP=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},JP=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},QP=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},XP=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let o;const a=e.slice(1,r);try{o=JSON.parse("["+a+"]")}catch{o=a?a.split(","):[]}return o.map(l=>Bb(t,l))}return e},ZP=e=>typeof e=="string"?e.replace(" ","T"):e,Wb=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class Ld{constructor(t,r,n={},s=xf){this.channel=t,this.event=r,this.payload=n,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var n;return this._hasReceived(t)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var Vv;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Vv||(Vv={}));class ti{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},s=>{const{onJoin:o,onLeave:a,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=ti.syncState(this.state,s,o,a),this.pendingDiffs.forEach(c=>{this.state=ti.syncDiff(this.state,c,o,a)}),this.pendingDiffs=[],l()}),this.channel._on(n.diff,{},s=>{const{onJoin:o,onLeave:a,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=ti.syncDiff(this.state,s,o,a),l())}),this.onJoin((s,o,a)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:o,newPresences:a})}),this.onLeave((s,o,a)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:o,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,n,s){const o=this.cloneDeep(t),a=this.transformState(r),l={},c={};return this.map(o,(u,d)=>{a[u]||(c[u]=d)}),this.map(a,(u,d)=>{const f=o[u];if(f){const m=d.map(b=>b.presence_ref),p=f.map(b=>b.presence_ref),x=d.filter(b=>p.indexOf(b.presence_ref)<0),g=f.filter(b=>m.indexOf(b.presence_ref)<0);x.length>0&&(l[u]=x),g.length>0&&(c[u]=g)}else l[u]=d}),this.syncDiff(o,{joins:l,leaves:c},n,s)}static syncDiff(t,r,n,s){const{joins:o,leaves:a}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),s||(s=()=>{}),this.map(o,(l,c)=>{var u;
415const d=(u=t[l])!==null&&u!==void 0?u:[];if(t[l]=this.cloneDeep(c),d.length>0){const f=t[l].map(p=>p.presence_ref),m=d.filter(p=>f.indexOf(p.presence_ref)<0);t[l].unshift(...m)}n(l,d,c)}),this.map(a,(l,c)=>{let u=t[l];if(!u)return;const d=c.map(f=>f.presence_ref);u=u.filter(f=>d.indexOf(f.presence_ref)<0),t[l]=u,s(l,u,c),u.length===0&&delete t[l]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const s=t[n];return"metas"in s?r[n]=s.metas.map(o=>(o.presence_ref=o.phx_ref,delete o.phx_ref,delete o.phx_ref_prev,o)):r[n]=s,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Gv;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Gv||(Gv={}));var ri;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ri||(ri={}));var Xr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Xr||(Xr={}));class Ro{constructor(t,r={config:{}},n){var s,o;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.state=Je.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new Ld(this,wr.join,this.params,this.timeout),this.rejoinTimer=new zb(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Je.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Je.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Je.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Je.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Je.errored,this.rejoinTimer.scheduleTimeout())}),this._on(wr.reply,{},(a,l)=>{this._trigger(this._replyEventName(l),a)}),this.presence=new ti(this),this.broadcastEndpointURL=Wb(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((o=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||o===void 0)&&o.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var n,s,o;if(this.socket.isConnected()||this.socket.connect(),this.state==Je.closed){const{config:{broadcast:a,presence:l,private:c}}=this.params,u=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(p=>p.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[ri.PRESENCE]&&this.bindings[ri.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,f={},m={broadcast:a,presence:Object.assign(Object.assign({},l),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(p=>t==null?void 0:t(Xr.CHANNEL_ERROR,p)),this._onClose(()=>t==null?void 0:t(Xr.CLOSED)),this.updateJoinPayload(Object.assign({config:m},f)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:p})=>{var x;if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(Xr.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,b=(x=g==null?void 0:g.length)!==null&&x!==void 0?x:0,y=[];for(let v=0;v<b;v++){const w=g[v],{filter:{event:S,schema:_,table:k,filter:C}}=w,j=p&&p[v];if(j&&j.event===S&&Ro.isFilterValueEqual(j.schema,_)&&Ro.isFilterValueEqual(j.table,k)&&Ro.isFilterValueEqual(j.filter,C))y.push(Object.assign(Object.assign({},w),{id:j.id}));else{this.unsubscribe(),this.state=Je.errored,t==null||t(Xr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=y,t&&t(Xr.SUBSCRIBED);return}}).receive("error",p=>{this.state=Je.errored,t==null||t(Xr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Xr.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){return this.state===Je.joined&&t===ri.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,r,n)}async httpSend(t,r,n={}){var s;if(r==null)return Promise.reject("Payload is required for httpSend()");const o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;
415try{const u=await l.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,r={}){var n,s;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:o,payload:a}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:a,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var a,l,c;const u=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(a=this.params)===null||a===void 0?void 0:a.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&o("ok"),u.receive("ok",()=>o("ok")),u.receive("error",()=>o("error")),u.receive("timeout",()=>o("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Je.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(wr.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(s=>{n=new Ld(this,wr.leave,{},t),n.receive("ok",()=>{r(),s("ok")}).receive("timeout",()=>{r(),s("timed out")}).receive("error",()=>{s("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Je.closed,this.bindings={}}async _fetchWithTimeout(t,r,n){const s=new AbortController,o=setTimeout(()=>s.abort(),n),a=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(o),a}_push(t,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new Ld(this,t,r,n);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>GP){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,n){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,n){var s,o;const a=t.toLocaleLowerCase(),{close:l,error:c,leave:u,join:d}=wr;if(n&&[l,c,u,d].indexOf(a)>=0&&n!==this._joinRef())return;let m=this._onMessage(a,r,n);if(r&&!m)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(p=>{var x,g,b;return((x=p.filter)===null||x===void 0?void 0:x.event)==="*"||((b=(g=p.filter)===null||g===void 0?void 0:g.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===a}).map(p=>p.callback(m,n)):(o=this.bindings[a])===null||o===void 0||o.filter(p=>{var x,g,b,y,v,w;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in p){const S=p.id,_=(x=p.filter)===null||x===void 0?void 0:x.event;return S&&((g=r.ids)===null||g===void 0?void 0:g.includes(S))&&(_==="*"||(_==null?void 0:_.toLocaleLowerCase())===((b=r.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))}else{const S=(v=(y=p==null?void 0:p.filter)===null||y===void 0?void 0:y.event)===null||v===void 0?void 0:v.toLocaleLowerCase();return S==="*"||S===((w=r==null?void 0:r.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===a}).map(p=>{if(typeof m=="object"&&"ids"in m){const x=m.data,{schema:g,table:b,commit_timestamp:y,type:v,errors:w}=x;m=Object.assign(Object.assign({},{schema:g,table:b,commit_timestamp:y,eventType:v,new:{},old:{},errors:w}),this._getPayloadRecords(x))}p.callback(m,n)})}_isClosed(){return this.state===Je.closed}_isJoined(){return this.state===Je.joined}_isJoining(){return this.state===Je.joining}_isLeaving(){return this.state===Je.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,n){const s=t.toLocaleLowerCase(),o={type:s,filter:r,callback:n};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this}_off(t,r){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(s=>{var o;return!(((o=s.type)===null||o===void 0?void 0:o.toLocaleLowerCase())===n&&Ro.isEqual(s.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(t[n]!==r[n])return!1;return!0}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(wr.close,{},t)}_onError(t){this._on(wr.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Je.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=Hv(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=Hv(t.columns,t.old_record)),r}}const $d=()=>{},El={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},eA=[1e3,2e3,5e3,1e4],tA=1e4,rA=` 416 addEventListener("message", (e) => { 417 if (e.data.event === "start") { 418 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 419 } 420 });`;class nA{constructor(t,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=xf,this.transport=null,this.heartbeatIntervalMs=El.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=$d,this.ref=0,this.reconnectTimer=null,this.vsn=Wv,this.logger=$d,this.conn=null,this.sendBuffer=[],this.serializer
420=new qP,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=s=>s?(...o)=>s(...o):(...o)=>fetch(...o),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${bf.websocket}`,this.httpEndpoint=Wb(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=zP.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const r=t.message;throw r.includes("Node.js")?new Error(`${r} 421 422To use Realtime in Node.js, you need to provide a WebSocket implementation: 423 424Option 1: Use Node.js 22+ which has native WebSocket support 425Option 2: Install and provide the "ws" package: 426 427 npm install ws 428 429 import ws from "ws" 430 const client = new RealtimeClient(url, { 431 ...options, 432 transport: ws 433 })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,n){this.logger(t,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case En.connecting:return ms.Connecting;case En.open:return ms.Open;case En.closing:return ms.Closing;default:return ms.Closed}}isConnected(){return this.connectionState()===ms.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const n=`realtime:${t}`,s=this.getChannels().find(o=>o.topic===n);if(s)return s;{const o=new Ro(`realtime:${t}`,r,this);return this.channels.push(o),o}}push(t){const{topic:r,event:n,payload:s,ref:o}=t,a=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${r} ${n} (${o})`,s),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(VP,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.sc
vendor: 3,886 bytes, line 433
433heduleTimeout()},El.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(n=>n.topic===t&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply"&&r.ref&&r.ref===this.pendingHeartbeatRef){const u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error",u)}catch(d){this.log("error","error in heartbeat callback",d)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:n,event:s,payload:o,ref:a}=r,l=a?`(${a})`:"",c=o.status||"";this.log("receive",`${c} ${n} ${s} ${l}`.trim(),o),this.channels.filter(u=>u._isMember(n)).forEach(u=>u._trigger(s,o,a)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===En.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===En.open||this.conn.readyState===En.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.sc
433heduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t);try{this.heartbeatCallback("error")}catch(r){this.log("error","error in heartbeat callback",r)}}_triggerChanError(){this.channels.forEach(t=>t._trigger(wr.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const n=t.match(/\?/)?"&":"?",s=new URLSearchParams(r);return`${t}${n}${s}`}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([rA],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r,n=!1;if(t)r=t,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const o={access_token:r,version:WP};r&&s.updateJoinPayload(o),s.joinedOnce&&s._isJoined()&&s._push(wr.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(n=>{try{n(r)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new zb(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},El.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,n,s,o,a,l,c,u,d,f,m,p;switch(this.transport=(r=t==null?void 0:t.transport)!==null&&r!==void 0?r:null,this.timeout=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:xf,this.heartbeatIntervalMs=(s=t==null?void 0:t.heartbeatIntervalMs)!==null&&s!==void 0?s:El.HEARTBEAT_INTERVAL,this.worker=(o=t==null?void 0:t.worker)!==null&&o!==void 0?o:!1,this.accessToken=(a=t==null?void 0:t.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(l=t==null?void 0:t.heartbeatCallback)!==null&&l!==void 0?l:$d,this.vsn=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:Wv,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:x=>eA[x-1]||tA,this.vsn){case HP:this.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:(x,g)=>g(JSON.stringify(x)),this.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:(x,g)=>g(JSON.parse(x));break;case Ub:this.encode=(m=t==null?void 0:t.encode)!==null&&m!==void 0?m:this.serializer.encode.bind(this.serializer),this.decode=(p=t==null?void 0:t.decode)!==null&&p!==void 0?p:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var Ai=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function sA(e,t,r){const n=new URL(t,e);if(r)for(const[s,o]of Object.entries(r))o!==void 0&&n.searchParams.set(s,o);return n.toString()}async function oA(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function aA(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:o,headers:a}){const l=sA(e.baseUrl,n,s),c=await oA(e.auth),u=await t(l,{method:r,headers:{...o?{"Content-Type":"application/json"}:{},...c,...a},body:o?JSON.stringify(o):void 0}),d=await u.text(),f=(u.headers.get("content-type")||"").includes("application/json"),m=f&&d?JSON.parse(d):d;if(!u.ok){const p=f?m:void 0,x=p==null?void 0:p.error;throw new Ai((x==null?void 0:x.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:x==null?void 0:x.type,icebergCode:x==null?void 0:x.code,details:p})}return{status:u.status,headers:u.headers,data:m}}}}function Tl(e){return e.join("�")}var iA=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Tl(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Tl(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Tl(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Tl(e.namespace)}`}),!0}catch(t){if(t instanceof Ai&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Ai&&r.status===409)return;throw r}}};function to(e){return e.join("�")}var lA=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Ai&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Ai&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},cA=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=aA({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new iA(this.client,t),this.tableOps=new lA(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
433async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},Iu=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}};function Ou(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Rl=class extends Iu{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Hb=class extends Iu{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const uA=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),dA=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},_f=e=>{if(Array.isArray(e))return e.map(r=>_f(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));t[s]=_f(n)}),t},hA=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Ii(e){"@babel/helpers - typeof";return Ii=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ii(e)}function fA(e,t){if(Ii(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ii(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pA(e){var t=fA(e,"string");return Ii(t)=="symbol"?t:t+""}function mA(e,t,r){return(t=pA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qv(Object(r),!0).forEach(function(n){mA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const Kv=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},gA=async(e,t,r,n)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(r!=null&&r.noResolveJson)){const s=e,o=s.status||500;if(typeof s.json=="function")s.json().then(a=>{const l=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||o+"";t(new Rl(Kv(a),o,l,n))}).catch(()=>{if(n==="vectors"){const a=o+"";t(new Rl(s.statusText||`HTTP ${o} error`,o,a,n))}else{const a=o+"";t(new Rl(s.statusText||`HTTP ${o} error`,o,a,n))}});else{const a=o+"";t(new Rl(s.statusText||`HTTP ${o} error`,o,a,n))}}else t(new Hb(Kv(e),e,n))},vA=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!n?ie(ie({},s),r):(dA(n)?(s.headers=ie({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(n)):s.body=n,t!=null&&t.duplex&&(s.duplex=t.duplex),ie(ie({},s),r))};async function Ia(e,t,r,n,s,o,a){return new Promise((l,c)=>{e(r,vA(t,n,s,o)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;if(a==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>l(u)).catch(u=>gA(u,c,n,a))})}function Vb(e="storage"){return{get:async(t,r,n,s)=>Ia(t,"GET",r,n,s,void 0,e),post:async(t,r,n,s,o)=>Ia(t,"POST",r,s,o,n,e),put:async(t,r,n,s,o)=>Ia(t,"PUT",r,s,o,n,e),head:async(t,r,n,s)=>Ia(t,"HEAD",r,ie(ie({},n),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,r,n,s,o)=>Ia(t,"DELETE",r,s,o,n,e)}}const yA=Vb("storage"),{get:Oi,post:mr,put:kf,head:wA,remove:hm}=yA,Ut=Vb("vectors");var va=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=uA(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=ie(ie({},this.headers),{},{[e]:t}),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Ou(r))return{data:null,error:r};throw r}}},xA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Ou(t))return{data:null,error:t};throw t}}};let Gb;Gb=Symbol.toStringTag;var bA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Gb]="BlobDownloadBuilder",this.promise=null}asStream(){return new xA(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Ou(t))return{data:null,error:t};throw t}}};const SA={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Yv={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var _A=class extends va{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var s=this;return s.handleOperation(async()=>{let o;const a=ie(ie({},Yv),n);let l=ie(ie({},s.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const c=a.metadata;typeof Blob<"u"&&r instanceof Blob?(o=new FormData,o.append("cacheControl",a.cacheControl),c&&o.append("metadata",s.encodeMetadata(c)),o.append("",r)):typeof FormData<"u"&&r instanceof FormData?(o=r,o.has("cacheControl")||o.append("cacheControl",a.cacheControl),c&&!o.has("metadata")&&o.append("metadata",s.encodeMetadata(c))):(o=r,l["cache-control"]=`max-age=${a.cacheControl}`,l["content-type"]=a.contentType,c&&(l["x-metadata"]=s.toBase64(s.encodeMetadata(c))),(typeof ReadableStream<"u"&&o instanceof ReadableStream||o&&typeof o=="object"&&"pipe"in o&&typeof o.pipe=="function")&&!a.duplex&&(a.duplex="half")),n!=null&&n.headers&&(l=ie(ie({},l),n.headers));const u=s._removeEmptyFolders(t),d=s._getFinalPath(u),f=await(e=="PUT"?kf:mr)(s.fetch,`${s.url}/object/${d}`,o,ie({headers:l},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:u,id:f.Id,fullPath:f.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var s=this;const o=s._removeEmptyFolders(e),a=s._getFinalPath(o),l=new URL(s.url+`/object/upload/sign/${a}`);return l.searchParams.set("token",t),s.handleOperation(async()=>{let c;const u=ie({upsert:Yv.upsert},n),d=ie(ie({},s.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",u.cacheControl)):(c=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:o,fullPath:(await kf(s.fetch,l.toString(),c,{headers:d})).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e);const s=ie({},r.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const o=await mr(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),a=new URL(r.url+o.url),l=a.searchParams.get("token");if(!l)throw new Iu("No token returned by API");return{signedUrl:a.toString(),path:e,token:l}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await mr(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
433stinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await mr(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(e),o=await mr(n.fetch,`${n.url}/object/sign/${s}`,ie({expiresIn:t},r!=null&&r.transform?{transform:r.transform}:{}),{headers:n.headers});const a=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{signedUrl:encodeURI(`${n.url}${o.signedURL}${a}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{const s=await mr(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return s.map(a=>ie(ie({},a),{},{signedUrl:a.signedURL?encodeURI(`${n.url}${a.signedURL}${o}`):null}))})}download(e,t,r){const n=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),o=s?`?${s}`:"",a=this._getFinalPath(e),l=()=>Oi(this.fetch,`${this.url}/${n}/${a}${o}`,{headers:this.headers,noResolveJson:!0},r);return new bA(l,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>_f(await Oi(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await wA(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Ou(n)&&n instanceof Hb){const s=n.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:n}}throw n}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=[],s=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";s!==""&&n.push(s);const o=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",a=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});a!==""&&n.push(a);let l=n.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${r}${l}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await hm(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var n=this;return n.handleOperation(async()=>{const s=ie(ie(ie({},SA),t),{},{prefix:e||""});return await mr(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const n=ie({},e);return await mr(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const kA="2.97.0",Zi={"X-Client-Info":`storage-js/${kA}`};var CA=class extends va{constructor(e,t={},r,n){const s=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const o=s.href.replace(/\/$/,""),a=ie(ie({},Zi),t);super(o,a,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await Oi(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Oi(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await mr(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await kf(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await mr(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await hm(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},NA=class extends va{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=ie(ie({},Zi),t);super(n,s,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await mr(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>
433{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),s=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await Oi(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await hm(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!hA(e))throw new Iu("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new cA({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,o){const a=s[o];return typeof a!="function"?a:async(...l)=>{try{return{data:await a.apply(s,l),error:null}}catch(c){if(n)throw c;return{data:null,error:c}}}}})}},jA=class extends va{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=ie(ie({},Zi),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await Ut.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await Ut.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},EA=class extends va{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=ie(ie({},Zi),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},TA=class extends va{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=ie(ie({},Zi),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},RA=class extends TA{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new PA(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},PA=class extends jA{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,ie(ie({},e),{},{vectorBucketName:r.vectorBucketName}))}
433async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,ie(ie({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new AA(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},AA=class extends EA{constructor(e,t,r,n,s){super(e,t,s),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,ie(ie({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,ie(ie({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,ie(ie({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,ie(ie({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,ie(ie({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},IA=class extends CA{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new _A(this.url,this.headers,e,this.fetch)}get vectors(){return new RA(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new NA(this.url+"/iceberg",this.headers,this.fetch)}};function Du(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}const qb="2.97.0",po=30*1e3,Cf=3,Fd=Cf*po,OA="http://localhost:9999",DA="supabase.auth.token",MA={"X-Client-Info":`gotrue-js/${qb}`},Nf="X-Supabase-Api-Version",Kb={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},LA=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,$A=10*60*1e3;class Di extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function ee(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class FA extends Di{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function UA(e){return ee(e)&&e.name==="AuthApiError"}class gs extends Di{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class mn extends Di{constructor(t,r,n,s){super(t,n,s),this.name=r,this.status=n}}class Lt extends mn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Ud(e){return ee(e)&&e.name==="AuthSessionMissingError"}class ro extends mn{constructor(){super("Auth session or user missing","AuthInvalidToken
433ResponseError",500,void 0)}}class Pl extends mn{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Al extends mn{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function zA(e){return ee(e)&&e.name==="AuthImplicitGrantRedirectError"}class Jv extends mn{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class BA extends mn{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class jf extends mn{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function zd(e){return ee(e)&&e.name==="AuthRetryableFetchError"}class Qv extends mn{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class Ef extends mn{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Fc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Xv=` 434\r=`.split(""),WA=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Xv.length;t+=1)e[Xv[t].charCodeAt(0)]=-2;for(let t=0;t<Fc.length;t+=1)e[Fc[t].charCodeAt(0)]=t;return e})();function Zv(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Fc[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Fc[n]),t.queuedBits-=6}}function Yb(e,t,r){const n=WA[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function ey(e){const t=[],r=a=>{t.push(String.fromCodePoint(a))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=a=>{GA(a,n,r)};for(let a=0;a<e.length;a+=1)Yb(e.charCodeAt(a),s,o);return t.join("")}function HA(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function VA(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}HA(n,t)}}function GA(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function Fo(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)Yb(e.charCodeAt(s),r,n);return new Uint8Array(t)}function qA(e){const t=[];return VA(e,r=>t.push(r)),new Uint8Array(t)}function xs(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};return e.forEach(s=>Zv(s,r,n)),Zv(null,r,n),t.join("")}function KA(e){return Math.round(Date.now()/1e3)+e}function YA(){return Symbol("auth-callback")}const ct=()=>typeof window<"u"&&typeof document<"u",cs={tested:!1,writable:!1},Jb=()=>{if(!ct())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(cs.tested)return cs.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),cs.tested=!0,cs.writable=!0}catch{cs.tested=!0,cs.writable=!1}return cs.writable};function JA(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEac
434h((s,o)=>{t[o]=s})}catch{}return r.searchParams.forEach((n,s)=>{t[s]=n}),t}const Qb=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),QA=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",mo=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},us=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},it=async(e,t)=>{await e.removeItem(t)};class Mu{constructor(){this.promise=new Mu.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}Mu.promiseConstructor=Promise;function Il(e){const t=e.split(".");if(t.length!==3)throw new Ef("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!LA.test(t[n]))throw new Ef("JWT not in base64url format");return{header:JSON.parse(ey(t[0])),payload:JSON.parse(ey(t[1])),signature:Fo(t[2]),raw:{header:t[0],payload:t[1]}}}async function XA(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function ZA(e,t){return new Promise((n,s)=>{(async()=>{for(let o=0;o<1/0;o++)try{const a=await e(o);if(!t(o,null,a)){n(a);return}}catch(a){if(!t(o,a)){s(a);return}}})()})}function eI(e){return("0"+e.toString(16)).substr(-2)}function tI(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let o=0;o<56;o++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(t),Array.from(t,eI).join("")}async function rI(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(o=>String.fromCharCode(o)).join("")}async function nI(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await rI(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function no(e,t,r=!1){const n=tI();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await mo(e,`${t}-code-verifier`,s);const o=await nI(n);return[o,n===o?"plain":"s256"]}const sI=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function oI(e){const t=e.headers.get(Nf);if(!t||!t.match(sI))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function aI(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function iI(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const lI=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function so(e){if(!lI.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Bd(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function cI(e,t){return new Proxy(e,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const o=n.toString();if(o==="Symbol(Symbol.toPrimitive)"||o==="Symbol(Symbol.toStringTag)"||o==="Symbol(util.inspect.custom)"||o==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,n,s)}})}function ty(e){return JSON.parse(JSON.stringify(e))}
434const ps=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),uI=[502,503,504];async function ry(e){var t;if(!QA(e))throw new jf(ps(e),0);if(uI.includes(e.status))throw new jf(ps(e),e.status);let r;try{r=await e.json()}catch(o){throw new gs(ps(o),o)}let n;const s=oI(e);if(s&&s.getTime()>=Kb["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Qv(ps(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new Lt}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,a)=>o&&typeof a=="string",!0))throw new Qv(ps(r),e.status,r.weak_password.reasons);throw new FA(ps(r),e.status||500,n)}const dI=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function le(e,t,r,n){var s;const o=Object.assign({},n==null?void 0:n.headers);o[Nf]||(o[Nf]=Kb["2024-01-01"].name),n!=null&&n.jwt&&(o.Authorization=`Bearer ${n.jwt}`);const a=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(a.redirect_to=n.redirectTo);const l=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",c=await hI(e,t,r+l,{headers:o,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function hI(e,t,r,n,s,o){const a=dI(t,n,s,o);let l;try{l=await e(r,Object.assign({},a))}catch(c){throw console.error(c),new jf(ps(c),0)}if(l.ok||await ry(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(c){await ry(c)}}function dr(e){var t;let r=null;mI(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=KA(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function ny(e){const t=dr(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Pn(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function fI(e){return{data:e,error:null}}function pI(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:o}=e,a=Du(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:o},c=Object.assign({},a);return{data:{properties:l,user:c},error:null}}function sy(e){return e}function mI(e){return e.access_token&&e.refresh_token&&e.expires_in}const Wd=["global","local","others"];class gI{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=Qb(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,r=Wd[0]){if(Wd.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Wd.join(", ")}`);try{return await le(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ee(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await le(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Pn})}catch(n){if(ee(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=Du(t,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await le(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:pI,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(ee(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await le(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Pn})}catch(r){if(ee(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,s,o,a,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await le(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:sy});if(d.error)throw d.error;const f=await d.json(),m=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>
4340&&(p.forEach(x=>{const g=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);u[`${b}Page`]=g}),u.total=parseInt(m)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(ee(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){so(t);try{return await le(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Pn})}catch(r){if(ee(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){so(t);try{return await le(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:Pn})}catch(n){if(ee(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){so(t);try{return await le(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:Pn})}catch(n){if(ee(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){so(t.userId);try{const{data:r,error:n}=await le(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(ee(r))return{data:null,error:r};throw r}}async _deleteFactor(t){so(t.userId),so(t.id);try{return{data:await le(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(ee(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,s,o,a,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await le(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:sy});if(d.error)throw d.error;const f=await d.json(),m=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(x=>{const g=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);u[`${b}Page`]=g}),u.total=parseInt(m)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(ee(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await le(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ee(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await le(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ee(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await le(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ee(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await le(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ee(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await le(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ee(r))return{data:null,error:r};throw r}}}function oy(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const oo={debug:!!(globalThis&&Jb()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Xb extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class ay extends Xb{}async function vI(e,t,r){oo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;t>0&&setTimeout(()=>{n.abort(),oo.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async s=>{if(s){oo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await r()}finally{oo.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}else{if(t===0)throw oo.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new ay(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(oo.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}})}catch(s){throw(s==null?void 0:s.name)==="AbortError"?new ay(`Acquiring an exclusive Navigator LockManager lock "${e}" timed out waiting ${t}ms`):s}}function yI(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Zb(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}
434" is invalid.`);return e.toLowerCase()}function wI(e){return parseInt(e,16)}function xI(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function bI(e){var t;const{chainId:r,domain:n,expirationTime:s,issuedAt:o=new Date,nonce:a,notBefore:l,requestId:c,resources:u,scheme:d,uri:f,version:m}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(m!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${m}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 435`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=Zb(e.address),x=d?`${d}://${n}`:n,g=e.statement?`${e.statement} 436`:"",b=`${x} wants you to sign in with your Ethereum account: 437${p} 438 439${g}`;let y=`URI: ${f} 440Version: ${m} 441Chain ID: ${r}${a?` 442Nonce: ${a}`:""} 443Issued At: ${o.toISOString()}`;if(s&&(y+=` 444Expiration Time: ${s.toISOString()}`),l&&(y+=` 445Not Before: ${l.toISOString()}`),c&&(y+=` 446Request ID: ${c}`),u){let v=` 447Resources:`;for(const w of u){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);v+=` 448- ${w}`}y+=v}return`${b} 449${y}`}class qe extends Error{constructor({message:t,code:r,cause:n,name:s}){var o;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(o=s??(n instanceof Error?n.name:void 0))!==null&&o!==void 0?o:"Unknown Error",this.code=r}}class Uc extends qe{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function SI({error:e,options:t}){var r,n,s;const{publicKey:o}=t;if(!o)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new qe({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=o.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new qe({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=o.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new qe({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=o.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new qe({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new qe({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new qe({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return o.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new qe({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new qe({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const a=window.location.hostname;if(e1(a)){if(o.rp.id!==a)return new qe({message:`The RP ID "${o.rp.id}
449" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new qe({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(o.user.id.byteLength<1||o.user.id.byteLength>64)return new qe({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new qe({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new qe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function _I({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new qe({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new qe({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(e1(n)){if(r.rpId!==n)return new qe({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new qe({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new qe({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new qe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class kI{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const CI=new kI;function NI(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,s=Du(e,["challenge","user","excludeCredentials"]),o=Fo(t).buffer,a=Object.assign(Object.assign({},r),{id:Fo(r.id).buffer}),l=Object.assign(Object.assign({},s),{challenge:o,user:a});if(n&&n.length>0){l.excludeCredentials=new Array(n.length);for(let c=0;c<n.length;c++){const u=n[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Fo(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function jI(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,n=Du(e,["challenge","allowCredentials"]),s=Fo(t).buffer,o=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){o.allowCredentials=new Array(r.length);for(let a=0;a<r.length;a++){const l=r[a];o.allowCredentials[a]=Object.assign(Object.assign({},l),{id:Fo(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return o}function EI(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:xs(new Uint8Array(e.response.attestationObject)),clientDataJSON:xs(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function TI(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:xs(new Uint8Array(s.authenticatorData)),clientDataJSON:xs(new Uint8Array(s.clientDataJSON)),signature:xs(new Uint8Array(s.signature)),userHandle:s.userHandle?xs(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function e1(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function iy(){var e,t;return!!(ct()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function RI(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Uc("Browser returned unexpected credential type",t)}:{data:null,error:new Uc("Empty credential response",t)}}
449catch(t){return{data:null,error:SI({error:t,options:e})}}}async function PI(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Uc("Browser returned unexpected credential type",t)}:{data:null,error:new Uc("Empty credential response",t)}}catch(t){return{data:null,error:_I({error:t,options:e})}}}const AI={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},II={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function zc(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of e)if(s)for(const o in s){const a=s[o];if(a!==void 0)if(Array.isArray(a))n[o]=a;else if(r(a))n[o]=a;else if(t(a)){const l=n[o];t(l)?n[o]=zc(l,a):n[o]=zc(a)}else n[o]=a}return n}function OI(e,t){return zc(AI,e,t||{})}function DI(e,t){return zc(II,e,t||{})}class MI{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:s},o){var a;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!l)return{data:null,error:c};const u=s??CI.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:d}=l.webauthn.credential_options.publicKey;if(!d.name){const f=n;if(f)d.name=`${d.id}:${f}`;else{const p=(await this.client.getUser()).data.user,x=((a=p==null?void 0:p.user_metadata)===null||a===void 0?void 0:a.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";d.name=`${d.id}:${x}`}}d.displayName||(d.displayName=d.name)}switch(l.webauthn.type){case"create":{const d=OI(l.webauthn.credential_options.publicKey,o==null?void 0:o.create),{data:f,error:m}=await RI({publicKey:d,signal:u});return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:m}}case"request":{const d=DI(l.webauthn.credential_options.publicKey,o==null?void 0:o.request),{data:f,error:m}=await PI(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:d,signal:u}));return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:m}}}}catch(l){return ee(l)?{data:null,error:l}:{data:null,error:new gs("Unexpected error in challenge",l)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!r)return{data:null,error:new Di("rpId is required for WebAuthn authentication")};try{if(!iy())return{data:null,error:new gs("Browser does not support WebAuthn",null)};const{data:a,error:l}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:o});if(!a)return{data:null,error:l};const{webauthn:c}=a;return this._verify({factorId:t,challengeId:a.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:n,credential_response:c.credential_response}})}catch(a){return ee(a)?{data:null,error:a}:{data:null,error:new gs("Unexpected error in authenticate",a)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!r)return{data:null,error:new Di("rpId is required for WebAuthn registration")};try{if(!iy())return{data:null,error:new gs("Browser does not support WebAuthn",null)};const{data:a,error:l}=await this._enroll({friendlyName:t});if(!a)return await this.client.mfa.listFactors().then(d=>{var f;return(f=d.data)===null||f===void 0?void 0:f.all.find(m=>m.factor_type==="webauthn"&&m.friendly_name===t&&m.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:o});return c?this._verify({factorId:a.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:n,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(a){return ee(a)?{data:null,error:a}:{data:null,error:new gs("Unexpected error in register",a)}}}}yI();const LI={url:OA,storageKey:DA,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:MA,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4,skipAutoInitialize:!1};async function ly(e,t,r){return await r()}const ao={};class Mi{get jwks(){var t,r;return(r=(t=ao[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){ao[this.storageKey]=Object.assign(Object.assign({},ao[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=ao[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){ao[this.storageKey]=Object.assign(Object.assign({},ao[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},LI),t);if(this.storageKey=o.storageKey,this.instanceID=(r=Mi.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Mi.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&ct()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.admin=new gI({url:o.url,headers:o.headers,fetch:o.fetch}
449),this.url=o.url,this.headers=o.headers,this.fetch=Qb(o.fetch),this.lock=o.lock||ly,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock?this.lock=o.lock:this.persistSession&&ct()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=vI:this.lock=ly,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new MI(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:Jb()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=oy(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=oy(this.memoryStorage)),ct()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}o.skipAutoInitialize||this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${qb}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(ct()&&(r=JA(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),ct()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:o}=await this._getSessionFromURL(r,n);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),zA(o)){const c=(t=o.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:o}}return{error:o}}const{session:a,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",a,"redirect type",l),await this._saveSession(a),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return ee(r)?this._returnResult({error:r}):this._returnResult({error:new gs("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,s;try{const o=await le(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:dr}),{data:a,error:l}=o;if(l||!a)return this._returnResult({data:{user:null,session:null},error:l});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(o){if(ee(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signUp(t){var r,n,s;try{let o;if("email"in t){const{email:d,password:f,options:m}=t;let p=null,x=null;this.flowType==="pkce"&&([p,x]=await no(this.storage,this.storageKey)),o=await le(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:m==null?void 0:m.emailRedirectTo,body:{email:d,password:f,data:(r=m==null?void 0:m.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken},code_challenge:p,code_challenge_method:x},xform:dr})}else if("phone"in t){const{phone:d,password:f,options:m}=t;o=await le(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(n=m==null?void 0:m.data)!==null&&n!==void 0?n:{},channel:(s=m==null?void 0:m.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken}},xform:dr})}else throw new Pl("You must provide either an email or phone number and a password");const{data:a,error:l}=o;if(l||!a)return await it(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(o){if(await it(this.storage,`${this.storageKey}-code-verifier`),ee(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithPassword(t){try{let r;if("email"in t){const{email:o,password:a,options:l}=t;r=await le(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:ny})}else if("phone"in t){const{phone:o,password:a,options:l}=t;r=await le(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:ny})}else throw new Pl("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const o=new ro;return this._returnResult({data:{user:null,session:null},error:o})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(ee(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,s,o;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(o=t.o
449ptions)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,s,o,a,l,c,u,d,f,m;let p,x;if("message"in t)p=t.message,x=t.signature;else{const{chain:g,wallet:b,statement:y,options:v}=t;let w;if(ct())if(typeof b=="object")w=b;else{const P=window;if("ethereum"in P&&typeof P.ethereum=="object"&&"request"in P.ethereum&&typeof P.ethereum.request=="function")w=P.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=b}const S=new URL((r=v==null?void 0:v.url)!==null&&r!==void 0?r:window.location.href),_=await w.request({method:"eth_requestAccounts"}).then(P=>P).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!_||_.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=Zb(_[0]);let C=(n=v==null?void 0:v.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!C){const P=await w.request({method:"eth_chainId"});C=wI(P)}const j={domain:S.host,address:k,statement:y,uri:S.href,version:"1",chainId:C,nonce:(s=v==null?void 0:v.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(a=(o=v==null?void 0:v.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(l=v==null?void 0:v.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=v==null?void 0:v.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=v==null?void 0:v.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=v==null?void 0:v.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=bI(j),x=await w.request({method:"personal_sign",params:[xI(p),k]})}try{const{data:g,error:b}=await le(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:x},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:dr});if(b)throw b;if(!g||!g.session||!g.user){const y=new ro;return this._returnResult({data:{user:null,session:null},error:y})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:b})}catch(g){if(ee(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var r,n,s,o,a,l,c,u,d,f,m,p;let x,g;if("message"in t)x=t.message,g=t.signature;else{const{chain:b,wallet:y,statement:v,options:w}=t;let S;if(ct())if(typeof y=="object")S=y;
449else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))S=k.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=y}const _=new URL((r=w==null?void 0:w.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in S&&S.signIn){const k=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:_.host,uri:_.href}),v?{statement:v}:null));let C;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")C=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)C=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in C&&"signature"in C&&(typeof C.signedMessage=="string"||C.signedMessage instanceof Uint8Array)&&C.signature instanceof Uint8Array)x=typeof C.signedMessage=="string"?C.signedMessage:new TextDecoder().decode(C.signedMessage),g=C.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${_.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...v?["",v,""]:[""],"Version: 1",`URI: ${_.href}`,`Issued At: ${(s=(n=w==null?void 0:w.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((a=w==null?void 0:w.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((c=w==null?void 0:w.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((u=w==null?void 0:w.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((f=(d=w==null?void 0:w.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...w.signInWithSolana.resources.map(C=>`- ${C}`)]:[]].join(` 450`);const k=await S.signMessage(new TextEncoder().encode(x),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=k}}try{const{data:b,error:y}=await le(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:xs(g)},!((m=t.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:dr});if(y)throw y;if(!b||!b.session||!b.user){const v=new ro;return this._returnResult({data:{user:null,session:null},error:v})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:y})}catch(b){if(ee(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(t){const r=await us(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new BA;const{data:o,error:a}=await le(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:dr});if(await it(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!o||!o.session||!o.user){const l=new ro;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),this._returnResult({data:Object.assign(Object.assign({},o),{redirectType:s??null}),error:a})}catch(o){if(await it(this.storage,`${this.storageKey}-code-verifier`),ee(o))return this._returnResult({data:{user:null,session:null,redirectType:null},error:o});throw o}}async signInWithIdToken(t){try{const{options:r,provider:n,token:s,access_token:o,nonce:a}=t,l=await le(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:o,nonce:a,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:dr}),{data:c,error:u}=l;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new ro;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(r){if(ee(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,s,o,a;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await no(this.storage,this.storageKey));const{error:f}=await le(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(n=c==null?void 0:c.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await le(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(o=c==null?void 0:c.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(a=c==null?void 0:c.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new Pl("You must provide either an email or phone number.")}catch(l){if(await it(this.storage,`${this.storageKey}-code-verifier`),ee(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var r,n;try{let s,o;"options"in t&&(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo,o=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:a,error:l}=await le(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:dr});if(l)throw l;if(!a)throw new Error("An error occurred on token verification.");const c=a.session,u=a.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(ee(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var r,n,s,o,a;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await no(this.storage,this.storageKey));const u=await le(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:fI});return!((o=u.data)===null||o===void 0)&&o.url&&ct()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await it(this.storage,`${this.storageKey}-code-verifier`),ee(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new Lt;const{error:s}=await le(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(ee(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:s,options:o}=t,{error:a}=await le(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},redirectTo:o==null?void 0:o.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in t){const{phone:n,type:s,options:o}=t,{data:a,error:l}=await le(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:l})}throw new Pl("You must provide either an email or phone number and a type")}catch(r){if(ee(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await us(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
450id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<Fd:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const a=await us(this.userStorage,this.storageKey+"-user");a!=null&&a.user?t.user=a.user:t.user=Bd()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};t.user=cI(t.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{session:null},error:o}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await le(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Pn}):await this._useSession(async r=>{var n,s,o;const{data:a,error:l}=r;if(l)throw l;return!(!((n=a.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Lt}:await le(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0,xform:Pn})})}catch(r){if(ee(r))return Ud(r)&&(await this._removeSession(),await it(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:s,error:o}=n;if(o)throw o;if(!s.session)throw new Lt;const a=s.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await no(this.storage,this.storageKey));const{data:u,error:d}=await le(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:a.access_token,xform:Pn});if(d)throw d;return a.user=u.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(n){if(await it(this.storage,`${this.storageKey}-code-verifier`),ee(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Lt;const r=Date.now()/1e3;let n=r,s=!0,o=null;const{payload:a}=Il(t.access_token);if(a.exp&&(n=a.exp,s=n<=r),s){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};o=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});o={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return this._returnResult({data:{user:o.user,session:o},error:null})}catch(r){if(ee(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:a,error:l}=r;if(l)throw l;t=(n=a.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new Lt;const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{user:null,session:null},error:o}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(ee(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!ct())throw new Al("No browser detected.");
450if(t.error||t.error_description||t.error_code)throw new Al(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Jv("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Al("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Jv("No code detected.");const{data:v,error:w}=await this._exchangeCodeForSession(t.code);if(w)throw w;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:v.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:o,refresh_token:a,expires_in:l,expires_at:c,token_type:u}=t;if(!o||!l||!a||!u)throw new Al("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(l);let m=d+f;c&&(m=parseInt(c));const p=m-d;p*1e3<=po&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${f}s`);const x=m-f;d-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,m,d):d-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,m,d);const{data:g,error:b}=await this._getUser(o);if(b)throw b;const y={provider_token:n,provider_refresh_token:s,access_token:o,expires_in:f,expires_at:m,refresh_token:a,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(n){if(ee(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await us(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:o}=r;if(o&&!Ud(o))return this._returnResult({error:o});const a=(n=s.session)===null||n===void 0?void 0:n.access_token;if(a){const{error:l}=await this.admin.signOut(a,t);if(l&&!(UA(l)&&(l.status===404||l.status===401||l.status===403)||Ud(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await it(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=YA(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,s;try{const{data:{session:o},error:a}=r;if(a)throw a;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",t,"session",o)}catch(o){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",o),console.error(o)}})}async resetPasswordForEmail(t,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await no(this.storage,this.storageKey,!0));try{return await le(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if(await it(this.storage,`${this.storageKey}-code-verifier`),ee(o))return this._returnResult({data:null,error:o});throw o}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(ee(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:s}=await this._useSession(async o=>{var a,l,c,u,d;const{data:f,error:m}=o;if(m)throw m;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await le(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return ct()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(ee(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:o}}=r;if(s)throw s;const{options:a,provider:l,token:c,access_token:u,nonce:d}=t,f=await le(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=o==null?void 0:o.access_token)!==null&&n!==void 0?n:void 0,body:{provider:l,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:dr}),{data:m,error:p}=f;return p?this._returnResult({data:{user:null,session:null},error:p}):!m||!m.session||!m.user?this._returnResult({data:{user:null,session:null},error:new ro}):(m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("USER_UPDATED",m.session)),this._returnResult({data:m,error:p}))}catch(s){if(await it(this.storage,`${this.storageKey}-code-verifier`),ee(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,s;const{data:o,error:a}=r;if(a)throw a;
450return await le(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(ee(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await ZA(async s=>(s>0&&await XA(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await le(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:dr})),(s,o)=>{const a=200*Math.pow(2,s);return o&&zd(o)&&Date.now()+a-n<po})}catch(n){if(this._debug(r,"error",n),ee(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),ct()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await us(this.storage,this.storageKey);if(s&&this.userStorage){let a=await us(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:s.user},await mo(this.userStorage,this.storageKey+"-user",a)),s.user=(t=a==null?void 0:a.user)!==null&&t!==void 0?t:Bd()}else if(s&&!s.user&&!s.user){const a=await us(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(s.user=a.user,await it(this.storage,this.storageKey+"-user"),await mo(this.storage,this.storageKey,s)):s.user=Bd()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const o=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Fd;if(this._debug(n,`session has${o?"":" not"} expired with margin of ${Fd}s`),o){if(this.autoRefreshToken&&s.refresh_token){const{error:a}=await this._callRefreshToken(s.refresh_token);a&&(console.error(a),zd(a)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:l}=await this._getUser(s.access_token);!l&&(a!=null&&a.user)?(s.user=a.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(n,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new Lt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Mu;const{data:o,error:a}=await this._refreshAccessToken(t);if(a)throw a;if(!o.session)throw new Lt;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);const l={data:o.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(o){if(this._debug(s,"error",o),ee(o)){const a={data:null,error:o};return zd(o)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(a),a}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,r,n=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const o=[],a=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,r)}catch(c){o.push(c)}});if(await Promise.all(a),o.length>0){for(let l=0;l<o.length;l+=1)console.error(o[l]);throw o[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await it(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await mo(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const o=ty(s);await mo(this.storage,this.storageKey,o)}else{const s=ty(r);await mo(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await it(this.storage,this.storageKey),await it(this.storage,this.storageKey+"-code-verifier"),await it(this.storage,this.storageKey+"-user"),this.userStorage&&await it(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ct()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
450catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),po);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-t)/po);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${po}ms, refresh threshold is ${Cf} ticks`),s<=Cf&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof Xb)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ct()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[o,a]=await no(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(l.toString())}if(n!=null&&n.queryParams){const o=new URLSearchParams(n.queryParams);s.push(o.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:s,error:o}=r;return o?this._returnResult({data:null,error:o}):await le(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(ee(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,s;const{data:o,error:a}=r;if(a)return this._returnResult({data:null,error:a});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await le(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=o==null?void 0:o.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if(ee(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:o}=r;if(o)return this._returnResult({data:null,error:o});const a=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?EI(t.webauthn.credential_response):TI(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await le(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:a,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(r){if(ee(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:o}=r;if(o)return this._returnResult({data:null,error:o});const a=await le(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(a.error)return a;const{data:l}=a;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:NI(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:jI(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(ee(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const o of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])s.all.push(o),o.status==="verified"&&s[o.factor_type].push(o);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var r,n,s,o;if(t)try{const{payload:p}=Il(t);let x=null;p.aal&&(x=p.aal);let g=x;const{data:{user:b},error:y}=await this.getUser(t);if(y)return this._returnResult({data:null,error:y});((n=(r=b==null?void 0:b.factors)===null||r===void 0?void 0:r.filter(S=>S.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(g="aal2");const w=p.amr||[];return{data:{currentLevel:x,nextLevel:g,currentAuthenticationMethods:w},error:null}}catch(p){if(ee(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:a},error:l}
450=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=Il(a.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((o=(s=a.user.factors)===null||s===void 0?void 0:s.filter(p=>p.status==="verified"))!==null&&o!==void 0?o:[]).length>0&&(d="aal2");const m=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:m},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await le(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new Lt})})}catch(r){if(ee(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new Lt});const a=await le(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return a.data&&a.data.redirect_url&&ct()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(ee(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new Lt});const a=await le(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return a.data&&a.data.redirect_url&&ct()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(ee(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await le(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Lt})})}catch(t){if(ee(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await le(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Lt})})}catch(r){if(ee(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(l=>l.kid===t);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(l=>l.kid===t),n&&this.jwks_cached_at+$A>s)return n;const{data:o,error:a}=await le(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=s,n=o.keys.find(l=>l.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:p,error:x}
450=await this.getSession();if(x||!p.session)return this._returnResult({data:null,error:x});n=p.session.access_token}const{header:s,payload:o,signature:a,raw:{header:l,payload:c}}=Il(n);r!=null&&r.allowExpired||aI(o.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:p}=await this.getUser(n);if(p)throw p;return{data:{claims:o,header:s,signature:a},error:null}}const d=iI(s.alg),f=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,a,qA(`${l}.${c}`)))throw new Ef("Invalid JWT signature");return{data:{claims:o,header:s,signature:a},error:null}}catch(n){if(ee(n))return this._returnResult({data:null,error:n});throw n}}}Mi.nextInstanceID={};const $I=Mi,FI="2.97.0";let Ua="";typeof Deno<"u"?Ua="deno":typeof document<"u"?Ua="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ua="react-native":Ua="node";const UI={"X-Client-Info":`supabase-js-${Ua}/${FI}`},zI={headers:UI},BI={schema:"public"},WI={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},HI={};function Li(e){"@babel/helpers - typeof";return Li=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Li(e)}function VI(e,t){if(Li(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Li(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GI(e){var t=VI(e,"string");return Li(t)=="symbol"?t:t+""}function qI(e,t,r){return(t=GI(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ze(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cy(Object(r),!0).forEach(function(n){qI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const KI=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),YI=()=>Headers,JI=(e,t,r)=>{const n=KI(r),s=YI();return async(o,a)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let u=new s(a==null?void 0:a.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),n(o,ze(ze({},a),{},{headers:u}))}};function QI(e){return e.endsWith("/")?e:e+"/"}function XI(e,t){var r,n;const{db:s,auth:o,realtime:a,global:l}=e,{db:c,auth:u,realtime:d,global:f}=t,m={db:ze(ze({},c),s),auth:ze(ze({},u),o),realtime:ze(ze({},d),a),storage:{},global:ze(ze(ze({},f),l),{},{headers:ze(ze({},(r=f==null?void 0:f.headers)!==null&&r!==void 0?r:{}),(n=l==null?void 0:l.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?m.accessToken=e.accessToken:delete m.accessToken,m}function ZI(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(QI(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var eO=class extends $I{constructor(e){super(e)}},tO=class{constructor(e,t,r){var n,s;this.supabaseUrl=e,this.supabaseKey=t;const o=ZI(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const a=`sb-${o.hostname.split(".")[0]}-auth-token`,l={db:BI,realtime:HI,auth:ze(ze({},WI),{},{storageKey:a}),global:zI},c=XI(r??{},l);if(this.storageKey=(n=c.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=c.global.headers)!==null&&s!==void 0?s:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=JI(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(ze({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new UP(new URL("rest/v1",o).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new IA(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new AP(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
450channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:o,flowType:a,lock:l,debug:c,throwOnError:u},d,f){const m={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new eO({url:this.authUrl.href,headers:ze(ze({},m),d),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:a,lock:l,debug:c,throwOnError:u,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new nA(this.realtimeUrl.href,ze(ze({},e),{},{params:ze(ze({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const rO=(e,t,r)=>new tO(e,t,r);function nO(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}nO()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const sO="https://tptqfcbbgvrcegaobmai.supabase.co",oO="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InRwdHFmY2JiZ3ZyY2VnYW9ibWFpIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njk3MDE1NDUsImV4cCI6MjA4NTI3NzU0NX0.Qq_Wa1QzfcMMK6LPEBcVB2Va1NJEbenBWazCcRm8HBI",yt=rO(sO,oO,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),Zr=[{level:1,title:"Rookie",pointsRequired:0,unlock:"Basic styles"},{level:2,title:"Starter",pointsRequired:100,unlock:"Modern style"},{level:3,title:"Creator",pointsRequired:300,unlock:"Caption variations"},{level:4,title:"Pro",pointsRequired:600,unlock:"Luxury style"},{level:5,title:"Expert",pointsRequired:1e3,unlock:"Priority templates"},{level:6,title:"Elite",pointsRequired:1500,unlock:"Cinematic style"},{level:7,title:"Master",pointsRequired:2500,unlock:"Advanced analytics"},{level:8,title:"Legend",pointsRequired:4e3,unlock:"Custom color themes"},{level:9,title:"Guru",pointsRequired:6e3,unlock:"Early access features"},{level:10,title:"Marketing Master",pointsRequired:1e4,unlock:"VIP badge on graphics"}],Tf=[{id:"first_flame",name:"First Flame",description:"Create your first graphic",emoji:"ð¥",category:"creation",requirement:1,unlocked:!1},{id:"getting_started",name:"Getting Started",description:"Create 5 graphics",emoji:"ð±",category:"creation",requirement:5,unlocked:!1},{id:"double_digits",name:"Double Digits",description:"Create 10 graphics",emoji:"ð¯",category:"milestone",requirement:10,unlocked:!1},{id:"content_machine",name:"Content Machine",description:"Create 25 graphics",emoji:"â¡",category:"milestone",requirement:25,unlocked:!1},{id:"half_century",name:"Half Century",description:"Create 50 graphics",emoji:"ð",category:"milestone",requirement:50,unlocked:!1},{id:"century_club",name:"Century Club",description:"Create 100 graphics",emoji:"ð¯",category:"milestone",requirement:100,unlocked:!1},{id:"week_warrior",name:"Week Warrior",description:"7-day creation streak",emoji:"ðï¸",category:"streak",requirement:7,unlocked:!1},{id:"two_week_titan",name:"Two Week Titan",description:"14-day creation streak",emoji:"ðª",category:"streak",requirement:14,unlocked:!1},{id:"monthly_master",name:"Monthly Master",description:"30-day creation streak",emoji:"ð",category:"streak",requirement:30,unlocked:!1},{id:"review_champion",name:"Review Champion",description:"Create 25 review graphics",emoji:"â",category:"special",requirement:25,unlocked:!1},{id:"financing_pro",name:"Financing Pro",description:"Create 25 financing graphics",emoji:"ð°",category:"special",requirement:25,unlocked:!1}],uy={create_graphic:10,complete_challenge:25,log_results:15,daily_streak:5,first_of_month:20,weekly_batch:50},aO={harper_score:0,level:1,level_title:"Rookie",total_creations:0,current_streak:0,longest_streak:0,badges_earned:[],unlocked_styles:["professional","bold"],unlocked_features:[],last_creation_date:null},t1=()=>{const{user:e}=Xi(),[t,r]=h.useState(aO),[n,s]=h.useState(!0),[o,a]=h.useState([]),[l,c]=h.useState(!1),[u,d]=h.useState(1),f=h.useCallback(S=>{for(let _=Zr.length-1;_>=0;_--)if(S>=Zr[_].pointsRequired)return{level:Zr[_].level,title:Zr[_].title};return{level:1,title:"Rookie"}},[]),m=h.useCallback((S,_)=>{if(_>=10)return 100;const k=Zr[_-1].pointsRequired,C=Zr[_].pointsRequired,j=(S-k)/(C-k)
450*100;return Math.min(100,Math.max(0,j))},[]),p=h.useCallback(async()=>{if(!e){const S=localStorage.getItem("harper_achievements");S&&r(JSON.parse(S)),s(!1);return}try{const{data:S,error:_}=await yt.from("user_achievements").select("*").eq("user_id",e.id).maybeSingle();if(_&&_.code!=="PGRST116"){console.error("Error loading achievements:",_),s(!1);return}S?r({harper_score:S.harper_score||0,level:S.level||1,level_title:S.level_title||"Rookie",total_creations:S.total_creations||0,current_streak:S.current_streak||0,longest_streak:S.longest_streak||0,badges_earned:S.badges_earned||[],unlocked_styles:S.unlocked_styles||["professional","bold"],unlocked_features:S.unlocked_features||[],last_creation_date:S.last_creation_date}):await yt.from("user_achievements").insert({user_id:e.id,harper_score:0,level:1,level_title:"Rookie",total_creations:0,current_streak:0,longest_streak:0,badges_earned:[],unlocked_styles:["professional","bold"],unlocked_features:[]})}catch(S){console.error("Error in loadAchievements:",S)}s(!1)},[e]),x=h.useCallback(async S=>{if(!e){localStorage.setItem("harper_achievements",JSON.stringify(S));return}try{await yt.from("user_achievements").update({harper_score:S.harper_score,level:S.level,level_title:S.level_title,total_creations:S.total_creations,current_streak:S.current_streak,longest_streak:S.longest_streak,badges_earned:S.badges_earned,unlocked_styles:S.unlocked_styles,unlocked_features:S.unlocked_features,last_creation_date:S.last_creation_date}).eq("user_id",e.id)}catch(_){console.error("Error saving achievements:",_)}},[e]),g=h.useCallback((S,_)=>{r(k=>{const C=k.harper_score+S,{level:j,title:P}=f(C);if(j>k.level){c(!0),d(k.level);const F=[...k.unlocked_styles];j>=2&&!F.includes("modern")&&F.push("modern"),j>=4&&!F.includes("luxury")&&F.push("luxury"),j>=6&&!F.includes("cinematic")&&F.push("cinematic");const D={...k,harper_score:C,level:j,level_title:P,unlocked_styles:F};return x(D),D}const I={...k,harper_score:C};return x(I),I})},[f,x]),b=h.useCallback((S,_)=>{r(k=>{const C=k.badges_earned.map(P=>P.id),j=[];if(Tf.forEach(P=>{if(C.includes(P.id))return;let I=!1;P.category==="creation"||P.category==="milestone"?I=S>=P.requirement:P.category==="streak"&&(I=_>=P.requirement),I&&j.push({...P,unlocked:!0,unlockedAt:new Date().toISOString()})}),j.length>0){a(j);const P={...k,badges_earned:[...k.badges_earned,...j]};return x(P),P}return k})},[x]),y=h.useCallback(S=>{const _=new Date().toDateString();r(k=>{let C=k.current_streak,j=k.longest_streak;if(k.last_creation_date!==_){const F=new Date;F.setDate(F.getDate()-1),k.last_creation_date===F.toDateString()?C=k.current_streak+1:k.last_creation_date!==_&&(C=1),C>j&&(j=C)}const P=k.total_creations+1,I={...k,total_creations:P,current_streak:C,longest_streak:j,last_creation_date:_};return x(I),g(uy.create_graphic,"Created a graphic"),C>k.current_streak&&g(uy.daily_streak,"Daily streak bonus"),setTimeout(()=>b(P,C),100),I})},[g,b,x]),v=h.useCallback(()=>{a([])},[]),w=h.useCallback(()=>{c(!1)},[]);return h.useEffect(()=>{p()},[p]),{data:t,isLoading:n,newBadges:o,leveledUp:l,previousLevel:u,addPoints:g,recordCreation:y,clearNewBadges:v,clearLevelUp:w,getProgressToNextLevel:m,LEVELS:Zr}},Dt="/assets/harper-avatar-CP1G8gpy.png",dy=["#f97316","#22c55e","#3b82f6","#eab308","#ec4899","#8b5cf6","#06b6d4","#f43f5e"];let iO=0;const Hd=e=>Array.from({length:e},()=>({id:iO++,x:50+(Math.random()-.5)*40,y:50,color:dy[Math.floor(Math.random()*dy.length)],size:Math.random()*10+6,rotation:Math.random()*360,delay:Math.random()*.3,type:["confetti","sparkle","star","circle"][Math.floor(Math.random()*4)],velocityX:(Math.random()-.5)*200,velocityY:Math.random()*-150-50})),lO=({isVisible:e,onComplete:t})=>{const[r,n]=h.useState([]),[s,o]=h.useState(!1),[a,l]=h.useState(0);return h.useEffect(()=>{if(e){n(Hd(50)),o(!0),l(1);const c=setTimeout(()=>{n(f=>[...f,...Hd(30)]),l(2)},200),u=setTimeout(()=>{n(f=>[...f,...Hd(20)]),l(3)},400),d=setTimeout(()=>{o(!1),n([]),l(0),t==null||t()},4e3);return()=>{clearTimeout(c),clearTimeout(u),clearTimeout(d)}}},[e,t]),!e&&r.length===0?null:i.jsxs("div",{className:"fixed inset-0 pointer-events-none z-50 overflow-hidden",children:[a===1&&i.jsx("div",{className:"absolute inset-0 bg-accent/10 animate-pulse",style:{animationDuration:"0.3s"}}),r.map(c=>i.jsxs("div",{className:"absolute animate-confetti-fall",style:{left:`${c.x}%`,top:`${c.y}%`,animationDelay:`${c.delay}s`,"--velocity-x":`${c.velocityX}px`,"--velocity-y":`${c.velocityY}px`},children:[c.type==="confetti"&&i.jsx("div",{className:"rounded-sm",style:{width:c.size,height:c.size*.6,backgroundColor:c.color,transform:`rotate(${c.rotation}deg)`}}),c.type==="sparkle"&&i.jsx("div",{className:"animate-spin-slow",style:{color:c.color,fontSize:c.size*2},children:"â¨"}),c.type==="star"&&i.jsx("div",{className:"animate-pulse",style:{color:c.color,fontSize:c.size*1.5},children:"â"}),c.type==="circle"&&i.jsx("div",{className:"rounded-full",style:{width:c.size,height:c.size,backgroundColor:c.color,opacity:.8}})]},c.id)),s&&i.jsx("div",{className:"fixed bottom-8 right-8 animate-bounce-in",children:i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 bg-accent/40 rounded-full blur-2xl animate-pulse"}),i.jsx("div",{className:"absolute inset-0 bg-primary/20 rounded-full blur-xl animate-pulse",style:{animationDelay:"0.1s"}}),i.jsxs("div",{className:"relative bg-gradient-to-br from-card via-card to-accent/10 rounded-2xl p-5 border-2 border-accent/40 shadow-2xl glow-accent",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:Dt,alt:"Harper celebrating",className:"w-16 h-16 rounded-full border-3 border-accent animate-wiggle"}),i.jsx("div",{className:"absolute -top-2 left-1/2 -translate-x-1/2 text-lg animate-bounce",children:"ð"})]}),i.jsxs("div",{className:"text-left",children:[i.jsxs("p",{className:"font-bold text-foreground text-base flex items-center gap-2",children:["ð Nailed it!",i.jsx("span",{className:"text-accent animate-pulse",children:"â¨"})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Your design is ready to share!"})]})]}),i.jsx("div",{className:"absolute -top-3 -left-3 text-xl animate-float",children:"ð¨"}),i.jsx("div",{className:"absolute -top-3 -right-3 text-xl animate-float",style:{animationDelay:"0.2s"},children:"ð¥"}),i.jsx("div",{className:"absolute -bottom-3 -left-3 text-xl animate-float",style:{animationDelay:"0.4s"},children:"â"}),i.jsx("div",{className:"absolute -bottom-3 -right-3 text-xl animate-float",style:{animationDelay:"0.6s"},children:"ðª"}),i.jsx("div",{className:"absolute inset-0 rounded-2xl border-2 border-accent/20 animate-ping",style:{animationDuration:"1.5s"}})]})]})})]})},fm=vu("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),q=h.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const a=n?lj:"button";return i.jsx(a,{className:ae(fm({variant:t,size:r,className:e})),ref:o,...s})});q.displayName="Button";const cO=()=>{const{theme:e,setTheme:t}=Kx(),[r,n]=h.useState(!1);return h.useEffect(()=>{n(!0)},[]),r?i.jsx(q,{variant:"ghost",size:"icon",onClick:()=>t(e==="dark"?"light":"dark"),title:e==="dark"?"Switch to light mode":"Switch to dark mode",children:e==="dark"?i.jsx(rf,{className:"w-4 h-4 text-yellow-500"}):i.jsx(hE,{className:"w-4 h-4"})}):i.jsx(q,{variant:"ghost",size:"icon",disabled:!0,children:i.jsx(rf,{className:"w-4 h-4"})})},uO=()=>i.jsx(cO,{}),hy=(e=10)=>{typeof navigator<"u"&&"vibrate"in navigator&&navigator.vibrate(e)},dO=({onSwipeLeft:e,onSwipeRight:t,threshold:r=50,hapticFeedback:n=!0})=>{const[s,o]=h.useState(null),[a,l]=h.useState(null),c=h.useCallback(f=>{l(null),o(f.targetTouches[0].clientX)},[]),u=h.useCallback(f=>{l(f.targetTouches[0].clientX)},[]),d=h.useCallback(()=>
450{if(!s||!a)return;const f=s-a,m=f>r,p=f<-r;m&&e&&(n&&hy(15),e()),p&&t&&(n&&hy(15),t())},[s,a,r,e,t,n]);return{onTouchStart:c,onTouchMove:u,onTouchEnd:d}},Te=h.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{type:t,className:ae("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));Te.displayName="Input";const $i=h.forwardRef(({className:e,...t},r)=>i.jsx("textarea",{className:ae("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));$i.displayName="Textarea";const Ee=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ae("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ee.displayName="Card";const hO=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ae("flex flex-col space-y-1.5 p-6",e),...t}));hO.displayName="CardHeader";const fO=h.forwardRef(({className:e,...t},r)=>i.jsx("h3",{ref:r,className:ae("text-2xl font-semibold leading-none tracking-tight",e),...t}));fO.displayName="CardTitle";const pO=h.forwardRef(({className:e,...t},r)=>i.jsx("p",{ref:r,className:ae("text-sm text-muted-foreground",e),...t}));pO.displayName="CardDescription";const mO=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ae("p-6 pt-0",e),...t}));mO.displayName="CardContent";const gO=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ae("flex items-center p-6 pt-0",e),...t}));gO.displayName="CardFooter";var Lu="Collapsible",[vO,a5]=qt(Lu),[yO,pm]=vO(Lu),r1=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:a,...l}=e,[c,u]=un({prop:n,defaultProp:s??!1,onChange:a,caller:Lu});return i.jsx(yO,{scope:r,disabled:o,contentId:nr(),open:c,onOpenToggle:h.useCallback(()=>u(d=>!d),[u]),children:i.jsx(se.div,{"data-state":gm(c),"data-disabled":o?"":void 0,...l,ref:t})})});r1.displayName=Lu;var n1="CollapsibleTrigger",s1=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,s=pm(n1,r);return i.jsx(se.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":gm(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:t,onClick:G(e.onClick,s.onOpenToggle)})});s1.displayName=n1;var mm="CollapsibleContent",o1=h.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=pm(mm,e.__scopeCollapsible);return i.jsx(xt,{present:r||s.open,children:({present:o})=>i.jsx(wO,{...n,ref:t,present:o})})});o1.displayName=mm;var wO=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=e,a=pm(mm,r),[l,c]=h.useState(n),u=h.useRef(null),d=ye(t,u),f=h.useRef(0),m=f.current,p=h.useRef(0),x=p.current,g=a.open||l,b=h.useRef(g),y=h.useRef(void 0);return h.useEffect(()=>{const v=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(v)},[]),tt(()=>{const v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();f.current=w.height,p.current=w.width,b.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),c(n)}},[a.open,n]),i.jsx(se.div,{"data-state":gm(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!g,...o,ref:d,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:g&&s})});function gm(e){return e?"open":"closed"}var xO=r1;const bO=xO,SO=s1,_O=o1,fy=({children:e,isActive:t,direction:r="forward"})=>t?i.jsx("div",{className:ae("animate-in fade-in duration-300",r==="forward"?"slide-in-from-right-4":"slide-in-from-left-4"),children:e}):null,a1=({variant:e,onDismiss:t})=>{const r=()=>{window.open("https://gethearth.com/tools/ai/","_blank")};return e==="inline"?i.jsx(Ee,{className:"p-4 bg-gradient-to-r from-purple-500/10 via-blue-500/10 to-purple-500/10 border-purple-500/20 mt-4",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-purple-500/20 flex items-center justify-center flex-shrink-0",children:i.jsx(Rd,{className:"w-5 h-5 text-purple-600 dar
450k:text-purple-400"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-medium text-sm",children:"Did you know?"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Harper has an AI Receptionist that answers calls & books jobs 24/7!"})]}),i.jsxs(q,{size:"sm",variant:"outline",className:"gap-1 border-purple-500/30 hover:bg-purple-500/10 flex-shrink-0",onClick:r,children:["Learn More",i.jsx(lv,{className:"w-3 h-3"})]})]})}):i.jsxs(Ee,{className:"p-5 bg-gradient-to-br from-purple-500/10 via-blue-500/10 to-purple-500/5 border-purple-500/20 relative",children:[t&&i.jsx("button",{onClick:t,className:"absolute top-2 right-2 p-1 hover:bg-muted rounded",children:i.jsx(Ls,{className:"w-4 h-4 text-muted-foreground"})}),i.jsxs("div",{className:"flex flex-col items-center text-center gap-3",children:[i.jsx("div",{className:"w-14 h-14 rounded-full bg-purple-500/20 flex items-center justify-center",children:i.jsx(Rd,{className:"w-7 h-7 text-purple-600 dark:text-purple-400"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold text-lg",children:"Meet Harper's AI Receptionist!"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Never miss a lead again. Our AI answers calls, qualifies leads, and books jobs automatically - even at 2am."})]}),i.jsxs(q,{className:"gap-2 bg-purple-600 hover:bg-purple-700",onClick:r,children:[i.jsx(Rd,{className:"w-4 h-4"}),"Explore AI Receptionist",i.jsx(lv,{className:"w-4 h-4"})]})]})]})},io=[{id:1,label:"Analyzing your content",icon:yE,duration:1500},{id:2,label:"Choosing the perfect layout",icon:Si,duration:2e3},{id:3,label:"Selecting colors & fonts",icon:na,duration:2e3},{id:4,label:"Adding your branding",icon:xu,duration:1500},{id:5,label:"Final polish",icon:Ze,duration:1e3}],Vd=["Ooh, this is going to look great! ð¨","Let me work my magic... â¨","Picking the perfect colors for you!","Almost there, looking fantastic!","Adding the finishing touches! ð"],i1=({isVisible:e,type:t="single",currentDay:r})=>{const[n,s]=h.useState(0),[o,a]=h.useState(Vd[0]);return h.useEffect(()=>{if(!e){s(0);return}let l=0;const c=()=>{l<io.length-1&&(l++,s(l),a(Vd[l%Vd.length]))},u=[];let d=0;return io.forEach((f,m)=>{m>0&&(d+=io[m-1].duration,u.push(setTimeout(c,d)))}),()=>{u.forEach(f=>clearTimeout(f))}},[e]),e?i.jsxs("div",{className:"flex flex-col items-center justify-center p-6 bg-gradient-to-br from-primary/5 via-accent/10 to-primary/5 rounded-xl border border-primary/20 min-h-[400px]",children:[i.jsxs("div",{className:"relative mb-6",children:[i.jsx("div",{className:"absolute inset-0 bg-accent/30 rounded-full blur-xl animate-pulse"}),i.jsx("img",{src:Dt,alt:"Harper is working",className:"relative w-20 h-20 rounded-full border-4 border-accent/50 shadow-lg animate-bounce-in"}),i.jsx("div",{className:"absolute -bottom-1 -right-1 w-6 h-6 bg-accent rounded-full flex items-center justify-center animate-spin-slow",children:i.jsx(Ze,{className:"w-3 h-3 text-accent-foreground"})})]}),i.jsx("p",{className:"text-lg font-medium text-foreground mb-2 text-center animate-fade-in",children:o},o),t==="weekly"&&r!==void 0&&i.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:["Creating day ",r," of 7..."]}),i.jsx("div",{className:"w-full max-w-xs space-y-3 mt-4",children:io.map((l,c)=>{const u=l.icon,d=c<n,f=c===n;return i.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg transition-all duration-300 ${f?"bg-accent/20 border border-accent/30":d?"bg-success/10":"opacity-40"}`,children:[i.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center transition-colors ${d?"bg-success text-success-foreground":f?"bg-accent text-accent-foreground":"bg-muted"}`,children:d?i.jsx(Br,{className:"w-4 h-4"}):i.jsx(u,{className:`w-4 h-4 ${f?"animate-pulse":""}`})}),i.jsx("span",{className:`text-sm ${f?"font-medium":""}`,children:l.label}),f&&i.jsxs("div",{className:"ml-auto flex gap-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 bg-accent rounded-full animate-bounce",style:{animationDelay:"0ms"}}),i.jsx("span",{className:"w-1.5 h-1.5 bg-accent rounded-full animate-bounce",style:{animationDelay:"150ms"}}),i.jsx("span",{className:"w-1.5 h-1.5 bg-accent rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})]},l.id)})}),i.jsxs("div",{className:"w-full max-w-xs mt-6",children:[i.jsx("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-accent to-primary rounded-full transition-all duration-500 ease-out",style:{width:`${(n+1)/io.length*100}%`}})}),i.jsxs("p",{className:"text-xs text-muted-foreground text-center mt-2",children:["Step ",n+1," of ",io.length]})]}),i.jsx(a1,{variant:"inline"})]}):null};var Gd="focusScope.autoFocusOnMount",qd="focusScope.autoFocusOnUnmount",py={bubbles:!1,cancelable:!0},kO="FocusScope",$u=h.forwardRef((e,t)=>
vendor: 4,227 bytes, line 450
450{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[l,c]=h.useState(null),u=Ve(s),d=Ve(o),f=h.useRef(null),m=ye(t,g=>c(g)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let g=function(w){if(p.paused||!l)return;const S=w.target;l.contains(S)?f.current=S:Cn(f.current,{select:!0})},b=function(w){if(p.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||Cn(f.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const _ of w)_.removedNodes.length>0&&Cn(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const v=new MutationObserver(y);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),v.disconnect()}}},[n,l,p.paused]),h.useEffect(()=>{if(l){gy.add(p);const g=document.activeElement;if(!l.contains(g)){const y=new CustomEvent(Gd,py);l.addEventListener(Gd,u),l.dispatchEvent(y),y.defaultPrevented||(CO(RO(l1(l)),{select:!0}),document.activeElement===g&&Cn(l))}return()=>{l.removeEventListener(Gd,u),setTimeout(()=>{const y=new CustomEvent(qd,py);l.addEventListener(qd,d),l.dispatchEvent(y),y.defaultPrevented||Cn(g??document.body,{select:!0}),l.removeEventListener(qd,d),gy.remove(p)},0)}}},[l,u,d,p]);const x=h.useCallback(g=>{if(!r&&!n||p.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(b&&y){const v=g.currentTarget,[w,S]=NO(v);w&&S?!g.shiftKey&&y===S?(g.preventDefault(),r&&Cn(w,{select:!0})):g.shiftKey&&y===w&&(g.preventDefault(),r&&Cn(S,{select:!0})):y===v&&g.preventDefault()}},[r,n,p.paused]);return i.jsx(se.div,{tabIndex:-1,...a,ref:m,onKeyDown:x})});$u.displayName=kO;function CO(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Cn(n,{select:t}),document.activeElement!==r)return}function NO(e){const t=l1(e),r=my(t,e),n=my(t.reverse(),e);return[r,n]}function l1(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function my(e,t){for(const r of e)if(!jO(r,{upTo:t}))return r}function jO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function EO(e){return e instanceof HTMLInputElement&&"select"in e}function Cn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&EO(e)&&t&&e.select()}}var gy=TO();function TO(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=vy(e,t),e.unshift(t)},remove(t){var r;e=vy(e,t),(r=e[0])==null||r.resume()}}}function vy(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function RO(e){return e.filter(t=>t.tagName!=="A")}var Kd=0;function vm(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yy()),document.body.insertAdjacentElement("beforeend",e[1]??yy()),Kd++,()=>{Kd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Kd--}},[])}function yy(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var $r=function(){return $r=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},$r.apply(this,arguments)};function c1(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function PO(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;
vendor: 4,973 bytes, lines 450-465
450n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var ac="right-scroll-bar-position",ic="width-before-scroll-bar",AO="with-scroll-bars-hidden",IO="--removed-body-scroll-bar-size";function Yd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function OO(e,t){var r=h.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var DO=typeof window<"u"?h.useLayoutEffect:h.useEffect,wy=new WeakMap;function MO(e,t){var r=OO(null,function(n){return e.forEach(function(s){return Yd(s,n)})});return DO(function(){var n=wy.get(r);if(n){var s=new Set(n),o=new Set(e),a=r.current;s.forEach(function(l){o.has(l)||Yd(l,null)}),o.forEach(function(l){s.has(l)||Yd(l,a)})}wy.set(r,e)},[e]),r}function LO(e){return e}function $O(e,t){t===void 0&&(t=LO);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var a=t(o,n);return r.push(a),function(){r=r.filter(function(l){return l!==a})}},assignSyncMedium:function(o){for(n=!0;r.length;){var a=r;r=[],a.forEach(o)}r={push:function(l){return o(l)},filter:function(){return r}}},assignMedium:function(o){n=!0;var a=[];if(r.length){var l=r;r=[],l.forEach(o),a=r}var c=function(){var d=a;a=[],d.forEach(o)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),r}}}};return s}function FO(e){e===void 0&&(e={});var t=$O(null);return t.options=$r({async:!0,ssr:!1},e),t}var u1=function(e){var t=e.sideCar,r=c1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return h.createElement(n,$r({},r))};u1.isSideCarExport=!0;function UO(e,t){return e.useMedium(t),u1}var d1=FO(),Jd=function(){},Fu=h.forwardRef(function(e,t){var r=h.useRef(null),n=h.useState({onScrollCapture:Jd,onWheelCapture:Jd,onTouchMoveCapture:Jd}),s=n[0],o=n[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,p=e.noRelative,x=e.noIsolation,g=e.inert,b=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,w=e.gapMode,S=c1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=m,k=MO([r,t]),C=$r($r({},S),s);return h.createElement(h.Fragment,null,d&&h.createElement(_,{sideCar:d1,removeScrollBar:u,shards:f,noRelative:p,noIsolation:x,inert:g,setCallbacks:o,allowPinchZoom:!!b,lockRef:r,gapMode:w}),a?h.cloneElement(h.Children.only(l),$r($r({},C),{ref:k})):h.createElement(v,$r({},C,{className:c,ref:k}),l))});Fu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fu.classNames={fullWidth:ic,zeroRight:ac};var zO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=zO();return t&&e.setAttribute("nonce",t),e}function WO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var VO=function(){var e=0,t=null;return{add:function(r){e==0&&(t=BO())&&(WO(t,r),HO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},GO=function(){var e=VO();return function(t,r){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},h1=function(){var e=GO(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},qO={left:0,top:0,right:0,gap:0},Qd=function(e){return parseInt(e||"",10)||0},KO=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Qd(r),Qd(n),Qd(s)]},YO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qO;var t=KO(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},JO=h1(),Uo="data-scroll-locked",QO=function(e,t,r,n){var s=e.left,o=e.top,a=e.right,l=e.gap;return r===void 0&&(r="margin"),` 451 .`.concat(AO,` { 452 overflow: hidden `).concat(n,`; 453 padding-right: `).concat(l,"px ").concat(n,`; 454 } 455 body[`).concat(Uo,`] { 456 overflow: hidden `).concat(n,`; 457 overscroll-behavior: contain; 458 `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` 459 padding-left: `.concat(s,`px; 460 padding-top: `).concat(o,`px; 461 padding-right: `).concat(a,`px; 462 margin-left:0; 463 margin-top:0; 464 margin-right: `).concat(l,"px ").concat(n,`; 465 `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";
465")].filter(Boolean).join(""),` 466 } 467 468 .`).concat(ac,` { 469 right: `).concat(l,"px ").concat(n,`; 470 } 471 472 .`).concat(ic,` { 473 margin-right: `).concat(l,"px ").concat(n,`; 474 } 475 476 .`).concat(ac," .").concat(ac,` { 477 right: 0 `).concat(n,`; 478 } 479 480 .`).concat(ic," .").concat(ic,` { 481 margin-right: 0 `).concat(n,`; 482 } 483 484 body[`).concat(Uo,`] { 485 `).concat(IO,": ").concat(l,`px; 486 } 487`)},xy=function(){var e=parseInt(document.body.getAttribute(Uo)||"0",10);return isFinite(e)?e:0},XO=function(){h.useEffect(function(){return document.body.setAttribute(Uo,(xy()+1).toString()),function(){var e=xy()-1;e<=0?document.body.removeAttribute(Uo):document.body.setAttribute(Uo,e.toString())}},[])},ZO=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;XO();var o=h.useMemo(function(){return YO(s)},[s]);return h.createElement(JO,{styles:QO(o,!t,s,r?"":"!important")})},Rf=!1;if(typeof window<"u")try{var Ol=Object.defineProperty({},"passive",{get:function(){return Rf=!0,!0}});window.addEventListener("test",Ol,Ol),window.removeEventListener("test",Ol,Ol)}catch{Rf=!1}var lo=Rf?{passive:!1}:!1,e4=function(e){return e.tagName==="TEXTAREA"},f1=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!e4(e)&&r[t]==="visible")},t4=function(e){return f1(e,"overflowY")},r4=function(e){return f1(e,"overflowX")},by=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=p1(e,n);if(s){var o=m1(e,n),a=o[1],l=o[2];if(a>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},n4=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},s4=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},p1=function(e,t){return e==="v"?t4(t):r4(t)},m1=function(e,t){return e==="v"?n4(t):s4(t)},o4=function(e,t){return e==="h"&&t==="rtl"?-1:1},a4=function(e,t,r,n,s){var o=o4(e,window.getComputedStyle(t).direction),a=o*n,l=r.target,c=t.contains(l),u=!1,d=a>0,f=0,m=0;do{if(!l)break;var p=m1(e,l),x=p[0],g=p[1],b=p[2],y=g-b-o*x;(x||y)&&p1(e,l)&&(f+=y,m+=x);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(m)<1||!s))&&(u=!0),u},Dl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Sy=function(e){return[e.deltaX,e.deltaY]},_y=function(e){return e&&"current"in e?e.current:e},i4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},l4=function(e){return` 488 .block-interactivity-`.concat(e,` {pointer-events: none;} 489 .allow-interactivity-`).concat(e,` {pointer-events: all;} 490`)},c4=0,co=[];function u4(e){var t=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),s=h.useState(c4++)[0],o=h.useState(h1)[0],a=h.useRef(e);h.useEffect(function(){a.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=PO([e.lockRef.current],(e.shards||[]).map(_y),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var y=Dl(g),v=r.current,w="deltaX"in g?g.deltaX:v[0]-y[0],S="deltaY"in g?g.deltaY:v[1]-y[1],_,k=g.target,C=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in g&&C==="h"&&k.type==="range")return!1;var j=by(C,k);if(!j)return!0;if(j?_=C:(_=C==="v"?"h":"v",j=by(C,k)),!j)return!1;if(!n.current&&"changedTouches"in g&&(w||S)&&(n.current=_),!_)return!0;var P=n.current||_;return a4(P,b,g,P==="h"?w:S,!0)},[]),c=h.useCallback(function(g){var b=g;if(!(!co.length||co[co.length-1]!==o)){var y="deltaY"in b?Sy(b):Dl(b),v=t.current.filter(function(_){return _.name===b.type&&(_.target===b.target||b.target===_.shadowParent)&&i4(_.delta,y)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}
vendor: 4,332 bytes, line 490
490if(!v){var w=(a.current.shards||[]).map(_y).filter(Boolean).filter(function(_){return _.contains(b.target)}),S=w.length>0?l(b,w[0]):!a.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),u=h.useCallback(function(g,b,y,v){var w={name:g,delta:b,target:y,should:v,shadowParent:d4(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=h.useCallback(function(g){r.current=Dl(g),n.current=void 0},[]),f=h.useCallback(function(g){u(g.type,Sy(g),g.target,l(g,e.lockRef.current))},[]),m=h.useCallback(function(g){u(g.type,Dl(g),g.target,l(g,e.lockRef.current))},[]);h.useEffect(function(){return co.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,lo),document.addEventListener("touchmove",c,lo),document.addEventListener("touchstart",d,lo),function(){co=co.filter(function(g){return g!==o}),document.removeEventListener("wheel",c,lo),document.removeEventListener("touchmove",c,lo),document.removeEventListener("touchstart",d,lo)}},[]);var p=e.removeScrollBar,x=e.inert;return h.createElement(h.Fragment,null,x?h.createElement(o,{styles:l4(s)}):null,p?h.createElement(ZO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function d4(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const h4=UO(d1,u4);var Uu=h.forwardRef(function(e,t){return h.createElement(Fu,$r({},e,{ref:t,sideCar:h4}))});Uu.classNames=Fu.classNames;var f4=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},uo=new WeakMap,Ml=new WeakMap,Ll={},Xd=0,g1=function(e){return e&&(e.host||g1(e.parentNode))},p4=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=g1(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},m4=function(e,t,r,n){var s=p4(t,Array.isArray(e)?e:[e]);Ll[r]||(Ll[r]=new WeakMap);var o=Ll[r],a=[],l=new Set,c=new Set(s),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(m){if(l.has(m))d(m);else try{var p=m.getAttribute(n),x=p!==null&&p!=="false",g=(uo.get(m)||0)+1,b=(o.get(m)||0)+1;uo.set(m,g),o.set(m,b),a.push(m),g===1&&x&&Ml.set(m,!0),b===1&&m.setAttribute(r,"true"),x||m.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return d(t),l.clear(),Xd++,function(){a.forEach(function(f){var m=uo.get(f)-1,p=o.get(f)-1;uo.set(f,m),o.set(f,p),m||(Ml.has(f)||f.removeAttribute(n),Ml.delete(f)),p||f.removeAttribute(r)}),Xd--,Xd||(uo=new WeakMap,uo=new WeakMap,Ml=new WeakMap,Ll={})}},ym=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=f4(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),m4(n,s,r,"aria-hidden")):function(){return null}},zu="Dialog",[v1,y1]=qt(zu),[g4,Nr]=v1(zu),w1=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=h.useRef(null),c=h.useRef(null),[u,d]=un({prop:n,defaultProp:s??!1,onChange:o,caller:zu});return i.jsx(g4,{scope:t,triggerRef:l,contentRef:c,contentId:nr(),titleId:nr(),descriptionId:nr(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(f=>!f),[d]),modal:a,children:r})};w1.displayName=zu;var x1="DialogTrigger",b1=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Nr(x1,r),o=ye(t,s.triggerRef);return i.jsx(se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":bm(s.open),...n,ref:o,onClick:G(e.onClick,s.onOpenToggle)})});b1.displayName=x1;var wm="DialogPortal",[v4,S1]=v1(wm,{forceMount:void 0}),_1=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=Nr(wm,t);return i.jsx(v4,{scope:t,forceMount:r,children:h.Children.map(n,a=>i.jsx(xt,{present:r||o.open,children:i.jsx(Ki,{asChild:!0,container:s,children:a})}))})};_1.displayName=wm;var Bc="DialogOverlay",k1=h.forwardRef((e,t)=>{const r=S1(Bc,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Nr(Bc,e.__scopeDialog);return o.modal?i.jsx(xt,{present:n||o.open,children:i.jsx(w4,{...s,ref:t})}):null});k1.displayName=Bc;var y4=Ms("DialogOverlay.RemoveScroll"),w4=h.forwardRef((e,t)=>
vendor: 4,636 bytes, lines 490-494
490{const{__scopeDialog:r,...n}=e,s=Nr(Bc,r);return i.jsx(Uu,{as:y4,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(se.div,{"data-state":bm(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Fs="DialogContent",C1=h.forwardRef((e,t)=>{const r=S1(Fs,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Nr(Fs,e.__scopeDialog);return i.jsx(xt,{present:n||o.open,children:o.modal?i.jsx(x4,{...s,ref:t}):i.jsx(b4,{...s,ref:t})})});C1.displayName=Fs;var x4=h.forwardRef((e,t)=>{const r=Nr(Fs,e.__scopeDialog),n=h.useRef(null),s=ye(t,r.contentRef,n);return h.useEffect(()=>{const o=n.current;if(o)return ym(o)},[]),i.jsx(N1,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&o.preventDefault()}),onFocusOutside:G(e.onFocusOutside,o=>o.preventDefault())})}),b4=h.forwardRef((e,t)=>{const r=Nr(Fs,e.__scopeDialog),n=h.useRef(!1),s=h.useRef(!1);return i.jsx(N1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((u=r.triggerRef.current)==null?void 0:u.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),N1=h.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,l=Nr(Fs,r),c=h.useRef(null),u=ye(t,c);return vm(),i.jsxs(i.Fragment,{children:[i.jsx($u,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx(ua,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":bm(l.open),...a,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(_4,{titleId:l.titleId}),i.jsx(C4,{contentRef:c,descriptionId:l.descriptionId})]})]})}),xm="DialogTitle",j1=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Nr(xm,r);return i.jsx(se.h2,{id:s.titleId,...n,ref:t})});j1.displayName=xm;var E1="DialogDescription",T1=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Nr(E1,r);return i.jsx(se.p,{id:s.descriptionId,...n,ref:t})});T1.displayName=E1;var R1="DialogClose",P1=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Nr(R1,r);return i.jsx(se.button,{type:"button",...n,ref:t,onClick:G(e.onClick,()=>s.onOpenChange(!1))})});P1.displayName=R1;function bm(e){return e?"open":"closed"}var A1="DialogTitleWarning",[S4,I1]=aj(A1,{contentName:Fs,titleName:xm,docsSlug:"dialog"}),_4=({titleId:e})=>{const t=I1(A1),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 491 492If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 493 494For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},k4="DialogDescriptionWarning",C4=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${I1(k4).contentName}}.`;return h.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},O1=w1,D1=b1,M1=_1,Sm=k1,_m=C1,km=j1,Cm=T1,Nm=P1;const ns=O1,jm=D1,N4=M1,L1=h.forwardRef(({className:e,...t},r)=>i.jsx(Sm,{ref:r,className:ae("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));L1.displayName=Sm.displayName;const gn=h.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(N4,{children:[i.jsx(L1,{}),i.jsxs(_m,{ref:n,className:ae("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
494nded-lg",e),...r,children:[t,i.jsxs(Nm,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(Ls,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));gn.displayName=_m.displayName;const ya=({className:e,...t})=>i.jsx("div",{className:ae("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ya.displayName="DialogHeader";const wa=h.forwardRef(({className:e,...t},r)=>i.jsx(km,{ref:r,className:ae("text-lg font-semibold leading-none tracking-tight",e),...t}));wa.displayName=km.displayName;const Bu=h.forwardRef(({className:e,...t},r)=>i.jsx(Cm,{ref:r,className:ae("text-sm text-muted-foreground",e),...t}));Bu.displayName=Cm.displayName;var j4=h.createContext(void 0);function el(e){const t=h.useContext(j4);return e||t||"ltr"}function Pf(e,[t,r]){return Math.min(r,Math.max(t,e))}function E4(e,t){return h.useReducer((r,n)=>t[r][n]??r,e)}var Em="ScrollArea",[$1,i5]=qt(Em),[T4,ir]=$1(Em),F1=h.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...a}=e,[l,c]=h.useState(null),[u,d]=h.useState(null),[f,m]=h.useState(null),[p,x]=h.useState(null),[g,b]=h.useState(null),[y,v]=h.useState(0),[w,S]=h.useState(0),[_,k]=h.useState(!1),[C,j]=h.useState(!1),P=ye(t,F=>c(F)),I=el(s);return i.jsx(T4,{scope:r,type:n,dir:I,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:m,scrollbarX:p,onScrollbarXChange:x,scrollbarXEnabled:_,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:C,onScrollbarYEnabledChange:j,onCornerWidthChange:v,onCornerHeightChange:S,children:i.jsx(se.div,{dir:I,...a,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});F1.displayName=Em;var U1="ScrollAreaViewport",z1=h.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,a=ir(U1,r),l=h.useRef(null),c=ye(t,l,a.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),i.jsx(se.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});z1.displayName=U1;var Gr="ScrollAreaScrollbar",Tm=h.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=ir(Gr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,l=e.orientation==="horizontal";return h.useEffect(()=>(l?o(!0):a(!0),()=>{l?o(!1):a(!1)}),[l,o,a]),s.type==="hover"?i.jsx(R4,{...n,ref:t,forceMount:r}):s.type==="scroll"?i.jsx(P4,{...n,ref:t,forceMount:r}):s.type==="auto"?i.jsx(B1,{...n,ref:t,forceMount:r}):s.type==="always"?i.jsx(Rm,{...n,ref:t}):null});Tm.displayName=Gr;var R4=h.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=ir(Gr,e.__scopeScrollArea),[o,a]=h.useState(!1);return h.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx(xt,{present:r||o,children:i.jsx(B1,{"data-state":o?"visible":"hidden",...n,ref:t})})}),P4=h.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=ir(Gr,e.__scopeScrollArea),o=e.orientation==="horizontal",a=Hu(()=>c("SCROLL_END"),100),[l,c]=E4("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,s.scrollHideDelay,c]),h.useEffect(()=>{const u=s.viewport,d=o?"scrollLeft":"scrollTop";if(u){let f=u[d];const m=()=>{const p=u[d];f!==p&&(c("SCROLL"),a()),f=p};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[s.viewport,o,c,a]),i.jsx(xt,{present:r||l!=="hidden",children:i.jsx(Rm,{"data-state":l==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:G(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:G(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),B1=h.forwardRef((e,t)=>
vendor: 4,771 bytes, line 494
494{const r=ir(Gr,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,a]=h.useState(!1),l=e.orientation==="horizontal",c=Hu(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;a(l?u:d)}},10);return aa(r.viewport,c),aa(r.content,c),i.jsx(xt,{present:n||o,children:i.jsx(Rm,{"data-state":o?"visible":"hidden",...s,ref:t})})}),Rm=h.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,s=ir(Gr,e.__scopeScrollArea),o=h.useRef(null),a=h.useRef(0),[l,c]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=q1(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:m=>a.current=m};function f(m,p){return L4(m,a.current,l,p)}return r==="horizontal"?i.jsx(A4,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollLeft,p=ky(m,l,s.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollLeft=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollLeft=f(m,s.dir))}}):r==="vertical"?i.jsx(I4,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollTop,p=ky(m,l);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollTop=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollTop=f(m))}}):null}),A4=h.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=ir(Gr,e.__scopeScrollArea),[a,l]=h.useState(),c=h.useRef(null),u=ye(t,c,o.onScrollbarXChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(H1,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Wu(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const m=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),Y1(m,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Hc(a.paddingLeft),paddingEnd:Hc(a.paddingRight)}})}})}),I4=h.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=ir(Gr,e.__scopeScrollArea),[a,l]=h.useState(),c=h.useRef(null),u=ye(t,c,o.onScrollbarYChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(H1,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Wu(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const m=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),Y1(m,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Hc(a.paddingTop),paddingEnd:Hc(a.paddingBottom)}})}})}),[O4,W1]=$1(Gr),H1=h.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...m}=e,p=ir(Gr,r),[x,g]=h.useState(null),b=ye(t,P=>g(P)),y=h.useRef(null),v=h.useRef(""),w=p.viewport,S=n.content-n.viewport,_=Ve(d),k=Ve(c),C=Hu(f,10);function j(P){if(y.current){const I=P.clientX-y.current.left,F=P.clientY-y.current.top;u({x:I,y:F})}}return h.useEffect(()=>{const P=I=>{const F=I.target;(x==null?void 0:x.contains(F))&&_(I,S)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[w,x,S,_]),h.useEffect(k,[n,k]),aa(x,C),aa(p.content,C),i.jsx(O4,{scope:r,scrollbar:x,hasThumb:s,onThumbChange:Ve(o),onThumbPointerUp:Ve(a),onThumbPositionChange:k,onThumbPointerDown:Ve(l),children:i.jsx(se.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:G(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),y.current=x.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),j(P))}),onPointerMove:G(e.onPointerMove,j),onPointerUp:G(e.onPointerUp,P=>{const I=P.target;I.hasPointerCapture(P.pointerId)&&I.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=""),y.current=null})})})}),Wc="ScrollAreaThumb",V1=h.forwardRef((e,t)=>
vendor: 4,095 bytes, line 494
494{const{forceMount:r,...n}=e,s=W1(Wc,e.__scopeScrollArea);return i.jsx(xt,{present:r||s.hasThumb,children:i.jsx(D4,{ref:t,...n})})}),D4=h.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=ir(Wc,r),a=W1(Wc,r),{onThumbPositionChange:l}=a,c=ye(t,f=>a.onThumbChange(f)),u=h.useRef(void 0),d=Hu(()=>{u.current&&(u.current(),u.current=void 0)},100);return h.useEffect(()=>{const f=o.viewport;if(f){const m=()=>{if(d(),!u.current){const p=$4(f,l);u.current=p,l()}};return l(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[o.viewport,d,l]),i.jsx(se.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:G(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),x=f.clientX-p.left,g=f.clientY-p.top;a.onThumbPointerDown({x,y:g})}),onPointerUp:G(e.onPointerUp,a.onThumbPointerUp)})});V1.displayName=Wc;var Pm="ScrollAreaCorner",G1=h.forwardRef((e,t)=>{const r=ir(Pm,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?i.jsx(M4,{...e,ref:t}):null});G1.displayName=Pm;var M4=h.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=ir(Pm,r),[o,a]=h.useState(0),[l,c]=h.useState(0),u=!!(o&&l);return aa(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),aa(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),a(d)}),u?i.jsx(se.div,{...n,ref:t,style:{width:o,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Hc(e){return e?parseInt(e,10):0}function q1(e,t){const r=e/t;return isNaN(r)?0:r}function Wu(e){const t=q1(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function L4(e,t,r,n="ltr"){const s=Wu(r),o=s/2,a=t||o,l=s-a,c=r.scrollbar.paddingStart+a,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return K1([c,u],f)(e)}function ky(e,t,r="ltr"){const n=Wu(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,a=t.content-t.viewport,l=o-n,c=r==="ltr"?[0,a]:[a*-1,0],u=Pf(e,c);return K1([0,a],[0,l])(u)}function K1(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Y1(e,t){return e>0&&e<t}var $4=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},a=r.left!==o.left,l=r.top!==o.top;(a||l)&&t(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function Hu(e,t){const r=Ve(e),n=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(n.current),[]),h.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function aa(e,t){const r=Ve(t);tt(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var J1=F1,F4=z1,U4=G1;const Vu=h.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(J1,{ref:n,className:ae("relative overflow-hidden",e),...r,children:[i.jsx(F4,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(Q1,{}),i.jsx(U4,{})]}));Vu.displayName=J1.displayName;const Q1=h.forwardRef(({className:e,orientation:t="vertical",...r},n)=>i.jsx(Tm,{ref:n,orientation:t,className:ae("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:i.jsx(V1,{className:"relative flex-1 rounded-full bg-border"})}));Q1.displayName=Tm.displayName;const Cy=({selectedPhotoUrl:e,onSelectPhoto:t,disabled:r})=>{const{user:n}=Xi(),[s,o]=h.useState(!1),[a,l]=h.useState([]),[c,u]=h.useState(!1);h.useEffect(()=>{n&&s&&d()},[n,s]);const d=async()=>{if(u(!0),n){const{data:p,error:x}
494=await yt.from("project_photos").select("id, photo_url, title, category, is_favorite").eq("user_id",n.id).order("is_favorite",{ascending:!1}).order("created_at",{ascending:!1});!x&&p&&l(p)}else try{const p=localStorage.getItem("guest_brand_settings");if(p){const g=JSON.parse(p).project_photos||[];l(g)}}catch{}u(!1)},f=p=>{t(p.photo_url),o(!1)},m=()=>{t(null),o(!1)};return i.jsxs(ns,{open:s,onOpenChange:o,children:[i.jsx(jm,{asChild:!0,children:i.jsxs(q,{variant:"outline",size:"sm",className:"gap-2",disabled:r,children:[i.jsx(Si,{className:"w-4 h-4"}),e?"Change Photo":"Use My Photo"]})}),i.jsxs(gn,{className:"max-w-lg",children:[i.jsx(ya,{children:i.jsxs(wa,{className:"flex items-center gap-2",children:[i.jsx(Si,{className:"w-5 h-5"}),"Select Project Photo"]})}),e&&i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted/50 rounded-lg",children:[i.jsx("img",{src:e,alt:"Selected",className:"w-12 h-12 object-cover rounded"}),i.jsx("span",{className:"text-sm flex-1",children:"Currently using your photo"}),i.jsx(q,{variant:"ghost",size:"sm",onClick:m,children:"Use AI Instead"})]}),i.jsx(Vu,{className:"h-[300px]",children:c?i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx("p",{className:"text-muted-foreground",children:"Loading photos..."})}):a.length===0?i.jsxs(Ee,{className:"p-8 text-center",children:[i.jsx(Ts,{className:"w-12 h-12 mx-auto mb-3 text-muted-foreground/50"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"No project photos yet"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload photos in Brand Settings to use them here"})]}):i.jsx("div",{className:"grid grid-cols-3 gap-2 p-1",children:a.map(p=>i.jsxs("button",{onClick:()=>f(p),className:`relative aspect-square rounded-lg overflow-hidden border-2 transition-all hover:ring-2 hover:ring-primary/50 ${e===p.photo_url?"border-primary ring-2 ring-primary/50":"border-transparent"}`,children:[i.jsx("img",{src:p.photo_url,alt:p.title||"Project photo",className:"w-full h-full object-cover"}),e===p.photo_url&&i.jsx("div",{className:"absolute inset-0 bg-primary/20 flex items-center justify-center",children:i.jsx(Br,{className:"w-8 h-8 text-primary"})}),p.is_favorite&&i.jsx("div",{className:"absolute top-1 left-1",children:i.jsx(dn,{className:"w-4 h-4 fill-yellow-400 text-yellow-400"})}),p.title&&i.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-1",children:i.jsx("p",{className:"text-[10px] text-white truncate",children:p.title})})]},p.id))})}),i.jsxs("div",{className:"flex justify-between pt-2",children:[i.jsx(q,{variant:"ghost",size:"sm",onClick:m,children:"Use AI-Generated Background"}),i.jsx(q,{variant:"outline",size:"sm",onClick:()=>o(!1),children:"Cancel"})]})]})]})};var Zd="rovingFocusGroup.onEntryFocus",z4={bubbles:!1,cancelable:!0},tl="RovingFocusGroup",[Af,X1,B4]=pu(tl),[W4,Gu]=qt(tl,[B4]),[H4,V4]=W4(tl),Z1=h.forwardRef((e,t)=>i.jsx(Af.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Af.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(G4,{...e,ref:t})})}));Z1.displayName=tl;var G4=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,m=h.useRef(null),p=ye(t,m),x=el(o),[g,b]=un({prop:a,defaultProp:l??null,onChange:c,caller:tl}),[y,v]=h.useState(!1),w=Ve(u),S=X1(r),_=h.useRef(!1),[k,C]=h.useState(0);return h.useEffect(()=>{const j=m.current;if(j)return j.addEventListener(Zd,w),()=>j.removeEventListener(Zd,w)},[w]),i.jsx(H4,{scope:r,orientation:n,dir:x,loop:s,currentTabStopId:g,onItemFocus:h.useCallback(j=>b(j),[b]),onItemShiftTab:h.useCallback(()=>v(!0),[]),onFocusableItemAdd:h.useCallback(()=>C(j=>j+1),[]),onFocusableItemRemove:h.useCallback(()=>C(j=>j-1),[]),children:i.jsx(se.div,{tabIndex:y||k===0?-1:0,"data-orientation":n,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:G(e.onMouseDown,()=>{_.current=!0}),onFocus:G(e.onFocus,j=>{const P=!_.current;if(j.target===j.currentTarget&&P&&!y){const I=new CustomEvent(Zd,z4);
vendor: 16,971 bytes, line 494
494if(j.currentTarget.dispatchEvent(I),!I.defaultPrevented){const F=S().filter(A=>A.focusable),D=F.find(A=>A.active),$=F.find(A=>A.id===g),O=[D,$,...F].filter(Boolean).map(A=>A.ref.current);rS(O,d)}}_.current=!1}),onBlur:G(e.onBlur,()=>v(!1))})})}),eS="RovingFocusGroupItem",tS=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,children:a,...l}=e,c=nr(),u=o||c,d=V4(eS,r),f=d.currentTabStopId===u,m=X1(r),{onFocusableItemAdd:p,onFocusableItemRemove:x,currentTabStopId:g}=d;return h.useEffect(()=>{if(n)return p(),()=>x()},[n,p,x]),i.jsx(Af.ItemSlot,{scope:r,id:u,focusable:n,active:s,children:i.jsx(se.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:G(e.onMouseDown,b=>{n?d.onItemFocus(u):b.preventDefault()}),onFocus:G(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:G(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=Y4(b,d.orientation,d.dir);if(y!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=m().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const S=w.indexOf(b.currentTarget);w=d.loop?J4(w,S+1):w.slice(S+1)}setTimeout(()=>rS(w))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:g!=null}):a})})});tS.displayName=eS;var q4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function K4(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Y4(e,t,r){const n=K4(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return q4[n]}function rS(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function J4(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var nS=Z1,sS=tS,If=["Enter"," "],Q4=["ArrowDown","PageUp","Home"],oS=["ArrowUp","PageDown","End"],X4=[...Q4,...oS],Z4={ltr:[...If,"ArrowRight"],rtl:[...If,"ArrowLeft"]},eD={ltr:["ArrowLeft"],rtl:["ArrowRight"]},rl="Menu",[Fi,tD,rD]=pu(rl),[Vs,aS]=qt(rl,[rD,pa,Gu]),qu=pa(),iS=Gu(),[nD,Gs]=Vs(rl),[sD,nl]=Vs(rl),lS=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:a=!0}=e,l=qu(t),[c,u]=h.useState(null),d=h.useRef(!1),f=Ve(o),m=el(s);return h.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),i.jsx(rm,{...l,children:i.jsx(nD,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:u,children:i.jsx(sD,{scope:t,onClose:h.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:m,modal:a,children:n})})})};lS.displayName=rl;var oD="MenuAnchor",Am=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=qu(r);return i.jsx(nm,{...s,...n,ref:t})});Am.displayName=oD;var Im="MenuPortal",[aD,cS]=Vs(Im,{forceMount:void 0}),uS=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=Gs(Im,t);return i.jsx(aD,{scope:t,forceMount:r,children:i.jsx(xt,{present:r||o.open,children:i.jsx(Ki,{asChild:!0,container:s,children:n})})})};uS.displayName=Im;var sr="MenuContent",[iD,Om]=Vs(sr),dS=h.forwardRef((e,t)=>{const r=cS(sr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Gs(sr,e.__scopeMenu),a=nl(sr,e.__scopeMenu);return i.jsx(Fi.Provider,{scope:e.__scopeMenu,children:i.jsx(xt,{present:n||o.open,children:i.jsx(Fi.Slot,{scope:e.__scopeMenu,children:a.modal?i.jsx(lD,{...s,ref:t}):i.jsx(cD,{...s,ref:t})})})})}),lD=h.forwardRef((e,t)=>{const r=Gs(sr,e.__scopeMenu),n=h.useRef(null),s=ye(t,n);return h.useEffect(()=>{const o=n.current;if(o)return ym(o)},[]),i.jsx(Dm,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:G(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),cD=h.forwardRef((e,t)=>{const r=Gs(sr,e.__scopeMenu);return i.jsx(Dm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),uD=Ms("MenuContent.ScrollLock"),Dm=h.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,onDismiss:p,disableOutsideScroll:x,...g}=e,b=Gs(sr,r),y=nl(sr,r),v=qu(r),w=iS(r),S=tD(r),[_,k]=h.useState(null),C=h.useRef(null),j=ye(t,C,b.onContentChange),P=h.useRef(0),I=h.useRef(""),F=h.useRef(0),D=h.useRef(null),$=h.useRef("right"),T=h.useRef(0),O=x?Uu:h.Fragment,A=x?{as:uD,allowPinchZoom:!0}:void 0,L=N=>{var H,me;const z=I.current+N,Y=S().filter(de=>!de.disabled),K=document.activeElement,te=(H=Y.find(de=>de.ref.current===K))==null?void 0:H.textValue,Z=Y.map(de=>de.textValue),ve=SD(Z,z,te),pe=(me=Y.find(de=>de.textValue===ve))==null?void 0:me.ref.current;(function de(he){I.current=he,window.clearTimeout(P.current),he!==""&&(P.current=window.setTimeout(()=>de(""),1e3))})(z),pe&&setTimeout(()=>pe.focus())};h.useEffect(()=>()=>window.clearTimeout(P.current),[]),vm();const E=h.useCallback(N=>{var Y,K;return $.current===((Y=D.current)==null?void 0:Y.side)&&kD(N,(K=D.current)==null?void 0:K.area)},[]);return i.jsx(iD,{scope:r,searchRef:I,onItemEnter:h.useCallback(N=>{E(N)&&N.preventDefault()},[E]),onItemLeave:h.useCallback(N=>{var z;E(N)||((z=C.current)==null||z.focus(),k(null))},[E]),onTriggerLeave:h.useCallback(N=>{E(N)&&N.preventDefault()},[E]),pointerGraceTimerRef:F,onPointerGraceIntentChange:h.useCallback(N=>{D.current=N},[]),children:i.jsx(O,{...A,children:i.jsx($u,{asChild:!0,trapped:s,onMountAutoFocus:G(o,N=>{var z;N.preventDefault(),(z=C.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:i.jsx(ua,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,onDismiss:p,children:i.jsx(nS,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:_,onCurrentTabStopIdChange:k,onEntryFocus:G(c,N=>{y.isUsingKeyboardRef.current||N.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(sm,{role:"menu","aria-orientation":"vertical","data-state":jS(b.open),"data-radix-menu-content":"",dir:y.dir,...v,...g,ref:j,style:{outline:"none",...g.style},onKeyDown:G(g.onKeyDown,N=>{const Y=N.target.closest("[data-radix-menu-content]")===N.currentTarget,K=N.ctrlKey||N.altKey||N.metaKey,te=N.key.length===1;Y&&(N.key==="Tab"&&N.preventDefault(),!K&&te&&L(N.key));const Z=C.current;if(N.target!==Z||!X4.includes(N.key))return;N.preventDefault();const pe=S().filter(H=>!H.disabled).map(H=>H.ref.current);oS.includes(N.key)&&pe.reverse(),xD(pe)}),onBlur:G(e.onBlur,N=>{N.currentTarget.contains(N.target)||(window.clearTimeout(P.current),I.current="")}),onPointerMove:G(e.onPointerMove,Ui(N=>{const z=N.target,Y=T.current!==N.clientX;if(N.currentTarget.contains(z)&&Y){const K=N.clientX>T.current?"right":"left";$.current=K,T.current=N.clientX}}))})})})})})})});dS.displayName=sr;var dD="MenuGroup",Mm=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(se.div,{role:"group",...n,ref:t})});Mm.displayName=dD;var hD="MenuLabel",hS=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(se.div,{...n,ref:t})});hS.displayName=hD;var Vc="MenuItem",Ny="menu.itemSelect",Ku=h.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=h.useRef(null),a=nl(Vc,e.__scopeMenu),l=Om(Vc,e.__scopeMenu),c=ye(t,o),u=h.useRef(!1),d=()=>{const f=o.current;if(!r&&f){const m=new CustomEvent(Ny,{bubbles:!0,cancelable:!0});f.addEventListener(Ny,p=>n==null?void 0:n(p),{once:!0}),Mp(f,m),m.defaultPrevented?u.current=!1:a.onClose()}};return i.jsx(fS,{...s,ref:c,disabled:r,onClick:G(e.onClick,d),onPointerDown:f=>{var m;(m=e.onPointerDown)==null||m.call(e,f),u.current=!0},onPointerUp:G(e.onPointerUp,f=>{var m;u.current||(m=f.currentTarget)==null||m.click()}),onKeyDown:G(e.onKeyDown,f=>{const m=l.searchRef.current!=="";r||m&&f.key===" "||If.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Ku.displayName=Vc;var fS=h.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,a=Om(Vc,r),l=iS(r),c=h.useRef(null),u=ye(t,c),[d,f]=h.useState(!1),[m,p]=h.useState("");return h.useEffect(()=>{const x=c.current;x&&p((x.textContent??"").trim())},[o.children]),i.jsx(Fi.ItemSlot,{scope:r,disabled:n,textValue:s??m,children:i.jsx(sS,{asChild:!0,...l,focusable:!n,children:i.jsx(se.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:u,onPointerMove:G(e.onPointerMove,Ui(x=>{n?a.onItemLeave(x):(a.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:G(e.onPointerLeave,Ui(x=>a.onItemLeave(x))),onFocus:G(e.onFocus,()=>f(!0)),onBlur:G(e.onBlur,()=>f(!1))})})})}),fD="MenuCheckboxItem",pS=h.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return i.jsx(wS,{scope:e.__scopeMenu,checked:r,children:i.jsx(Ku,{role:"menuitemcheckbox","aria-checked":Gc(r)?"mixed":r,...s,ref:t,"data-state":$m(r),onSelect:G(s.onSelect,()=>n==null?void 0:n(Gc(r)?!0:!r),{checkForDefaultPrevented:!1})})})});pS.displayName=fD;var mS="MenuRadioGroup",[pD,mD]=Vs(mS,{value:void 0,onValueChange:()=>{}}),gS=h.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=Ve(n);return i.jsx(pD,{scope:e.__scopeMenu,value:r,onValueChange:o,children:i.jsx(Mm,{...s,ref:t})})});gS.displayName=mS;var vS="MenuRadioItem",yS=h.forwardRef((e,t)=>{const{value:r,...n}=e,s=mD(vS,e.__scopeMenu),o=r===s.value;return i.jsx(wS,{scope:e.__scopeMenu,checked:o,children:i.jsx(Ku,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":$m(o),onSelect:G(n.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})});yS.displayName=vS;var Lm="MenuItemIndicator",[wS,gD]=Vs(Lm,{checked:!1}),xS=h.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=gD(Lm,r);return i.jsx(xt,{present:n||Gc(o.checked)||o.checked===!0,children:i.jsx(se.span,{...s,ref:t,"data-state":$m(o.checked)})})});xS.displayName=Lm;var vD="MenuSeparator",bS=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(se.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});bS.displayName=vD;var yD="MenuArrow",SS=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=qu(r);return i.jsx(om,{...s,...n,ref:t})});SS.displayName=yD;var wD="MenuSub",[l5,_S]=Vs(wD),za="MenuSubTrigger",kS=h.forwardRef((e,t)=>{const r=Gs(za,e.__scopeMenu),n=nl(za,e.__scopeMenu),s=_S(za,e.__scopeMenu),o=Om(za,e.__scopeMenu),a=h.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=o,u={__scopeMenu:e.__scopeMenu},d=h.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return h.useEffect(()=>d,[d]),h.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),i.jsx(Am,{asChild:!0,...u,children:i.jsx(fS,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":jS(r.open),...e,ref:fu(t,s.onTriggerChange),onClick:f=>{var m;(m=e.onClick)==null||m.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:G(e.onPointerMove,Ui(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:G(e.onPointerLeave,Ui(f=>{var p,x;d();const m=(p=r.content)==null?void 0:p.getBoundingClientRect();if(m){const g=(x=r.content)==null?void 0:x.dataset.side,b=g==="right",y=b?-5:5,v=m[b?"left":"right"],w=m[b?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x:v,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:v,y:m.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:G(e.onKeyDown,f=>{var p;const m=o.searchRef.current!=="";e.disabled||m&&f.key===" "||Z4[n.dir].includes(f.key)&&(r.onOpenChange(!0),(p=r.content)==null||p.focus(),f.preventDefault())})})})});kS.displayName=za;var CS="MenuSubContent",NS=h.forwardRef((e,t)=>{const r=cS(sr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Gs(sr,e.__scopeMenu),a=nl(sr,e.__scopeMenu),l=_S(CS,e.__scopeMenu),c=h.useRef(null),u=ye(t,c);return i.jsx(Fi.Provider,{scope:e.__scopeMenu,children:i.jsx(xt,{present:n||o.open,children:i.jsx(Fi.Slot,{scope:e.__scopeMenu,children:i.jsx(Dm,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;a.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:G(e.onFocusOutside,d=>{d.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:G(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:G(e.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),m=eD[a.dir].includes(d.key);f&&m&&(o.onOpenChange(!1),(p=l.trigger)==null||p.focus(),d.preventDefault())})})})})})});NS.displayName=CS;function jS(e){return e?"open":"closed"}function Gc(e){return e==="indeterminate"}function $m(e){return Gc(e)?"indeterminate":e?"checked":"unchecked"}function xD(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function bD(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function SD(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=bD(e,Math.max(o,0));s.length===1&&(a=a.filter(u=>u!==r));const c=a.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function _D(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],c=t[a],u=l.x,d=l.y,f=c.x,m=c.y;d>n!=m>n&&r<(f-u)*(n-d)/(m-d)+u&&(s=!s)}return s}function kD(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return _D(r,t)}function Ui(e){return t=>t.pointerType==="mouse"?e(t):void 0}var CD=lS,ND=Am,jD=uS,ED=dS,TD=Mm,RD=hS,PD=Ku,AD=pS,ID=gS,OD=yS,DD=xS,MD=bS,LD=SS,$D=kS,FD=NS,Yu="DropdownMenu",[UD,c5]=qt(Yu,[aS]),jt=aS(),[zD,ES]=UD(Yu),TS=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,c=jt(t),u=h.useRef(null),[d,f]=un({prop:s,defaultProp:o??!1,onChange:a,caller:Yu});return i.jsx(zD,{scope:t,triggerId:nr(),triggerRef:u,contentId:nr(),open:d,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(m=>!m),[f]),modal:l,children:i.jsx(CD,{...c,open:d,onOpenChange:f,dir:n,modal:l,children:r})})};TS.displayName=Yu;var RS="DropdownMenuTrigger",PS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=ES(RS,r),a=jt(r);return i.jsx(ND,{asChild:!0,...a,children:i.jsx(se.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:fu(t,o.triggerRef),onPointerDown:G(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:G(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});PS.displayName=RS;var BD="DropdownMenuPortal",AS=e=>{const{__scopeDropdownMenu:t,...r}=e,n=jt(t);return i.jsx(jD,{...n,...r})};AS.displayName=BD;var IS="DropdownMenuContent",OS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=ES(IS,r),o=jt(r),a=h.useRef(!1);return i.jsx(ED,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:G(e.onCloseAutoFocus,l=>{var c;a.current||(c=s.triggerRef.current)==null||c.focus(),a.current=!1,l.preventDefault()}),onInteractOutside:G(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!s.modal||d)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});OS.displayName=IS;var WD="DropdownMenuGroup",HD=h.forwardRef((e,t)=>
494{const{__scopeDropdownMenu:r,...n}=e,s=jt(r);return i.jsx(TD,{...s,...n,ref:t})});HD.displayName=WD;var VD="DropdownMenuLabel",DS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=jt(r);return i.jsx(RD,{...s,...n,ref:t})});DS.displayName=VD;var GD="DropdownMenuItem",MS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=jt(r);return i.jsx(PD,{...s,...n,ref:t})});MS.displayName=GD;var qD="DropdownMenuCheckboxItem",LS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=jt(r);return i.jsx(AD,{...s,...n,ref:t})});LS.displayName=qD;var KD="DropdownMenuRadioGroup",YD=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=jt(r);return i.jsx(ID,{...s,...n,ref:t})});YD.displayName=KD;var JD="DropdownMenuRadioItem",$S=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=jt(r);return i.jsx(OD,{...s,...n,ref:t})});$S.displayName=JD;var QD="DropdownMenuItemIndicator",FS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=jt(r);return i.jsx(DD,{...s,...n,ref:t})});FS.displayName=QD;var XD="DropdownMenuSeparator",US=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=jt(r);return i.jsx(MD,{...s,...n,ref:t})});US.displayName=XD;var ZD="DropdownMenuArrow",eM=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=jt(r);return i.jsx(LD,{...s,...n,ref:t})});eM.displayName=ZD;var tM="DropdownMenuSubTrigger",zS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=jt(r);return i.jsx($D,{...s,...n,ref:t})});zS.displayName=tM;var rM="DropdownMenuSubContent",BS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=jt(r);return i.jsx(FD,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});BS.displayName=rM;var nM=TS,sM=PS,oM=AS,WS=OS,HS=DS,VS=MS,GS=LS,qS=$S,KS=FS,YS=US,JS=zS,QS=BS;const aM=nM,iM=sM,lM=h.forwardRef(({className:e,inset:t,children:r,...n},s)=>i.jsxs(JS,{ref:s,className:ae("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...n,children:[r,i.jsx(eE,{className:"ml-auto h-4 w-4"})]}));lM.displayName=JS.displayName;const cM=h.forwardRef(({className:e,...t},r)=>i.jsx(QS,{ref:r,className:ae("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));cM.displayName=QS.displayName;const XS=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>i.jsx(oM,{children:i.jsx(WS,{ref:n,sideOffset:t,className:ae("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));XS.displayName=WS.displayName;const ZS=h.forwardRef(({className:e,inset:t,...r},n)=>i.jsx(VS,{ref:n,className:ae("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...r}));ZS.displayName=VS.displayName;const uM=h.forwardRef(({className:e,children:t,checked:r,...n},s)=>i.jsxs(GS,{ref:s,className:ae("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:r,...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(KS,{children:i.jsx(Br,{className:"h-4 w-4"})})}),t]}));uM.displayName=GS.displayName;const dM=h.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(qS,{ref:n,className:ae("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(KS,{children:i.jsx(nE,{className:"h-2 w-2 fill-current"})})}),t]}));dM.displayName=qS.displayName;const hM=h.forwardRef(({className:e,inset:t,...r},n)=>i.jsx(HS,{ref:n,className:ae("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));hM.displayName=HS.displayName;const fM=h.forwardRef(({className:e,...t},r)=>i.jsx(YS,{ref:r,className:ae("-mx-1 my-1 h-px bg-muted",e),...t}));fM.displayName=YS.displayName;const jy={financing:zp,general:bi,review:dn},Ey={professional:na,bold:Ji,seasonal:Wp,minimalistic:Ax},pM=({currentSettings:e,onLoadTemplate:t,disabled:r})=>{const{user:n}=Xi(),[s,o]=h.useState([]),[a,l]=h.useState(!1),[c,u]=h.useState(!1),[d,f]=h.useState(""),[m,p]=h.useState(!1);h.useEffect(()=>{n&&x()},[n]);const x=async()=>
494{if(!n)return;l(!0);const{data:S,error:_}=await yt.from("saved_templates").select("*").eq("user_id",n.id).order("use_count",{ascending:!1}).order("created_at",{ascending:!1});!_&&S&&o(S),l(!1)},g=async()=>{if(!n||!d.trim()){ne.error("Please enter a template name");return}p(!0);const{error:S}=await yt.from("saved_templates").insert({user_id:n.id,name:d.trim(),content_type:e.contentType,style:e.style,headline:e.headline||null,description:e.description||null});S?ne.error("Failed to save template"):(ne.success("Template saved!"),f(""),u(!1),x()),p(!1)},b=async S=>{await yt.from("saved_templates").update({use_count:S.use_count+1}).eq("id",S.id),t({contentType:S.content_type,style:S.style,headline:S.headline||"",description:S.description||""}),ne.success(`Loaded "${S.name}"`),x()},y=async(S,_)=>{_.stopPropagation();const{error:k}=await yt.from("saved_templates").delete().eq("id",S);k||(ne.success("Template deleted"),x())};if(!n)return null;const v=jy[e.contentType]||bi,w=Ey[e.style]||na;return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(aM,{children:[i.jsx(iM,{asChild:!0,children:i.jsxs(q,{variant:"outline",size:"sm",className:"gap-2",disabled:r||a,children:[i.jsx(av,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Templates"}),i.jsx(wu,{className:"w-3 h-3"})]})}),i.jsx(XS,{align:"start",className:"w-64",children:s.length===0?i.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground",children:[i.jsx(av,{className:"w-8 h-8 mx-auto mb-2 opacity-30"}),i.jsx("p",{children:"No saved templates yet"}),i.jsx("p",{className:"text-xs mt-1",children:"Save your first template below!"})]}):i.jsx(Vu,{className:"max-h-[300px]",children:s.map(S=>{const _=jy[S.content_type]||bi,k=Ey[S.style]||na;return i.jsxs(ZS,{className:"flex items-center justify-between py-3 cursor-pointer",onClick:()=>b(S),children:[i.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(_,{className:"w-4 h-4 text-primary"}),i.jsx(k,{className:"w-3 h-3 text-muted-foreground"})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-medium text-sm truncate",children:S.name}),i.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.headline||`${S.content_type} ⢠${S.style}`})]})]}),i.jsxs("div",{className:"flex items-center gap-2 ml-2",children:[S.use_count>0&&i.jsxs("span",{className:"text-xs text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:[S.use_count,"Ã"]}),i.jsx(q,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:C=>y(S.id,C),children:i.jsx(sf,{className:"w-3 h-3"})})]})]},S.id)})})})]}),i.jsxs(ns,{open:c,onOpenChange:u,children:[i.jsx(jm,{asChild:!0,children:i.jsxs(q,{variant:"ghost",size:"sm",className:"gap-2",disabled:r,children:[i.jsx(ov,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Save"})]})}),i.jsxs(gn,{className:"max-w-md",children:[i.jsxs(ya,{children:[i.jsxs(wa,{className:"flex items-center gap-2",children:[i.jsx(ov,{className:"w-5 h-5"}),"Save Template"]}),i.jsx(Bu,{children:"Save your current settings as a reusable template"})]}),i.jsxs("div",{className:"space-y-4 pt-2",children:[i.jsxs(Ee,{className:"p-4 bg-muted/30",children:[i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Current Settings"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(v,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm capitalize",children:e.contentType})]}),i.jsx("span",{className:"text-muted-foreground",children:"â¢"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(w,{className:"w-4 h-4 text-muted-foreground"}),i.jsx("span",{className:"text-sm capitalize",children:e.style})]})]}),e.headline&&i.jsxs("p",{className:"text-xs text-muted-foreground mt-2 truncate",children:['"',e.headline,'"']})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Template Name"}),i.jsx(Te,{value:d,onChange:S=>f(S.target.value),placeholder:"e.g., My Financing Post, Holiday Special...",autoFocus:!0})]}),i.jsxs(q,{onClick:g,className:"w-full gap-2",disabled:m||!d.trim(),children:[i.jsx(Ze,{className:"w-4 h-4"}),m?"Saving...":"Save Template"]})]})]})]})]})},mM=vu("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Wr({className:e,variant:t,...r}){return i.jsx("div",{className:ae(mM({variant:t}),e),...r})}const gM=e=>({roofing:"Roofing",hvac:"HVAC",plumbing:"Plumbing",electrical:"Electrical",windows:"Windows",siding:"Siding",flooring:"Flooring",painting:"Painting",landscaping:"Landscaping",fence:"Fencing",fencing:"Fencing",deck:"Deck",gutters:"Gutters",bathroom:"Bathroom",kitchen:"Kitchen",restoration:"Restoration"})[e.toLowerCase()]||"General",vM=e=>{if(!e)return[];const t=[],r=[...e.recentEvents||[],...e.upcomingEvents||[]];for(const n of r){const s=n.type.toLowerCase();(s.includes("snow")||s.includes("freeze")||s.includes("cold"))&&t.push("weather","season"),(s.includes("heat")||s.includes("hot"))&&t.push("weather","season"),(s.includes("rain")||s.includes("storm"))&&t.push("weather"),s.includes("wind")&&t.push("weather","urgency")}return e.current&&(e.current.temp<32||e.current.temp>
49490)&&t.push("weather","urgency"),[...new Set(t)]},yM=e=>{if(!e)return i.jsx(tf,{className:"w-3 h-3"});const t=e.toLowerCase();return t.includes("snow")||t.includes("cold")||t.includes("freeze")?i.jsx(Wp,{className:"w-3 h-3 text-blue-400"}):t.includes("rain")||t.includes("storm")?i.jsx(oE,{className:"w-3 h-3 text-blue-500"}):t.includes("hot")||t.includes("sun")||t.includes("clear")?i.jsx(rf,{className:"w-3 h-3 text-amber-400"}):i.jsx(tf,{className:"w-3 h-3 text-muted-foreground"})},wM=()=>{const e=new Date().getMonth();return e>=2&&e<=4?"spring":e>=5&&e<=7?"summer":e>=8&&e<=10?"fall":"winter"},xM=(e,t)=>{const r=[...t],n=wM(),s=new Date().getMonth();r.push("evergreen"),(n==="winter"||n==="summer")&&r.push("season");const o=(e==null?void 0:e.busy_season_months)||[];return o.length>0&&!o.includes(s+1)&&r.push("slow-season","financing"),e!=null&&e.years_in_business&&e.years_in_business>=5&&r.push("trust"),r.push("urgency","financing"),[...new Set(r)]},bM=({industry:e,onSelectOffer:t})=>{var _,k,C,j,P;const{userSettings:r}=Xi(),[n,s]=h.useState([]),[o,a]=h.useState(null),[l,c]=h.useState(!0),[u,d]=h.useState(!1),[f,m]=h.useState(null),[p,x]=h.useState(!1),g=e||(r==null?void 0:r.default_industry)||"",b=(r==null?void 0:r.business_city)||"",y=gM(g);h.useEffect(()=>{(async()=>{if(!b){x(!0);return}try{const{data:F,error:D}=await yt.functions.invoke("fetch-weather",{body:{city:b,industry:g}});D?(console.error("Weather fetch error:",D),x(!0)):F&&(a(F),x(!1))}catch(F){console.error("Weather fetch exception:",F),x(!0)}})()},[b,g]),h.useEffect(()=>{g&&(async()=>{c(!0);try{const{data:F,error:D}=await yt.from("offer_templates").select("*").in("industry",[y,"General"]).eq("is_active",!0).order("performance_tier",{ascending:!0}).order("use_count",{ascending:!1});D?console.error("Error fetching offers:",D):(console.log(`Loaded ${(F==null?void 0:F.length)||0} offers for industry: ${y}`),s(F||[]))}catch(F){console.error("Error in fetchOffers:",F)}c(!1)})()},[g,y]);const v=async()=>{if(n.length===0)return;if(d(!0),await new Promise(E=>setTimeout(E,800)),o!=null&&o.suggestions&&o.suggestions.length>0&&Math.random()<.4){const E=o.suggestions[Math.floor(Math.random()*o.suggestions.length)];t({headline:E.headline,description:E.description}),m(null),d(!1);return}const I=vM(o),F=xM(r,I);let D=n.filter(E=>{const N=E.industry===y,z=F.includes(E.trigger_type);return(!f||E.id!==f.id)&&(z||N)});D.length===0&&(D=n.filter(E=>!f||E.id!==f.id));const $=D.filter(E=>I.includes(E.trigger_type)),T=D.filter(E=>E.performance_tier==="top-performer"&&E.industry===y),O=D.filter(E=>E.industry===y);let A;const L=Math.random();$.length>0&&L<.35?A=$[Math.floor(Math.random()*$.length)]:L<.55&&T.length>0?A=T[Math.floor(Math.random()*T.length)]:L<.85&&O.length>0?A=O[Math.floor(Math.random()*O.length)]:D.length>0?A=D[Math.floor(Math.random()*D.length)]:A=n[Math.floor(Math.random()*n.length)],await yt.from("offer_templates").update({use_count:A.use_count+1}).eq("id",A.id),m(A),t({headline:A.headline,description:A.description||"",discountText:A.discount_text||void 0}),d(!1)};if(l)return i.jsx(Ee,{className:"p-4 animate-pulse",children:i.jsx("div",{className:"h-12 bg-muted rounded"})});if(n.length===0)return null;const w=n.filter(I=>I.industry===y).length,S=o&&!p&&(((_=o.recentEvents)==null?void 0:_.length)>0||((k=o.upcomingEvents)==null?void 0:k.length)>0);return i.jsxs(Ee,{className:"p-4 border-accent/20 bg-gradient-to-r from-accent/5 to-transparent",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("img",{src:Dt,alt:"Harper",className:`w-12 h-12 rounded-full ${u?"animate-bounce":""}`}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[i.jsx("span",{className:"text-sm font-medium",children:"Need help with your message?"}),w>0&&i.jsxs(Wr,{variant:"secondary",className:"text-[10px]",children:[w," ",y," ideas"]}),S&&i.jsxs(Wr,{variant:"outline",className:"text-[10px] gap-1",children:[yM((C=o==null?void 0:o.current)==null?void 0:C.condition),(j=o==null?void 0:o.current)!=null&&j.temp?`${Math.round(o.current.temp)}°F`:"Weather-aware"]})]}),i.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S?`Harper knows ${y.toLowerCase()} + current weather in ${b}`:`Harper knows ${y.toLowerCase()} marketing`})]}),i.jsx(q,{onClick:v,disabled:u||n.length===0,className:"gap-2 bg-accent hover:bg-accent/90 text-accent-foreground shrink-0",children:u?i.jsxs(i.Fragment,{children:[i.jsx(Ze,{className:"w-4 h-4 animate-spin"}),"Thinking..."]}):i.jsxs(i.Fragment,{children:[i.jsx(xu,{className:"w-4 h-4"}),"Let Harper Write"]})})]}),(f||(o==null?void 0:o.suggestions)&&o.suggestions.length>0)&&i.jsx("div",{className:"mt-3 pt-3 border-t border-border/50",children:i.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground flex-wrap",children:f?i.jsxs(i.Fragment,{children:[f.performance_tier==="top-performer"&&i.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[i.jsx(Hp,{className:"w-3 h-3"}),i.jsx("span",{children:"Top performer"})]}),i.jsx("span",{children:"â¢"}),i.jsx("span",{children:f.trigger_type}),i.jsx("span",{children:"â¢"}),i.jsx("span",{children:f.industry})]}):((P=o==null?void 0:o.suggestions)==null?void 0:P[0])&&i.jsxs("div",{className:"flex items-center gap-1 text-blue-600",children:[i.jsx(tf,{className:"w-3 h-3"}),i.jsx("span",{children:"Weather-based suggestion available"})]})})})]})},Ty={annualRatePercent:7.49,termYears:5};
494function e_(e,t=Ty.annualRatePercent,r=Ty.termYears){if(e<=0)return 0;const n=t/100/12,s=r*12;if(n===0)return Math.round(e/s);const o=e*(n*Math.pow(1+n,s))/(Math.pow(1+n,s)-1);return Math.round(o)}const Ry={roofing:12e3,siding:15e3,windows:1e4,gutters:2500,fence:8e3,deck:12e3,driveway:6e3,landscaping:8e3,kitchen:25e3,bathroom:15e3,flooring:8e3,painting:4e3,hvac:1e4,plumbing:5e3,electrical:6e3,restoration:8e3,pergola:12e3,septic:8e3,"general-contractor":15e3,"home-improvement":1e4,general:1e4,other:1e4};function t_(e){const t=(e==null?void 0:e.toLowerCase().trim())||"general";return Ry[t]||Ry.general}function r_(e){const t={roofing:"Roof",siding:"Siding",windows:"Windows",gutters:"Gutters",fence:"Fence",deck:"Deck",driveway:"Driveway",landscaping:"Landscaping",kitchen:"Kitchen",bathroom:"Bathroom",flooring:"Flooring",painting:"Painting",hvac:"HVAC System",plumbing:"Plumbing",electrical:"Electrical",restoration:"Restoration",pergola:"Pergola",septic:"Septic System","general-contractor":"Home Project","home-improvement":"Home Upgrade",general:"Home Upgrade",other:"Project"},r=(e==null?void 0:e.toLowerCase().trim())||"general";return t[r]||"Home Upgrade"}function SM(e,t){const r=t_(e),n=e_(r),s=r_(e);return[{headline:`Get Your Dream ${s} for as Low as $${n}/month`,description:"It's more affordable than you think with easy monthly payments"},{headline:`Get Your New ${s} for as Low as $${n}/month`,description:"Flexible financing makes it possible today"},{headline:`Get Your ${s} for as Low as $${n}/month`,description:"Same great work, payments that fit your budget"},{headline:`Get Your ${s} Project for as Low as $${n}/month`,description:"Affordable monthly payments starting today"},{headline:`Start Your ${s} for as Low as $${n}/month`,description:"Quality work with financing that works for you"}]}function _M(e,t){const r=t_(e),n=e_(r),s=r_(e);return[{type:"financing",headline:`Get Your ${s} for as Low as $${n}/month!`,description:"Flexible financing options available"},{type:"general",headline:"Quality You Can Trust!",description:"Licensed, insured, and ready to serve you"},{type:"financing",headline:`Get Your Dream ${s} for as Low as $${n}/month!`,description:"Easy approval for qualified buyers"},{type:"general",headline:"Your Local Home Improvement Experts",description:"Family-owned and dedicated to excellence"},{type:"financing",headline:`Start Your ${s} for as Low as $${n}/month!`,description:"Easy monthly payments that fit your budget"},{type:"general",headline:"Results That Speak For Themselves",description:"Join hundreds of happy homeowners"},{type:"general",headline:"Ready to Get Started?",description:"Free estimates, no obligation"}]}var n_="AlertDialog",[kM,u5]=qt(n_,[y1]),vn=y1(),s_=e=>{const{__scopeAlertDialog:t,...r}=e,n=vn(t);return i.jsx(O1,{...n,...r,modal:!0})};s_.displayName=n_;var CM="AlertDialogTrigger",NM=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=vn(r);return i.jsx(D1,{...s,...n,ref:t})});NM.displayName=CM;var jM="AlertDialogPortal",o_=e=>{const{__scopeAlertDialog:t,...r}=e,n=vn(t);return i.jsx(M1,{...n,...r})};o_.displayName=jM;var EM="AlertDialogOverlay",a_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=vn(r);return i.jsx(Sm,{...s,...n,ref:t})});a_.displayName=EM;var zo="AlertDialogContent",[TM,RM]=kM(zo),PM=ox("AlertDialogContent"),i_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=vn(r),a=h.useRef(null),l=ye(t,a),c=h.useRef(null);return i.jsx(S4,{contentName:zo,titleName:l_,docsSlug:"alert-dialog",children:i.jsx(TM,{scope:r,cancelRef:c,children:i.jsxs(_m,{role:"alertdialog",...o,...s,ref:l,onOpenAutoFocus:G(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[i.jsx(PM,{children:n}),i.jsx(IM,{contentRef:a})]})})})});i_.displayName=zo;var l_="AlertDialogTitle",c_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=vn(r);return i.jsx(km,{...s,...n,ref:t})});c_.displayName=l_;var u_="AlertDialogDescription",d_=h.forwardRef((e,t)=>
494{const{__scopeAlertDialog:r,...n}=e,s=vn(r);return i.jsx(Cm,{...s,...n,ref:t})});d_.displayName=u_;var AM="AlertDialogAction",h_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=vn(r);return i.jsx(Nm,{...s,...n,ref:t})});h_.displayName=AM;var f_="AlertDialogCancel",p_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=RM(f_,r),o=vn(r),a=ye(t,s);return i.jsx(Nm,{...o,...n,ref:a})});p_.displayName=f_;var IM=({contentRef:e})=>{const t=`\`${zo}\` requires a description for the component to be accessible for screen reader users. 495 496You can add a description to the \`${zo}\` by passing a \`${u_}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 497 498Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${zo}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 499 500For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},OM=s_,DM=o_,m_=a_,g_=i_,v_=h_,y_=p_,w_=c_,x_=d_;const MM=OM,LM=DM,b_=h.forwardRef(({className:e,...t},r)=>i.jsx(m_,{className:ae("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));b_.displayName=m_.displayName;const S_=h.forwardRef(({className:e,...t},r)=>i.jsxs(LM,{children:[i.jsx(b_,{}),i.jsx(g_,{ref:r,className:ae("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));S_.displayName=g_.displayName;const __=({className:e,...t})=>i.jsx("div",{className:ae("flex flex-col space-y-2 text-center sm:text-left",e),...t});__.displayName="AlertDialogHeader";const k_=({className:e,...t})=>i.jsx("div",{className:ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});k_.displayName="AlertDialogFooter";const C_=h.forwardRef(({className:e,...t},r)=>i.jsx(w_,{ref:r,className:ae("text-lg font-semibold",e),...t}));C_.displayName=w_.displayName;const N_=h.forwardRef(({className:e,...t},r)=>i.jsx(x_,{ref:r,className:ae("text-sm text-muted-foreground",e),...t}));N_.displayName=x_.displayName;const j_=h.forwardRef(({className:e,...t},r)=>i.jsx(v_,{ref:r,className:ae(fm(),e),...t}));j_.displayName=v_.displayName;const E_=h.forwardRef(({className:e,...t},r)=>i.jsx(y_,{ref:r,className:ae(fm({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));E_.displayName=y_.displayName;const $M=e=>new Promise((t,r)=>{const n=new Image,s=URL.createObjectURL(e);n.onload=()=>{const a=Math.min(1,1024/n.width),l=document.createElement("canvas");l.width=n.width*a,l.height=n.height*a,l.getContext("2d").drawImage(n,0,0,l.width,l.height),URL.revokeObjectURL(s),t(l.toDataURL("image/jpeg",.75))},n.onerror=()=>{URL.revokeObjectURL(s),r(new Error("Failed to load image"))},n.src=s}),$l=[{value:"financing",label:"Financing Promo",emoji:"ð°",icon:zp,description:"Promote your financing options",color:"text-green-600 dark:text-green-400",bgColor:"bg-green-500/10 border-green-500/50"},{value:"general",label:"General Content",emoji:"ð ",icon:bi,description:"Brand awareness & marketing",color:"text-blue-600 dark:text-blue-400",bgColor:"bg-blue-500/10 border-blue-500/50"},{value:"review",label:"Review Showcase",emoji:"â",icon:dn,description:"Highlight customer reviews",color:"text-amber-600 dark:text-amber-400",bgColor:"bg-
500amber-500/10 border-amber-500/50"}],eh=[{value:"professional",label:"Pro",description:"Clean",icon:na,color:"text-slate-600 dark:text-slate-400"},{value:"bold",label:"Bold",description:"Energy",icon:Ji,color:"text-orange-600 dark:text-orange-400"},{value:"seasonal",label:"Seasonal",description:"Holiday",icon:Wp,color:"text-sky-600 dark:text-sky-400"},{value:"minimalistic",label:"Minimal",description:"Simple",icon:Ax,color:"text-gray-600 dark:text-gray-400"}],th=[{value:"conversational",label:"Friendly",description:"Like a trusted neighbor"},{value:"direct",label:"Direct",description:"Get to the point"},{value:"aspirational",label:"Inspiring",description:"Dream big"}],Py=[{headline:"Let's get your home working like it should",description:"Quality work from people who care"},{headline:"Before winter hits, let's talk",description:"Now's the time to get ahead of the weather"},{headline:"Here's the thing about doing it right the first time",description:"It actually saves you money"},{headline:"Your neighbors just finished their project. Ready for yours?",description:"Let's make it happen"},{headline:"That thing you've been putting off? We can help.",description:"Free estimate, no pressure"}],Ay=[{text:"They showed up when they said they would and did exactly what they promised. Refreshing!",name:"Sarah M.",city:"Austin"},{text:"Our neighbors keep asking who did our work. Happy to tell them!",name:"John D.",city:"Houston"},{text:"Honest pricing, great communication, beautiful results. What more could you ask for?",name:"Mike R.",city:"Dallas"}],FM=({businessName:e,businessCity:t,industry:r,logoUrl:n,onGenerate:s,isGenerating:o,onBusinessInfoChange:a,quickActionData:l,onQuickActionConsumed:c,autoStartSparkyChoice:u,onAutoStartSparkyChoiceConsumed:d})=>{var as,is;const f=Au(),[m,p]=h.useState(1),[x,g]=h.useState("forward"),[b,y]=h.useState("financing"),[v,w]=h.useState("professional"),[S,_]=h.useState("conversational"),[k,C]=h.useState(!1),[j,P]=h.useState(e),[I,F]=h.useState(t),[D,$]=h.useState(r||"roofing"),[T,O]=h.useState(""),[A,L]=h.useState(""),[E,N]=h.useState(""),[z,Y]=h.useState(""),[K,te]=h.useState(""),[Z,ve]=h.useState(null),[pe,H]=h.useState(""),[me,de]=h.useState(""),[he,U]=h.useState(null),[re,be]=h.useState(!1),[Fe,we]=h.useState(!1),[Ye,Kt]=h.useState(!1),[Yt,Jt]=h.useState(!1),[yn,lr]=h.useState([]),jr=h.useMemo(()=>SM(D),[D]),st=2;h.useEffect(()=>{const W=localStorage.getItem("reuse_style_preset");if(W)try{const ce=JSON.parse(W);U(ce),ce.graphic_type&&["financing","general","review"].includes(ce.graphic_type)&&y(ce.graphic_type),ce.style&&w(ce.style),ce.headline&&O(ce.headline),localStorage.removeItem("reuse_style_preset"),p(2)}catch(ce){console.error("Failed to parse reuse preset:",ce),localStorage.removeItem("reuse_style_preset")}},[]),h.useEffect(()=>{l&&(l.type&&["financing","general","review"].includes(l.type)&&y(l.type),l.headline&&O(l.headline),l.description&&L(l.description),p(2),c==null||c())},[l,c]),h.useEffect(()=>{const W=localStorage.getItem("guest_brand_settings");if(W)try{const ce=JSON.parse(W);ce.scraped_reviews&&Array.isArray(ce.scraped_reviews)&&lr(ce.scraped_reviews)}catch(ce){console.error("Failed to parse guest settings for reviews:",ce)}},[]),h.useEffect(()=>{a&&(j!==e||I!==t||D!==r)&&a({businessName:j,businessCity:I,industry:D})},[j,I,D]);const qs=h.useCallback(()=>{m<st&&Rr()&&(g("forward"),p(m+1))},[m,st,b,v,T,E,z,K,j]),ba=h.useCallback(()=>{m>1&&(g("backward"),p(m-1))},[m]),We=dO({onSwipeLeft:()=>{!pe&&m<st&&Rr()&&qs()},onSwipeRight:()=>{!pe&&m>1&&ba()},threshold:50}),Er=()=>{if(b==="review"){const W=Ay[Math.floor(Math.random()*Ay.length)];N(W.text),Y(W.name),te(W.city)}else{const W=b==="financing"?jr:Py,ce=W[Math.floor(Math.random()*W.length)];O(ce.headline),L(ce.description)}ne.success("⨠Loaded new suggestion!")};h.useCallback(async()=>null,[]);const qr=h.useCallback(async()=>{const W=$l,ce=W[Math.floor(Math.random()*W.length)],ot=eh[Math.floor(Math.random()*eh.length)],wn=th[Math.floor(Math.random()*th.length)];y(ce.value),w(ot.value),_(wn.value);const ue=ce.value==="financing"?jr:Py,Se=ue[Math.floor(Math.random()*ue.length)];O(Se.headline),L(Se.description),ne.success(`ð² Harper chose ${ot.label} style! Generating...`),Kt(!0),we(!0),p(2);const je={type:ce.value,style:ot.value,messagingStyle:wn.value,headline:Se.headline,description:Se.description,projectPhotoUrl:Z};try{const at=await s(je);at.imageUrl&&(H(at.imageUrl),de(at.caption||""))}finally{we(!1)}},[s,Z,jr]),Tr=async()=>
500{if(!n){be(!0);return}await qr()},Ge=async()=>{be(!1),await qr()};h.useEffect(()=>{if(u){if(d==null||d(),!n){be(!0);return}qr()}},[u,qr,n,d]);const Ks=async()=>{Kt(!1);const ce=await s({type:b,style:v,messagingStyle:S,headline:T,description:A,reviewText:E,customerName:z,city:K,projectPhotoUrl:Z});ce.imageUrl&&(H(ce.imageUrl),de(ce.caption||""))},Ys=async()=>{if(!Yt){Jt(!0);try{const{data:W,error:ce}=await yt.functions.invoke("regenerate-caption",{body:{graphicType:b,industry:D,headline:T,description:A,reviewText:E,customerName:z,city:K,businessCity:I,businessName:e,messagingStyle:S}});if(ce)throw new Error(ce.message||"Failed to regenerate caption");if(W!=null&&W.error)throw new Error(W.error);W!=null&&W.caption&&(de(W.caption),ne.success("New caption generated!"))}catch(W){console.error("Error regenerating caption:",W),ne.error(W.message||"Failed to regenerate caption")}finally{Jt(!1)}}},Rr=()=>{switch(m){case 1:return!0;case 2:return b==="review"?E.trim()&&z.trim()&&K.trim():T.trim().length>0;default:return!1}},Js=["What are we creating?",(o||Fe)&&!pe?"Harper is creating your graphic":b==="review"?"Add the review details":"Craft your message"],Pr=["Pick your content type","Add your content and generate!"],Qs=async()=>{if(Ye){H(""),de(""),await qr();return}H(""),p(1),O(""),L(""),N(""),Y(""),te(""),ve(null)},Sa=W=>{W.contentType&&["financing","general","review"].includes(W.contentType)&&y(W.contentType),W.style&&w(W.style),W.headline&&O(W.headline),W.description&&L(W.description),p(2)};return i.jsxs("div",{className:"min-h-[calc(100vh-200px)] flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{src:Dt,alt:"Harper",className:"w-10 h-10 rounded-full border-2 border-primary/20"}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold",children:Js[m-1]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:Pr[m-1]})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(q,{variant:"outline",size:"sm",onClick:Tr,className:"gap-2 text-accent border-accent/30 hover:bg-accent/10",disabled:o,children:[i.jsx(xu,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Let Harper Choose!"})]}),i.jsx(pM,{currentSettings:{contentType:b,style:v,headline:T,description:A},onLoadTemplate:Sa,disabled:o})]})]}),i.jsx("div",{className:"flex gap-2 mb-6",children:Array.from({length:st}).map((W,ce)=>i.jsx("div",{className:`h-2 flex-1 rounded-full transition-all duration-300 ${ce+1<=m?"bg-accent":"bg-muted"}`},ce))}),i.jsxs("div",{className:"flex-1 touch-pan-y",...We,children:[i.jsx(fy,{isActive:m===1,direction:x,children:i.jsxs("div",{className:"space-y-6 max-w-4xl mx-auto",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Content Type"}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:$l.map(W=>(W.icon,i.jsxs("button",{onClick:()=>y(W.value),className:`p-4 rounded-xl border-2 transition-all text-center hover-scale ${b===W.value?W.bgColor:"bg-card border-transparent hover:border-primary/20"}`,children:[i.jsx("span",{className:"text-2xl block mb-1",children:W.emoji}),i.jsx("h3",{className:"font-medium text-sm",children:W.label}),i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 hidden sm:block",children:W.description})]},W.value)))})]}),i.jsxs(bO,{open:k,onOpenChange:C,children:[i.jsx(SO,{asChild:!0,children:i.jsxs(q,{variant:"ghost",className:"w-full justify-between gap-2 text-muted-foreground hover:text-foreground",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Dx,{className:"w-4 h-4"}),i.jsx("span",{children:"Customize Style & Background"})]}),i.jsx(wu,{className:`w-4 h-4 transition-transform ${k?"rotate-180":""}`})]})}),i.jsxs(_O,{className:"space-y-4 pt-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Style"}),i.jsx("div",{className:"grid grid-cols-4 gap-2",children:eh.map(W=>{const ce=W.icon;return i.jsxs("button",{onClick:()=>w(W.value),className:`p-3 rounded-xl border-2 transition-all text-center hover-scale ${v===W.value?"bg-primary/10 border-primary":"bg-card border-transparent hover:border-primary/20"}`,children:[i.jsx(ce,{className:`w-5 h-5 mx-auto mb-1 ${W.color}`}),i.jsx("h3",{className:"font-medium text-xs",children:W.label})]},W.value)})})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Message Tone"}),i.jsx("div",{className:"grid grid-cols-3 gap-2",children:th.map(W=>i.jsxs("button",{onClick:()=>_(W.value),className:`p-3 rounded-xl border-2 transition-all text-center hover-scale ${S===W.value?"bg-accent/10 border-accent":"bg-card border-transparent hover:border-accent/20"}`,children:[i.jsx("h3",{className:"font-medium text-xs",children:W.label}),i.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:W.description})]},W.value))})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Backgroun
500d Image"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Cy,{selectedPhotoUrl:Z,onSelectPhoto:ve,disabled:o}),Z?i.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[i.jsx(Si,{className:"w-4 h-4 text-primary"}),i.jsx("span",{children:"Using your photo"})]}):i.jsx("span",{className:"text-sm text-muted-foreground",children:"Harper will generate background"})]})]})]})]})]})}),i.jsx(fy,{isActive:m===2,direction:x,children:i.jsx("div",{className:"max-w-4xl mx-auto",children:o||Fe?i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"text-center animate-fade-in",children:[i.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Harper is creating..."}),i.jsxs("div",{className:"inline-flex items-center gap-3 px-4 py-2 bg-accent/10 rounded-full border border-accent/20",children:[i.jsx("span",{className:"text-lg",children:((as=$l.find(W=>W.value===b))==null?void 0:as.emoji)||"ð¨"}),i.jsx("span",{className:"font-medium text-sm",children:((is=$l.find(W=>W.value===b))==null?void 0:is.label)||"Content"}),i.jsx("span",{className:"text-muted-foreground",children:"â¢"}),i.jsxs("span",{className:"text-sm text-muted-foreground capitalize",children:[v," style"]})]})]}),i.jsx(i1,{isVisible:!0,type:"single"})]}):pe?i.jsxs("div",{className:"space-y-4 animate-fade-in",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("h3",{className:"text-xl font-semibold",children:"⨠Your Graphic is Ready!"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Download and share on social media"}),i.jsx("p",{className:"text-xs text-muted-foreground/70 mt-2 italic",children:'â¡ Harper makes errors sometimes. Just click "Create Again" if she does!'})]}),i.jsx("img",{src:pe,alt:"Generated Graphic",className:"w-full max-w-md mx-auto rounded-xl shadow-xl"}),me&&i.jsxs(Ee,{className:"max-w-md mx-auto p-4 bg-muted/30",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h4",{className:"text-sm font-medium",children:"ð Caption"}),i.jsxs("div",{className:"flex gap-1",children:[i.jsxs(q,{variant:"ghost",size:"sm",onClick:Ys,disabled:Yt,className:"gap-1 text-xs",children:[Yt?i.jsx(ho,{className:"w-3 h-3 animate-spin"}):i.jsx(_i,{className:"w-3 h-3"}),"New Caption"]}),i.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>{navigator.clipboard.writeText(me),ne.success("Caption copied!")},className:"gap-1 text-xs",children:[i.jsx(ec,{className:"w-3 h-3"}),"Copy"]})]})]}),i.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:me})]}),i.jsxs("div",{className:"flex justify-center gap-3 flex-wrap",children:[i.jsx(q,{asChild:!0,className:"gap-2 bg-accent hover:bg-accent/90",children:i.jsx("a",{href:pe,download:`${Fa(j)}-${b}.png`,children:"Download"})}),i.jsxs(q,{onClick:Qs,variant:"outline",className:"gap-2",children:[i.jsx(Ze,{className:"w-4 h-4"}),"Create Again"]}),i.jsxs(q,{onClick:()=>{H(""),de(""),p(1),y("financing"),w("professional"),O(""),L(""),N(""),Y(""),te(""),ve(null)},variant:"ghost",className:"gap-2",children:[i.jsx(Fr,{className:"w-4 h-4"}),"Start Over"]})]})]}):i.jsxs("div",{className:"space-y-4",children:[he&&i.jsx(Ee,{className:"p-3 bg-gold/10 border-gold/30",children:i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx(dn,{className:"w-4 h-4 fill-gold text-gold"}),i.jsx("span",{className:"font-medium",children:"Using starred style"}),i.jsxs("span",{className:"text-muted-foreground",children:["â ",he.style," ",he.graphic_type]}),i.jsx(q,{variant:"ghost",size:"sm",className:"ml-auto text-xs",onClick:()=>{U(null),p(1)},children:"Change"})]})}),!n&&i.jsx(Ee,{className:"p-3 bg-amber-500/10 border-amber-500/30",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(tE,{className:"w-5 h-5 text-amber-500 flex-shrink-0"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"Add your logo for branded graphics"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Your logo will appear on every graphic you create"})]}),i.jsx(q,{variant:"outline",size:"sm",onClick:()=>f("/settings"),className:"flex-shrink-0 border-amber-500/30 hover:bg-amber-500/10",children:"Add Logo"})]})}),b!=="review"&&i.jsx(bM,{industry:D,onSelectOffer:W=>{O(W.headline),L(W.description),ne.success("Offer applied!")}}),i.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[i.jsxs(Ee,{className:"p-5",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("h3",{className:"font-medium",children:b==="review"?"Review Details":"Your Message"}),b!=="review"&&i.jsxs(q,{variant:"ghost",size:"sm",onClick:Er,className:"gap-2 text-xs text-accent",children:[i.jsx(Mx,{className:"w-3 h-3"}),"Shuffle"]})]}),b==="review"?i.jsxs("div",{className:"space-y-4",children:[yn.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[i.jsx(Bp,{className:"w-3 h-3"}),"Reviews from your website:"]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:yn.slice(0,5).map((W,ce)=>i.jsx(q,{type:"button",variant:"outline",size:"sm",className:"text-xs h-auto py-1.5 px-2 whitespace-normal text-left max-w-[200px]",onClick:()=>{N(W.text),Y(W.customerName),te(W.city||I||""),ne.success("Review loaded!")},children:i.jsxs("span",{className:"line-clamp-1",children:['"',W.text.substring(0,40),'..."']})},ce))})]}),i.jsx($i,{value:E,onChange:W=>N(W.target.value),placeholder:"Paste the customer review here...",className:"min-h-[100px] resize-none"}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx(Te,{value:z,onChange:W=>Y(W.target.value),placeholder:"Customer name"}),i.jsx(Te,{value:K,onChange:W=>te(W.target.value),placeholder:"City"})]})]}):i.jsxs("div",{className:"space-y-4",children:[i.jsx(Te,{value:T,onChange:W=>O(W.target.value),placeholder:"Your headline...",className:"text-lg font-medium"}),i.jsx($i,{value:A,onChange:W=>L(W.target.value),placeholder:"Supporting text (optional)...",className:"min-h-[80px] resize-none"})]}),i.jsxs("div",{className:"mt-4 space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Backgroun
500d photo (optional):"}),i.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[i.jsx(Cy,{selectedPhotoUrl:Z,onSelectPhoto:ve,disabled:o}),i.jsxs("label",{children:[i.jsx(q,{variant:"outline",size:"sm",className:"gap-2 cursor-pointer",disabled:o,asChild:!0,children:i.jsxs("span",{children:[i.jsx(Ts,{className:"w-4 h-4"}),"Upload"]})}),i.jsx("input",{type:"file",accept:"image/*",className:"hidden",disabled:o,onChange:async W=>{var ot;const ce=(ot=W.target.files)==null?void 0:ot[0];if(ce){try{const wn=await $M(ce);ve(wn)}catch{ne.error("Failed to process image. Please try another.")}W.target.value=""}}})]})]})]}),Z&&i.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted/50 rounded-lg",children:[i.jsx("img",{src:Z,alt:"Selected background",className:"w-10 h-10 object-cover rounded"}),i.jsx("span",{className:"text-xs text-muted-foreground flex-1",children:"Photo will be used as background"}),i.jsx(q,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>ve(null),children:i.jsx(Ls,{className:"w-3 h-3"})})]})]}),i.jsxs(q,{onClick:Ks,className:"w-full mt-6 py-6 text-lg gap-2 bg-accent hover:bg-accent/90 text-accent-foreground shimmer pulse-glow",disabled:o||!Rr(),children:[i.jsx(Ze,{className:"w-5 h-5"}),"⨠Generate Graphic"]})]}),i.jsxs(Ee,{className:"p-5 bg-muted/30",children:[i.jsx("h3",{className:"font-medium mb-3 text-sm text-muted-foreground",children:"Live Preview"}),i.jsxs("div",{className:"aspect-square rounded-lg bg-gradient-to-br from-primary/20 to-accent/20 flex flex-col items-center justify-center p-6 text-center border-2 border-dashed border-primary/20",children:[b==="review"?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex gap-1 mb-3",children:[...Array(5)].map((W,ce)=>i.jsx(dn,{className:"w-6 h-6 fill-gold text-gold"},ce))}),i.jsxs("p",{className:"text-sm italic text-foreground/80 mb-3",children:['"',E||"Your review will appear here...",'"']}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["â ",z||"Customer Name",", ",K||"City"]})]}):i.jsxs(i.Fragment,{children:[i.jsx("h4",{className:"text-xl font-bold text-foreground mb-2",children:T||"Your headline here..."}),i.jsx("p",{className:"text-sm text-foreground/70",children:A||"Description will appear here"})]}),i.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground",children:[i.jsx("span",{className:"capitalize",children:b}),i.jsx("span",{children:"â¢"}),i.jsx("span",{className:"capitalize",children:v})]})]})]})]})]})})})]}),!pe&&!o&&!Fe&&i.jsxs("div",{className:"flex items-center justify-between pt-4 mt-4 border-t max-w-4xl mx-auto w-full",children:[i.jsx("div",{children:m>1&&i.jsxs(q,{variant:"ghost",onClick:ba,className:"gap-2",children:[i.jsx(Fr,{className:"w-4 h-4"}),"Back"]})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("span",{className:"text-sm text-muted-foreground",children:["Step ",m," of ",st]}),m<st&&i.jsxs(q,{onClick:qs,disabled:!Rr(),className:"gap-2",children:["Next",i.jsx(Up,{className:"w-4 h-4"})]})]})]}),i.jsx(MM,{open:re,onOpenChange:be,children:i.jsxs(S_,{children:[i.jsxs(__,{children:[i.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[i.jsx("img",{src:Dt,alt:"Harper",className:"w-12 h-12 rounded-full border-2 border-primary/20"}),i.jsx(C_,{className:"text-xl",children:"Add Your Logo for Best Results!"})]}),i.jsx(N_,{className:"text-base",children:"Your graphics will look more professional and on-brand with your company logo. Would you like to add it now?"})]}),i.jsxs(k_,{className:"flex-col sm:flex-row gap-2",children:[i.jsx(E_,{onClick:Ge,className:"sm:order-1",children:"Skip for Now"}),i.jsx(j_,{onClick:()=>{be(!1),f("/settings")},className:"sm:order-2",children:"Add Logo in Settings"})]})]})})]})},UM=({onGetStarted:e})=>{const t=Au();return i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-background via-background to-accent/5 flex flex-col items-center justify-center p-4 sm:p-6 animate-fade-in",children:i.jsxs("div",{className:"max-w-2xl w-full text-center space-y-8",children:[i.jsxs("div",{className:"relative inline-block",children:[i.jsx("div",{className:"absolute inset-0 bg-accent/20 rounded-full blur-2xl animate-pulse"}),i.jsx("img",{src:Dt,alt:"Harper",className:"relative w-24 h-24 sm:w-32 sm:h-32 rounded-full border-4 border-accent/30 mx-auto animate-float"}),i.jsx("span",{className:"absolute -top-1 -right-1 text-3xl animate-wave",children:"ð"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("h1",{className:"text-3xl sm:text-5xl font-bold text-foreground leading-tight",children:[i.jsx("span",{className:"text-accent",children:"Dominate"})," Your Local Market"]}),i.jsxs("p",{className:"text-lg sm:text-xl text-muted-foreground max-w-lg mx-auto leading-relaxed",children:["I'm ",i.jsx("span",{className:"text-accent font-semibold",children:"Harper"}),", your AI graphics partner. I create scroll-stopping social media content that keeps your business top of mindâevery single day."]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 py-4",children:[i.jsxs("div",{className:"flex flex-col items-center gap-2 p-4 rounded-xl bg-accent/5 border border-accent/10",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-accent/20 flex items-center justify-center",children:i.jsx(Ji,{className:"w-5 h-5 text-accent"})}),i.jsx("span",{className:"font-medium text-foreground",children:"30 Seconds"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"From idea to post"})]}),i.jsxs("div",{className:"flex flex-col items-center gap-2 p-4 rounded-xl bg-accent/5 border border-accent/10",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-accent/20 flex items-center justify-center",children:i.jsx(gE,{className:"w-5 h-5 text-accent"})}),i.jsx("span",{className:"font-medium text-foreground",children:"Brand Awareness"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Stay visible daily"})]}),i.jsxs("div",{className:"flex flex-col items-center gap-2 p-4 rounded-xl bg-accent/5 border border-accent/10",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-accent/20 flex items-center justify-center",children:i.jsx(Hp,{className:"w-5 h-5 text-accent"})}),i.jsx("span",{className:"font-medium text-foreground",children:"More Leads"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Turn followers into customers"})]})]}),i.jsx("div",{className:"space-y-3 pt-2",children:i.jsxs(q,{onClick:e,size:"lg",className:"py-6 px-8 text-lg bg-accent hover:bg-accent/90 text-accent-foreground shimmer gap-2",children:[i.jsx(Ze,{className:"w-5 h-5"}),"Start Creating",i.jsx(Up,{className:"w-4 h-4"})]})}),i.jsx("p",{className:"text-xs text-muted-foreground pt-2",children:"No account required ⢠Free to try"}),i.jsxs(q,{variant:"link",onClick:()=>t("/how-to-use"),className:"text-muted-foreground hover:text-accent gap-1",children:[i.jsx(rE,{className:"w-4 h-4"}),"First time? See how it works"]})]})})},zM=({data:e,getProgressToNextLevel:t,onViewBadges:r})=>{const n=t(e.harper_score,e.level),s=l=>l>=9?"text-purple-500":l>=7?"text-amber-500":l>=5?"text-blue-500":l>=3?"text-green-500":"text-slate-500",o=l=>l>=9?i.jsx(xi,{className:"w-4 h-4"}):l>=7?i.jsx(vE,{className:"w-4 h-4"}):l>=5?i.jsx(dn,{className:"w-4 h-4"}):l>=3?i.jsx(Ji,{className:"w-4 h-4"}):i.jsx(cv,{className:"w-4 h-4"}),a=l=>l>=30?"ð¥ð¥ð¥":l>=14?"ð¥ð¥":l>=7?"ð¥":l>=3?"â¨":"";return i.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 bg-muted/30 rounded-lg border border-border/50",children:[i.jsx(rc,{children:i.jsxs(nc,{children:[i.jsx(sc,{asChild:!0,children:i.jsxs("div",{className:`relative w-8 h-8 rounded-full bg-gradient-to-br from-primary/20 to-accent/20 flex items-center justify-center ${s(e.level)} cursor-default`,children:[o(e.level),i.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 w-4 h-4 rounded-full bg-background border border-accent flex items-center justify-center text-[10px] font-bold",children:e.level})]})}),i.jsxs(ei,{children:[i.jsx("p",{className:"font-medium",children:e.level_title}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Level ",e.level," ⢠",Math.round(n),"% to next"]})]})]})}),i.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.current_streak>0&&i.jsx(rc,{children:i.jsxs(nc,{children:[i.jsx(sc,{asChild:!0,children:i.jsxs("div",{className:"flex items-center gap-1 cursor-default",children:[i.jsx(cv,{className:"w-3.5 h-3.5 text-orange-500"}),i.jsx("span",{className:"font-medium",children:e.current_streak}),a(e.current_streak)&&i.jsx("span",{className:"text-xs",children:a(e.current_streak)})]})}),i.jsx(ei,{children:i.jsxs("p",{children:[e.current_streak," day streak! Best: ",e.longest_streak]})})]})}),i.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[i.jsx("span",{className:"font-medium text-foreground",children:e.total_creations}),i.jsx("span",{className:"text-xs",children:"created"})]}),e.badges_earned.length>0&&i.jsx(rc,{children:i.jsxs(nc,{children:[i.jsx(sc,{asChild:!0,children:i.jsxs("button",{onClick:r,className:"flex items-center gap-1 hover:scale-105 transition-transform",children:[i.jsx(xi,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{className:"font-medium",children:e.badges_earned.length})]})}),i.jsx(ei,{children:i.jsxs("p",{children:["View ",e.badges_earned.length," badges"]})})]})})]})]})},BM=({earnedBadges:e,open:t,onOpenChange:r})=>{const n=e.map(l=>l.id),s=l=>{switch(l){case"creation":return"bg-blue-500/10 border-blue-500/30 text-blue-600";case"streak":return"bg-orange-500/10 border-orange-500/30 text-orange-600";case"milestone":return"bg-purple-500/10 border-purple-500/30 text-purple-600";case"special":return"bg-amber-500/10 border-amber-500/30 text-amber-600";default:return"bg-slate-500/10 border-slate-500/30 text-slate-600"}},o=Tf.reduce((l,c)=>(l[c.category]||(l[c.category]=[]),l[c.category].push(c),l),{}),a={creation:"ð¨ Creation Badges",streak:"ð¥ Streak Badges",milestone:"ð Milestone Badges",special:"â Special Badges"};return i.jsx(ns,{open:t,onOpenChange:r,children:i.jsxs(gn,{className:"max-w-2xl",children:[i.jsx(ya,{children:i.jsxs(wa,{className:"flex items-center gap-2",children:[i.jsx(xi,{className:"w-5 h-5 text-amber-500"}),"Your Badges",i.jsxs(Wr,{variant:"secondary",className:"ml-2",children:[e.length," / ",Tf.length]})]})}),i.jsx(Vu,{className:"max-h-[60vh] pr-4",children:i.jsx("div",{className:"space-y-6",children:Object.entries(o).map(([l,c])=>i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-medium mb-3",children:a[l]}),i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:c.map(u=>{const d=n.includes(u.id),f=e.find(m=>m.id===u.id);return i.jsxs(Ee,{className:`p-3 relative transition-all ${d?s(l):"bg-muted/50 border-muted opacity-60"}`,children:[d&&i.jsx("div",{className:"absolute top-2 right-2",children:i.jsx(Br,{className:"w-4 h-4 text-green-500"})}),!d&&i.jsx("div",{className:"absolute top-2 right-2",children:i.jsx(cE,{className:"w-4 h-4 text-muted-foreground"})}),i.jsx("div",{className:"text-2xl mb-2",children:u.emoji}),i.jsx("h4",{className:"font-medium text-sm",children:u.name}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:u.description}),d&&(f==null?void 0:f.unlockedAt)&&i.jsxs("p",{className:"text-[10px] text-muted-foreground mt-2",children:["Earned ",new Date(f.unlockedAt).toLocaleDateString()]})]},u.id)})})]},l))})})]})})},WM=({isVisible:e,newLevel:t,previousLevel:r,onClose:n})=>{const[s,o]=h.useState(!1),a=Zr[t-1],l=Zr[r-1];return h.useEffect(()=>{if(e){o(!0);const c=setTimeout(()=>
500o(!1),3e3);return()=>clearTimeout(c)}},[e]),i.jsx(ns,{open:e,onOpenChange:c=>!c&&n(),children:i.jsxs(gn,{className:"max-w-sm text-center overflow-hidden",children:[s&&i.jsx("div",{className:"absolute inset-0 pointer-events-none overflow-hidden",children:Array.from({length:50}).map((c,u)=>i.jsx("div",{className:"absolute w-2 h-2 rounded-full animate-bounce",style:{left:`${Math.random()*100}%`,top:`${Math.random()*100}%`,backgroundColor:["#f59e0b","#3b82f6","#10b981","#8b5cf6","#ef4444"][Math.floor(Math.random()*5)],animationDelay:`${Math.random()*.5}s`,animationDuration:`${.5+Math.random()*.5}s`}},u))}),i.jsxs("div",{className:"relative mx-auto mb-4",children:[i.jsx("img",{src:Dt,alt:"Harper",className:"w-20 h-20 rounded-full border-4 border-accent animate-bounce"}),i.jsx("div",{className:"absolute -bottom-2 -right-2 w-10 h-10 rounded-full bg-accent flex items-center justify-center text-white font-bold text-lg",children:t})]}),i.jsxs("div",{className:"space-y-2 mb-6",children:[i.jsxs("h2",{className:"text-2xl font-bold text-accent flex items-center justify-center gap-2",children:[i.jsx(ef,{className:"w-6 h-6"}),"LEVEL UP!",i.jsx(ef,{className:"w-6 h-6"})]}),i.jsxs("div",{className:"flex items-center justify-center gap-3",children:[i.jsxs("div",{className:"text-center opacity-50",children:[i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Level ",r]}),i.jsx("p",{className:"font-medium",children:l==null?void 0:l.title})]}),i.jsx(Ze,{className:"w-5 h-5 text-accent"}),i.jsxs("div",{className:"text-center",children:[i.jsxs("p",{className:"text-sm text-accent",children:["Level ",t]}),i.jsx("p",{className:"font-bold text-lg",children:a==null?void 0:a.title})]})]})]}),(a==null?void 0:a.unlock)&&i.jsxs("div",{className:"bg-accent/10 rounded-lg p-4 mb-6",children:[i.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"ð New Unlock:"}),i.jsx("p",{className:"font-medium text-accent",children:a.unlock})]}),i.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 mb-6",children:[i.jsx("p",{className:"text-sm italic text-muted-foreground",children:`"Amazing work! You're becoming a marketing pro! Keep creating and watch your business grow!"`}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"- Harper ð"})]}),i.jsxs(q,{onClick:n,className:"w-full gap-2",children:[i.jsx(Ze,{className:"w-4 h-4"}),"Keep Creating!"]})]})})},HM=({badges:e,onClose:t})=>{const[r,n]=h.useState(0),[s,o]=h.useState(!0);if(h.useEffect(()=>{if(e.length>0){o(!0);const d=setTimeout(()=>o(!1),2e3);return()=>clearTimeout(d)}},[r,e.length]),e.length===0)return null;const a=e[r],l=r<e.length-1,c=()=>{l?n(d=>d+1):t()},u=d=>{switch(d){case"creation":return"from-blue-500/20 to-blue-500/5";case"streak":return"from-orange-500/20 to-orange-500/5";case"milestone":return"from-purple-500/20 to-purple-500/5";case"special":return"from-amber-500/20 to-amber-500/5";default:return"from-slate-500/20 to-slate-500/5"}};return i.jsx(ns,{open:e.length>0,onOpenChange:d=>!d&&t(),children:i.jsxs(gn,{className:`max-w-sm text-center bg-gradient-to-b ${u(a.category)}`,children:[i.jsx("button",{onClick:t,className:"absolute top-4 right-4 text-muted-foreground hover:text-foreground",children:i.jsx(Ls,{className:"w-4 h-4"})}),s&&i.jsx("div",{className:"absolute inset-0 pointer-events-none overflow-hidden",children:Array.from({length:20}).map((d,f)=>i.jsx(Ze,{className:"absolute w-4 h-4 text-amber-400 animate-ping",style:{left:`${Math.random()*100}%`,top:`${Math.random()*100}%`,animationDelay:`${Math.random()*.5}s`,animationDuration:`${1+Math.random()}s`}},f))}),e.length>1&&i.jsx("div",{className:"absolute top-4 left-4",children:i.jsxs(Wr,{variant:"secondary",className:"text-xs",children:[r+1," of ",e.length]})}),i.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[i.jsx(xi,{className:"w-5 h-5 text-amber-500"}),i.jsx("span",{className:"text-sm font-medium text-amber-600",children:"New Badge Earned!"})]}),i.jsx("div",{className:"text-7xl mb-4 animate-bounce",children:a.emoji}),i.jsxs("div",{className:"space-y-2 mb-6",children:[i.jsx("h2",{className:"text-2xl font-bold",children:a.name}),i.jsx("p",{className:"text-muted-foreground",children:a.description}),i.jsxs(Wr,{variant:"outline",className:"capitalize",children:[a.category," badge"]})]}),i.jsxs("div",{className:"flex items-start gap-3 bg-background/50 rounded-lg p-3 mb-6",children:[i.jsx("img",{src:Dt,alt:"Harper",className:"w-10 h-10 rounded-full border-2 border-accent"}),i.jsxs("div",{className:"text-left",children:[i.jsx("p",{className:"text-sm font-medium",children:"Harper says:"}),i.jsxs("p",{className:"text-xs text-muted-foreground italic",children:['"Incredible! You earned the ',a.name,' badge! Keep up the amazing work!"']})]})]}),i.jsx(q,{onClick:c,className:"w-full gap-2",children:l?i.jsxs(i.Fragment,{children:["Next Badge ",i.jsx(Ze,{className:"w-4 h-4"})]}):i.jsxs(i.Fragment,{children:["Awesome! ",i.jsx(Ze,{className:"w-4 h-4"})]})})]})})},VM=()=>{const{user:e}=Xi(),{data:t,isLoading:r,newBadges:n,leveledUp:s,previousLevel:o,clearNewBadges:a,clearLevelUp:l,getProgressToNextLevel:c}=t1(),[u,d]=h.useState(!1),[f,m]=h.useState({currentStreak:0,totalCreations:0,todayCreations:0,lastCreationDate:null});h.useEffect(()=>{if(!e){const x=localStorage.getItem("streak_data");x&&m(JSON.parse(x))}},[e]);const p=e?t:{...t,current_streak:f.currentStreak,total_creations:f.totalCreations,last_creation_date:f.lastCreationDate};return r?i.jsx("div",{className:"h-20 bg-muted/50 rounded-xl animate-pulse"}):i.jsxs(i.Fragment,{children:[i.jsx(WM,{isVisible:s,newLevel:t.level,previousLevel:o,onClose:l}),i.jsx(HM,{badges:n,onClose:a}),i.jsx(BM,{earnedBadges:t.badges_earned,open:u,onOpenChange:d}),i.jsx(zM,{data:p,getProgressToNextLevel:c,onViewBadges:()=>d(!0)})]})},GM=e=>{const t=new Date().toDateString(),r=localStorage.getItem("streak_data");let n=r?JSON.parse(r):{currentStreak:0,totalCreations:0,todayCreations:0,lastCreationDate:null};if(n.lastCreationDate===t)n.todayCreations+=1,n.totalCreations+=1;else{const s=new Date;s.setDate(s.getDate()-1),n.lastCreationDate===s.toDateString()?n.currentStreak+=1:n.currentStreak=1,n.todayCreations=1,n.totalCreations+=1,n.lastCreationDate=t}return localStorage.setItem("streak_data",JSON.stringify(n)),e&&(localStorage.getItem(`challenge_${t}`)||localStorage.setItem(`challenge_${t}`,e)),n};var Ju="Tabs",[qM,d5]=qt(Ju,[Gu]),T_=Gu(),[KM,Fm]=qM(Ju),R_=h.forwardRef((e,t)=>
vendor: 4,953 bytes, line 500
500{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=el(l),[f,m]=un({prop:n,onChange:s,defaultProp:o??"",caller:Ju});return i.jsx(KM,{scope:r,baseId:nr(),value:f,onValueChange:m,orientation:a,dir:d,activationMode:c,children:i.jsx(se.div,{dir:d,"data-orientation":a,...u,ref:t})})});R_.displayName=Ju;var P_="TabsList",A_=h.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,o=Fm(P_,r),a=T_(r);return i.jsx(nS,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:n,children:i.jsx(se.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});A_.displayName=P_;var I_="TabsTrigger",O_=h.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,a=Fm(I_,r),l=T_(r),c=L_(a.baseId,n),u=$_(a.baseId,n),d=n===a.value;return i.jsx(sS,{asChild:!0,...l,focusable:!s,active:d,children:i.jsx(se.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:G(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?a.onValueChange(n):f.preventDefault()}),onKeyDown:G(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(n)}),onFocus:G(e.onFocus,()=>{const f=a.activationMode!=="manual";!d&&!s&&f&&a.onValueChange(n)})})})});O_.displayName=I_;var D_="TabsContent",M_=h.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:o,...a}=e,l=Fm(D_,r),c=L_(l.baseId,n),u=$_(l.baseId,n),d=n===l.value,f=h.useRef(d);return h.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),i.jsx(xt,{present:s||d,children:({present:m})=>i.jsx(se.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&o})})});M_.displayName=D_;function L_(e,t){return`${e}-trigger-${t}`}function $_(e,t){return`${e}-content-${t}`}var YM=R_,F_=A_,U_=O_,z_=M_;const JM=YM,B_=h.forwardRef(({className:e,...t},r)=>i.jsx(F_,{ref:r,className:ae("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));B_.displayName=F_.displayName;const go=h.forwardRef(({className:e,...t},r)=>i.jsx(U_,{ref:r,className:ae("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));go.displayName=U_.displayName;const vo=h.forwardRef(({className:e,...t},r)=>i.jsx(z_,{ref:r,className:ae("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));vo.displayName=z_.displayName;var QM="Label",W_=h.forwardRef((e,t)=>i.jsx(se.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));W_.displayName=QM;var H_=W_;const XM=vu("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),lt=h.forwardRef(({className:e,...t},r)=>i.jsx(H_,{ref:r,className:ae(XM(),e),...t}));lt.displayName=H_.displayName;function ZM(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var eL=[" ","Enter","ArrowUp","ArrowDown"],tL=[" ","Enter"],Us="Select",[Qu,Xu,rL]=pu(Us),[xa,h5]=qt(Us,[rL,pa]),Zu=pa(),[nL,ss]=xa(Us),[sL,oL]=xa(Us),V_=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:a,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:m,required:p,form:x}=e,g=Zu(t),[b,y]=h.useState(null),[v,w]=h.useState(null),[S,_]=h.useState(!1),k=el(u),[C,j]=un({prop:n,defaultProp:s??!1,onChange:o,caller:Us}),[P,I]=un({prop:a,defaultProp:l,onChange:c,caller:Us}),F=h.useRef(null),D=b?x||!!b.closest("form"):!0,[$,T]=h.useState(new Set),O=Array.from($).map(A=>A.props.value).join(";");return i.jsx(rm,{...g,children:i.jsxs(nL,{required:p,scope:t,trigger:b,onTriggerChange:y,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:_,contentId:nr(),value:P,onValueChange:I,open:C,onOpenChange:j,dir:k,triggerPointerDownPosRef:F,disabled:m,children:[i.jsx(Qu.Provider,{scope:t,children:i.jsx(sL,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(A=>{T(L=>new Set(L).add(A))},[]),onNativeOptionRemove:h.useCallback(A=>{T(L=>{const E=new Set(L);return E.delete(A),E})},[]),children:r})}),D?i.jsxs(mk,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:P,onChange:A=>
vendor: 16,958 bytes, line 500
500I(A.target.value),disabled:m,form:x,children:[P===void 0?i.jsx("option",{value:""}):null,Array.from($)]},O):null]})})};V_.displayName=Us;var G_="SelectTrigger",q_=h.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Zu(r),a=ss(G_,r),l=a.disabled||n,c=ye(t,a.onTriggerChange),u=Xu(r),d=h.useRef("touch"),[f,m,p]=vk(g=>{const b=u().filter(w=>!w.disabled),y=b.find(w=>w.value===a.value),v=yk(b,g,y);v!==void 0&&a.onValueChange(v.value)}),x=g=>{l||(a.onOpenChange(!0),p()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return i.jsx(nm,{asChild:!0,...o,children:i.jsx(se.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":gk(a.value)?"":void 0,...s,ref:c,onClick:G(s.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&x(g)}),onPointerDown:G(s.onPointerDown,g=>{d.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(x(g),g.preventDefault())}),onKeyDown:G(s.onKeyDown,g=>{const b=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&m(g.key),!(b&&g.key===" ")&&eL.includes(g.key)&&(x(),g.preventDefault())})})})});q_.displayName=G_;var K_="SelectValue",Y_=h.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:a="",...l}=e,c=ss(K_,r),{onValueNodeHasChildrenChange:u}=c,d=o!==void 0,f=ye(t,c.onValueNodeChange);return tt(()=>{u(d)},[u,d]),i.jsx(se.span,{...l,ref:f,style:{pointerEvents:"none"},children:gk(c.value)?i.jsx(i.Fragment,{children:a}):o})});Y_.displayName=K_;var aL="SelectIcon",J_=h.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return i.jsx(se.span,{"aria-hidden":!0,...s,ref:t,children:n||"â¼"})});J_.displayName=aL;var iL="SelectPortal",Q_=e=>i.jsx(Ki,{asChild:!0,...e});Q_.displayName=iL;var zs="SelectContent",X_=h.forwardRef((e,t)=>{const r=ss(zs,e.__scopeSelect),[n,s]=h.useState();if(tt(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?Hs.createPortal(i.jsx(Z_,{scope:e.__scopeSelect,children:i.jsx(Qu.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),o):null}return i.jsx(ek,{...e,ref:t})});X_.displayName=zs;var hr=10,[Z_,os]=xa(zs),lL="SelectContentImpl",cL=Ms("SelectContent.RemoveScroll"),ek=h.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:x,hideWhenDetached:g,avoidCollisions:b,...y}=e,v=ss(zs,r),[w,S]=h.useState(null),[_,k]=h.useState(null),C=ye(t,H=>S(H)),[j,P]=h.useState(null),[I,F]=h.useState(null),D=Xu(r),[$,T]=h.useState(!1),O=h.useRef(!1);h.useEffect(()=>{if(w)return ym(w)},[w]),vm();const A=h.useCallback(H=>{const[me,...de]=D().map(re=>re.ref.current),[he]=de.slice(-1),U=document.activeElement;for(const re of H)if(re===U||(re==null||re.scrollIntoView({block:"nearest"}),re===me&&_&&(_.scrollTop=0),re===he&&_&&(_.scrollTop=_.scrollHeight),re==null||re.focus(),document.activeElement!==U))return},[D,_]),L=h.useCallback(()=>A([j,w]),[A,j,w]);h.useEffect(()=>{$&&L()},[$,L]);const{onOpenChange:E,triggerPointerDownPosRef:N}=v;h.useEffect(()=>{if(w){let H={x:0,y:0};const me=he=>{var U,re;H={x:Math.abs(Math.round(he.pageX)-(((U=N.current)==null?void 0:U.x)??0)),y:Math.abs(Math.round(he.pageY)-(((re=N.current)==null?void 0:re.y)??0))}},de=he=>{H.x<=10&&H.y<=10?he.preventDefault():w.contains(he.target)||E(!1),document.removeEventListener("pointermove",me),N.current=null};return N.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",de,{capture:!0})}}},[w,E,N]),h.useEffect(()=>{const H=()=>E(!1);return window.addEventListener("blur",H),window.addEventListener("resize",H),()=>{window.removeEventListener("blur",H),window.removeEventListener("resize",H)}},[E]);const[z,Y]=vk(H=>{const me=D().filter(U=>!U.disabled),de=me.find(U=>U.ref.current===document.activeElement),he=yk(me,H,de);he&&setTimeout(()=>he.ref.current.focus())}),K=h.useCallback((H,me,de)=>{const he=!O.current&&!de;(v.value!==void 0&&v.value===me||he)&&(P(H),he&&(O.current=!0))},[v.value]),te=h.useCallback(()=>w==null?void 0:w.focus(),[w]),Z=h.useCallback((H,me,de)=>{const he=!O.current&&!de;(v.value!==void 0&&v.value===me||he)&&F(H)},[v.value]),ve=n==="popper"?Of:tk,pe=ve===Of?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:x,hideWhenDetached:g,avoidCollisions:b}:{};return i.jsx(Z_,{scope:r,content:w,viewport:_,onViewportChange:k,itemRefCallback:K,selectedItem:j,onItemLeave:te,itemTextRefCallback:Z,focusSelectedItem:L,selectedItemText:I,position:n,isPositioned:$,searchRef:z,children:i.jsx(Uu,{as:cL,allowPinchZoom:!0,children:i.jsx($u,{asChild:!0,trapped:v.open,onMountAutoFocus:H=>{H.preventDefault()},onUnmountAutoFocus:G(s,H=>{var me;(me=v.trigger)==null||me.focus({preventScroll:!0}),H.preventDefault()}),children:i.jsx(ua,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:H=>H.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:i.jsx(ve,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:H=>H.preventDefault(),...y,...pe,onPlaced:()=>T(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:G(y.onKeyDown,H=>{const me=H.ctrlKey||H.altKey||H.metaKey;if(H.key==="Tab"&&H.preventDefault(),!me&&H.key.length===1&&Y(H.key),["ArrowUp","ArrowDown","Home","End"].includes(H.key)){let he=D().filter(U=>!U.disabled).map(U=>U.ref.current);if(["ArrowUp","End"].includes(H.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(H.key)){const U=H.target,re=he.indexOf(U);he=he.slice(re+1)}setTimeout(()=>A(he)),H.preventDefault()}})})})})})})});ek.displayName=lL;var uL="SelectItemAlignedPosition",tk=h.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=ss(zs,r),a=os(zs,r),[l,c]=h.useState(null),[u,d]=h.useState(null),f=ye(t,C=>d(C)),m=Xu(r),p=h.useRef(!1),x=h.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:y,focusSelectedItem:v}=a,w=h.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&u&&g&&b&&y){const C=o.trigger.getBoundingClientRect(),j=u.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),I=y.getBoundingClientRect();if(o.dir!=="rtl"){const U=I.left-j.left,re=P.left-U,be=C.left-re,Fe=C.width+be,we=Math.max(Fe,j.width),Ye=window.innerWidth-hr,Kt=Pf(re,[hr,Math.max(hr,Ye-we)]);l.style.minWidth=Fe+"px",l.style.left=Kt+"px"}else{const U=j.right-I.right,re=window.innerWidth-P.right-U,be=window.innerWidth-C.right-re,Fe=C.width+be,we=Math.max(Fe,j.width),Ye=window.innerWidth-hr,Kt=Pf(re,[hr,Math.max(hr,Ye-we)]);l.style.minWidth=Fe+"px",l.style.right=Kt+"px"}const F=m(),D=window.innerHeight-hr*2,$=g.scrollHeight,T=window.getComputedStyle(u),O=parseInt(T.borderTopWidth,10),A=parseInt(T.paddingTop,10),L=parseInt(T.borderBottomWidth,10),E=parseInt(T.paddingBottom,10),N=O+A+$+E+L,z=Math.min(b.offsetHeight*5,N),Y=window.getComputedStyle(g),K=parseInt(Y.paddingTop,10),te=parseInt(Y.paddingBottom,10),Z=C.top+C.height/2-hr,ve=D-Z,pe=b.offsetHeight/2,H=b.offsetTop+pe,me=O+A+H,de=N-me;if(me<=Z){const U=F.length>0&&b===F[F.length-1].ref.current;l.style.bottom="0px";const re=u.clientHeight-g.offsetTop-g.offsetHeight,be=Math.max(ve,pe+(U?te:0)+re+L),Fe=me+be;l.style.height=Fe+"px"}else{const U=F.length>0&&b===F[0].ref.current;l.style.top="0px";const be=Math.max(Z,O+g.offsetTop+(U?K:0)+pe)+de;l.style.height=be+"px",g.scrollTop=me-Z+g.offsetTop}l.style.margin=`${hr}px 0`,l.style.minHeight=z+"px",l.style.maxHeight=D+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[m,o.trigger,o.valueNode,l,u,g,b,y,o.dir,n]);tt(()=>w(),[w]);const[S,_]=h.useState();tt(()=>{u&&_(window.getComputedStyle(u).zIndex)},[u]);const k=h.useCallback(C=>{C&&x.current===!0&&(w(),v==null||v(),x.current=!1)},[w,v]);return i.jsx(hL,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:k,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:i.jsx(se.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});tk.displayName=uL;var dL="SelectPopperPosition",Of=h.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=hr,...o}=e,a=Zu(r);return i.jsx(sm,{...a,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Of.displayName=dL;var[hL,Um]=xa(zs,{}),Df="SelectViewport",rk=h.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=os(Df,r),a=Um(Df,r),l=ye(t,o.onViewportChange),c=h.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),i.jsx(Qu.Slot,{scope:r,children:i.jsx(se.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:G(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&f){const p=Math.abs(c.current-d.scrollTop);if(p>0){const x=window.innerHeight-hr*2,g=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),y=Math.max(g,b);if(y<x){const v=y+p,w=Math.min(x,v),S=v-w;f.style.height=w+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});rk.displayName=Df;var nk="SelectGroup",[fL,pL]=xa(nk),mL=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=nr();return i.jsx(fL,{scope:r,id:s,children:i.jsx(se.div,{role:"group","aria-labelledby":s,...n,ref:t})})});mL.displayName=nk;var sk="SelectLabel",ok=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=pL(sk,r);return i.jsx(se.div,{id:s.id,...n,ref:t})});ok.displayName=sk;var qc="SelectItem",[gL,ak]=xa(qc),ik=h.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...a}=e,l=ss(qc,r),c=os(qc,r),u=l.value===n,[d,f]=h.useState(o??""),[m,p]=h.useState(!1),x=ye(t,v=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,v,n,s)}),g=nr(),b=h.useRef("touch"),y=()=>{s||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(gL,{scope:r,value:n,disabled:s,textId:g,isSelected:u,onItemTextChange:h.useCallback(v=>{f(w=>w||((v==null?void 0:v.textContent)??"").trim())},[]),children:i.jsx(Qu.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:i.jsx(se.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:x,onFocus:G(a.onFocus,()=>p(!0)),onBlur:G(a.onBlur,()=>p(!1)),onClick:G(a.onClick,()=>{b.current!=="mouse"&&y()}),onPointerUp:G(a.onPointerUp,()=>{b.current==="mouse"&&y()}),onPointerDown:G(a.onPointerDown,v=>{b.current=v.pointerType}),onPointerMove:G(a.onPointerMove,v=>{var w;b.current=v.pointerType,s?(w=c.onItemLeave)==null||w.call(c):b.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:G(a.onPointerLeave,v=>{var w;v.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:G(a.onKeyDown,v=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&v.key===" "||(tL.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});ik.displayName=qc;var Ba="SelectItemText",lk=h.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,a=ss(Ba,r),l=os(Ba,r),c=ak(Ba,r),u=oL(Ba,r),[d,f]=h.useState(null),m=ye(t,y=>f(y),c.onItemTextChange,y=>{var v;return(v=l.itemTextRefCallback)==null?void 0:v.call(l,y,c.value,c.disabled)}),p=d==null?void 0:d.textContent,x=h.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=u;return tt(()=>(g(x),()=>b(x)),[g,b,x]),i.jsxs(i.Fragment,{children:[i.jsx(se.span,{id:c.textId,...o,ref:m}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Hs.createPortal(o.children,a.valueNode):null]})});lk.displayName=Ba;var ck="SelectItemIndicator",uk=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return ak(ck,r).isSelected?i.jsx(se.span,{"aria-hidden":!0,...n,ref:t}):null});uk.displayName=ck;var Mf="SelectScrollUpButton",dk=h.forwardRef((e,t)=>{const r=os(Mf,e.__scopeSelect),n=Um(Mf,e.__scopeSelect),[s,o]=h.useState(!1),a=ye(t,n.onScrollButtonChange);return tt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;o(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?i.jsx(fk,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});dk.displayName=Mf;var Lf="SelectScrollDownButton",hk=h.forwardRef((e,t)=>{const r=os(Lf,e.__scopeSelect),n=Um(Lf,e.__scopeSelect),[s,o]=h.useState(!1),a=ye(t,n.onScrollButtonChange);return tt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;o(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?i.jsx(fk,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});hk.displayName=Lf;var fk=h.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=os("SelectScrollButton",r),a=h.useRef(null),l=Xu(r),c=h.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),tt(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),i.jsx(se.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:G(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:G(s.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:G(s.onPointerLeave,()=>{c()})})}),vL="SelectSeparator",pk=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return i.jsx(se.div,{"aria-hidden":!0,...n,ref:t})});pk.displayName=vL;var $f="SelectArrow",yL=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Zu(r),o=ss($f,r),a=os($f,r);return o.open&&a.position==="popper"?i.jsx(om,{...s,...n,ref:t}):null});yL.displayName=$f;var wL="SelectBubbleInput",mk=h.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=h.useRef(null),o=ye(n,s),a=ZM(t);return h.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&d){const f=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[a,t]),i.jsx(se.select,{...r,style:{...cx,...r.style},ref:o,defaultValue:t})});mk.displayName=wL;function gk(e){return e===""||e===void 0}function vk(e){const t=Ve(e),r=h.useRef(""),n=h.useRef(0),s=h.useCallback(a=>{const l=r.current+a;t(l),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),o=h.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function yk(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=xL(e,Math.max(o,0));s.length===1&&(a=a.filter(u=>u!==r));const c=a.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function xL(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var bL=V_,wk=q_,SL=Y_,_L=J_,kL=Q_,xk=X_,CL=rk,bk=ok,Sk=ik,NL=lk,jL=uk,_k=dk,kk=hk,Ck=pk;const Ff=bL,Uf=SL,Kc=h.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(wk,{ref:n,className:ae("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
500ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,i.jsx(_L,{asChild:!0,children:i.jsx(wu,{className:"h-4 w-4 opacity-50"})})]}));Kc.displayName=wk.displayName;const Nk=h.forwardRef(({className:e,...t},r)=>i.jsx(_k,{ref:r,className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(ef,{className:"h-4 w-4"})}));Nk.displayName=_k.displayName;const jk=h.forwardRef(({className:e,...t},r)=>i.jsx(kk,{ref:r,className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(wu,{className:"h-4 w-4"})}));jk.displayName=kk.displayName;const Yc=h.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>i.jsx(kL,{children:i.jsxs(xk,{ref:s,className:ae("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[i.jsx(Nk,{}),i.jsx(CL,{className:ae("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(jk,{})]})}));Yc.displayName=xk.displayName;const EL=h.forwardRef(({className:e,...t},r)=>i.jsx(bk,{ref:r,className:ae("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));EL.displayName=bk.displayName;const Jc=h.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(Sk,{ref:n,className:ae("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(jL,{children:i.jsx(Br,{className:"h-4 w-4"})})}),i.jsx(NL,{children:t})]}));Jc.displayName=Sk.displayName;const TL=h.forwardRef(({className:e,...t},r)=>i.jsx(Ck,{ref:r,className:ae("-mx-1 my-1 h-px bg-muted",e),...t}));TL.displayName=Ck.displayName;const Fl=null,ds=null;const rh=[{value:"general-contractor",label:"General Contractor"},{value:"roofing",label:"Roofing"},{value:"hvac",label:"HVAC"},{value:"plumbing",label:"Plumbing"},{value:"electrical",label:"Electrical"},{value:"landscaping",label:"Landscaping"},{value:"painting",label:"Painting"},{value:"kitchen",label:"Kitchen Remodeling"},{value:"bathroom",label:"Bathroom Remodeling"},{value:"flooring",label:"Flooring"},{value:"siding",label:"Siding"},{value:"deck",label:"Deck & Patio"},{value:"windows",label:"Windows & Doors"},{value:"gutters",label:"Gutters"},{value:"fence",label:"Fencing"},{value:"driveway",label:"Driveway & Concrete"},{value:"restoration",label:"Restoration"},{value:"pergola",label:"Pergolas & Outdoor Structures"},{value:"septic",label:"Septic Services"},{value:"other",label:"Other"}],RL={roofing:[{value:"shingle",label:"Shingle Roofing"},{value:"metal",label:"Metal Roofing"},{value:"flat-tpo",label:"Flat/TPO Roofing"},{value:"tile",label:"Tile Roofing"},{value:"repairs",label:"Repairs Only"},{value:"commercial",label:"Commercial"},{value:"residential",label:"Residential"},{value:"storm-damage",label:"Storm Damage"}],fence:[{value:"vinyl",label:"Vinyl Fence"},{value:"wood",label:"Wood Fence"},{value:"chain-link",label:"Chain-link"},{value:"aluminum",label:"Aluminum"},{value:"ornamental-iron",label:"Ornamental Iron"},{value:"farm-agricultural",label:"Farm/Agricultural"},{value:"pool-fencing",label:"Pool Fencing"},{value:"privacy",label:"Privacy Fencing"}],hvac:[{value:"residential",label:"Residential"},{value:"commercial",label:"Commercial"},{value:"heat-pumps",label:"Heat Pumps"},{value:"ductless",label:"Ductless Mini-Splits"},{value:"geothermal",label:"Geothermal"},{value:"repairs",label:"Repairs & Service"},{value:"installations",label:"New Installations"},{value:"duct-work",label:"Duct Work"}],landscaping:[{value:"hardscaping",label:"Hardscaping"},{value:"softscaping",label:"Softscaping"},{value:"irrigation",label:"Irrigation"},{value:"lawn-care",label:"Lawn Care"},{value:"tree-service",label:"Tree Service"},{value:"design",label:"Landscape Design"},{value:"maintenance",label:"Maintenance"},{value:"outdoor-living",label:"Outdoor Living"}],plumbing:[{value:"residential",label:"Residential"},{value:"commercial",label:"Commercial"},{value:"drain-cleaning",label:"Drain Cleaning"},{value:"water-heaters",label:"Water Heaters"},{value:"repiping",label:"Repiping"},{value:"sewer",label:"Sewer Lines"},{value:"emergency",label:"Emergency Service"},{value:"fixtures",label:"Fixture Installation"}],electrical:[{value:"residential",label:"Residential"},{value:"commercial",label:"Commercial"},{value:"panel-upgrades",label:"Panel Upgrades"},{value:"wiring",label:"Wiring & Rewiring"},{value:"lighting",label:"Lighting"},{value:"ev-charging",label:"EV Charging"},{value:"generators",label:"Generators"},{value:"smart-home",label:"Smart Home"}],painting:[{value:"interior",label:"Interior"},{value:"exterior",label:"Exterior"},{value:"residential",label:"Residential"},{value:"commercial",label:"Commercial"},{value:"cabinets",label:"Cabinet Painting"},{value:"staining",label:"Staining"},{value:"pressure-washing",label:"Pressure Washing"},{value:"drywall-repair",label:"Drywall Repair"}],kitchen:[{value:"full-remodel",label:"Full Remodel"},{value:"cabinet-refacing",label:"Cabinet Refacing"},{value:"countertops",label:"Countertops"},{value:"backsplash",label:"Backsplash"},{value:"flooring",label:"Kitchen Flooring"},{value:"lighting",label:"Kitchen Lighting"},{value:"islands",label:"Kitchen Islands"},{value:"appliances",label:"Appliance Install"}],bathroom:[{value:"full-remodel",label:"Full Remodel"},{value:"tub-shower",label:"Tub/Shower"},{value:"tile",label:"Tile Work"},{value:"vanity",label:"Vanity & Counters"},{value:"accessibility",label:"Accessibility"},{value:"spa-luxury",label:"Spa/Luxury"},{value:"walk-in-tubs",label:"Walk-in Tubs"},{value:"shower-conversions",label:"Shower Conversions"}],flooring:[{value:"hardwood",label:"Hardwood"},{value:"laminate",label:"Laminate"},{value:"vinyl-lvp",label:"Vinyl/LVP"},{value:"tile",label:"Tile"},{value:"carpet",label:"Carpet"},{value:"refinishing",label:"Refinishing"},{value:"commercial",label:"Commercial"},{value:"waterproof",label:"Waterproof"}],siding:[{value:"vinyl",label:"Vinyl Siding"},{value:"james-hardie",label:"James Hardie"},{value:"wood",label:"Wood Siding"},{value:"metal",label:"Metal Siding"},{value:"stucco",label:"Stucco"},{value:"stone-veneer",label:"Stone Veneer"},{value:"repairs",label:"Repairs"},{value:"painting",label:"Siding Painting"}],deck:[{value:"wood",label:"Wood Decks"},{value:"composite",label:"Composite"},{value:"trex",label:"Trex Decking"},{value:"pergolas",label:"Pergolas"},{value:"patios",label:"Patios"},{value:"repairs",label:"Deck Repairs"},{value:"staining",label:"Deck Staining"},{value:"railing",label:"Railing Systems"}],windows:[{value:"replacement",label:"Replacement"},{value:"new-construction",label:"New Construction"},{value:"energy-efficient",label:"Energy Efficient"},{value:"vinyl",label:"Vinyl Windows"},{value:"wood",label:"Wood Windows"},{value:"bay-bow",label:"Bay/Bow Windows"},{value:"doors",label:"Entry Doors"},{value:"patio-doors",label:"Patio Doors"}],gutters:[{value:"seamless",label:"Seamless Gutters"},{value:"guards",label:"Gutter Guards"},{value:"cleaning",label:"Gutter Cleaning"},{value:"repairs",label:"Repairs"},{value:"aluminum",label:"Aluminum"},{value:"copper",label:"Copper"},{value:"commercial",label:"Commercial"},{value:"downspouts",label:"Downspouts"}],driveway:[{value:"concrete",label:"Concrete"},{value:"asphalt",label:"Asphalt"},{value:"pavers",label:"Pavers"},{value:"stamped",label:"Stamped Concrete"},{value:"sealing",label:"Sealing"},{value:"repairs",label:"Repairs"},{value:"extensions",label:"Extensions"},{value:"resurfacing",label:"Resurfacing"}],"general-contractor":[{value:"roofing",label:"Roofing"},{value:"siding",label:"Siding"},{value:"windows",label:"Windows & Doors"},{value:"kitchen",label:"Kitchen Remodeling"},{value:"bathroom",label:"Bathroom Remodeling"},{value:"basement",label:"Basement Finishing"},{value:"additions",label:"Home Additions"},{value:"decks",label:"Decks & Patios"},{value:"painting",label:"Painting"},{value:"flooring",label:"Flooring"},{value:"electrical",label:"Electrical"},{value:"plumbing",label:"Plumbing"},{value:"hvac",label:"HVAC"},{value:"whole-home",label:"Whole Home Renovations"},{value:"restoration",label:"Restoration"}],restoration:[{value:"water-damage",label:"Water Damage"},{value:"fire-damage",label:"Fire & Smoke Damage"},{value:"mold-remediation",label:"Mold Remediation"},{value:"storm-damage",label:"Storm Damage"},{value:"flood",label:"Flood Cleanup"},{value:"biohazard",label:"Biohazard Cleanup"},{value:"commercial",label:"Commercial"},{value:"residential",label:"Residential"}],pergola:[{value:"pergolas",label:"Pergolas"},{value:"gazebos",label:"Gazebos"},{value:"covered-patios",label:"Covered Patios"},{value:"shade-sails",label:"Shade Sails"},{value:"arbors",label:"Arbors"},{value:"screen-enclosures",label:"Screen Enclosures"},{value:"louvered-roofs",label:"Louvered Roofs"},{value:"outdoor-kitchens",label:"Outdoor Kitchens"}],septic:[{value:"installation",label:"New Installation"},{value:"pumping",label:"Tank Pumping"},{value:"repairs",label:"Repairs"},{value:"inspection",label:"Inspections"},{value:"drain-field",label:"Drain Field Repair"},{value:"aerobic",label:"Aerobic Systems"},{value:"risers",label:"Riser Installation"},{value:"emergency",label:"Emergency Service"}]},PL=({autoOpen:e=!1,onAutoOpenHandled:t,onSettingsChange:r})=>{var Et;const[n,s]=h.useState(!1),[o,a]=h.useState("business");h.useEffect(()=>{e&&!n&&(s(!0),t==null||t())},[e,n,t]);const[l,c]=h.useState(""),[u,d]=h.useState(""),[f,m]=h.useState(""),[p,x]=h.useState(""),[g,b]=h.useState(""),[y,v]=h.useState(""),[w,S]=h.useState(""),[_,k]=h.useState(!1),[C,j]=h.useState([]),[P,I]=h.useState(""),[F,D]=h.useState(""),[$,T]=h.useState([]),[O,A]=h.useState(!1),[L,E]=h.useState(""),[N,z]=h.useState(""),Y=h.useRef(null),[K,te]=h.useState(!1),Z=h.useRef(null),[ve,pe]=h.useState(""),[H,me]=h.useState(""),[de,he]=h.useState([]),[U,re]=h.useState([]),[be,Fe]=h.useState(""),[we,Ye]=h.useState({primary:null,secondary:null,accent:null}),[Kt,Yt]=h.useState(!1),[Jt,yn]=h.useState(!1),[lr,jr]=h.useState([]),st=f||(ds==null?void 0:ds.default_industry)||"roofing",qs=RL[st]||[],We=(()=>{{const R=localStorage.getItem("guest_brand_settings");if(R){const oe=JSON.parse(R);if(oe.logo_url)return oe.logo_url}const J=localStorage.getItem("onboarding_data");if(J){const oe=JSON.parse(J);
500if(oe.logoUrl)return oe.logoUrl}}return null})(),Er=["Licensed","Bonded","Insured","BBB Accredited","EPA Certified","OSHA Certified","Manufacturer Certified","Energy Star Partner","GAF Certified","NATE Certified","Master Plumber","Master Electrician"],qr=[{value:"solo",label:"Just Me"},{value:"2-5",label:"2-5 People"},{value:"6-10",label:"6-10 People"},{value:"11-25",label:"11-25 People"},{value:"25+",label:"25+ People"}],Tr=()=>{const R=localStorage.getItem("guest_brand_settings");return R?JSON.parse(R):{}},Ge=R=>{const oe={...Tr(),...R};return localStorage.setItem("guest_brand_settings",JSON.stringify(oe)),oe},Ks=()=>{const R=Tr(),J=localStorage.getItem("onboarding_data"),oe=J?JSON.parse(J):{};c(R.business_name??oe.businessName??""),d(R.business_city??oe.city??"");const _e=R.default_industry??oe.industry??"",Mt=rh.some(xn=>xn.value===_e);_e&&!Mt?(m("other"),x(_e)):(m(_e),x("")),b(af(R.phone_number??oe.phoneNumber??"")),v(R.website_url??oe.websiteUrl??""),S(R.service_area_description??oe.serviceAreaDescription??""),j(R.specializations??oe.specializations??[]),I(R.services_focus??oe.servicesFocus??""),D(R.business_slogan??oe.slogan??""),pe(R.years_in_business??oe.yearsInBusiness??""),me(R.team_size??oe.teamSize??""),he(R.certifications??oe.certifications??[]),re(R.awards??[]),R.brand_colors&&Ye({primary:R.brand_colors.primary??null,secondary:R.brand_colors.secondary??null,accent:R.brand_colors.accent??null,extracted_from_logo:R.brand_colors.extracted_from_logo??!1})};h.useEffect(()=>{Ks()},[Fl,ds]),h.useEffect(()=>{n&&Ks()},[n]),h.useEffect(()=>{if(n){const R=Tr();R.project_photos&&T(R.project_photos)}},[Fl,n]);const Ys=R=>{j(J=>J.includes(R)?J.filter(oe=>oe!==R):[...J,R])},Rr=async()=>{{Ge({specializations:C,services_focus:P||null}),ne.success("Specializations saved locally!"),r==null||r();return}},Kr=async()=>{{Ge({business_slogan:F||null}),ne.success("Slogan saved locally!"),r==null||r();return}},Js=async()=>{{Ge({years_in_business:ve||null,team_size:H||null,certifications:de.length>0?de:null,awards:U.length>0?U:null}),ne.success("Business details saved locally!"),r==null||r();return}},Pr=R=>{he(J=>J.includes(R)?J.filter(oe=>oe!==R):[...J,R])},Qs=()=>{be.trim()&&!U.includes(be.trim())&&(re(R=>[...R,be.trim()]),Fe(""))},Sa=R=>{re(J=>J.filter(oe=>oe!==R))},as=async()=>{if(!l.trim()){ne.error("Company name is required");return}k(!0);const R=f==="other"?p.trim():f;{const J={business_name:l.trim(),business_city:u.trim()||null,default_industry:R||null,phone_number:g.trim()||null,website_url:y.trim()||null,service_area_description:w.trim()||null};Ge(J);const oe=localStorage.getItem("onboarding_data"),_e=oe?JSON.parse(oe):{};localStorage.setItem("onboarding_data",JSON.stringify({..._e,businessName:l.trim(),city:u.trim()||_e.city,industry:R||_e.industry})),ne.success("Business info saved locally!"),r==null||r(),k(!1);return}},is=async R=>{Yt(!0);try{const{data:J,error:oe}=await yt.functions.invoke("extract-brand-colors",{body:{logoUrl:R}});if(oe)throw oe;if(J!=null&&J.error)throw new Error(J.error);if(J!=null&&J.colors){const _e={primary:J.colors.primary,secondary:J.colors.secondary,accent:J.colors.accent,extracted_from_logo:!0,extraction_date:new Date().toISOString()};Fl||(Ge({brand_colors:_e}),r==null||r()),Ye(_e),ne.success("Brand colors extracted from your logo!")}}catch(J){console.error("Color extraction error:",J),ne.error("Failed to extract colors from logo")}finally{Yt(!1)}},W=async()=>{try{const R={...we,extracted_from_logo:!1,extraction_date:new Date().toISOString()};Fl||(Ge({brand_colors:R}),r==null||r()),ne.success("Brand colors saved!")}catch{ne.error("Failed to save brand colors")}},ce=async()=>{if(!y.trim()){ne.error("Please enter your website URL first");return}yn(!0),jr([]);try{const{data:R,error:J}=await yt.functions.invoke("scrape-website-reviews",{body:{websiteUrl:y.trim()}});if(J){console.error("Scrape error:",J),ne.error("Failed to scrape website. Please check the URL and try again.");return}if(!R.success){ne.error(R.error||"Failed to find reviews on your website");return}R.reviews&&R.reviews.length>0?(jr(R.reviews),Ge({scraped_reviews:R.reviews}),ne.success(`Found ${R.reviews.length} review${R.reviews.length>
5001?"s":""} on your website!`)):ne.info("No reviews found on your website. Try adding a testimonials page!")}catch(R){console.error("Scrape error:",R),ne.error("Failed to connect to website scraper")}finally{yn(!1)}},ot=()=>{jr([]),Ge({scraped_reviews:[]})},wn=async R=>{var oe;const J=(oe=R.target.files)==null?void 0:oe[0];if(J){if(!J.type.startsWith("image/")){ne.error("Please upload an image file");return}if(J.size>5*1024*1024){ne.error("Logo must be under 5MB");return}te(!0);{try{const _e=new FileReader;_e.onload=Mt=>{var Xs;const xn=(Xs=Mt.target)==null?void 0:Xs.result;Ge({logo_url:xn});const ls=localStorage.getItem("onboarding_data"),Qt=ls?JSON.parse(ls):{};localStorage.setItem("onboarding_data",JSON.stringify({...Qt,logoUrl:xn})),ne.success("Logo uploaded!"),te(!1),r==null||r(),is(xn)},_e.onerror=()=>{ne.error("Failed to read logo file"),te(!1)},_e.readAsDataURL(J)}catch{ne.error("Failed to upload logo"),te(!1)}Z.current&&(Z.current.value="");return}}},ue=async()=>{{Ge({logo_url:null});const R=localStorage.getItem("onboarding_data");if(R){const J=JSON.parse(R);delete J.logoUrl,localStorage.setItem("onboarding_data",JSON.stringify(J))}ne.success("Logo removed"),r==null||r();return}},Se=async R=>{var oe;const J=(oe=R.target.files)==null?void 0:oe[0];if(J){if(!J.type.startsWith("image/")){ne.error("Please upload an image file");return}if(J.size>10*1024*1024){ne.error("Image must be under 10MB");return}A(!0);{try{(Mt=>new Promise((xn,ls)=>{const Qt=new Image,Xs=URL.createObjectURL(Mt);Qt.onload=()=>{const zm=Math.min(1,1024/Qt.width),Zs=document.createElement("canvas");Zs.width=Qt.width*zm,Zs.height=Qt.height*zm,Zs.getContext("2d").drawImage(Qt,0,0,Zs.width,Zs.height),URL.revokeObjectURL(Xs),xn(Zs.toDataURL("image/jpeg",.75))},Qt.onerror=()=>{URL.revokeObjectURL(Xs),ls()},Qt.src=Xs}))(J).then(Mt=>{const ls=Tr().project_photos||[],Qt={id:`guest-${Date.now()}`,photo_url:Mt,title:N||null,category:L||null,is_favorite:!1,created_at:new Date().toISOString()};Ge({project_photos:[Qt,...ls]}),T([Qt,...ls]),ne.success("Photo uploaded!"),z(""),E(""),A(!1)}).catch(()=>{ne.error("Failed to process photo"),A(!1)})}catch{ne.error("Failed to upload photo"),A(!1)}Y.current&&(Y.current.value="");return}}},je=async(R,J)=>{{const _e=(Tr().project_photos||[]).map(Mt=>Mt.id===R?{...Mt,is_favorite:!J}:Mt);Ge({project_photos:_e}),T(_e);return}},at=async(R,J)=>{{const _e=(Tr().project_photos||[]).filter(Mt=>Mt.id!==R);Ge({project_photos:_e}),T(_e),ne.success("Photo deleted");return}};return i.jsxs(ns,{open:n,onOpenChange:s,children:[i.jsx(jm,{asChild:!0,children:i.jsxs(q,{variant:"ghost",size:"sm",className:"gap-2",children:[i.jsx(Dx,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Brand Settings"})]})}),i.jsxs(gn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(ya,{children:[i.jsxs(wa,{className:"flex items-center gap-2",children:[i.jsx(Ze,{className:"w-5 h-5 text-primary"}),"Brand Settings"]}),i.jsx(Bu,{children:"Personalize your graphics with specializations, slogan, and project photos"})]}),i.jsx(Ee,{className:"p-4 bg-gradient-to-r from-primary/10 to-accent/10 border-primary/20",children:i.jsxs("div",{className:"flex items-center gap-4",children:[We?i.jsx("img",{src:We,alt:"Business logo",className:"w-12 h-12 rounded-lg object-contain bg-background"}):i.jsx("div",{className:"w-12 h-12 rounded-lg bg-background flex items-center justify-center",children:i.jsx(Za,{className:"w-6 h-6 text-muted-foreground"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h3",{className:"font-semibold truncate",children:l||"Your Business"}),i.jsxs("p",{className:"text-sm text-muted-foreground truncate",children:[((Et=rh.find(R=>R.value===f))==null?void 0:Et.label)||"Select Industry",u&&` ⢠${u}`]})]})]})}),i.jsxs(JM,{value:o,onValueChange:a,className:"mt-4",children:[i.jsxs(B_,{className:"grid grid-cols-5 w-full",children:[i.jsxs(go,{value:"business",className:"gap-1 text-xs sm:text-sm",children:[i.jsx(Za,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Business"})]}),i.jsxs(go,{value:"details",className:"gap-1 text-xs sm:text-sm",children:[i.jsx(Zh,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Details"})]}),i.jsxs(go,{value:"specializations",className:"gap-1 text-xs sm:text-sm",children:[i.jsx(nf,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Specs"})]}),i.jsxs(go,{value:"slogan",className:"gap-1 text-xs sm:text-sm",children:[i.jsx(Ox,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Slogan"})]}),i.jsxs(go,{value:"photos",className:"gap-1 text-xs sm:text-sm",children:[i.jsx(Zj,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Photos"})]})]}
500),i.jsx(vo,{value:"business",className:"space-y-4 mt-4",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs(lt,{htmlFor:"businessName",children:["Company Name ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx(Te,{id:"businessName",value:l,onChange:R=>c(R.target.value),placeholder:"Your Company Name"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(lt,{htmlFor:"industry",children:"Industry"}),i.jsxs(Ff,{value:f,onValueChange:R=>{m(R),R!=="other"&&x("")},children:[i.jsx(Kc,{children:i.jsx(Uf,{placeholder:"Select your industry"})}),i.jsx(Yc,{children:rh.map(R=>i.jsx(Jc,{value:R.value,children:R.label},R.value))})]}),f==="other"&&i.jsx(Te,{value:p,onChange:R=>x(R.target.value),placeholder:"Enter your industry (e.g., Pool Installation)",className:"mt-2"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(lt,{htmlFor:"phoneNumber",className:"flex items-center gap-2",children:[i.jsx(Ix,{className:"w-4 h-4"}),"Phone Number"]}),i.jsx(Te,{id:"phoneNumber",type:"tel",value:g,onChange:R=>b(af(R.target.value)),placeholder:"(555) 123-4567"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(lt,{htmlFor:"websiteUrl",className:"flex items-center gap-2",children:[i.jsx(Bp,{className:"w-4 h-4"}),"Website URL"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Te,{id:"websiteUrl",type:"url",value:y,onChange:R=>v(R.target.value),placeholder:"www.yourcompany.com",className:"flex-1"}),i.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:ce,disabled:Jt||!y.trim(),className:"gap-2 shrink-0",children:Jt?i.jsxs(i.Fragment,{children:[i.jsx(_i,{className:"w-4 h-4 animate-spin"}),"Scanning..."]}):i.jsxs(i.Fragment,{children:[i.jsx(uv,{className:"w-4 h-4"}),"Find Reviews"]})})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Sparky can scan your website to find customer reviews for graphics"})]}),lr.length>0&&i.jsxs("div",{className:"space-y-3 p-4 bg-primary/5 border border-primary/20 rounded-lg",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs(lt,{className:"flex items-center gap-2 text-primary",children:[i.jsx(uv,{className:"w-4 h-4"}),"Reviews Found (",lr.length,")"]}),i.jsxs(q,{variant:"ghost",size:"sm",onClick:ot,className:"h-7 text-xs",children:[i.jsx(Ls,{className:"w-3 h-3 mr-1"}),"Clear"]})]}),i.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:lr.map((R,J)=>i.jsxs("div",{className:"p-3 bg-background rounded-md border text-sm",children:[i.jsxs("p",{className:"text-foreground line-clamp-3",children:['"',R.text,'"']}),i.jsxs("p",{className:"text-muted-foreground text-xs mt-1",children:["â ",R.customerName,R.city?`, ${R.city}`:""]})]},J))}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"These reviews are ready to use when creating Review graphics!"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(lt,{htmlFor:"businessCity",children:"Location (City)"}),i.jsx(Te,{id:"businessCity",value:u,onChange:R=>d(R.target.value),placeholder:"Council Bluffs, IA"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(lt,{htmlFor:"serviceArea",children:"Service Area"}),i.jsx(Te,{id:"serviceArea",value:w,onChange:R=>S(R.target.value),placeholder:"e.g., Pottawattamie County, Greater Omaha Metro, Southwest Iowa"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Describe the broader area you serve for smarter localism in captions"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(lt,{children:"Logo"}),i.jsxs("div",{className:"flex items-center gap-4",children:[We?i.jsx("img",{src:We,alt:"Company logo",className:"w-16 h-16 rounded-lg object-contain bg-muted"}):i.jsx("div",{className:"w-16 h-16 rounded-lg bg-muted flex items-center justify-center",children:i.jsx(Za,{className:"w-8 h-8 text-muted-foreground"})}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("input",{type:"file",ref:Z,onChange:wn,accept:"image/*",className:"hidden"}),i.jsx(q,{variant:"outline",size:"sm",onClick:()=>{var R;return(R=Z.current)==null?void 0:R.click()},disabled:K,className:"gap-2",children:K?"Uploading...":i.jsxs(i.Fragment,{children:[i.jsx(Ts,{className:"w-4 h-4"}),We?"Change Logo":"Upload Logo"]})}),We&&i.jsxs(q,{variant:"ghost",size:"sm",onClick:ue,className:"gap-2 text-destructive hover:text-destructive",children:[i.jsx(sf,{className:"w-4 h-4"}),"Remove"]})]})]})]}),i.jsxs("div",{className:"space-y-3 pt-4 border-t",children:[i.jsxs(lt,{className:"flex items-center gap-2",children:[i.jsx(na,{className:"w-4 h-4"}),"Brand Colors"]}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["These colors will be used consistently in your generated graphics.",(we==null?void 0:we.extracted_from_logo)&&" Auto-extracted from your logo."]}),Kt?i.jsxs("div",{className:"flex items-center gap-2 p-4 bg-muted/50 rounded-lg",children:[i.jsx(_i,{className:"w-4 h-4 animate-spin"}),i.jsx("span",{className:"text-sm",children:"Extracting colors from logo..."})]}):i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(lt,{className:"text-xs",children:"Primary"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 rounded border-2 border-border flex-shrink-0",style:{backgroundColor:(we==null?void 0:we.primary)||"#cccccc"}}
500),i.jsx(Te,{type:"text",value:(we==null?void 0:we.primary)||"",placeholder:"#1A5FB4",className:"text-xs h-8",onChange:R=>Ye(J=>({...J,primary:R.target.value||null}))})]})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(lt,{className:"text-xs",children:"Secondary"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 rounded border-2 border-border flex-shrink-0",style:{backgroundColor:(we==null?void 0:we.secondary)||"#cccccc"}}),i.jsx(Te,{type:"text",value:(we==null?void 0:we.secondary)||"",placeholder:"#4A90D9",className:"text-xs h-8",onChange:R=>Ye(J=>({...J,secondary:R.target.value||null}))})]})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(lt,{className:"text-xs",children:"Accent"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 rounded border-2 border-border flex-shrink-0",style:{backgroundColor:(we==null?void 0:we.accent)||"#cccccc"}}),i.jsx(Te,{type:"text",value:(we==null?void 0:we.accent)||"",placeholder:"#F5A623",className:"text-xs h-8",onChange:R=>Ye(J=>({...J,accent:R.target.value||null}))})]})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(q,{onClick:W,size:"sm",disabled:!(we!=null&&we.primary),children:[i.jsx(Br,{className:"w-3 h-3 mr-1"}),"Save Colors"]}),ds==null?void 0:ds.logo_url]})]})]}),i.jsx(q,{onClick:as,className:"w-full",disabled:_,children:_?"Saving...":"Save Business Info"})]})}),i.jsx(vo,{value:"details",className:"space-y-4 mt-4",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs(lt,{htmlFor:"yearsInBusiness",className:"flex items-center gap-2",children:[i.jsx(yu,{className:"w-4 h-4"}),"Years in Business"]}),i.jsx(Te,{id:"yearsInBusiness",type:"number",min:"0",max:"200",value:ve,onChange:R=>pe(R.target.value?parseInt(R.target.value):""),placeholder:"e.g., 15"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:'This helps build trust in your graphics (e.g., "20+ years experience")'})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(lt,{htmlFor:"teamSize",className:"flex items-center gap-2",children:[i.jsx(Lx,{className:"w-4 h-4"}),"Team Size"]}),i.jsxs(Ff,{value:H,onValueChange:me,children:[i.jsx(Kc,{children:i.jsx(Uf,{placeholder:"Select team size"})}),i.jsx(Yc,{children:qr.map(R=>i.jsx(Jc,{value:R.value,children:R.label},R.value))})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:'Helps personalize messaging ("family-owned" vs "full team ready")'})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(lt,{className:"flex items-center gap-2",children:[i.jsx(Zh,{className:"w-4 h-4"}),"Certifications & Credentials"]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:Er.map(R=>i.jsxs(Wr,{variant:de.includes(R)?"default":"outline",className:`cursor-pointer transition-all ${de.includes(R)?"bg-primary hover:bg-primary/90":"hover:bg-primary/10"}`,onClick:()=>Pr(R),children:[de.includes(R)&&i.jsx(Br,{className:"w-3 h-3 mr-1"}),R]},R))})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(lt,{className:"flex items-center gap-2",children:[i.jsx(xi,{className:"w-4 h-4"}),"Awards & Recognition"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Te,{value:be,onChange:R=>Fe(R.target.value),placeholder:"e.g., Best of Omaha 2024",onKeyDown:R=>R.key==="Enter"&&(R.preventDefault(),Qs())}),i.jsx(q,{type:"button",variant:"outline",onClick:Qs,children:i.jsx(fE,{className:"w-4 h-4"})})]}),U.length>0&&i.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:U.map(R=>i.jsxs(Wr,{variant:"secondary",className:"gap-1",children:[R,i.jsx(Ls,{className:"w-3 h-3 cursor-pointer hover:text-destructive",onClick:()=>Sa(R)})]},R))})]}),i.jsx(q,{onClick:Js,className:"w-full",children:"Save Business Details"})]})}),i.jsxs(vo,{value:"specializations",className:"space-y-4 mt-4",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"text-sm font-medium mb-2",children:["What does your ",st," business specialize in?"]}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Select all that apply. This helps create more targeted graphics."}),i.jsx("div",{className:"flex flex-wrap gap-2",children:qs.map(R=>i.jsxs(Wr,{variant:C.includes(R.value)?"default":"outline",className:`curs
500or-pointer transition-all ${C.includes(R.value)?"bg-primary hover:bg-primary/90":"hover:bg-primary/10"}`,onClick:()=>Ys(R.value),children:[C.includes(R.value)&&i.jsx(Br,{className:"w-3 h-3 mr-1"}),R.label]},R.value))})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-medium mb-2",children:"Services Focus (Optional)"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Describe what makes your services unique"}),i.jsx($i,{value:P,onChange:R=>I(R.target.value),placeholder:"E.g., 'We specialize in repairs, not full replacements' or 'Family-owned, serving the community for 20+ years'",className:"min-h-[80px]"})]}),i.jsx(q,{onClick:Rr,className:"w-full",children:"Save Specializations"})]}),i.jsxs(vo,{value:"slogan",className:"space-y-4 mt-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-medium mb-2",children:"Business Slogan / Tagline"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Your slogan will be incorporated into your graphics"}),i.jsx(Te,{value:F,onChange:R=>D(R.target.value),placeholder:'E.g., "Quality You Can Trust" or "Your Local Experts Since 1985"',className:"text-lg"})]}),i.jsxs(Ee,{className:"p-4 bg-muted/30",children:[i.jsx("h4",{className:"text-sm font-medium mb-2",children:"Preview"}),i.jsxs("div",{className:"text-center py-4",children:[i.jsxs("p",{className:"text-lg font-semibold italic text-primary",children:['"',F||"Your slogan here...",'"']}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["â ","Your Business"]})]})]}),i.jsx(q,{onClick:Kr,className:"w-full",children:"Save Slogan"})]}),i.jsxs(vo,{value:"photos",className:"space-y-4 mt-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-medium mb-2",children:"Project Photo Library"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Upload your project photos to use as backgrounds in graphics"}),i.jsxs(Ee,{className:"p-4 border-dashed border-2",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3",children:[i.jsx(Te,{value:N,onChange:R=>z(R.target.value),placeholder:"Photo title (optional)"}),i.jsx(Te,{value:L,onChange:R=>E(R.target.value),placeholder:"Category (e.g., Before/After)"})]}),i.jsx("input",{type:"file",ref:Y,onChange:Se,accept:"image/*",className:"hidden"}),i.jsx(q,{variant:"outline",onClick:()=>{var R;return(R=Y.current)==null?void 0:R.click()},disabled:O,className:"w-full gap-2",children:O?i.jsx(i.Fragment,{children:"Uploading..."}):i.jsxs(i.Fragment,{children:[i.jsx(Ts,{className:"w-4 h-4"}),"Upload Project Photo"]})})]})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[$.map(R=>i.jsxs(Ee,{className:"relative group overflow-hidden",children:[i.jsx("img",{src:R.photo_url,alt:R.title||"Project photo",className:"w-full aspect-square object-cover"}),i.jsxs("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[i.jsx(q,{variant:"ghost",size:"icon",className:"text-white hover:bg-white/20",onClick:()=>je(R.id,R.is_favorite),children:i.jsx(dn,{className:`w-5 h-5 ${R.is_favorite?"fill-yellow-400 text-yellow-400":""}`})}),i.jsx(q,{variant:"ghost",size:"icon",className:"text-white hover:bg-red-500/50",onClick:()=>at(R.id,R.photo_url),children:i.jsx(sf,{className:"w-5 h-5"})})]}),R.is_favorite&&i.jsx("div",{className:"absolute top-2 left-2",children:i.jsx(dn,{className:"w-4 h-4 fill-yellow-400 text-yellow-400"})}),R.title&&i.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-2",children:i.jsx("p",{className:"text-xs text-white truncate",children:R.title})})]},R.id)),$.length===0&&i.jsxs(Ee,{className:"col-span-full p-8 text-center text-muted-foreground",children:[i.jsx(Si,{className:"w-12 h-12 mx-auto mb-2 opacity-30"}),i.jsx("p",{className:"text-sm",children:"No project photos yet"}),i.jsx("p",{className:"text-xs",children:"Upload your work to use in graphics"})]})]})]})]})]})]})},AL=[{value:"general-contractor",label:"General Contractor",emoji:"ð¨"},{value:"roofing",label:"Roofing",emoji:"ð "},{value:"fence",label:"Fencing",emoji:"ð¡"},{value:"painting",label:"Painting",emoji:"ð¨"},{value:"kitchen",label:"Kitchen Remodeling",emoji:"ð³"},{value:"bathroom",label:"Bathroom Remodeling",emoji:"ð¿"},{value:"flooring",label:"Flooring",emoji:"ðªµ"},{value:"landscaping",label:"Landscaping",emoji:"ð³"},{value:"siding",label:"Siding",emoji:"ð§±"},{value:"deck",label:"Deck Building",emoji:"ðª"},{value:"windows",label:"Windows",emoji:"ðª"},{value:"hvac",label:"HVAC",emoji:"âï¸"},{value:"plumbing",label:"Plumbing",emoji:"ð§"},{value:"electrical",label:"Electrical",emoji:"â¡"},{value:"gutters",label:"Gutters",emoji:"ð§ï¸"},{value:"driveway",label:"Driveway",emoji:"ð"},{value:"restoration",label:"Restoration",emoji:"ð§"},{value:"pergola",label:"Pergolas",emoji:"âº"},{value:"septic",label:"Septic Services",emoji:"ð©"},{value:"other",label:"Other",emoji:"â"}],IL=["Licensed","Bonded","Insured","BBB Accredited","EPA Certified","OSHA Certified","Manufacturer Certified","Energy Star Partner","GAF Certified","NATE Certified","Master Plumber","Master Electrician"],OL=[{value:"solo",label:"Just Me"},{value:"2-5",label:"2-5 People"},{value:"6-10",label:"6-10 People"},{value:"11-25",label:"11-25 People"},{value:"25+",label:"25+ People"}],DL={roofing:[{value:"shingle",label:"Shingle Roofing"},{value:"metal",label:"Metal Roofing"},{value:"flat-tpo",label:"Flat/TPO Roofing"},{value:"tile",label:"Tile Roofing"},{value:"repairs",label:"Repairs Only"},{value:"commercial",label:"Commercial"},{value:"residential",label:"Residential"},{value:"storm-damage",label:"Storm Damage"}],fence:[{value:"vinyl",label:"Vinyl Fence"},{value:"wood",label:"Wood Fence"},{value:"chain-link",label:"Chain-link"},{value:"aluminum",label:"Aluminum"},{value:"ornamental-iron",label:"Ornamental Iron"},{value:"farm-agricultural",label:"Farm/Agricultural"}
500,{value:"pool-fencing",label:"Pool Fencing"},{value:"privacy",label:"Privacy Fencing"}],hvac:[{value:"residential",label:"Residential"},{value:"commercial",label:"Commercial"},{value:"heat-pumps",label:"Heat Pumps"},{value:"ductless",label:"Ductless Mini-Splits"},{value:"geothermal",label:"Geothermal"},{value:"repairs",label:"Repairs & Service"},{value:"installations",label:"New Installations"},{value:"duct-work",label:"Duct Work"}],landscaping:[{value:"hardscaping",label:"Hardscaping"},{value:"softscaping",label:"Softscaping"},{value:"irrigation",label:"Irrigation"},{value:"lawn-care",label:"Lawn Care"},{value:"tree-service",label:"Tree Service"},{value:"design",label:"Landscape Design"},{value:"maintenance",label:"Maintenance"},{value:"outdoor-living",label:"Outdoor Living"}],plumbing:[{value:"residential",label:"Residential"},{value:"commercial",label:"Commercial"},{value:"drain-cleaning",label:"Drain Cleaning"},{value:"water-heaters",label:"Water Heaters"},{value:"repiping",label:"Repiping"},{value:"sewer",label:"Sewer Lines"},{value:"emergency",label:"Emergency Service"},{value:"fixtures",label:"Fixture Installation"}],electrical:[{value:"residential",label:"Residential"},{value:"commercial",label:"Commercial"},{value:"panel-upgrades",label:"Panel Upgrades"},{value:"wiring",label:"Wiring & Rewiring"},{value:"lighting",label:"Lighting"},{value:"ev-charging",label:"EV Charging"},{value:"generators",label:"Generators"},{value:"smart-home",label:"Smart Home"}],painting:[{value:"interior",label:"Interior"},{value:"exterior",label:"Exterior"},{value:"residential",label:"Residential"},{value:"commercial",label:"Commercial"},{value:"cabinets",label:"Cabinet Painting"},{value:"staining",label:"Staining"},{value:"pressure-washing",label:"Pressure Washing"},{value:"drywall-repair",label:"Drywall Repair"}],kitchen:[{value:"full-remodel",label:"Full Remodel"},{value:"cabinet-refacing",label:"Cabinet Refacing"},{value:"countertops",label:"Countertops"},{value:"backsplash",label:"Backsplash"},{value:"flooring",label:"Kitchen Flooring"},{value:"lighting",label:"Kitchen Lighting"},{value:"islands",label:"Kitchen Islands"},{value:"appliances",label:"Appliance Install"}],bathroom:[{value:"full-remodel",label:"Full Remodel"},{value:"tub-shower",label:"Tub/Shower"},{value:"tile",label:"Tile Work"},{value:"vanity",label:"Vanity & Counters"},{value:"accessibility",label:"Accessibility"},{value:"spa-luxury",label:"Spa/Luxury"},{value:"walk-in-tubs",label:"Walk-in Tubs"},{value:"shower-conversions",label:"Shower Conversions"}],flooring:[{value:"hardwood",label:"Hardwood"},{value:"laminate",label:"Laminate"},{value:"vinyl-lvp",label:"Vinyl/LVP"},{value:"tile",label:"Tile"},{value:"carpet",label:"Carpet"},{value:"refinishing",label:"Refinishing"},{value:"commercial",label:"Commercial"},{value:"waterproof",label:"Waterproof"}],siding:[{value:"vinyl",label:"Vinyl Siding"},{value:"james-hardie",label:"James Hardie"},{value:"wood",label:"Wood Siding"},{value:"metal",label:"Metal Siding"},{value:"stucco",label:"Stucco"},{value:"stone-veneer",label:"Stone Veneer"},{value:"repairs",label:"Repairs"},{value:"painting",label:"Siding Painting"}],deck:[{value:"wood",label:"Wood Decks"},{value:"composite",label:"Composite"},{value:"trex",label:"Trex Decking"},{value:"pergolas",label:"Pergolas"},{value:"patios",label:"Patios"},{value:"repairs",label:"Deck Repairs"},{value:"staining",label:"Deck Staining"},{value:"railing",label:"Railing Systems"}],windows:[{value:"replacement",label:"Replacement"},{value:"new-construction",label:"New Construction"},{value:"energy-efficient",label:"Energy Efficient"},{value:"vinyl",label:"Vinyl Windows"},{value:"wood",label:"Wood Windows"},{value:"bay-bow",label:"Bay/Bow Windows"},{value:"doors",label:"Entry Doors"},{value:"patio-doors",label:"Patio Doors"}],gutters:[{value:"seamless",label:"Seamless Gutters"},{value:"guards",label:"Gutter Guards"},{value:"cleaning",label:"Gutter Cleaning"},{value:"repairs",label:"Repairs"},{value:"aluminum",label:"Aluminum"},{value:"copper",label:"Copper"},{value:"commercial",label:"Commercial"},{value:"downspouts",label:"Downspouts"}],driveway:[{value:"concrete",label:"Concrete"},{value:"asphalt",label:"Asphalt"},{value:"pavers",label:"Pavers"},{value:"stamped",label:"Stamped Concrete"},{value:"sealing",label:"Sealing"},{value:"repairs",label:"Repairs"},{value:"extensions",label:"Extensions"},{value:"resurfacing",label:"Resurfacing"}],"general-contractor":[{value:"roofing",label:"Roofing"},{value:"siding",label:"Siding"},{value:"windows",label:"Windows & Doors"},{value:"kitchen",label:"Kitchen Remodeling"},{value:"bathroom",label:"Bathroom Remodeling"},{value:"basement",label:"Basement Finishing"},{value:"additions",label:"Home Additions"},{value:"decks",label:"Decks & Patios"},{value:"painting",label:"Painting"},{value:"flooring",label:"Flooring"},{value:"electrical",label:"Electrical"},{value:"plumbing",label:"Plumbing"},{value:"hvac",label:"HVAC"},{value:"whole-home",label:"Whole Home Renovations"},{value:"restoration",label:"Restoration"}],restoration:[{value:"water-damage",label:"Water Damage"},{value:"fire-damage",label:"Fire & Smoke Damage"},{value:"mold-remediation",label:"Mold Remediation"},{value:"storm-damage",label:"Storm Damage"},{value:"flood",label:"Flood Cleanup"},{value:"biohazard",label:"Biohazard Cleanup"},{value:"commercial",label:"Commercial"},{value:"residential",label:"Residential"}],pergola:[{value:"pergolas",label:"Pergolas"},{value:"gazebos",label:"Gazebos"},{value:"covered-patios",label:"Covered Patios"},{value:"shade-sails",label:"Shade Sails"},{value:"arbors",label:"Arbors"},{value:"screen-enclosures",label:"Screen Enclosures"},{value:"louvered-roofs",label:"Louvered Roofs"},{value:"outdoor-kitchens",label:"Outdoor Kitchens"}],septic:[{value:"installation",label:"New Installation"},{value:"pumping",label:"Tank Pumping"},{value:"repairs",label:"Repairs"},{value:"inspection",label:"Inspections"},{value:"drain-field",label:"Drain Field Repair"},{value:"aerobic",label:"Aerobic Systems"},{value:"risers",label:"Riser Installation"},{value:"emergency",label:"Emergency Service"}]},ML=({onComplete:e})=>{const[t,r]=h.useState(!1),[n,s]=h.useState(1),[o,a]=h.useState(""),[l,c]=h.useState(""),[u,d]=h.useState(""),[f,m]=h.useState(""),[p,x]=h.useState(""),[g,b]=h.useState(""),[y,v]=h.useState(""),[w,S]=h.useState(""),[_,k]=h.useState(""),[C,j]=h.useState([]),[P,I]=h.useState([]),[F,D]=h.useState(""),[$,T]=h.useState(""),[O,A]=h.useState(""),L=h.useRef(null),E=6,N=DL[u]||[];h.useEffect(()=>{if(localStorage.getItem("onboarding_completed"))return;const re=setTimeout(()=>r(!0),500);return()=>clearTimeout(re)},[]);const z=()=>{n<E?s(n+1):K()},Y=()=>{n>1&&s(n-1)},K=async()=>{const U=pe(),re={businessName:o,city:l,industry:U,phoneNumber:p||void 0,websiteUrl:g||void 0,serviceAreaDescription:y||void 0,yearsInBusiness:w?Number(w):void 0,teamSize:_||void 0,certifications:C.length>0?C:void 0,specializations:P.length>0?P:void 0,servicesFocus:F||void 0,slogan:O||void 0,logoUrl:$||void 0};localStorage.setItem("onboarding_completed","true"),localStorage.setItem("onboarding_data",JSON.stringify(re));const be={business_name:o,business_city:l,default_industry:U,phone_number:p||null,website_url:g||null,service_area_description:y||null,years_in_business:w?Number(w):null,team_size:_||null,certifications:C.length>0?C:null,specializations:P.length>0?P:null,services_focus:F||null,business_slogan:O||null,logo_url:$||null};localStorage.setItem("guest_brand_settings",JSON.stringify(be)),localStorage.removeItem("first_creation_complete"),e(re),r(!1),ne.success("ð Profile complete! Let's create your first graphic.")},te=U=>{var be;const re=(be=U.target.files)==null?void 0:be[0];if(re){const Fe=new FileReader;Fe.onload=we=>{var Ye;T((Ye=we.target)==null?void 0:Ye.result),ne.success("Logo uploaded!")}
500,Fe.readAsDataURL(re)}},Z=U=>{j(re=>re.includes(U)?re.filter(be=>be!==U):[...re,U])},ve=U=>{I(re=>re.includes(U)?re.filter(be=>be!==U):[...re,U])},pe=()=>u==="other"?f.trim():u,H=()=>{switch(n){case 1:return o.trim().length>0;case 2:return l.trim().length>0&&(u!=="other"?u.length>0:f.trim().length>0);case 3:return!0;case 4:return!0;case 5:return!0;case 6:return!0;default:return!1}},me=()=>{switch(n){case 1:return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(Za,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"This helps personalize your graphics"})]}),i.jsx(Te,{value:o,onChange:U=>a(U.target.value),placeholder:"e.g., Smith Roofing Co.",className:"text-lg p-6 border-2 border-accent/50 focus:border-accent bg-background/50",autoFocus:!0})]});case 2:return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(uE,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"We'll add local flair to your content"})]}),i.jsx(Te,{value:l,onChange:U=>c(U.target.value),placeholder:"e.g., Austin, TX",className:"text-lg p-6 mb-4 border-2 border-accent/50 focus:border-accent bg-background/50"}),i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(iv,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"This sets your default background imagery"})]}),i.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-5 gap-2 max-h-[200px] overflow-y-auto p-1",children:AL.map(U=>i.jsxs("button",{onClick:()=>{d(U.value),U.value!=="other"&&m("")},className:`p-3 rounded-lg border-2 transition-all text-center ${u===U.value?"bg-primary/10 border-primary":"bg-muted/50 border-transparent hover:border-primary/30"}`,children:[i.jsx("span",{className:"text-2xl block mb-1",children:U.emoji}),i.jsx("span",{className:"text-xs font-medium",children:U.label})]},U.value))}),u==="other"&&i.jsx("div",{className:"mt-3",children:i.jsx(Te,{value:f,onChange:U=>m(U.target.value),placeholder:"Enter your industry (e.g., Pool Installation)",className:"text-base p-4 border-2 border-accent/50 focus:border-accent bg-background/50",autoFocus:!0})})]});case 3:return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(Ix,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Optional - helps with call-to-actions"})]}),i.jsx(Te,{type:"tel",value:p,onChange:U=>x(af(U.target.value)),placeholder:"(555) 123-4567",className:"text-lg p-6 border-2 border-accent/50 focus:border-accent bg-background/50"}),i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(Bp,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Your website address"})]}),i.jsx(Te,{type:"url",value:g,onChange:U=>b(U.target.value),placeholder:"www.yourcompany.com",className:"text-lg p-6 border-2 border-accent/50 focus:border-accent bg-background/50"}),i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(dE,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Describe your service area"})]}),i.jsx(Te,{value:y,onChange:U=>v(U.target.value),placeholder:"e.g., Greater Metro Area, Southwest County",className:"text-lg p-6 border-2 border-accent/50 focus:border-accent bg-background/50"})]});case 4:return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(yu,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Build trust with experience"})]}),i.jsx(Te,{type:"number",value:w,onChange:U=>S(U.target.value?parseInt(U.target.value):""),placeholder:"Years in business",className:"text-lg p-6 border-2 border-accent/50 focus:border-accent bg-background/50",min:0}),i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(Lx,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Team size"})]}),i.jsxs(Ff,{value:_,onValueChange:k,children:[i.jsx(Kc,{className:"text-lg p-6 h-auto border-2 border-accent/50 focus:border-accent bg-background/50",children:i.jsx(Uf,{placeholder:"Select team size"})}),i.jsx(Yc,{children:OL.map(U=>i.jsx(Jc,{value:U.value,children:U.label},U.value))})]}),i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(Zh,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Select your certifications"})]}),i.jsx("div",{className:"flex flex-wrap gap-2 max-h-[150px] overflow-y-auto p-1",children:IL.map(U=>i.jsxs(Wr,{variant:C.includes(U)?"default":"outline",className:`curs
500or-pointer transition-all ${C.includes(U)?"bg-primary text-primary-foreground":"hover:bg-primary/10"}`,onClick:()=>Z(U),children:[C.includes(U)&&i.jsx(Br,{className:"w-3 h-3 mr-1"}),U]},U))})]});case 5:return i.jsxs("div",{className:"space-y-4",children:[N.length>0?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(nf,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"What do you specialize in?"})]}),i.jsx("div",{className:"flex flex-wrap gap-2 max-h-[150px] overflow-y-auto p-1",children:N.map(U=>i.jsxs(Wr,{variant:P.includes(U.value)?"default":"outline",className:`cursor-pointer transition-all ${P.includes(U.value)?"bg-primary text-primary-foreground":"hover:bg-primary/10"}`,onClick:()=>ve(U.value),children:[P.includes(U.value)&&i.jsx(Br,{className:"w-3 h-3 mr-1"}),U.label]},U.value))})]}):i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted/50 rounded-lg border",children:[i.jsx(nf,{className:"w-5 h-5 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Select an industry first to see specializations"})]}),i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(iv,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Describe your main services focus"})]}),i.jsx($i,{value:F,onChange:U=>D(U.target.value),placeholder:"e.g., We specialize in high-end residential projects with a focus on energy efficiency...",className:"min-h-[100px] border-2 border-accent/50 focus:border-accent bg-background/50"})]});case 6:return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(Ts,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Your logo will appear on all graphics (optional)"})]}),i.jsx("input",{type:"file",ref:L,onChange:te,accept:"image/*",className:"hidden"}),i.jsx("div",{className:"flex flex-col items-center gap-4 p-6 border-2 border-dashed border-accent/40 rounded-xl bg-background/30",children:$?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:$,alt:"Your logo",className:"w-24 h-24 object-contain rounded-lg border"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(q,{variant:"outline",size:"sm",onClick:()=>{var U;return(U=L.current)==null?void 0:U.click()},children:"Change Logo"}),i.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(""),children:"Remove"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-20 h-20 rounded-xl bg-muted flex items-center justify-center",children:i.jsx(Ts,{className:"w-8 h-8 text-muted-foreground"})}),i.jsxs(q,{variant:"outline",onClick:()=>{var U;return(U=L.current)==null?void 0:U.click()},className:"gap-2",children:[i.jsx(Ts,{className:"w-4 h-4"}),"Upload Logo"]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, JPG, or SVG recommended"})]})}),i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[i.jsx(Ox,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Add a catchy slogan (optional)"})]}),i.jsx(Te,{value:O,onChange:U=>A(U.target.value),placeholder:"e.g., Quality You Can Trust",className:"text-lg p-6 border-2 border-accent/50 focus:border-accent bg-background/50"})]});default:return null}},de=["What's your business name?","Where are you located?","How can customers reach you?","Tell us about your business","What do you specialize in?","Final touches"],he=["Step 1 of 6 â Let's get started","Step 2 of 6 â City & Industry","Step 3 of 6 â Optional contact info","Step 4 of 6 â Build trust signals","Step 5 of 6 â Your expertise","Step 6 of 6 â Logo & Slogan (optional)"];return i.jsx(ns,{open:t,onOpenChange:r,children:i.jsxs(gn,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[i.jsxs(ya,{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[i.jsx("img",{src:Dt,alt:"Harper",className:"w-14 h-14 roun
500ded-full border-2 border-primary/20"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx(wa,{className:"text-xl flex items-center gap-2",children:de[n-1]}),i.jsx(Bu,{className:"mt-1",children:he[n-1]})]})]}),i.jsx("div",{className:"flex gap-1 mt-4",children:Array.from({length:E}).map((U,re)=>i.jsx("div",{className:`h-1.5 flex-1 rounded-full transition-colors ${re+1<=n?"bg-accent":"bg-muted"}`},re))})]}),i.jsx("div",{className:"py-4",children:me()}),i.jsxs("div",{className:"flex items-center justify-between pt-4 border-t",children:[i.jsx("div",{children:n===1?i.jsx("div",{}):n>=3?i.jsx(q,{variant:"ghost",onClick:z,className:"text-muted-foreground",children:"Skip this step"}):i.jsxs(q,{variant:"ghost",onClick:Y,className:"gap-2",children:[i.jsx(Fr,{className:"w-4 h-4"}),"Back"]})}),i.jsx(q,{onClick:z,disabled:!H(),className:"gap-2",children:n===E?i.jsxs(i.Fragment,{children:[i.jsx(Ze,{className:"w-4 h-4"}),"Let's Create!"]}):i.jsxs(i.Fragment,{children:["Next",i.jsx(Up,{className:"w-4 h-4"})]})})]})]})})},LL=[{type:"financing",label:"Financing Promo",description:"Promote easy payments",icon:zp,emoji:"ð°",bgColor:"bg-green-500/10 hover:bg-green-500/20 border-green-500/30",iconColor:"text-green-600 dark:text-green-400"},{type:"general",label:"General Content",description:"Brand & marketing",icon:bi,emoji:"ð ",bgColor:"bg-blue-500/10 hover:bg-blue-500/20 border-blue-500/30",iconColor:"text-blue-600 dark:text-blue-400"},{type:"review",label:"5 Star Reviews",description:"Highlight your best reviews",icon:dn,emoji:"â",bgColor:"bg-amber-500/10 hover:bg-amber-500/20 border-amber-500/30",iconColor:"text-amber-600 dark:text-amber-400"}],$L=({onAction:e,onWeekContent:t,onGiveIdeas:r,isGenerating:n})=>{const[s,o]=h.useState(!1),a=LL;return s?i.jsxs(Ee,{className:"p-4 md:p-6 bg-gradient-to-br from-primary/5 via-accent/5 to-primary/5 border-accent/20",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>o(!1),className:"gap-2",children:[i.jsx(Fr,{className:"w-4 h-4"}),"Back"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:Dt,alt:"Harper",className:"w-8 h-8 rounded-full border-2 border-primary/20"}),i.jsx("h2",{className:"text-lg font-semibold",children:"What type of content?"})]})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:a.map(l=>{const c=l.icon;return i.jsxs("button",{onClick:()=>{r(l.type),o(!1)},disabled:n,className:`p-4 rounded-xl border-2 transition-all text-left hover:scale-[1.02] disabled:opacity-50 disabled:cursor-not-allowed ${l.bgColor}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("span",{className:"text-2xl",children:l.emoji}),i.jsx(c,{className:`w-5 h-5 ${l.iconColor}`})]}),i.jsx("h3",{className:"font-medium text-sm",children:l.label}),i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:l.description})]},l.type)})})]}):i.jsxs(Ee,{className:"p-4 md:p-6 bg-gradient-to-br from-primary/5 via-accent/5 to-primary/5 border-accent/20",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-4 justify-center",children:[i.jsx("img",{src:Dt,alt:"Harper",className:"w-12 h-12 rounded-full border-2 border-primary/20"}),i.jsxs("div",{className:"text-left",children:[i.jsx("h2",{className:"text-lg font-semibold",children:"What are we creating today?"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose how I can help!"})]})]}),i.jsxs("div",{className:"bg-muted/30 rounded-lg p-4 mb-6",children:[i.jsx("p",{className:"text-sm text-center text-muted-foreground mb-3",children:"I can create professional social media graphics for you:"}),i.jsxs("div",{className:"flex flex-wrap justify-center gap-2 text-xs",children:[i.jsx("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-green-500/10 text-green-700 dark:text-green-400 rounded-full",children:"ð° Financing Promos"}),i.jsx("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-amber-500/10 text-amber-700 dark:text-amber-400 rounded-full",children:"â 5-Star Review Highlights"}),i.jsx("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-blue-500/10 text-blue-700 dark:text-blue-400 rounded-full",children:"ð
A Week's Worth of Content"})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs(q,{onClick:t,disabled:n,size:"lg",className:"gap-3 bg-accent hover:bg-accent/90 text-accent-foreground shimmer text-lg px-8 py-6 h-auto w-full",children:[i.jsx(yu,{className:"w-6 h-6"}),"Create A Week's Worth of Content, Harper!"]}),i.jsxs(q,{onClick:()=>o(!0),disabled:n,size:"lg",variant:"outline",className:"gap-3 text-base px-6 py-5 h-auto w-full border-2 border-primary/20 hover:bg-primary/5",children:[i.jsx(lE,{className:"w-5 h-5"}),"Give Harper Ideas (more customization)"]})]})]})}
500,Oa=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Iy=["professional","bold","seasonal","minimalistic"],FL=()=>crypto.randomUUID(),UL=({onGenerate:e,isGenerating:t,onClose:r,industry:n="general",businessName:s=""})=>{const[o,a]=h.useState([]),[l,c]=h.useState(0),[u,d]=h.useState(!1),[f,m]=h.useState(!1),[p,x]=h.useState(null),[g,b]=h.useState(null),[y,v]=h.useState(null),[w,S]=h.useState(!1),[_,k]=h.useState(!1),C=h.useMemo(()=>_M(n),[n]),j=async()=>{d(!0),a([]),c(0),m(!1);const T=[],O=FL();for(let A=0;A<7;A++){c(A+1);const L=C[A%C.length],E=Iy[A%Iy.length];try{const N=await e({type:L.type,style:E,headline:L.headline,description:L.description,batchId:O,batchDay:A+1});N.imageUrl&&(T.push({day:Oa[A],dayNumber:A+1,type:L.type,style:E,headline:L.headline,description:L.description,imageUrl:N.imageUrl,caption:N.caption}),a([...T]))}catch(N){console.error(`Error generating content for ${Oa[A]}:`,N),ne.error(`Failed to generate ${Oa[A]}'s content`)}A<6&&await new Promise(N=>setTimeout(N,500))}d(!1),m(!0),T.length===7&&(ne.success("ð Your week of content is ready and saved to History!"),S(!0))},P=async T=>{const O=o[T];if(O){b(T);try{const A=await e({type:O.type,style:O.style,headline:O.headline,description:O.description});if(A.imageUrl){const L=[...o];L[T]={...O,imageUrl:A.imageUrl,caption:A.caption},a(L),(p==null?void 0:p.dayNumber)===O.dayNumber&&x(L[T]),v(T),setTimeout(()=>v(null),500),ne.success(`${O.day}'s graphic regenerated!`)}}catch(A){console.error(`Error regenerating ${O.day}:`,A),ne.error(`Failed to regenerate ${O.day}`)}finally{b(null)}}},I=async T=>{const O=o[T];if(!(!O||_)){k(!0);try{const{data:A,error:L}=await yt.functions.invoke("regenerate-caption",{body:{graphicType:O.type,industry:n,headline:O.headline,description:O.description,messagingStyle:"conversational"}});if(L)throw new Error(L.message||"Failed to regenerate caption");if(A!=null&&A.error)throw new Error(A.error);if(A!=null&&A.caption){const E=[...o];E[T]={...O,caption:A.caption},a(E),(p==null?void 0:p.dayNumber)===O.dayNumber&&x(E[T]),ne.success("New caption generated!")}}catch(A){console.error("Error regenerating caption:",A),ne.error(A.message||"Failed to regenerate caption")}finally{k(!1)}}},F=()=>{const T=o.map(O=>`ð ${O.day} 501${O.caption}`).join(` 502 503--- 504 505`);navigator.clipboard.writeText(T),ne.success("All captions copied!")},D=async()=>{ne.info("Downloading all images...");for(const T of o)try{const O=document.createElement("a");O.href=T.imageUrl,O.download=`${Fa(s)}-${T.day.toLowerCase()}.png`,document.body.appendChild(O),O.click(),document.body.removeChild(O),await new Promise(A=>setTimeout(A,300))}catch(O){console.error(`Error downloading ${T.day}:`,O)}ne.success("All images downloaded!")},$=()=>{const T=`<!DOCTYPE html> 506<html> 507<head> 508 <title>Weekly Content - ${s||"Your Business"}</title> 509 <style> 510 body { font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; } 511 .header { margin-bottom: 30px; border-bottom: 2px solid #333; padding-bottom: 20px; } 512 .day-card { margin-bottom: 40px; page-break-inside: avoid; } 513 .day-header { font-size: 24px; font-weight: bold; margin-bottom: 15px; color: #333; } 514 .graphic { max-width: 400px; border-radius: 8px; margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } 515 .caption { background: #f5f5f5; padding: 15px; border-radius: 8px; white-space: pre-wrap; line-height: 1.6; } 516 hr { margin: 30px 0; border: none; border-top: 1px solid #ddd; } 517 </style> 518</head> 519<body> 520 <div class="header"> 521 <h1>Weekly Social Media Content</h1> 522 <p><strong>Generated for:</strong> ${s||"Your Business"}</p> 523 <p><strong>Created:</strong> ${new Date().toLocaleDateString()}</p> 524 </div> 525 ${o.map((E,N)=>` 526 <div class="day-card"> 527 <div class="day-header">ð ${E.day}</div> 528 <img src="${E.imageUrl}" alt="${E.day}" class="graphic" /> 529 <div class="caption">${E.caption}</div> 530 </div> 531 ${N<o.length-1?"<hr>":""} 532 `).join("")} 533</body> 534</html>`,O=new Blob([T],{type:"text/html"}),A=URL.createObjectURL(O),L=document.createElement("a");L.href=A,L.download=`${Fa(s)}-weekly-captions.html`,document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(A),ne.success("Captions document downloaded!")};return u?i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsxs(q,{variant:"ghost",size:"sm",onClick:r,disabled:!0,children:[i.jsx(Fr,{className:"w-4 h-4 mr-2"}),"Back"]}),i.jsx("h2",{className:"text-xl font-semibold",children:"Creating Your Week of Content"})]}),i.jsx(i1,{isVisible:!0,type:"weekly",currentDay:l}),i.jsx("div",{className:"grid grid-cols-7 gap-2 mt-6",children:Oa.map((T,O)=>{const A=o[O],L=O+1===l,E=!!A;return i.jsx("div",{className:`aspect-square rounded-lg border-2 overflow-hidden transition-all ${L?"border-accent animate-pulse":E?"border-success":"border-muted"}`,children:E?i.jsx("img",{src:A.imageUrl,alt:T,className:"w-full h-full object-cover"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center bg-muted/30",children:L?i.jsx(ho,{className:"w-4 h-4 animate-spin text-accent"}):i.jsx("span",{className:"text-xs text-muted-foreground",children:T.slice(0,3)})})},T)})})]}):f&&o.length>0?i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs(q,{variant:"ghost",size:"sm",onClick:r,children:[i.jsx(Fr,{className:"w-4 h-4 mr-2"}),"Back"]}),i.jsx("h2",{className:"text-xl font-semibold",children:"Your Week of Content"})]}),i.jsxs("div",{className:"flex gap-2 flex-wrap",children:[i.jsxs(q,{variant:"outline",size:"sm",onClick:$,className:"gap-2",children:[i.jsx(aE,{className:"w-4 h-4"}),"Captions Doc"]}),i.jsxs(q,{variant:"outline",size:"sm",onClick:F,className:"gap-2",children:[i.jsx(ec,{className:"w-4 h-4"}),"Copy All"]}),i.jsxs(q,{variant:"outline",size:"sm",onClick:D,className:"gap-2",children:[i.jsx(Pd,{className:"w-4 h-4"}),"Download All"]})]})]}),w&&i.jsx("div",{className:"mb-4",children:i.jsx(a1,{variant:"popup",onDismiss:()=>S(!1)})}),i.jsx("p",{className:"text-xs text-center text-muted-foreground
534/70 italic",children:"â¡ Harper makes errors sometimes. You can regenerate any day that doesn't look right!"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:o.map((T,O)=>i.jsxs(Ee,{className:`overflow-hidden ${y===O?"animate-shake":""}`,children:[i.jsxs("div",{className:"aspect-square relative cursor-pointer group",onClick:()=>g!==O&&x(T),children:[i.jsx("img",{src:T.imageUrl,alt:T.day,className:`w-full h-full object-cover transition-opacity ${g===O?"opacity-40":""}`}),g===O&&i.jsxs("div",{className:"absolute inset-0 bg-background/60 flex flex-col items-center justify-center gap-2",children:[i.jsx(ho,{className:"w-8 h-8 animate-spin text-accent"}),i.jsx("span",{className:"text-xs font-medium text-foreground",children:"Regenerating..."})]}),g!==O&&i.jsx("div",{className:"absolute inset-0 bg-black/30 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:i.jsx(wE,{className:"w-8 h-8 text-white"})}),i.jsx("div",{className:"absolute top-2 left-2 px-2 py-1 bg-background/90 rounded-md text-xs font-medium",children:T.day})]}),i.jsxs("div",{className:"p-3 space-y-2",children:[i.jsx("p",{className:"text-xs text-muted-foreground line-clamp-3",children:T.caption}),i.jsxs("div",{className:"flex gap-1",children:[i.jsxs(q,{variant:"ghost",size:"sm",className:"flex-1 text-xs px-2",onClick:()=>{navigator.clipboard.writeText(T.caption),ne.success(`${T.day}'s caption copied!`)},children:[i.jsx(ec,{className:"w-3 h-3 mr-1"}),"Copy"]}),i.jsx(q,{variant:"ghost",size:"sm",className:"flex-1 text-xs px-2",asChild:!0,children:i.jsxs("a",{href:T.imageUrl,download:`${Fa(s)}-${T.day.toLowerCase()}.png`,children:[i.jsx(Pd,{className:"w-3 h-3 mr-1"}),"Save"]})}),i.jsx(q,{variant:"ghost",size:"sm",className:"flex-1 text-xs px-2",onClick:()=>P(O),disabled:g!==null,children:g===O?i.jsx(ho,{className:"w-3 h-3 animate-spin"}):i.jsxs(i.Fragment,{children:[i.jsx(_i,{className:"w-3 h-3 mr-1"}),"Redo"]})})]})]})]},O))}),i.jsx(ns,{open:!!p,onOpenChange:()=>x(null),children:i.jsx(gn,{className:"max-w-4xl p-0 overflow-hidden",children:p&&i.jsxs("div",{className:"space-y-0",children:[i.jsx("img",{src:p.imageUrl,alt:p.day,className:"w-full h-auto"}),i.jsxs("div",{className:"p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[i.jsx("span",{className:"font-semibold text-lg",children:p.day}),i.jsxs("div",{className:"flex gap-2 flex-wrap",children:[i.jsxs(q,{size:"sm",variant:"outline",onClick:()=>{const T=o.findIndex(O=>O.dayNumber===p.dayNumber);T!==-1&&I(T)},disabled:_,children:[_?i.jsx(ho,{className:"w-4 h-4 animate-spin mr-1"}):i.jsx(pE,{className:"w-4 h-4 mr-1"}),"New Caption"]}),i.jsxs(q,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(p.caption),ne.success("Caption copied!")},children:[i.jsx(ec,{className:"w-4 h-4 mr-1"})," Copy Caption"]}),i.jsx(q,{size:"sm",asChild:!0,children:i.jsxs("a",{href:p.imageUrl,download:`${Fa(s)}-${p.day.toLowerCase()}.png`,children:[i.jsx(Pd,{className:"w-4 h-4 mr-1"})," Download"]})}),i.jsx(q,{size:"sm",variant:"secondary",onClick:()=>{const T=o.findIndex(O=>O.dayNumber===p.dayNumber);T!==-1&&P(T)},disabled:g!==null,children:g!==null?i.jsx(ho,{className:"w-4 h-4 animate-spin"}):i.jsxs(i.Fragment,{children:[i.jsx(_i,{className:"w-4 h-4 mr-1"})," Regenerate"]})})]})]}),i.jsx("p",{className:"text-muted-foreground text-sm",children:p.caption})]})]})})}),i.jsxs("div",{className:"flex justify-center gap-4 pt-4",children:[i.jsxs(q,{variant:"outline",onClick:r,className:"gap-2",children:[i.jsx(Fr,{className:"w-4 h-4"}),"Back to Single Posts"]}),i.jsxs(q,{onClick:j,className:"gap-2 bg-accent hover:bg-accent/90",children:[i.jsx(Ze,{className:"w-4 h-4"}),"Generate Another Week"]})]})]}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsxs(q,{variant:"ghost",size:"sm",onClick:r,children:[i.jsx(Fr,{className:"w-4 h-4 mr-2"}),"Back"]}),i.jsx("h2",{className:"text-xl font-semibold",children:"Create a Week of Content"})]}),i.jsxs(Ee,{className:"p-8 text-center bg-gradient-to-br from-primary/5 via-accent/10 to-primary/5",children:[i.jsxs("div",{className:"relative inline-block mb-6",children:[i.jsx("div",{className:"absolute inset-0 bg-accent/30 rounded-full blur-xl animate-pulse"}),i.jsx("img",{src:Dt,alt:"Harper",className:"relative w-24 h-24 rounded-full border-4 border-accent/50
534shadow-lg"})]}),i.jsx("h3",{className:"text-2xl font-bold mb-3",children:"Let me plan your whole week!"}),i.jsx("p",{className:"text-muted-foreground max-w-md mx-auto mb-6",children:"I'll create 7 unique social media graphics with varied content types and stylesâone for each day of the week. Perfect for scheduling ahead!"}),i.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:Oa.map(T=>i.jsxs("div",{className:"px-3 py-1.5 bg-muted rounded-full text-sm font-medium",children:[i.jsx(yu,{className:"w-3 h-3 inline-block mr-1"}),T]},T))}),i.jsx("div",{className:"flex flex-col sm:flex-row gap-3 justify-center items-center",children:i.jsxs(q,{onClick:j,size:"lg",className:"py-6 px-8 text-lg bg-accent hover:bg-accent/90 text-accent-foreground shimmer gap-2",children:[i.jsx(Ze,{className:"w-5 h-5"}),"Generate Week of Content"]})}),i.jsx("p",{className:"text-xs text-muted-foreground mt-4",children:"This will create 7 graphics. May take a minute or two."})]})]})},zL=e=>new Promise(t=>{const r=new Image;r.onload=()=>{const n=Math.min(r.width,r.height),s=document.createElement("canvas");s.width=n,s.height=n;const o=s.getContext("2d"),a=(r.width-n)/2,l=(r.height-n)/2;o.drawImage(r,a,l,n,n,0,0,n,n),t(s.toDataURL("image/jpeg",.95))},r.onerror=()=>t(e),r.src=e}),BL=e=>new Promise(t=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{const n=document.createElement("canvas"),s=r.width,o=r.height;n.width=s,n.height=o;const a=n.getContext("2d");a.drawImage(r,0,0);const l=a.getImageData(0,0,s,o),c=l.data,u=240,d=new Uint8Array(s*o),f=[],m=p=>{const x=c[p],g=c[p+1],b=c[p+2];return c[p+3]<30?!0:x>u&&g>u&&b>u};for(let p=0;p<s;p++)[0,o-1].forEach(x=>{const g=x*s+p;!d[g]&&m(g*4)&&(d[g]=1,f.push(g))});for(let p=0;p<o;p++)[0,s-1].forEach(x=>{const g=p*s+x;!d[g]&&m(g*4)&&(d[g]=1,f.push(g))});for(;f.length>0;){const p=f.pop();c[p*4+3]=0;const x=p%s,g=Math.floor(p/s),b=[g>0?p-s:-1,g<o-1?p+s:-1,x>0?p-1:-1,x<s-1?p+1:-1];for(const y of b)y>=0&&!d[y]&&m(y*4)&&(d[y]=1,f.push(y))}a.putImageData(l,0,0),t(n.toDataURL("image/png"))},r.onerror=()=>t(e),r.src=e}),WL=(e,t)=>new Promise(r=>{const n=document.createElement("canvas"),s=new Image;s.crossOrigin="anonymous",s.onload=async()=>{n.width=s.width,n.height=s.height;const o=n.getContext("2d");o.drawImage(s,0,0);const a=await BL(t),l=new Image;l.onload=()=>{const c=Math.round(s.width*.03),u=Math.min(s.width*.22,225),d=l.naturalWidth/l.naturalHeight,f=u,m=u/d;o.drawImage(l,c,c,f,m),r(n.toDataURL("image/jpeg",.95))},l.onerror=()=>r(e),l.src=a},s.onerror=()=>r(e),s.src=e}),HL=()=>{const{recordCreation:e}=t1(),t=Au(),[r,n]=h.useState(()=>!localStorage.getItem("has_seen_welcome")),[s,o]=h.useState(""),[a,l]=h.useState(""),[c,u]=h.useState("roofing"),[d,f]=h.useState("");h.useState("professional");const[m,p]=h.useState(!1),[x,g]=h.useState(!1),[b,y]=h.useState(null),[v,w]=h.useState("dashboard"),[S,_]=h.useState(null),[k,C]=h.useState(()=>localStorage.getItem("show_brand_settings_after_skip")==="true"?(localStorage.removeItem("show_brand_settings_after_skip"),!0):!1),j=h.useCallback(()=>{const $=localStorage.getItem("guest_brand_settings"),T=localStorage.getItem("onboarding_data"),O=$?JSON.parse($):{},A=T?JSON.parse(T):{},L=O.business_name||A.businessName,E=O.business_city||A.city,N=O.default_industry||A.industry,z=O.logo_url||A.logoUrl;L&&o(L),E&&l(E),N&&u(N),f(z||"")},[]);h.useEffect(()=>{j()},[j]);const P=async $=>{var O,A;p(!0);const T=(()=>{const L=localStorage.getItem("guest_brand_settings");return L?JSON.parse(L):{}})();try{let L;const E={yearsInBusiness:T.years_in_business,teamSize:T.team_size,certifications:T.certifications||[],awards:T.awards||[],uniqueSellingPoints:T.unique_selling_points||[],targetCustomerTypes:T.target_customer_types||[]};$.type==="review"?L={graphicType:"review",reviewText:$.reviewText,customerName:$.customerName,city:$.city,businessCity:a,businessName:s,industry:c,logoImage:d||void 0,style:$.style,messagingStyle:$.messagingStyle,batchId:$.batchId,batchDay:$.batchDay,specializations:T.specializations,servicesFocus:T.services_focus,businessSlogan:T.business_slogan,projectPhotoUrl:$.projectPhotoUrl,phoneNumber:T.phone_number,websiteUrl:T.website_url,serviceAreaDescription:T.service_area_description,brandColors:T.brand_colors,...E}:L={graphicType:$.type,headline:$.headline,description:$.description,businessCity:a,businessName:s,industry:c,logoImage:d||void 0,style:$.style,messagingStyle:$.messagingStyle,batchId:$.batchId,batchDay:$.batchDay,specializations:T.specializations,servicesFocus:T.services_focus,businessSlogan:T.business_slogan,projectPhotoUrl:$.projectPhotoUrl,phoneNumber:T.phone_number,websiteUrl:T.website_url,serviceAreaDescription:T.service_area_description,brandColors:T.brand_colors,...E};const{data:N,error:z}=await yt.functions.invoke("generate-graphic",{body:L});if(z)throw new Error(z.message||"Failed to generate AI graphic");if(N!=null&&N.error)throw new Error(N.error);if(N!=null&&N.imageUrl){$.batchId||g(!0),GM($.type),e($.type),localStorage.setItem("first_creation_complete","true");let Y=await zL(N.imageUrl);return d&&(Y=await WL(Y,d)),{imageUrl:Y,caption:N.caption||""}}throw new Error("No image URL returned")}catch(L){return console.error("Error generating AI graphic:",L),((O=L.message)==null?void 0:O.toLowerCase().includes("temporarily unavailable"))||((A=L.message)==null?void 0:A.toLowerCase().includes("internal_server_error"))?ne.error("Our image AI is temporarily unavailable. Please try again in a few minutes.",{description:"This is a temporary outage on our AI provider's side.",duration:8e3}):ne.error(L.message||"Failed to generate AI graphic"),{imageUrl:"",caption:""}}finally{p(!1)}},I=()=>{localStorage.setItem("has_seen_welcome","true"),n(!1)},F=$=>{$.businessName&&o($.businessName),$.businessCity&&l($.businessCity),$.industry&&u($.industry)},D=async $=>{o($.businessName),l($.city),u($.industry),$.logoUrl&&f($.logoUrl)};return r?i.jsx(UM,{onGetStarted:I}):i.jsxs(i.Fragment,{children:[i.jsx(lO,{isVisible:x,onComplete:()=>g(!1)}),i.jsx("div",{className:"min-h-screen bg-background p-3 sm:p-4 md:p-8",children:i.jsxs("div",{className:"max-w-6xl mx-auto
534space-y-4 md:space-y-6",children:[i.jsxs("div",{className:"relative flex flex-col md:flex-row items-center gap-3 md:gap-6 p-4 md:p-6 bg-gradient-to-r from-primary/5 via-accent/5 to-primary/5 rounded-xl md:rounded-2xl border border-border/50 mb-4 md:mb-6",children:[i.jsxs("div",{className:"relative flex-shrink-0",children:[i.jsx("img",{src:Dt,alt:"Harper - Your AI Social Media Designer",className:"w-14 h-14 sm:w-16 sm:h-16 md:w-20 md:h-20 rounded-full object-cover border-4 border-primary/20 shadow-lg"}),i.jsx("div",{className:"absolute -bottom-1 -right-1 w-4 h-4 md:w-5 md:h-5 bg-green-500 rounded-full border-2 border-background animate-pulse",title:"Online"})]}),i.jsxs("div",{className:"text-center md:text-left flex-1 min-w-0",children:[i.jsxs("h1",{className:"text-xl sm:text-2xl md:text-3xl font-bold text-foreground",children:["Hi, I'm ",i.jsx("span",{className:"text-primary",children:"Harper"}),"! ð"]}),i.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:"Your AI Social Media Designer"})]}),i.jsxs("div",{className:"absolute top-3 right-3 md:relative md:top-0 md:right-0 md:ml-auto flex items-center gap-2",children:[i.jsx(VM,{}),i.jsxs(nc,{children:[i.jsx(sc,{asChild:!0,children:i.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>t("/how-to-use"),className:"text-muted-foreground hover:text-foreground gap-1",children:[i.jsx("span",{className:"text-lg",children:"â"}),i.jsx("span",{className:"hidden sm:inline text-sm",children:"How do I use this?"})]})}),i.jsx(ei,{children:"How To Use Harper"})]}),i.jsx(PL,{autoOpen:k,onAutoOpenHandled:()=>C(!1),onSettingsChange:j}),i.jsx(uO,{})]})]}),i.jsx(ML,{onComplete:D}),v==="week"&&i.jsx("div",{className:"min-h-[calc(100vh-200px)]",children:i.jsx(UL,{onGenerate:P,isGenerating:m,onClose:()=>w("dashboard"),industry:c,businessName:s})}),v==="dashboard"&&i.jsx($L,{onAction:$=>{y($),w("wizard")},onWeekContent:()=>{w("week")},onGiveIdeas:$=>{_($),w("wizard")},isGenerating:m}),v==="wizard"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>{w("dashboard"),y(null),_(null)},className:"gap-2",children:[i.jsx(Fr,{className:"w-4 h-4"}),"Back to Dashboard"]}),i.jsx(FM,{businessName:s,businessCity:a,industry:c,logoUrl:d,onGenerate:P,isGenerating:m,onBusinessInfoChange:F,quickActionData:b||(S?{type:S}:null),onQuickActionConsumed:()=>{y(null),_(null)}})]})]})})]})},VL=()=>i.jsx(HL,{}),Oy=[{number:1,title:"Quick Setup",icon:Za,description:"Enter your business name, email, and logo"},{number:2,title:"Choose Your Path",icon:Ze,description:"'Week of Content' or 'Give Harper Ideas'"},{number:3,title:"Generate!",icon:xu,description:"Harper creates your graphics in seconds"},{number:4,title:"Download & Post",icon:mE,description:"Download images, copy captions, post to social!"}],GL=[{platform:"Facebook",color:"bg-blue-500",steps:["Click 'Download' to save your graphic","Click 'Copy' to copy the caption","Open Facebook and click 'Create Post'","Click the photo icon and select your downloaded image","Paste the caption in the text box","Click 'Post' - you're done!"]},{platform:"Instagram",color:"bg-gradient-to-br from-purple-500 via-pink-500 to-orange-400",steps:["Download your graphic and copy the caption","Open Instagram and tap the '+' button","Select your downloaded image from your gallery","Tap 'Next' and add filters if desired","Paste the caption and add hashtags","Tap 'Share' - you're live!"]}],qL=[{title:"Week of Content",description:"Generate 7 days of varied graphics at once - financing promos, trust-building posts, and community messages."},{title:"Custom Graphics",description:"Use 'Give Harper Ideas' to choose exactly what type of content you want: Financing, General, or Review graphics."},{title:"Ready-to-Post Captions",description:"Every graphic includes an engaging caption. Just copy, paste, and post to any social platform!"},{title:"Review Graphics",description:"Turn customer reviews into eye-catching social proof. Perfect for building trust with potential customers."},{title:"Financing Promos",description:"Promote your financing options with professional graphics that highlight payment plans and drive leads."},{title:"Your Brand, Every Time",description:"Your logo and business info are automatically added to every graphic for consistent branding."}],KL=[{title:"Best Times to Post",description:"Weekdays 9-11am and 7-9pm typically see the highest engagement for home improvement content.",icon:sE},{title:"Consistency is Key",description:"Posting 3-5 times per week keeps your business top of mind. Use 'Week of Content' to stay on track.",icon:Hp},{title:"Mix Up Your Content",description:"Alternate between financing promos, customer reviews, and general brand-building posts.",icon:Mx},{title:"Add Hashtags",description:"Add 3-5 relevant hashtags like #HomeImprovement #YourCity #ContractorLife to increase reach.",icon:iE}],YL=[{question:"What's the difference between 'Week of Content' and 'Give Harper Ideas'?",answer:"Week of Content generates 7 varied graphics automatically. Give Harper Ideas lets you choose exactly what type (Financing, General, or Review) and customize the content."},{question:"How do I download my graphics?",answer:"Click the 'Download' button below any generated graphic. For weekly content, use 'Download All' to save all 7 at once."},{question:"Can I regenerate a graphic I don't like?",answer:"Yes! Click 'Create Again' for single graphics, or click the refresh icon on any day in the weekly view."},{question:"What size are the graphics?",answer:"All graphics are 1080x1080 pixels - the perfect square format for Instagram, Facebook, and most social platforms."},{question:"How do I use the caption?",answer:"Click 'Copy' next to the caption, then paste it into your social media post. Feel free to customize it!"},{question:"Do I need to create an account?",answer:"No account needed! Just enter your business details and start creating. Your settings are saved for this browser session."}];function JL(){const e=Au();return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("div",{className:"sticky top-0 z-50 bg-background/95 backdrop-blur border-b",children:i.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-3 flex items-center justify-between",children:[i.jsxs(q,{variant:"ghost",onClick:()=>e("/"),className:"gap-2",children:[i.jsx(Fr,{className:"w-4 h-4"}),"Back to App"]}),i.jsxs(q,{onClick:()=>e("/"),className:"gap-2 bg-accent hover:bg-accent/90 text-accent-foreground",children:[i.jsx(Ze,{className:"w-4 h-4"}),"Start Creating"]})]})}),i.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8 space-y-12",children:[i.jsxs("div",{className:"text-center space-y-4",children:[i.jsxs("div",{className:"relative inline-block",children:[i.jsx("div",{className:"absolute inset-0 bg-accent/20 rounded-full blur-2xl animate-pulse"}),i.jsx("img",{src:Dt,alt:"Harper",className:"relative w-24 h-24 rounded-full border-4 border-accent/30 mx-auto"})]}),i.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-foreground",children:"Hey! Let me show you how I work ð"}),i.jsxs("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:["I'm ",i.jsx("span",{className:"text-accent font-semibold",children:"Harper"}),", your AI social media designer. Creating professional graphics for your home improvement business takes just 30 seconds!"]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("h2",{className:"text-2xl font-bold text-foreground flex items-center gap-2",children:[i.jsx(Ji,{className:"w-6 h-6 text-accent"}),"Quick Start (30 seconds)"]}),i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:Oy.map((t,r)=>i.jsxs(Ee,{className:"p-4 text-center relative",children:[i.jsx("div",{className:"absolute -top-3 -left-3 w-8 h-8 rounded-full bg-accent text-accent-foreground flex items-center justify-center font-bold text-sm",children:t.number}),i.jsx("div",{className:"w-12 h-12 rounded-full bg-accent/10 flex items-center justify-center mx-auto mb-3",children:i.jsx(t.icon,{className:"w-6 h-6 text-accent"})}),i.jsx("h3",{className:"font-semibold text-foreground",children:t.title}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t.description}),r<Oy.length-1&&i.jsx("div",{className:"hidden md:block absolute top-1/2 -right-2 text-muted-foreground
534/30",children:"â"})]},t.number))})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-2xl font-bold text-foreground flex items-center gap-2",children:"ð± After You Generate: How to Post"}),i.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:GL.map(t=>i.jsxs(Ee,{className:"p-5 overflow-hidden",children:[i.jsx("div",{className:`${t.color} text-white px-4 py-2 -mx-5 -mt-5 mb-4 font-semibold text-lg`,children:t.platform}),i.jsx("ol",{className:"space-y-2",children:t.steps.map((r,n)=>i.jsxs("li",{className:"flex items-start gap-3",children:[i.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-muted flex items-center justify-center text-sm font-medium",children:n+1}),i.jsx("span",{className:"text-sm text-muted-foreground",children:r})]},n))})]},t.platform))})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-2xl font-bold text-foreground flex items-center gap-2",children:"⨠What Harper Can Do"}),i.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:qL.map(t=>i.jsxs(Ee,{className:"p-5",children:[i.jsx("h3",{className:"font-semibold text-foreground mb-2",children:t.title}),i.jsx("p",{className:"text-sm text-muted-foreground",children:t.description})]},t.title))})]}),i.jsxs(Ee,{className:"p-6 bg-accent/5 border-accent/20",children:[i.jsx("h2",{className:"text-xl font-bold text-foreground mb-4",children:"ð¡ Pro Tips"}),i.jsxs("ul",{className:"space-y-3",children:[i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-accent font-bold",children:"â¢"}),i.jsxs("span",{className:"text-muted-foreground",children:[i.jsx("strong",{className:"text-foreground",children:'"Week of Content"'})," creates 7 unique graphics with different themes - perfect for staying consistent!"]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-accent font-bold",children:"â¢"}),i.jsxs("span",{className:"text-muted-foreground",children:[i.jsx("strong",{className:"text-foreground",children:'"Give Harper Ideas"'})," lets you pick exactly what you want: Financing, General, or Review graphics"]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-accent font-bold",children:"â¢"}),i.jsxs("span",{className:"text-muted-foreground",children:[i.jsx("strong",{className:"text-foreground",children:'"Download All"'})," button saves all 7 images at once when using Week of Content"]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-accent font-bold",children:"â¢"}),i.jsxs("span",{className:"text-muted-foreground",children:[i.jsx("strong",{className:"text-foreground",children:'"Copy All Captions"'})," grabs every caption so you can schedule posts in advance"]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-accent font-bold",children:"â¢"}),i.jsxs("span",{className:"text-muted-foreground",children:[i.jsx("strong",{className:"text-foreground",children:"Don't like a graphic?"}),' Click "Create Again" or the refresh icon to regenerate']})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-2xl font-bold text-foreground flex items-center gap-2",children:"ð Posting Best Practices"}),i.jsx("div",{className:"grid sm:grid-cols-2 gap-4",children:KL.map(t=>i.jsx(Ee,{className:"p-5",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"p-2 rounded-lg bg-accent/10 flex-shrink-0",children:i.jsx(t.icon,{className:"w-5 h-5 text-accent"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold text-foreground mb-1",children:t.title}),i.jsx("p",{className:"text-sm text-muted-foreground",children:t.description})]})]})},t.title))})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-2xl font-bold text-foreground flex items-center gap-2",children:"â Frequently Asked Questions"}),i.jsx("div",{className:"space-y-3",children:YL.map(t=>i.jsxs(Ee,{className:"p-5",children:[i.jsx("h3",{className:"font-semibold text-foreground mb-2",children:t.question}),i.jsx("p",{className:"text-sm text-muted-foreground",children:t.answer})]},t.question))})]}),i.jsx("div",{className:"text-center py-8",children:i.jsxs(q,{onClick:()=>e("/"),size:"lg",className:"gap-2 bg-accent hover:bg-accent/90 text-accent-foreground px-8 py-6 text-lg",children:[i.jsx(Ze,{className:"w-5 h-5"}),"Start Creating Graphics"]})})]})]})}const QL=()=>{const e=um();return h.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:i.jsxs("div",{className:"text-center",children:[i.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),i.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),i.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},XL=new AR,ZL=()=>i.jsx(OR,{client:XL,children:i.jsx(s2,{attribute:"class",defaultTheme:"dark",enableSystem:!0,children:i.jsx(EP,{children:i.jsxs(rc,{children:[i.jsx(t2,{}),i.jsx(M2,{}),i.jsx(jP,{children:i.jsxs(kP,{children:[i.jsx(oc,{path:"/",element:i.jsx(VL,{})}),i.jsx(oc,{path:"/how-to-use",element:i.jsx(JL,{})}),i.jsx(oc,{path:"*",element:i.jsx(QL,{})})]})})]})})})});nx(document.getElementById("root")).render(i.jsx(ZL,{}));
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.