diff --git a/dist/assets/CountUp-CaPcnNrA.js b/dist/assets/CountUp-4XjqJEhr.js similarity index 99% rename from dist/assets/CountUp-CaPcnNrA.js rename to dist/assets/CountUp-4XjqJEhr.js index 52e1a14..63c0798 100644 --- a/dist/assets/CountUp-CaPcnNrA.js +++ b/dist/assets/CountUp-4XjqJEhr.js @@ -1 +1 @@ -import{r as F,j as te}from"./index-BSnGsuja.js";function kt(t){const e=F.useRef(null);return e.current===null&&(e.current=t()),e.current}const ee=typeof window<"u",se=ee?F.useLayoutEffect:F.useEffect;function ne(t,e){t.indexOf(e)===-1&&t.push(e)}function re(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const U=(t,e,s)=>s>e?e:s{};const dt={},et=t=>t,ie=(t,e)=>s=>e(t(s)),pt=(...t)=>t.reduce(ie),Et=(t,e,s)=>{const r=e-t;return r===0?1:(s-t)/r};class oe{constructor(){this.subscriptions=[]}add(e){return ne(this.subscriptions,e),()=>re(this.subscriptions,e)}notify(e,s,r){const n=this.subscriptions.length;if(n)if(n===1)this.subscriptions[0](e,s,r);else for(let i=0;it*1e3,N=t=>t/1e3;function Pt(t,e){return e?t*(1e3/e):0}const Nt=(t,e,s)=>(((1-3*s+3*e)*t+(3*s-6*e))*t+3*e)*t,ae=1e-7,ce=12;function ue(t,e,s,r,n){let i,o,a=0;do o=e+(s-e)/2,i=Nt(o,r,n)-t,i>0?s=o:e=o;while(Math.abs(i)>ae&&++aue(i,0,1,t,s);return i=>i===0||i===1?i:Nt(n(i),e,r)}const Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ot=t=>e=>1-t(1-e),Ut=$(.33,1.53,.69,.99),mt=Ot(Ut),le=Rt(mt),fe=t=>t>=1?1:(t*=2)<1?.5*mt(t):.5*(2-Math.pow(2,-10*(t-1))),gt=t=>1-Math.sin(Math.acos(t)),he=Ot(gt),de=Rt(gt),pe=$(.42,0,1,1),me=$(0,0,.58,1),Kt=$(.42,0,.58,1),ge=t=>Array.isArray(t)&&typeof t[0]!="number",ye=t=>Array.isArray(t)&&typeof t[0]=="number",be={linear:et,easeIn:pe,easeInOut:Kt,easeOut:me,circIn:gt,circInOut:de,circOut:he,backIn:mt,backInOut:le,backOut:Ut,anticipate:fe},ve=t=>typeof t=="string",Mt=t=>{if(ye(t)){It(t.length===4);const[e,s,r,n]=t;return $(e,s,r,n)}else if(ve(t))return be[t];return t},J=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Te(t,e){let s=new Set,r=new Set,n=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(c){o.has(c)&&(l.schedule(c),t()),c(a)}const l={schedule:(c,f=!1,d=!1)=>{const x=d&&n?s:r;return f&&o.add(c),x.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(a=c,n){i=!0;return}n=!0;const f=s;s=r,r=f,s.forEach(u),s.clear(),n=!1,i&&(i=!1,l.process(c))}};return l}const xe=40;function Me(t,e){let s=!1,r=!0;const n={delta:0,timestamp:0,isProcessing:!1},i=()=>s=!0,o=J.reduce((v,g)=>(v[g]=Te(i),v),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:f,preRender:d,render:M,postRender:x}=o,m=()=>{const v=dt.useManualTiming,g=v?n.timestamp:performance.now();s=!1,v||(n.delta=r?1e3/60:Math.max(Math.min(g-n.timestamp,xe),1)),n.timestamp=g,n.isProcessing=!0,a.process(n),u.process(n),l.process(n),c.process(n),f.process(n),d.process(n),M.process(n),x.process(n),n.isProcessing=!1,s&&e&&(r=!1,t(m))},T=()=>{s=!0,r=!0,n.isProcessing||t(m)};return{schedule:J.reduce((v,g)=>{const y=o[g];return v[g]=(S,C=!1,b=!1)=>(s||T(),y.schedule(S,C,b)),v},{}),cancel:v=>{for(let g=0;g(H===void 0&&k.set(X.isProcessing||dt.useManualTiming?X.timestamp:performance.now()),H),set:t=>{H=t,queueMicrotask(Ae)}},Lt=t=>e=>typeof e=="string"&&e.startsWith(t),Ps=Lt("--"),Se=Lt("var(--"),De=t=>Se(t)?Fe.test(t.split("/*")[0].trim()):!1,Fe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ns(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const yt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},qt={...yt,transform:t=>U(0,1,t)},Rs={...yt,default:1},q=t=>Math.round(t*1e5)/1e5,Wt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function we(t){return t==null}const Ve=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bt=(t,e)=>s=>!!(typeof s=="string"&&Ve.test(s)&&s.startsWith(t)||e&&!we(s)&&Object.prototype.hasOwnProperty.call(s,e)),Bt=(t,e,s)=>r=>{if(typeof r!="string")return r;const[n,i,o,a]=r.match(Wt);return{[t]:parseFloat(n),[e]:parseFloat(i),[s]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ce=t=>U(0,255,t),rt={...yt,transform:t=>Math.round(Ce(t))},O={test:bt("rgb","red"),parse:Bt("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:r=1})=>"rgba("+rt.transform(t)+", "+rt.transform(e)+", "+rt.transform(s)+", "+q(qt.transform(r))+")"};function ke(t){let e="",s="",r="",n="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),r=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),r=t.substring(3,4),n=t.substring(4,5),e+=e,s+=s,r+=r,n+=n),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(r,16),alpha:n?parseInt(n,16)/255:1}}const ut={test:bt("#"),parse:ke,transform:O.transform},z=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Os=z("deg"),W=z("%"),Us=z("px"),Ks=z("vh"),Gs=z("vw"),Ls={...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(t*100)},G={test:bt("hsl","hue"),parse:Bt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:r=1})=>"hsla("+Math.round(t)+", "+W.transform(q(e))+", "+W.transform(q(s))+", "+q(qt.transform(r))+")"},I={test:t=>O.test(t)||ut.test(t)||G.test(t),parse:t=>O.test(t)?O.parse(t):G.test(t)?G.parse(t):ut.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?O.transform(t):G.transform(t),getAnimatableNone:t=>{const e=I.parse(t);return e.alpha=0,I.transform(e)}},Ie=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ee(t){var e,s;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Wt))==null?void 0:e.length)||0)+(((s=t.match(Ie))==null?void 0:s.length)||0)>0}const _t="number",jt="color",Pe="var",Ne="var(",At="${}",Re=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function j(t){const e=t.toString(),s=[],r={color:[],number:[],var:[]},n=[];let i=0;const a=e.replace(Re,u=>(I.test(u)?(r.color.push(i),n.push(jt),s.push(I.parse(u))):u.startsWith(Ne)?(r.var.push(i),n.push(Pe),s.push(u)):(r.number.push(i),n.push(_t),s.push(parseFloat(u))),++i,At)).split(At);return{values:s,split:a,indexes:r,types:n}}function Oe(t){return j(t).values}function $t({split:t,types:e}){const s=t.length;return r=>{let n="";for(let i=0;itypeof t=="number"?0:I.test(t)?I.getAnimatableNone(t):t,Ge=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Ke(t);function Le(t){const e=j(t);return $t(e)(e.values.map((r,n)=>Ge(r,e.split[n])))}const qe={test:Ee,parse:Oe,createTransformer:Ue,getAnimatableNone:Le};function it(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+(e-t)*6*s:s<1/2?e:s<2/3?t+(e-t)*(2/3-s)*6:t}function We({hue:t,saturation:e,lightness:s,alpha:r}){t/=360,e/=100,s/=100;let n=0,i=0,o=0;if(!e)n=i=o=s;else{const a=s<.5?s*(1+e):s+e-s*e,u=2*s-a;n=it(u,a,t+1/3),i=it(u,a,t),o=it(u,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Q(t,e){return s=>s>0?e:t}const nt=(t,e,s)=>t+(e-t)*s,ot=(t,e,s)=>{const r=t*t,n=s*(e*e-r)+r;return n<0?0:Math.sqrt(n)},Be=[ut,O,G],_e=t=>Be.find(e=>e.test(t));function St(t){const e=_e(t);if(!e)return!1;let s=e.parse(t);return e===G&&(s=We(s)),s}const Dt=(t,e)=>{const s=St(t),r=St(e);if(!s||!r)return Q(t,e);const n={...s};return i=>(n.red=ot(s.red,r.red,i),n.green=ot(s.green,r.green,i),n.blue=ot(s.blue,r.blue,i),n.alpha=nt(s.alpha,r.alpha,i),O.transform(n))},lt=new Set(["none","hidden"]);function je(t,e){return lt.has(t)?s=>s<=0?t:e:s=>s>=1?e:t}function $e(t,e){return s=>nt(t,e,s)}function vt(t){return typeof t=="number"?$e:typeof t=="string"?De(t)?Q:I.test(t)?Dt:Je:Array.isArray(t)?zt:typeof t=="object"?I.test(t)?Dt:ze:Q}function zt(t,e){const s=[...t],r=s.length,n=t.map((i,o)=>vt(i)(i,e[o]));return i=>{for(let o=0;o{for(const i in r)s[i]=r[i](n);return s}}function Ze(t,e){const s=[],r={color:0,var:0,number:0};for(let n=0;n{const s=qe.createTransformer(e),r=j(t),n=j(e);return r.indexes.var.length===n.indexes.var.length&&r.indexes.color.length===n.indexes.color.length&&r.indexes.number.length>=n.indexes.number.length?lt.has(t)&&!n.values.length||lt.has(e)&&!r.values.length?je(t,e):pt(zt(Ze(r,n),n.values),s):Q(t,e)};function Zt(t,e,s){return typeof t=="number"&&typeof e=="number"&&typeof s=="number"?nt(t,e,s):vt(t)(t,e)}const He=t=>{const e=({timestamp:s})=>t(s);return{start:(s=!0)=>st.update(e,s),stop:()=>Gt(e),now:()=>X.isProcessing?X.timestamp:k.now()}},Xe=(t,e,s=10)=>{let r="";const n=Math.max(Math.round(e/s),2);for(let i=0;i=Y?1/0:e}function Qe(t,e=100,s){const r=s({...t,keyframes:[0,e]}),n=Math.min(Tt(r),Y);return{type:"keyframes",ease:i=>r.next(n*i).value/e,duration:N(n)}}const A={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ft(t,e){return t*Math.sqrt(1-e*e)}const Ye=12;function ts(t,e,s){let r=s;for(let n=1;n{const c=l*o,f=c*t,d=c-s,M=ft(l,o),x=Math.exp(-f);return at-d/M*x},i=l=>{const f=l*o*t,d=f*s+s,M=Math.pow(o,2)*Math.pow(l,2)*t,x=Math.exp(-f),m=ft(Math.pow(l,2),o);return(-n(l)+at>0?-1:1)*((d-M)*x)/m}):(n=l=>{const c=Math.exp(-l*t),f=(l-s)*t+1;return-at+c*f},i=l=>{const c=Math.exp(-l*t),f=(s-l)*(t*t);return c*f});const a=5/t,u=ts(n,i,a);if(t=L(t),isNaN(u))return{stiffness:A.stiffness,damping:A.damping,duration:t};{const l=Math.pow(u,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:t}}}const ss=["duration","bounce"],ns=["stiffness","damping","mass"];function Ft(t,e){return e.some(s=>t[s]!==void 0)}function rs(t){let e={velocity:A.velocity,stiffness:A.stiffness,damping:A.damping,mass:A.mass,isResolvedFromDuration:!1,...t};if(!Ft(t,ns)&&Ft(t,ss))if(e.velocity=0,t.visualDuration){const s=t.visualDuration,r=2*Math.PI/(s*1.2),n=r*r,i=2*U(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:A.mass,stiffness:n,damping:i}}else{const s=es({...t,velocity:0});e={...e,...s,mass:A.mass},e.isResolvedFromDuration=!0}return e}function tt(t=A.visualDuration,e=A.bounce){const s=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:n}=s;const i=s.keyframes[0],o=s.keyframes[s.keyframes.length-1],a={done:!1,value:i},{stiffness:u,damping:l,mass:c,duration:f,velocity:d,isResolvedFromDuration:M}=rs({...s,velocity:-N(s.velocity||0)}),x=d||0,m=l/(2*Math.sqrt(u*c)),T=o-i,p=N(Math.sqrt(u/c)),w=Math.abs(T)<5;r||(r=w?A.restSpeed.granular:A.restSpeed.default),n||(n=w?A.restDelta.granular:A.restDelta.default);let v,g,y,S,C,b;if(m<1)y=ft(p,m),S=(x+m*p*T)/y,v=h=>{const D=Math.exp(-m*p*h);return o-D*(S*Math.sin(y*h)+T*Math.cos(y*h))},C=m*p*S+T*y,b=m*p*T-S*y,g=h=>Math.exp(-m*p*h)*(C*Math.sin(y*h)+b*Math.cos(y*h));else if(m===1){v=D=>o-Math.exp(-p*D)*(T+(x+p*T)*D);const h=x+p*T;g=D=>Math.exp(-p*D)*(p*h*D-x)}else{const h=p*Math.sqrt(m*m-1);v=P=>{const K=Math.exp(-m*p*P),R=Math.min(h*P,300);return o-K*((x+m*p*T)*Math.sinh(R)+h*T*Math.cosh(R))/h};const D=(x+m*p*T)/h,E=m*p*D-T*h,Z=m*p*T-D*h;g=P=>{const K=Math.exp(-m*p*P),R=Math.min(h*P,300);return K*(E*Math.sinh(R)+Z*Math.cosh(R))}}const V={calculatedDuration:M&&f||null,velocity:h=>L(g(h)),next:h=>{if(!M&&m<1){const E=Math.exp(-m*p*h),Z=Math.sin(y*h),P=Math.cos(y*h),K=o-E*(S*Z+T*P),R=L(E*(C*Z+b*P));return a.done=Math.abs(R)<=r&&Math.abs(o-K)<=n,a.value=a.done?o:K,a}const D=v(h);if(M)a.done=h>=f;else{const E=L(g(h));a.done=Math.abs(E)<=r&&Math.abs(o-D)<=n}return a.value=a.done?o:D,a},toString:()=>{const h=Math.min(Tt(V),Y),D=Xe(E=>V.next(h*E).value,h,30);return h+"ms "+D},toTransition:()=>{}};return V}tt.applyToOptions=t=>{const e=Qe(t,100,tt);return t.ease=e.ease,t.duration=L(e.duration),t.type="keyframes",t};const is=5;function Jt(t,e,s){const r=Math.max(e-is,0);return Pt(s-t(r),e-r)}function ht({keyframes:t,velocity:e=0,power:s=.8,timeConstant:r=325,bounceDamping:n=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const f=t[0],d={done:!1,value:f},M=b=>a!==void 0&&bu,x=b=>a===void 0?u:u===void 0||Math.abs(a-b)-m*Math.exp(-b/r),v=b=>p+w(b),g=b=>{const V=w(b),h=v(b);d.done=Math.abs(V)<=l,d.value=d.done?p:h};let y,S;const C=b=>{M(d.value)&&(y=b,S=tt({keyframes:[d.value,x(d.value)],velocity:Jt(v,b,d.value),damping:n,stiffness:i,restDelta:l,restSpeed:c}))};return C(0),{calculatedDuration:null,next:b=>{let V=!1;return!S&&y===void 0&&(V=!0,g(b),C(b)),y!==void 0&&b>=y?S.next(b-y):(!V&&g(b),d)}}}function os(t,e,s){const r=[],n=s||dt.mix||Zt,i=t.length-1;for(let o=0;oe[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=os(e,r,n),u=a.length,l=c=>{if(o&&c1)for(;fl(U(t[0],t[i-1],c)):l}function as(t,e){const s=t[t.length-1];for(let r=1;r<=e;r++){const n=Et(0,e,r);t.push(nt(s,1,n))}}function cs(t){const e=[0];return as(e,t.length-1),e}function us(t,e){return t.map(s=>s*e)}function ls(t,e){return t.map(()=>e||Kt).splice(0,t.length-1)}function B({duration:t=300,keyframes:e,times:s,ease:r="easeInOut"}){const n=ge(r)?r.map(Mt):Mt(r),i={done:!1,value:e[0]},o=us(s&&s.length===e.length?s:cs(e),t),a=Ht(o,e,{ease:Array.isArray(n)?n:ls(e,n)});return{calculatedDuration:t,next:u=>(i.value=a(u),i.done=u>=t,i)}}const fs=t=>t!==null;function hs(t,{repeat:e,repeatType:s="loop"},r,n=1){const i=t.filter(fs),a=n<0||e&&s!=="loop"&&e%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const ds={decay:ht,inertia:ht,tween:B,keyframes:B,spring:tt};function ps(t){typeof t.type=="string"&&(t.type=ds[t.type])}class ms{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,s){return this.finished.then(e,s)}}const gs=t=>t/100;class ys extends ms{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,n;const{motionValue:s}=this.options;s&&s.updatedAt!==k.now()&&this.tick(k.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(n=(r=this.options).onStop)==null||n.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;ps(e);const{type:s=B,repeat:r=0,repeatDelay:n=0,repeatType:i,velocity:o=0}=e;let{keyframes:a}=e;const u=s||B;u!==B&&typeof a[0]!="number"&&(this.mixKeyframes=pt(gs,Zt(a[0],a[1])),a=[0,100]);const l=u({...e,keyframes:a});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=Tt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+n,this.totalDuration=this.resolvedDuration*(r+1)-n,this.generator=l}updateTime(e){const s=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(e,s=!1){const{generator:r,totalDuration:n,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:c,repeat:f,repeatType:d,repeatDelay:M,type:x,onUpdate:m,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-n/this.speed,this.startTime)),s?this.currentTime=e:this.updateTime(e);const p=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?p<0:p>n;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=n);let v=this.currentTime,g=r;if(f){const b=Math.min(this.currentTime,n)/a;let V=Math.floor(b),h=b%1;!h&&b>=1&&(h=1),h===1&&V--,V=Math.min(V,f+1),!!(V%2)&&(d==="reverse"?(h=1-h,M&&(h-=M/a)):d==="mirror"&&(g=o)),v=U(0,1,h)*a}let y;w?(this.delayState.value=c[0],y=this.delayState):y=g.next(v),i&&!w&&(y.value=i(y.value));let{done:S}=y;!w&&u!==null&&(S=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return C&&x!==ht&&(y.value=hs(c,this.options,T,this.speed)),m&&m(y.value),C&&this.finish(),y}then(e,s){return this.finished.then(e,s)}get duration(){return N(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+N(e)}get time(){return N(this.currentTime)}set time(e){e=L(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const s=this.generator.next(e).value;return Jt(r=>this.generator.next(r).value,e,s)}get speed(){return this.playbackSpeed}set speed(e){const s=this.playbackSpeed!==e;s&&this.driver&&this.updateTime(k.now()),this.playbackSpeed=e,s&&this.driver&&(this.time=N(this.currentTime))}play(){var n,i;if(this.isStopped)return;const{driver:e=He,startTime:s}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(n=this.options).onPlay)==null||i.call(n);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=s??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(k.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,s;this.notifyFinished(),this.teardown(),this.state="finished",(s=(e=this.options).onComplete)==null||s.call(e)}cancel(){var e,s;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(s=(e=this.options).onCancel)==null||s.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var s;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(s=this.driver)==null||s.stop(),e.observe(this)}}const wt=30,bs=t=>!isNaN(parseFloat(t)),_={current:void 0};class vs{constructor(e,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const n=k.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=s.owner}setCurrent(e){this.current=e,this.updatedAt=k.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=bs(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,s){this.events[e]||(this.events[e]=new oe);const r=this.events[e].add(s);return e==="change"?()=>{r(),st.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,s){this.passiveEffect=e,this.stopPassiveEffect=s}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,s,r){this.set(s),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,s=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return _.current&&_.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=k.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>wt)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,wt);return Pt(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(e){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=e(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,s;(e=this.dependents)==null||e.clear(),(s=this.events.destroy)==null||s.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ts(t,e){return new vs(t,e)}const Xt=t=>!!(t&&t.getVelocity);function xs(t,e,s){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const n=document.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t).filter(r=>r!=null)}function Ms(...t){const e=!Array.isArray(t[0]),s=e?0:-1,r=t[0+s],n=t[1+s],i=t[2+s],o=t[3+s],a=Ht(n,i,o);return e?a(r):a}function As(t,e,s={}){const r=t.get();let n=null,i=r,o;const a=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,u=()=>{n&&(n.stop(),n=null),t.animation=void 0},l=()=>{const f=Vt(t.get()),d=Vt(i);if(f===d){u();return}const M=n?n.getGeneratorVelocity():t.getVelocity();u(),n=new ys({keyframes:[f,d],velocity:M,type:"spring",restDelta:.001,restSpeed:.01,...s,onUpdate:o})},c=()=>{var f;l(),t.animation=n??void 0,(f=t.events.animationStart)==null||f.notify(),n==null||n.then(()=>{var d;t.animation=void 0,(d=t.events.animationComplete)==null||d.notify()})};if(t.attach((f,d)=>{i=f,o=M=>d(ct(M,a)),st.postRender(c)},u),Xt(e)){let f=s.skipInitialAnimation===!0;const d=e.on("change",x=>{f?(f=!1,t.jump(ct(x,a),!1)):t.set(ct(x,a))}),M=t.on("destroy",d);return()=>{d(),M()}}return u}function ct(t,e){return e?t+e:t}function Vt(t){return typeof t=="number"?t:parseFloat(t)}const Qt=F.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function xt(t){const e=kt(()=>Ts(t)),{isStatic:s}=F.useContext(Qt);if(s){const[,r]=F.useState(t);F.useEffect(()=>e.on("change",r),[])}return e}function Yt(t,e){const s=xt(e()),r=()=>s.set(e());return r(),se(()=>{const n=()=>st.preRender(r,!1,!0),i=t.map(o=>o.on("change",n));return()=>{i.forEach(o=>o()),Gt(r)}}),s}function Ss(t){_.current=[],t();const e=Yt(_.current,t);return _.current=void 0,e}function Ds(t,e,s,r){if(typeof t=="function")return Ss(t);const i=typeof e=="function"?e:Ms(e,s,r),o=Array.isArray(t)?Ct(t,i):Ct([t],([u])=>i(u)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(s)&&(r==null?void 0:r.clamp)!==!1&&(o.accelerate={...a,times:e,keyframes:s,isTransformed:!0}),o}function Ct(t,e){const s=kt(()=>[]);return Yt(t,()=>{s.length=0;const r=t.length;for(let n=0;nXt(t)?t.get():t;if(s)return Ds(r);const n=xt(r());return F.useInsertionEffect(()=>As(n,t,e),[n,JSON.stringify(e)]),n}function ws(t,e={}){return Fs(t,{type:"spring",...e})}const Vs={some:0,all:1};function Cs(t,e,{root:s,margin:r,amount:n="some"}={}){const i=xs(t),o=new WeakMap,a=l=>{l.forEach(c=>{const f=o.get(c.target);if(c.isIntersecting!==!!f)if(c.isIntersecting){const d=e(c.target,c);typeof d=="function"?o.set(c.target,d):u.unobserve(c.target)}else typeof f=="function"&&(f(c),o.delete(c.target))})},u=new IntersectionObserver(a,{root:s,rootMargin:r,threshold:typeof n=="number"?n:Vs[n]});return i.forEach(l=>u.observe(l)),()=>u.disconnect()}function ks(t,{root:e,margin:s,amount:r,once:n=!1,initial:i=!1}={}){const[o,a]=F.useState(i);return F.useEffect(()=>{if(!t.current||n&&o)return;const u=()=>(a(!0),n?void 0:()=>a(!1)),l={root:e&&e.current||void 0,margin:s,amount:r};return Cs(t.current,u,l)},[e,t,s,n,r]),o}function qs({to:t,from:e=0,direction:s="up",delay:r=0,duration:n=2,className:i="",startWhen:o=!0,separator:a="",onStart:u,onEnd:l}){const c=F.useRef(null),f=xt(s==="down"?t:e),d=20+40*(1/n),M=100*(1/n),x=ws(f,{damping:d,stiffness:M}),m=ks(c,{once:!0,margin:"0px"}),T=v=>{const g=v.toString();if(g.includes(".")){const y=g.split(".")[1];if(parseInt(y)!==0)return y.length}return 0},p=Math.max(T(e),T(t)),w=F.useCallback(v=>{const g=p>0,y={useGrouping:!!a,minimumFractionDigits:g?p:0,maximumFractionDigits:g?p:0},S=Intl.NumberFormat("en-US",y).format(v);return a?S.replace(/,/g,a):S},[p,a]);return F.useEffect(()=>{c.current&&(c.current.textContent=w(s==="down"?t:e))},[e,t,s,w]),F.useEffect(()=>{if(m&&o){typeof u=="function"&&u();const v=setTimeout(()=>{f.set(s==="down"?e:t)},r*1e3),g=setTimeout(()=>{typeof l=="function"&&l()},r*1e3+n*1e3);return()=>{clearTimeout(v),clearTimeout(g)}}},[m,o,f,s,e,t,r,u,l,n]),F.useEffect(()=>{const v=x.on("change",g=>{c.current&&(c.current.textContent=w(g))});return()=>v()},[x,w]),te.jsx("span",{className:i,ref:c})}export{W as A,Os as B,qs as C,Gs as D,Ks as E,Wt as F,Ls as G,qt as H,Rs as I,ys as J,I as K,j as L,Qt as M,Ns as N,Me as O,xs as P,nt as Q,Ps as R,oe as S,Et as T,he as U,ne as V,ms as W,re as X,X as Y,Es as Z,pt as _,Ds as a,kt as b,Gt as c,se as d,It as e,st as f,Xe as g,hs as h,ye as i,et as j,de as k,le as l,N as m,yt as n,fe as o,Us as p,U as q,ps as r,L as s,k as t,xt as u,qe as v,dt as w,De as x,Ts as y,Xt as z}; +import{r as F,j as te}from"./index-sl7kA1zY.js";function kt(t){const e=F.useRef(null);return e.current===null&&(e.current=t()),e.current}const ee=typeof window<"u",se=ee?F.useLayoutEffect:F.useEffect;function ne(t,e){t.indexOf(e)===-1&&t.push(e)}function re(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const U=(t,e,s)=>s>e?e:s{};const dt={},et=t=>t,ie=(t,e)=>s=>e(t(s)),pt=(...t)=>t.reduce(ie),Et=(t,e,s)=>{const r=e-t;return r===0?1:(s-t)/r};class oe{constructor(){this.subscriptions=[]}add(e){return ne(this.subscriptions,e),()=>re(this.subscriptions,e)}notify(e,s,r){const n=this.subscriptions.length;if(n)if(n===1)this.subscriptions[0](e,s,r);else for(let i=0;it*1e3,N=t=>t/1e3;function Pt(t,e){return e?t*(1e3/e):0}const Nt=(t,e,s)=>(((1-3*s+3*e)*t+(3*s-6*e))*t+3*e)*t,ae=1e-7,ce=12;function ue(t,e,s,r,n){let i,o,a=0;do o=e+(s-e)/2,i=Nt(o,r,n)-t,i>0?s=o:e=o;while(Math.abs(i)>ae&&++aue(i,0,1,t,s);return i=>i===0||i===1?i:Nt(n(i),e,r)}const Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ot=t=>e=>1-t(1-e),Ut=$(.33,1.53,.69,.99),mt=Ot(Ut),le=Rt(mt),fe=t=>t>=1?1:(t*=2)<1?.5*mt(t):.5*(2-Math.pow(2,-10*(t-1))),gt=t=>1-Math.sin(Math.acos(t)),he=Ot(gt),de=Rt(gt),pe=$(.42,0,1,1),me=$(0,0,.58,1),Kt=$(.42,0,.58,1),ge=t=>Array.isArray(t)&&typeof t[0]!="number",ye=t=>Array.isArray(t)&&typeof t[0]=="number",be={linear:et,easeIn:pe,easeInOut:Kt,easeOut:me,circIn:gt,circInOut:de,circOut:he,backIn:mt,backInOut:le,backOut:Ut,anticipate:fe},ve=t=>typeof t=="string",Mt=t=>{if(ye(t)){It(t.length===4);const[e,s,r,n]=t;return $(e,s,r,n)}else if(ve(t))return be[t];return t},J=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Te(t,e){let s=new Set,r=new Set,n=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(c){o.has(c)&&(l.schedule(c),t()),c(a)}const l={schedule:(c,f=!1,d=!1)=>{const x=d&&n?s:r;return f&&o.add(c),x.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(a=c,n){i=!0;return}n=!0;const f=s;s=r,r=f,s.forEach(u),s.clear(),n=!1,i&&(i=!1,l.process(c))}};return l}const xe=40;function Me(t,e){let s=!1,r=!0;const n={delta:0,timestamp:0,isProcessing:!1},i=()=>s=!0,o=J.reduce((v,g)=>(v[g]=Te(i),v),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:f,preRender:d,render:M,postRender:x}=o,m=()=>{const v=dt.useManualTiming,g=v?n.timestamp:performance.now();s=!1,v||(n.delta=r?1e3/60:Math.max(Math.min(g-n.timestamp,xe),1)),n.timestamp=g,n.isProcessing=!0,a.process(n),u.process(n),l.process(n),c.process(n),f.process(n),d.process(n),M.process(n),x.process(n),n.isProcessing=!1,s&&e&&(r=!1,t(m))},T=()=>{s=!0,r=!0,n.isProcessing||t(m)};return{schedule:J.reduce((v,g)=>{const y=o[g];return v[g]=(S,C=!1,b=!1)=>(s||T(),y.schedule(S,C,b)),v},{}),cancel:v=>{for(let g=0;g(H===void 0&&k.set(X.isProcessing||dt.useManualTiming?X.timestamp:performance.now()),H),set:t=>{H=t,queueMicrotask(Ae)}},Lt=t=>e=>typeof e=="string"&&e.startsWith(t),Ps=Lt("--"),Se=Lt("var(--"),De=t=>Se(t)?Fe.test(t.split("/*")[0].trim()):!1,Fe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ns(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const yt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},qt={...yt,transform:t=>U(0,1,t)},Rs={...yt,default:1},q=t=>Math.round(t*1e5)/1e5,Wt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function we(t){return t==null}const Ve=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bt=(t,e)=>s=>!!(typeof s=="string"&&Ve.test(s)&&s.startsWith(t)||e&&!we(s)&&Object.prototype.hasOwnProperty.call(s,e)),Bt=(t,e,s)=>r=>{if(typeof r!="string")return r;const[n,i,o,a]=r.match(Wt);return{[t]:parseFloat(n),[e]:parseFloat(i),[s]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ce=t=>U(0,255,t),rt={...yt,transform:t=>Math.round(Ce(t))},O={test:bt("rgb","red"),parse:Bt("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:r=1})=>"rgba("+rt.transform(t)+", "+rt.transform(e)+", "+rt.transform(s)+", "+q(qt.transform(r))+")"};function ke(t){let e="",s="",r="",n="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),r=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),r=t.substring(3,4),n=t.substring(4,5),e+=e,s+=s,r+=r,n+=n),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(r,16),alpha:n?parseInt(n,16)/255:1}}const ut={test:bt("#"),parse:ke,transform:O.transform},z=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Os=z("deg"),W=z("%"),Us=z("px"),Ks=z("vh"),Gs=z("vw"),Ls={...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(t*100)},G={test:bt("hsl","hue"),parse:Bt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:r=1})=>"hsla("+Math.round(t)+", "+W.transform(q(e))+", "+W.transform(q(s))+", "+q(qt.transform(r))+")"},I={test:t=>O.test(t)||ut.test(t)||G.test(t),parse:t=>O.test(t)?O.parse(t):G.test(t)?G.parse(t):ut.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?O.transform(t):G.transform(t),getAnimatableNone:t=>{const e=I.parse(t);return e.alpha=0,I.transform(e)}},Ie=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ee(t){var e,s;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Wt))==null?void 0:e.length)||0)+(((s=t.match(Ie))==null?void 0:s.length)||0)>0}const _t="number",jt="color",Pe="var",Ne="var(",At="${}",Re=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function j(t){const e=t.toString(),s=[],r={color:[],number:[],var:[]},n=[];let i=0;const a=e.replace(Re,u=>(I.test(u)?(r.color.push(i),n.push(jt),s.push(I.parse(u))):u.startsWith(Ne)?(r.var.push(i),n.push(Pe),s.push(u)):(r.number.push(i),n.push(_t),s.push(parseFloat(u))),++i,At)).split(At);return{values:s,split:a,indexes:r,types:n}}function Oe(t){return j(t).values}function $t({split:t,types:e}){const s=t.length;return r=>{let n="";for(let i=0;itypeof t=="number"?0:I.test(t)?I.getAnimatableNone(t):t,Ge=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Ke(t);function Le(t){const e=j(t);return $t(e)(e.values.map((r,n)=>Ge(r,e.split[n])))}const qe={test:Ee,parse:Oe,createTransformer:Ue,getAnimatableNone:Le};function it(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+(e-t)*6*s:s<1/2?e:s<2/3?t+(e-t)*(2/3-s)*6:t}function We({hue:t,saturation:e,lightness:s,alpha:r}){t/=360,e/=100,s/=100;let n=0,i=0,o=0;if(!e)n=i=o=s;else{const a=s<.5?s*(1+e):s+e-s*e,u=2*s-a;n=it(u,a,t+1/3),i=it(u,a,t),o=it(u,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Q(t,e){return s=>s>0?e:t}const nt=(t,e,s)=>t+(e-t)*s,ot=(t,e,s)=>{const r=t*t,n=s*(e*e-r)+r;return n<0?0:Math.sqrt(n)},Be=[ut,O,G],_e=t=>Be.find(e=>e.test(t));function St(t){const e=_e(t);if(!e)return!1;let s=e.parse(t);return e===G&&(s=We(s)),s}const Dt=(t,e)=>{const s=St(t),r=St(e);if(!s||!r)return Q(t,e);const n={...s};return i=>(n.red=ot(s.red,r.red,i),n.green=ot(s.green,r.green,i),n.blue=ot(s.blue,r.blue,i),n.alpha=nt(s.alpha,r.alpha,i),O.transform(n))},lt=new Set(["none","hidden"]);function je(t,e){return lt.has(t)?s=>s<=0?t:e:s=>s>=1?e:t}function $e(t,e){return s=>nt(t,e,s)}function vt(t){return typeof t=="number"?$e:typeof t=="string"?De(t)?Q:I.test(t)?Dt:Je:Array.isArray(t)?zt:typeof t=="object"?I.test(t)?Dt:ze:Q}function zt(t,e){const s=[...t],r=s.length,n=t.map((i,o)=>vt(i)(i,e[o]));return i=>{for(let o=0;o{for(const i in r)s[i]=r[i](n);return s}}function Ze(t,e){const s=[],r={color:0,var:0,number:0};for(let n=0;n{const s=qe.createTransformer(e),r=j(t),n=j(e);return r.indexes.var.length===n.indexes.var.length&&r.indexes.color.length===n.indexes.color.length&&r.indexes.number.length>=n.indexes.number.length?lt.has(t)&&!n.values.length||lt.has(e)&&!r.values.length?je(t,e):pt(zt(Ze(r,n),n.values),s):Q(t,e)};function Zt(t,e,s){return typeof t=="number"&&typeof e=="number"&&typeof s=="number"?nt(t,e,s):vt(t)(t,e)}const He=t=>{const e=({timestamp:s})=>t(s);return{start:(s=!0)=>st.update(e,s),stop:()=>Gt(e),now:()=>X.isProcessing?X.timestamp:k.now()}},Xe=(t,e,s=10)=>{let r="";const n=Math.max(Math.round(e/s),2);for(let i=0;i=Y?1/0:e}function Qe(t,e=100,s){const r=s({...t,keyframes:[0,e]}),n=Math.min(Tt(r),Y);return{type:"keyframes",ease:i=>r.next(n*i).value/e,duration:N(n)}}const A={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ft(t,e){return t*Math.sqrt(1-e*e)}const Ye=12;function ts(t,e,s){let r=s;for(let n=1;n{const c=l*o,f=c*t,d=c-s,M=ft(l,o),x=Math.exp(-f);return at-d/M*x},i=l=>{const f=l*o*t,d=f*s+s,M=Math.pow(o,2)*Math.pow(l,2)*t,x=Math.exp(-f),m=ft(Math.pow(l,2),o);return(-n(l)+at>0?-1:1)*((d-M)*x)/m}):(n=l=>{const c=Math.exp(-l*t),f=(l-s)*t+1;return-at+c*f},i=l=>{const c=Math.exp(-l*t),f=(s-l)*(t*t);return c*f});const a=5/t,u=ts(n,i,a);if(t=L(t),isNaN(u))return{stiffness:A.stiffness,damping:A.damping,duration:t};{const l=Math.pow(u,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:t}}}const ss=["duration","bounce"],ns=["stiffness","damping","mass"];function Ft(t,e){return e.some(s=>t[s]!==void 0)}function rs(t){let e={velocity:A.velocity,stiffness:A.stiffness,damping:A.damping,mass:A.mass,isResolvedFromDuration:!1,...t};if(!Ft(t,ns)&&Ft(t,ss))if(e.velocity=0,t.visualDuration){const s=t.visualDuration,r=2*Math.PI/(s*1.2),n=r*r,i=2*U(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:A.mass,stiffness:n,damping:i}}else{const s=es({...t,velocity:0});e={...e,...s,mass:A.mass},e.isResolvedFromDuration=!0}return e}function tt(t=A.visualDuration,e=A.bounce){const s=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:n}=s;const i=s.keyframes[0],o=s.keyframes[s.keyframes.length-1],a={done:!1,value:i},{stiffness:u,damping:l,mass:c,duration:f,velocity:d,isResolvedFromDuration:M}=rs({...s,velocity:-N(s.velocity||0)}),x=d||0,m=l/(2*Math.sqrt(u*c)),T=o-i,p=N(Math.sqrt(u/c)),w=Math.abs(T)<5;r||(r=w?A.restSpeed.granular:A.restSpeed.default),n||(n=w?A.restDelta.granular:A.restDelta.default);let v,g,y,S,C,b;if(m<1)y=ft(p,m),S=(x+m*p*T)/y,v=h=>{const D=Math.exp(-m*p*h);return o-D*(S*Math.sin(y*h)+T*Math.cos(y*h))},C=m*p*S+T*y,b=m*p*T-S*y,g=h=>Math.exp(-m*p*h)*(C*Math.sin(y*h)+b*Math.cos(y*h));else if(m===1){v=D=>o-Math.exp(-p*D)*(T+(x+p*T)*D);const h=x+p*T;g=D=>Math.exp(-p*D)*(p*h*D-x)}else{const h=p*Math.sqrt(m*m-1);v=P=>{const K=Math.exp(-m*p*P),R=Math.min(h*P,300);return o-K*((x+m*p*T)*Math.sinh(R)+h*T*Math.cosh(R))/h};const D=(x+m*p*T)/h,E=m*p*D-T*h,Z=m*p*T-D*h;g=P=>{const K=Math.exp(-m*p*P),R=Math.min(h*P,300);return K*(E*Math.sinh(R)+Z*Math.cosh(R))}}const V={calculatedDuration:M&&f||null,velocity:h=>L(g(h)),next:h=>{if(!M&&m<1){const E=Math.exp(-m*p*h),Z=Math.sin(y*h),P=Math.cos(y*h),K=o-E*(S*Z+T*P),R=L(E*(C*Z+b*P));return a.done=Math.abs(R)<=r&&Math.abs(o-K)<=n,a.value=a.done?o:K,a}const D=v(h);if(M)a.done=h>=f;else{const E=L(g(h));a.done=Math.abs(E)<=r&&Math.abs(o-D)<=n}return a.value=a.done?o:D,a},toString:()=>{const h=Math.min(Tt(V),Y),D=Xe(E=>V.next(h*E).value,h,30);return h+"ms "+D},toTransition:()=>{}};return V}tt.applyToOptions=t=>{const e=Qe(t,100,tt);return t.ease=e.ease,t.duration=L(e.duration),t.type="keyframes",t};const is=5;function Jt(t,e,s){const r=Math.max(e-is,0);return Pt(s-t(r),e-r)}function ht({keyframes:t,velocity:e=0,power:s=.8,timeConstant:r=325,bounceDamping:n=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const f=t[0],d={done:!1,value:f},M=b=>a!==void 0&&bu,x=b=>a===void 0?u:u===void 0||Math.abs(a-b)-m*Math.exp(-b/r),v=b=>p+w(b),g=b=>{const V=w(b),h=v(b);d.done=Math.abs(V)<=l,d.value=d.done?p:h};let y,S;const C=b=>{M(d.value)&&(y=b,S=tt({keyframes:[d.value,x(d.value)],velocity:Jt(v,b,d.value),damping:n,stiffness:i,restDelta:l,restSpeed:c}))};return C(0),{calculatedDuration:null,next:b=>{let V=!1;return!S&&y===void 0&&(V=!0,g(b),C(b)),y!==void 0&&b>=y?S.next(b-y):(!V&&g(b),d)}}}function os(t,e,s){const r=[],n=s||dt.mix||Zt,i=t.length-1;for(let o=0;oe[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=os(e,r,n),u=a.length,l=c=>{if(o&&c1)for(;fl(U(t[0],t[i-1],c)):l}function as(t,e){const s=t[t.length-1];for(let r=1;r<=e;r++){const n=Et(0,e,r);t.push(nt(s,1,n))}}function cs(t){const e=[0];return as(e,t.length-1),e}function us(t,e){return t.map(s=>s*e)}function ls(t,e){return t.map(()=>e||Kt).splice(0,t.length-1)}function B({duration:t=300,keyframes:e,times:s,ease:r="easeInOut"}){const n=ge(r)?r.map(Mt):Mt(r),i={done:!1,value:e[0]},o=us(s&&s.length===e.length?s:cs(e),t),a=Ht(o,e,{ease:Array.isArray(n)?n:ls(e,n)});return{calculatedDuration:t,next:u=>(i.value=a(u),i.done=u>=t,i)}}const fs=t=>t!==null;function hs(t,{repeat:e,repeatType:s="loop"},r,n=1){const i=t.filter(fs),a=n<0||e&&s!=="loop"&&e%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const ds={decay:ht,inertia:ht,tween:B,keyframes:B,spring:tt};function ps(t){typeof t.type=="string"&&(t.type=ds[t.type])}class ms{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,s){return this.finished.then(e,s)}}const gs=t=>t/100;class ys extends ms{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,n;const{motionValue:s}=this.options;s&&s.updatedAt!==k.now()&&this.tick(k.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(n=(r=this.options).onStop)==null||n.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;ps(e);const{type:s=B,repeat:r=0,repeatDelay:n=0,repeatType:i,velocity:o=0}=e;let{keyframes:a}=e;const u=s||B;u!==B&&typeof a[0]!="number"&&(this.mixKeyframes=pt(gs,Zt(a[0],a[1])),a=[0,100]);const l=u({...e,keyframes:a});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=Tt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+n,this.totalDuration=this.resolvedDuration*(r+1)-n,this.generator=l}updateTime(e){const s=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(e,s=!1){const{generator:r,totalDuration:n,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:c,repeat:f,repeatType:d,repeatDelay:M,type:x,onUpdate:m,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-n/this.speed,this.startTime)),s?this.currentTime=e:this.updateTime(e);const p=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?p<0:p>n;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=n);let v=this.currentTime,g=r;if(f){const b=Math.min(this.currentTime,n)/a;let V=Math.floor(b),h=b%1;!h&&b>=1&&(h=1),h===1&&V--,V=Math.min(V,f+1),!!(V%2)&&(d==="reverse"?(h=1-h,M&&(h-=M/a)):d==="mirror"&&(g=o)),v=U(0,1,h)*a}let y;w?(this.delayState.value=c[0],y=this.delayState):y=g.next(v),i&&!w&&(y.value=i(y.value));let{done:S}=y;!w&&u!==null&&(S=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return C&&x!==ht&&(y.value=hs(c,this.options,T,this.speed)),m&&m(y.value),C&&this.finish(),y}then(e,s){return this.finished.then(e,s)}get duration(){return N(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+N(e)}get time(){return N(this.currentTime)}set time(e){e=L(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const s=this.generator.next(e).value;return Jt(r=>this.generator.next(r).value,e,s)}get speed(){return this.playbackSpeed}set speed(e){const s=this.playbackSpeed!==e;s&&this.driver&&this.updateTime(k.now()),this.playbackSpeed=e,s&&this.driver&&(this.time=N(this.currentTime))}play(){var n,i;if(this.isStopped)return;const{driver:e=He,startTime:s}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(n=this.options).onPlay)==null||i.call(n);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=s??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(k.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,s;this.notifyFinished(),this.teardown(),this.state="finished",(s=(e=this.options).onComplete)==null||s.call(e)}cancel(){var e,s;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(s=(e=this.options).onCancel)==null||s.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var s;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(s=this.driver)==null||s.stop(),e.observe(this)}}const wt=30,bs=t=>!isNaN(parseFloat(t)),_={current:void 0};class vs{constructor(e,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const n=k.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=s.owner}setCurrent(e){this.current=e,this.updatedAt=k.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=bs(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,s){this.events[e]||(this.events[e]=new oe);const r=this.events[e].add(s);return e==="change"?()=>{r(),st.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,s){this.passiveEffect=e,this.stopPassiveEffect=s}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,s,r){this.set(s),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,s=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return _.current&&_.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=k.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>wt)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,wt);return Pt(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(e){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=e(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,s;(e=this.dependents)==null||e.clear(),(s=this.events.destroy)==null||s.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ts(t,e){return new vs(t,e)}const Xt=t=>!!(t&&t.getVelocity);function xs(t,e,s){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const n=document.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t).filter(r=>r!=null)}function Ms(...t){const e=!Array.isArray(t[0]),s=e?0:-1,r=t[0+s],n=t[1+s],i=t[2+s],o=t[3+s],a=Ht(n,i,o);return e?a(r):a}function As(t,e,s={}){const r=t.get();let n=null,i=r,o;const a=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,u=()=>{n&&(n.stop(),n=null),t.animation=void 0},l=()=>{const f=Vt(t.get()),d=Vt(i);if(f===d){u();return}const M=n?n.getGeneratorVelocity():t.getVelocity();u(),n=new ys({keyframes:[f,d],velocity:M,type:"spring",restDelta:.001,restSpeed:.01,...s,onUpdate:o})},c=()=>{var f;l(),t.animation=n??void 0,(f=t.events.animationStart)==null||f.notify(),n==null||n.then(()=>{var d;t.animation=void 0,(d=t.events.animationComplete)==null||d.notify()})};if(t.attach((f,d)=>{i=f,o=M=>d(ct(M,a)),st.postRender(c)},u),Xt(e)){let f=s.skipInitialAnimation===!0;const d=e.on("change",x=>{f?(f=!1,t.jump(ct(x,a),!1)):t.set(ct(x,a))}),M=t.on("destroy",d);return()=>{d(),M()}}return u}function ct(t,e){return e?t+e:t}function Vt(t){return typeof t=="number"?t:parseFloat(t)}const Qt=F.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function xt(t){const e=kt(()=>Ts(t)),{isStatic:s}=F.useContext(Qt);if(s){const[,r]=F.useState(t);F.useEffect(()=>e.on("change",r),[])}return e}function Yt(t,e){const s=xt(e()),r=()=>s.set(e());return r(),se(()=>{const n=()=>st.preRender(r,!1,!0),i=t.map(o=>o.on("change",n));return()=>{i.forEach(o=>o()),Gt(r)}}),s}function Ss(t){_.current=[],t();const e=Yt(_.current,t);return _.current=void 0,e}function Ds(t,e,s,r){if(typeof t=="function")return Ss(t);const i=typeof e=="function"?e:Ms(e,s,r),o=Array.isArray(t)?Ct(t,i):Ct([t],([u])=>i(u)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(s)&&(r==null?void 0:r.clamp)!==!1&&(o.accelerate={...a,times:e,keyframes:s,isTransformed:!0}),o}function Ct(t,e){const s=kt(()=>[]);return Yt(t,()=>{s.length=0;const r=t.length;for(let n=0;nXt(t)?t.get():t;if(s)return Ds(r);const n=xt(r());return F.useInsertionEffect(()=>As(n,t,e),[n,JSON.stringify(e)]),n}function ws(t,e={}){return Fs(t,{type:"spring",...e})}const Vs={some:0,all:1};function Cs(t,e,{root:s,margin:r,amount:n="some"}={}){const i=xs(t),o=new WeakMap,a=l=>{l.forEach(c=>{const f=o.get(c.target);if(c.isIntersecting!==!!f)if(c.isIntersecting){const d=e(c.target,c);typeof d=="function"?o.set(c.target,d):u.unobserve(c.target)}else typeof f=="function"&&(f(c),o.delete(c.target))})},u=new IntersectionObserver(a,{root:s,rootMargin:r,threshold:typeof n=="number"?n:Vs[n]});return i.forEach(l=>u.observe(l)),()=>u.disconnect()}function ks(t,{root:e,margin:s,amount:r,once:n=!1,initial:i=!1}={}){const[o,a]=F.useState(i);return F.useEffect(()=>{if(!t.current||n&&o)return;const u=()=>(a(!0),n?void 0:()=>a(!1)),l={root:e&&e.current||void 0,margin:s,amount:r};return Cs(t.current,u,l)},[e,t,s,n,r]),o}function qs({to:t,from:e=0,direction:s="up",delay:r=0,duration:n=2,className:i="",startWhen:o=!0,separator:a="",onStart:u,onEnd:l}){const c=F.useRef(null),f=xt(s==="down"?t:e),d=20+40*(1/n),M=100*(1/n),x=ws(f,{damping:d,stiffness:M}),m=ks(c,{once:!0,margin:"0px"}),T=v=>{const g=v.toString();if(g.includes(".")){const y=g.split(".")[1];if(parseInt(y)!==0)return y.length}return 0},p=Math.max(T(e),T(t)),w=F.useCallback(v=>{const g=p>0,y={useGrouping:!!a,minimumFractionDigits:g?p:0,maximumFractionDigits:g?p:0},S=Intl.NumberFormat("en-US",y).format(v);return a?S.replace(/,/g,a):S},[p,a]);return F.useEffect(()=>{c.current&&(c.current.textContent=w(s==="down"?t:e))},[e,t,s,w]),F.useEffect(()=>{if(m&&o){typeof u=="function"&&u();const v=setTimeout(()=>{f.set(s==="down"?e:t)},r*1e3),g=setTimeout(()=>{typeof l=="function"&&l()},r*1e3+n*1e3);return()=>{clearTimeout(v),clearTimeout(g)}}},[m,o,f,s,e,t,r,u,l,n]),F.useEffect(()=>{const v=x.on("change",g=>{c.current&&(c.current.textContent=w(g))});return()=>v()},[x,w]),te.jsx("span",{className:i,ref:c})}export{W as A,Os as B,qs as C,Gs as D,Ks as E,Wt as F,Ls as G,qt as H,Rs as I,ys as J,I as K,j as L,Qt as M,Ns as N,Me as O,xs as P,nt as Q,Ps as R,oe as S,Et as T,he as U,ne as V,ms as W,re as X,X as Y,Es as Z,pt as _,Ds as a,kt as b,Gt as c,se as d,It as e,st as f,Xe as g,hs as h,ye as i,et as j,de as k,le as l,N as m,yt as n,fe as o,Us as p,U as q,ps as r,L as s,k as t,xt as u,qe as v,dt as w,De as x,Ts as y,Xt as z}; diff --git a/dist/assets/Dashboard-zYeILO9k.js b/dist/assets/Dashboard-BywtYNhH.js similarity index 94% rename from dist/assets/Dashboard-zYeILO9k.js rename to dist/assets/Dashboard-BywtYNhH.js index 145e013..905622d 100644 --- a/dist/assets/Dashboard-zYeILO9k.js +++ b/dist/assets/Dashboard-BywtYNhH.js @@ -1 +1 @@ -import{r as n,j as e,u as M,Q as $,L as k,g as _,d as I,z}from"./index-BSnGsuja.js";import{S}from"./SpotlightCard-DMZC3L4x.js";import{u as A,a as F,C as q}from"./CountUp-CaPcnNrA.js";import{m as K}from"./proxy-BY9NCDQu.js";import{u as Q}from"./use-animation-frame-D5p6ytsV.js";import{u as W}from"./useTranslation-fJCRxooE.js";const B=({text:s,disabled:t=!1,speed:v=2,className:r="",color:m="#b5b5b5",shineColor:p="#ffffff",spread:g=120,yoyo:j=!1,pauseOnHover:d=!1,direction:u="left",delay:w=0})=>{const[N,b]=n.useState(!1),o=A(0),x=n.useRef(0),a=n.useRef(null),l=n.useRef(u==="left"?1:-1),c=v*1e3,R=w*1e3;Q(f=>{if(t||N){a.current=null;return}if(a.current===null){a.current=f;return}const P=f-a.current;if(a.current=f,x.current+=P,j){const h=c+R,y=h*2,i=x.current%y;if(i{l.current=u==="left"?1:-1,x.current=0,o.set(0)},[u]);const D=F(o,f=>`${150-f*2}% center`),U=n.useCallback(()=>{d&&b(!0)},[d]),L=n.useCallback(()=>{d&&b(!1)},[d]),E={backgroundImage:`linear-gradient(${g}deg, ${m} 0%, ${m} 35%, ${p} 50%, ${m} 65%, ${m} 100%)`,backgroundSize:"200% auto",WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent"};return e.jsx(K.span,{className:`inline-block ${r}`,style:{...E,backgroundPosition:D},onMouseEnter:U,onMouseLeave:L,children:s})};function H(){const{t:s}=W(),{user:t,refreshUser:v}=M(),[r,m]=n.useState(null),[p,g]=n.useState(""),[j,d]=n.useState(!1),u=async()=>{try{const a=await _();a.data.success&&m(a.data.data)}catch{}};n.useEffect(()=>{u()},[]);const w=async a=>{if(a.preventDefault(),!!p.trim()){d(!0);try{(await I(p.trim())).data.success&&(z.success(s("dashboard.redeemSuccess")),g(""),await Promise.all([u(),v()]))}catch{}d(!1)}},N=(r==null?void 0:r.quota)??(t==null?void 0:t.quota)??0,b=(r==null?void 0:r.used_quota)??(t==null?void 0:t.used_quota)??0,o=(r==null?void 0:r.request_count)??(t==null?void 0:t.request_count)??0,x=N/$;return e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"text-2xl font-heading font-bold text-white mb-1",children:[s("dashboard.welcome")," ",e.jsx(B,{text:(t==null?void 0:t.display_name)||(t==null?void 0:t.username)||"User",className:"!inline",speed:3,color:"#a5b4fc",shineColor:"#e0e7ff"})]}),e.jsx("p",{className:"text-sm text-neutral-400",children:s("dashboard.manageDesc")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[e.jsxs(S,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(34,197,94,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.balance")}),e.jsxs("div",{className:"text-3xl font-bold text-white",children:["$",e.jsx(q,{from:0,to:x,duration:1.5})]}),e.jsx("p",{className:"text-xs text-neutral-500 mt-1",children:s("dashboard.quotaUnits",{count:N.toLocaleString()})})]}),e.jsxs(S,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(129,140,248,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.used")}),e.jsxs("div",{className:"text-3xl font-bold text-white",children:["$",e.jsx(q,{from:0,to:b/$,duration:1.5})]}),e.jsx("p",{className:"text-xs text-neutral-500 mt-1",children:s("dashboard.quotaUnits",{count:b.toLocaleString()})})]}),e.jsxs(S,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(244,114,182,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.totalRequests")}),e.jsx("div",{className:"text-3xl font-bold text-white",children:e.jsx(q,{from:0,to:o,duration:1.5})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("dashboard.redeemCode")}),e.jsxs("form",{onSubmit:w,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:p,onChange:a=>g(a.target.value),className:"input flex-1",placeholder:s("dashboard.enterCode")}),e.jsx("button",{type:"submit",disabled:j,className:"btn-primary whitespace-nowrap",children:s(j?"dashboard.redeeming":"dashboard.redeem")})]})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("dashboard.quickLinks")}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs(k,{to:"/tokens",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-white/[0.06] transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-white group-hover:text-brand-400 transition-colors",children:s("dashboard.apiKeys")}),e.jsx("p",{className:"text-xs text-neutral-500",children:s("dashboard.manageKeys")})]}),e.jsxs(k,{to:"/packages",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-white/[0.06] transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-white group-hover:text-brand-400 transition-colors",children:s("dashboard.packages")}),e.jsx("p",{className:"text-xs text-neutral-500",children:s("dashboard.viewPlans")})]}),e.jsxs(k,{to:"/pricing",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-white/[0.06] transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-white group-hover:text-brand-400 transition-colors",children:s("dashboard.pricing")}),e.jsx("p",{className:"text-xs text-neutral-500",children:s("dashboard.modelPrices")})]}),e.jsxs("div",{className:"glass-sm !rounded-xl px-4 py-3 opacity-50",children:[e.jsx("p",{className:"text-sm font-medium text-white",children:s("dashboard.apiDocs")}),e.jsx("p",{className:"text-xs text-neutral-500",children:s("dashboard.comingSoon")})]})]})]})]})]})}export{H as default}; +import{r as n,j as e,u as M,Q as $,L as k,g as _,d as I,z}from"./index-sl7kA1zY.js";import{S}from"./SpotlightCard-dMmfK1cV.js";import{u as A,a as F,C as q}from"./CountUp-4XjqJEhr.js";import{m as K}from"./proxy-Cyyan-lb.js";import{u as Q}from"./use-animation-frame-BTHnf9ip.js";import{u as W}from"./useTranslation-D01I4oIt.js";const B=({text:s,disabled:t=!1,speed:v=2,className:r="",color:m="#b5b5b5",shineColor:p="#ffffff",spread:g=120,yoyo:j=!1,pauseOnHover:d=!1,direction:u="left",delay:w=0})=>{const[N,b]=n.useState(!1),o=A(0),x=n.useRef(0),a=n.useRef(null),l=n.useRef(u==="left"?1:-1),c=v*1e3,R=w*1e3;Q(f=>{if(t||N){a.current=null;return}if(a.current===null){a.current=f;return}const P=f-a.current;if(a.current=f,x.current+=P,j){const h=c+R,y=h*2,i=x.current%y;if(i{l.current=u==="left"?1:-1,x.current=0,o.set(0)},[u]);const D=F(o,f=>`${150-f*2}% center`),U=n.useCallback(()=>{d&&b(!0)},[d]),L=n.useCallback(()=>{d&&b(!1)},[d]),E={backgroundImage:`linear-gradient(${g}deg, ${m} 0%, ${m} 35%, ${p} 50%, ${m} 65%, ${m} 100%)`,backgroundSize:"200% auto",WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent"};return e.jsx(K.span,{className:`inline-block ${r}`,style:{...E,backgroundPosition:D},onMouseEnter:U,onMouseLeave:L,children:s})};function H(){const{t:s}=W(),{user:t,refreshUser:v}=M(),[r,m]=n.useState(null),[p,g]=n.useState(""),[j,d]=n.useState(!1),u=async()=>{try{const a=await _();a.data.success&&m(a.data.data)}catch{}};n.useEffect(()=>{u()},[]);const w=async a=>{if(a.preventDefault(),!!p.trim()){d(!0);try{(await I(p.trim())).data.success&&(z.success(s("dashboard.redeemSuccess")),g(""),await Promise.all([u(),v()]))}catch{}d(!1)}},N=(r==null?void 0:r.quota)??(t==null?void 0:t.quota)??0,b=(r==null?void 0:r.used_quota)??(t==null?void 0:t.used_quota)??0,o=(r==null?void 0:r.request_count)??(t==null?void 0:t.request_count)??0,x=N/$;return e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"text-2xl font-heading font-bold text-white mb-1",children:[s("dashboard.welcome")," ",e.jsx(B,{text:(t==null?void 0:t.display_name)||(t==null?void 0:t.username)||"User",className:"!inline",speed:3,color:"#a5b4fc",shineColor:"#e0e7ff"})]}),e.jsx("p",{className:"text-sm text-neutral-400",children:s("dashboard.manageDesc")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[e.jsxs(S,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(34,197,94,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.balance")}),e.jsxs("div",{className:"text-3xl font-bold text-white",children:["$",e.jsx(q,{from:0,to:x,duration:1.5})]}),e.jsx("p",{className:"text-xs text-neutral-500 mt-1",children:s("dashboard.quotaUnits",{count:N.toLocaleString()})})]}),e.jsxs(S,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(129,140,248,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.used")}),e.jsxs("div",{className:"text-3xl font-bold text-white",children:["$",e.jsx(q,{from:0,to:b/$,duration:1.5})]}),e.jsx("p",{className:"text-xs text-neutral-500 mt-1",children:s("dashboard.quotaUnits",{count:b.toLocaleString()})})]}),e.jsxs(S,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(244,114,182,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.totalRequests")}),e.jsx("div",{className:"text-3xl font-bold text-white",children:e.jsx(q,{from:0,to:o,duration:1.5})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("dashboard.redeemCode")}),e.jsxs("form",{onSubmit:w,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:p,onChange:a=>g(a.target.value),className:"input flex-1",placeholder:s("dashboard.enterCode")}),e.jsx("button",{type:"submit",disabled:j,className:"btn-primary whitespace-nowrap",children:s(j?"dashboard.redeeming":"dashboard.redeem")})]})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("dashboard.quickLinks")}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs(k,{to:"/tokens",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-white/[0.06] transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-white group-hover:text-brand-400 transition-colors",children:s("dashboard.apiKeys")}),e.jsx("p",{className:"text-xs text-neutral-500",children:s("dashboard.manageKeys")})]}),e.jsxs(k,{to:"/packages",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-white/[0.06] transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-white group-hover:text-brand-400 transition-colors",children:s("dashboard.packages")}),e.jsx("p",{className:"text-xs text-neutral-500",children:s("dashboard.viewPlans")})]}),e.jsxs(k,{to:"/pricing",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-white/[0.06] transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-white group-hover:text-brand-400 transition-colors",children:s("dashboard.pricing")}),e.jsx("p",{className:"text-xs text-neutral-500",children:s("dashboard.modelPrices")})]}),e.jsxs("div",{className:"glass-sm !rounded-xl px-4 py-3 opacity-50",children:[e.jsx("p",{className:"text-sm font-medium text-white",children:s("dashboard.apiDocs")}),e.jsx("p",{className:"text-xs text-neutral-500",children:s("dashboard.comingSoon")})]})]})]})]})]})}export{H as default}; diff --git a/dist/assets/Home-CfWfC9v3.js b/dist/assets/Home-BiUxfnQ8.js similarity index 98% rename from dist/assets/Home-CfWfC9v3.js rename to dist/assets/Home-BiUxfnQ8.js index 79876ad..47329d0 100644 --- a/dist/assets/Home-CfWfC9v3.js +++ b/dist/assets/Home-BiUxfnQ8.js @@ -1 +1 @@ -import{r as c,j as e,u as f,a as N,l as v,k as w,L as r}from"./index-BSnGsuja.js";import{C as p}from"./CountUp-CaPcnNrA.js";import{u as y}from"./useTranslation-fJCRxooE.js";const o=({children:t,blur:i=!1,duration:n=800,delay:d=0,threshold:x=.1,initialOpacity:m=0,className:h="",...a})=>{const s=c.useRef(null),[l,j]=c.useState(!1);return c.useEffect(()=>{const b=s.current;if(!b)return;const u=new IntersectionObserver(([g])=>{g.isIntersecting&&(j(!0),u.disconnect())},{threshold:x});return u.observe(b),()=>u.disconnect()},[x]),e.jsx("div",{ref:s,className:h,style:{opacity:l?1:m,filter:i?l?"blur(0px)":"blur(10px)":void 0,transform:l?"translateY(0)":"translateY(20px)",transition:`opacity ${n}ms ease-out ${d}ms, filter ${n}ms ease-out ${d}ms, transform ${n}ms ease-out ${d}ms`,willChange:"opacity, filter, transform"},...a,children:t})};function $(){const{t}=y(),{user:i}=f(),{site:n}=N(),[d,x]=c.useState([]),[m,h]=c.useState([]);c.useEffect(()=>{v().then(s=>{s.data.success&&x(s.data.data||[])}).catch(()=>{}),w().then(s=>{s.data.success&&h(s.data.data||[])}).catch(()=>{})},[]);const a=d.filter(s=>s.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-24",children:[e.jsx(o,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(n==null?void 0:n.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:t("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:i?e.jsxs(r,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(r,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.getStarted")," →"]}),e.jsx(r,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:t("home.viewPricing")})]})})]})}),e.jsx(o,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 border-t border-neutral-800 pt-10",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(p,{from:0,to:a.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(p,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(p,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-6",children:[{title:t("home.lightningFast"),desc:t("home.lightningFastDesc")},{title:t("home.securePrivate"),desc:t("home.securePrivateDesc")},{title:t("home.payAsYouGo"),desc:t("home.payAsYouGoDesc")}].map((s,l)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-neutral-800/60 last:border-0 group",children:[e.jsxs("span",{className:"text-sm font-mono text-neutral-600 mt-0.5",children:["0",l+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-white mb-1 group-hover:text-neutral-300 transition-colors",children:s.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:s.desc})]})]},l))})]})}),a.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:t("home.availableModelsDesc",{count:a.length})})]}),a.length>8&&e.jsxs(r,{to:"/pricing",className:"text-sm text-neutral-400 hover:text-white transition-colors",children:[t("home.viewAllModels",{count:a.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:a.slice(0,8).map((s,l)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:e.jsx("span",{className:"text-sm text-neutral-300 font-mono",children:s.display_name||s.model_name})},s.id||l))})]})}),m.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:m.filter(s=>s.enabled).slice(0,3).map(s=>e.jsxs("div",{className:"rounded-xl p-6 flex flex-col border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:[e.jsx("h3",{className:"text-base font-semibold text-white",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:t("home.days",{count:s.duration})})]}),e.jsx(r,{to:i?"/packages":"/register",className:"mt-4 py-2.5 rounded-lg bg-neutral-800 text-white font-medium text-sm text-center hover:bg-neutral-700 transition-colors",children:t(i?"home.subscribe":"home.getStarted")})]},s.id))})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(o,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-neutral-800 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:t("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:t("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:i?e.jsxs(r,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(r,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.createFreeAccount")," →"]}),e.jsx(r,{to:"/login",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:t("home.signIn")})]})})]})})})]})}export{$ as default}; +import{r as c,j as e,u as f,a as N,l as v,k as w,L as r}from"./index-sl7kA1zY.js";import{C as p}from"./CountUp-4XjqJEhr.js";import{u as y}from"./useTranslation-D01I4oIt.js";const o=({children:t,blur:i=!1,duration:n=800,delay:d=0,threshold:x=.1,initialOpacity:m=0,className:h="",...a})=>{const s=c.useRef(null),[l,j]=c.useState(!1);return c.useEffect(()=>{const b=s.current;if(!b)return;const u=new IntersectionObserver(([g])=>{g.isIntersecting&&(j(!0),u.disconnect())},{threshold:x});return u.observe(b),()=>u.disconnect()},[x]),e.jsx("div",{ref:s,className:h,style:{opacity:l?1:m,filter:i?l?"blur(0px)":"blur(10px)":void 0,transform:l?"translateY(0)":"translateY(20px)",transition:`opacity ${n}ms ease-out ${d}ms, filter ${n}ms ease-out ${d}ms, transform ${n}ms ease-out ${d}ms`,willChange:"opacity, filter, transform"},...a,children:t})};function $(){const{t}=y(),{user:i}=f(),{site:n}=N(),[d,x]=c.useState([]),[m,h]=c.useState([]);c.useEffect(()=>{v().then(s=>{s.data.success&&x(s.data.data||[])}).catch(()=>{}),w().then(s=>{s.data.success&&h(s.data.data||[])}).catch(()=>{})},[]);const a=d.filter(s=>s.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-24",children:[e.jsx(o,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(n==null?void 0:n.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:t("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:i?e.jsxs(r,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(r,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.getStarted")," →"]}),e.jsx(r,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:t("home.viewPricing")})]})})]})}),e.jsx(o,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 border-t border-neutral-800 pt-10",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(p,{from:0,to:a.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(p,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(p,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-6",children:[{title:t("home.lightningFast"),desc:t("home.lightningFastDesc")},{title:t("home.securePrivate"),desc:t("home.securePrivateDesc")},{title:t("home.payAsYouGo"),desc:t("home.payAsYouGoDesc")}].map((s,l)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-neutral-800/60 last:border-0 group",children:[e.jsxs("span",{className:"text-sm font-mono text-neutral-600 mt-0.5",children:["0",l+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-white mb-1 group-hover:text-neutral-300 transition-colors",children:s.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:s.desc})]})]},l))})]})}),a.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:t("home.availableModelsDesc",{count:a.length})})]}),a.length>8&&e.jsxs(r,{to:"/pricing",className:"text-sm text-neutral-400 hover:text-white transition-colors",children:[t("home.viewAllModels",{count:a.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:a.slice(0,8).map((s,l)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:e.jsx("span",{className:"text-sm text-neutral-300 font-mono",children:s.display_name||s.model_name})},s.id||l))})]})}),m.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:m.filter(s=>s.enabled).slice(0,3).map(s=>e.jsxs("div",{className:"rounded-xl p-6 flex flex-col border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:[e.jsx("h3",{className:"text-base font-semibold text-white",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:t("home.days",{count:s.duration})})]}),e.jsx(r,{to:i?"/packages":"/register",className:"mt-4 py-2.5 rounded-lg bg-neutral-800 text-white font-medium text-sm text-center hover:bg-neutral-700 transition-colors",children:t(i?"home.subscribe":"home.getStarted")})]},s.id))})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(o,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-neutral-800 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:t("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:t("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:i?e.jsxs(r,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(r,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.createFreeAccount")," →"]}),e.jsx(r,{to:"/login",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:t("home.signIn")})]})})]})})})]})}export{$ as default}; diff --git a/dist/assets/Home-Cv07XbCn.js b/dist/assets/Home-DKZDwMrJ.js similarity index 98% rename from dist/assets/Home-Cv07XbCn.js rename to dist/assets/Home-DKZDwMrJ.js index 5412acf..a925eca 100644 --- a/dist/assets/Home-Cv07XbCn.js +++ b/dist/assets/Home-DKZDwMrJ.js @@ -1,4 +1,4 @@ -import{r as o,j as t,u as ee,a as te,l as se,k as re,L as I}from"./index-BSnGsuja.js";import{G as ne,R as oe,P as ae,M as ie}from"./Mesh-CwXV3WjE.js";import{i as H,P as le,u as ce,L as de,m as _}from"./proxy-BY9NCDQu.js";import{M as ue,b as X,d as me,C as he}from"./CountUp-CaPcnNrA.js";import{S as W}from"./SpotlightCard-DMZC3L4x.js";import{u as xe}from"./useTranslation-fJCRxooE.js";function U(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function fe(...e){return r=>{let n=!1;const c=e.map(d=>{const u=U(d,r);return!n&&typeof u=="function"&&(n=!0),u});if(n)return()=>{for(let d=0;d{const{width:y,height:g,top:N,left:b,right:j,bottom:L}=s.current;if(r||u===!1||!a.current||!y||!g)return;const E=n==="left"?`left: ${b}`:`right: ${j}`,i=c==="bottom"?`bottom: ${L}`:`top: ${N}`;a.current.dataset.motionPopId=m;const S=document.createElement("style");h&&(S.nonce=h);const k=d??document.head;return k.appendChild(S),S.sheet&&S.sheet.insertRule(` +import{r as o,j as t,u as ee,a as te,l as se,k as re,L as I}from"./index-sl7kA1zY.js";import{G as ne,R as oe,P as ae,M as ie}from"./Mesh-CwXV3WjE.js";import{i as H,P as le,u as ce,L as de,m as _}from"./proxy-Cyyan-lb.js";import{M as ue,b as X,d as me,C as he}from"./CountUp-4XjqJEhr.js";import{S as W}from"./SpotlightCard-dMmfK1cV.js";import{u as xe}from"./useTranslation-D01I4oIt.js";function U(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function fe(...e){return r=>{let n=!1;const c=e.map(d=>{const u=U(d,r);return!n&&typeof u=="function"&&(n=!0),u});if(n)return()=>{for(let d=0;d{const{width:y,height:g,top:N,left:b,right:j,bottom:L}=s.current;if(r||u===!1||!a.current||!y||!g)return;const E=n==="left"?`left: ${b}`:`right: ${j}`,i=c==="bottom"?`bottom: ${L}`:`top: ${N}`;a.current.dataset.motionPopId=m;const S=document.createElement("style");h&&(S.nonce=h);const k=d??document.head;return k.appendChild(S),S.sheet&&S.sheet.insertRule(` [data-motion-pop-id="${m}"] { position: absolute !important; width: ${y}px !important; diff --git a/dist/assets/Home-Csp4uo9R.js b/dist/assets/Home-DYyowgIk.js similarity index 97% rename from dist/assets/Home-Csp4uo9R.js rename to dist/assets/Home-DYyowgIk.js index b67ff86..4753e24 100644 --- a/dist/assets/Home-Csp4uo9R.js +++ b/dist/assets/Home-DYyowgIk.js @@ -1 +1 @@ -import{r as l,j as e,u as L,a as E,l as P,k as A,L as f}from"./index-BSnGsuja.js";import{u as R,a as B,C as F}from"./CountUp-CaPcnNrA.js";import{u as I}from"./use-animation-frame-D5p6ytsV.js";import{m as k}from"./proxy-BY9NCDQu.js";import{S as T}from"./SpotlightCard-DMZC3L4x.js";import{u as V}from"./useTranslation-fJCRxooE.js";function _({children:t,className:n="",colors:o=["#5227FF","#FF9FFC","#B19EEF"],animationSpeed:i=8,showBorder:a=!1,direction:r="horizontal",pauseOnHover:c=!1,yoyo:x=!0}){const[s,g]=l.useState(!1),u=R(0),j=l.useRef(0),m=l.useRef(null),p=i*1e3;I(d=>{if(s){m.current=null;return}if(m.current===null){m.current=d;return}const M=d-m.current;if(m.current=d,j.current+=M,x){const z=p*2,h=j.current%z;h{j.current=0,u.set(0)},[i,u,x]);const w=B(u,d=>r==="horizontal"?`${d}% 50%`:r==="vertical"?`50% ${d}%`:`${d}% 50%`),v=l.useCallback(()=>{c&&g(!0)},[c]),S=l.useCallback(()=>{c&&g(!1)},[c]),C=r==="horizontal"?"to right":r==="vertical"?"to bottom":"to bottom right",N=[...o,o[0]].join(", "),y={backgroundImage:`linear-gradient(${C}, ${N})`,backgroundSize:r==="horizontal"?"300% 100%":r==="vertical"?"100% 300%":"300% 300%",backgroundRepeat:"repeat"};return e.jsxs(k.div,{className:`relative mx-auto flex max-w-fit flex-row items-center justify-center rounded-[1.25rem] font-medium backdrop-blur transition-shadow duration-500 overflow-hidden cursor-pointer ${a?"py-1 px-2":""} ${n}`,onMouseEnter:v,onMouseLeave:S,children:[a&&e.jsx(k.div,{className:"absolute inset-0 z-0 pointer-events-none rounded-[1.25rem]",style:{...y,backgroundPosition:w},children:e.jsx("div",{className:"absolute bg-black rounded-[1.25rem] z-[-1]",style:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}})}),e.jsx(k.div,{className:"inline-block relative z-2 text-transparent bg-clip-text",style:{...y,backgroundPosition:w,WebkitBackgroundClip:"text"},children:t})]})}const W=(t,n)=>{const o=new Set([...Object.keys(t),...n.flatMap(a=>Object.keys(a))]),i={};return o.forEach(a=>{i[a]=[t[a],...n.map(r=>r[a])]}),i},G=({text:t="",delay:n=200,className:o="",animateBy:i="words",direction:a="top",threshold:r=.1,rootMargin:c="0px",animationFrom:x,animationTo:s,easing:g=m=>m,onAnimationComplete:u,stepDuration:j=.35})=>{const m=i==="words"?t.split(" "):t.split(""),[p,w]=l.useState(!1),v=l.useRef(null);l.useEffect(()=>{if(!v.current)return;const h=new IntersectionObserver(([b])=>{b.isIntersecting&&(w(!0),h.unobserve(v.current))},{threshold:r,rootMargin:c});return h.observe(v.current),()=>h.disconnect()},[r,c]);const S=l.useMemo(()=>a==="top"?{filter:"blur(10px)",opacity:0,y:-50}:{filter:"blur(10px)",opacity:0,y:50},[a]),C=l.useMemo(()=>[{filter:"blur(5px)",opacity:.5,y:a==="top"?5:-5},{filter:"blur(0px)",opacity:1,y:0}],[a]),N=x??S,y=s??C,d=y.length+1,M=j*(d-1),z=Array.from({length:d},(h,b)=>d===1?0:b/(d-1));return e.jsx("p",{ref:v,className:`blur-text ${o} flex flex-wrap`,children:m.map((h,b)=>{const D=W(N,y),$={duration:M,times:z,delay:b*n/1e3};return $.ease=g,e.jsxs(k.span,{className:"inline-block will-change-[transform,filter,opacity]",initial:N,animate:p?D:N,transition:$,onAnimationComplete:b===m.length-1?u:void 0,children:[h===" "?" ":h,i==="words"&&be.jsxs(t,{className:`relative inline-block overflow-hidden rounded-[20px] ${n}`,style:{padding:`${a}px 0`,...c.style},...c,children:[e.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 bottom-[-11px] right-[-250%] rounded-full animate-star-movement-bottom z-0",style:{background:`radial-gradient(circle, ${o}, transparent 10%)`,animationDuration:i}}),e.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 top-[-10px] left-[-250%] rounded-full animate-star-movement-top z-0",style:{background:`radial-gradient(circle, ${o}, transparent 10%)`,animationDuration:i}}),e.jsx("div",{className:"relative z-1 bg-gradient-to-b from-black to-gray-900 border border-gray-800 text-white text-center text-[16px] py-[16px] px-[26px] rounded-[20px]",children:r})]});function Q(){const{t}=V(),{user:n}=L(),{site:o}=E(),[i,a]=l.useState([]),[r,c]=l.useState([]);l.useEffect(()=>{P().then(s=>{s.data.success&&a(s.data.data||[])}).catch(()=>{}),A().then(s=>{s.data.success&&c(s.data.data||[])}).catch(()=>{})},[]);const x=i.filter(s=>s.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[800px] h-[600px] bg-gradient-radial from-brand-600/20 via-purple-600/5 to-transparent blur-3xl"}),e.jsx("div",{className:"absolute top-[400px] right-0 w-[500px] h-[500px] bg-gradient-radial from-pink-600/10 to-transparent blur-3xl"})]}),e.jsxs("section",{className:"relative max-w-7xl mx-auto px-6 pt-24 pb-20",children:[e.jsxs("div",{className:"text-center max-w-4xl mx-auto",children:[e.jsx("div",{className:"mb-6",children:e.jsx(_,{colors:["#818cf8","#c084fc","#f472b6","#818cf8"],animationSpeed:6,className:"text-5xl md:text-7xl font-extrabold leading-tight tracking-tight",children:(o==null?void 0:o.name)||t("home.defaultHeroTitle")})}),e.jsx(G,{text:t("home.heroSubtitle"),className:"text-lg md:text-xl text-neutral-400 max-w-2xl mx-auto mb-10 leading-relaxed",delay:50,animateBy:"words"}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsx(f,{to:"/dashboard",children:e.jsx(U,{as:"div",color:"#818cf8",speed:"5s",children:t("home.goToDashboard")})}):e.jsxs(e.Fragment,{children:[e.jsx(f,{to:"/register",className:"btn-primary text-base !px-8 !py-3",children:t("home.getStarted")}),e.jsx(f,{to:"/pricing",className:"btn-secondary text-base !px-8 !py-3",children:t("home.viewPricing")})]})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-6 max-w-xl mx-auto mt-20",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-3xl font-bold text-white",children:[e.jsx(F,{from:0,to:x.length||50,duration:2,separator:""}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-3xl font-bold text-white",children:[e.jsx(F,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-3xl font-bold text-white",children:["<",e.jsx(F,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t("home.latency")})]})]})]}),e.jsxs("section",{className:"relative max-w-7xl mx-auto px-6 py-20",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-3xl font-bold text-white mb-3",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-400",children:t("home.whyChooseUsDesc")})]}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[e.jsxs(T,{className:"!bg-neutral-900/60 !border-neutral-800/60",spotlightColor:"rgba(129,140,248,0.15)",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-brand-500/10 flex items-center justify-center mb-4",children:e.jsx("svg",{className:"w-6 h-6 text-brand-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),e.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:t("home.lightningFast")}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:t("home.lightningFastDesc")})]}),e.jsxs(T,{className:"!bg-neutral-900/60 !border-neutral-800/60",spotlightColor:"rgba(192,132,252,0.15)",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/10 flex items-center justify-center mb-4",children:e.jsx("svg",{className:"w-6 h-6 text-purple-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),e.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:t("home.securePrivate")}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:t("home.securePrivateDesc")})]}),e.jsxs(T,{className:"!bg-neutral-900/60 !border-neutral-800/60",spotlightColor:"rgba(244,114,182,0.15)",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-pink-500/10 flex items-center justify-center mb-4",children:e.jsx("svg",{className:"w-6 h-6 text-pink-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:t("home.payAsYouGo")}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:t("home.payAsYouGoDesc")})]})]})]}),x.length>0&&e.jsxs("section",{className:"relative max-w-7xl mx-auto px-6 py-20",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-3xl font-bold text-white mb-3",children:t("home.availableModels")}),e.jsx("p",{className:"text-neutral-400",children:t("home.availableModelsDesc",{count:x.length})})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:x.slice(0,12).map((s,g)=>e.jsxs("div",{className:"glass-sm px-4 py-3 flex items-center gap-3 hover:bg-white/[0.06] transition-colors group",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 flex-shrink-0"}),e.jsx("span",{className:"text-sm font-mono text-neutral-300 group-hover:text-white transition-colors truncate",children:s.display_name||s.model_name})]},s.id||g))}),x.length>12&&e.jsx("div",{className:"text-center mt-6",children:e.jsxs(f,{to:"/pricing",className:"text-sm text-brand-400 hover:text-brand-300 transition-colors",children:[t("home.viewAllModels",{count:x.length})," →"]})})]}),r.length>0&&e.jsxs("section",{className:"relative max-w-7xl mx-auto px-6 py-20",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-3xl font-bold text-white mb-3",children:t("home.plansPackages")}),e.jsx("p",{className:"text-neutral-400",children:t("home.choosePlan")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-6 max-w-4xl mx-auto",children:r.filter(s=>s.enabled).slice(0,3).map(s=>e.jsxs("div",{className:"glass rounded-2xl p-6 flex flex-col hover:border-brand-500/30 transition-colors",children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-400 mb-4",children:s.description}),e.jsxs("div",{className:"mt-auto pt-4",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-neutral-500 line-through",children:["$",s.original_price]})]}),s.duration>0&&e.jsx("p",{className:"text-xs text-neutral-500 mt-1",children:t("home.days",{count:s.duration})})]}),e.jsx(f,{to:n?"/packages":"/register",className:"btn-primary text-center mt-4 !py-2",children:t(n?"home.subscribe":"home.getStarted")})]},s.id))})]}),e.jsx("section",{className:"relative max-w-7xl mx-auto px-6 py-24",children:e.jsxs("div",{className:"glass rounded-3xl p-12 text-center relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-brand-600/10 via-transparent to-purple-600/10"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("h2",{className:"text-3xl font-bold text-white mb-4",children:t("home.readyToStart")}),e.jsx("p",{className:"text-neutral-400 mb-8 max-w-md mx-auto",children:t("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsx(f,{to:"/dashboard",className:"btn-primary text-base !px-8 !py-3",children:t("home.goToDashboard")}):e.jsxs(e.Fragment,{children:[e.jsx(f,{to:"/register",className:"btn-primary text-base !px-8 !py-3",children:t("home.createFreeAccount")}),e.jsx(f,{to:"/login",className:"btn-secondary text-base !px-8 !py-3",children:t("home.signIn")})]})})]})]})})]})}export{Q as default}; +import{r as l,j as e,u as L,a as E,l as P,k as A,L as f}from"./index-sl7kA1zY.js";import{u as R,a as B,C as F}from"./CountUp-4XjqJEhr.js";import{u as I}from"./use-animation-frame-BTHnf9ip.js";import{m as k}from"./proxy-Cyyan-lb.js";import{S as T}from"./SpotlightCard-dMmfK1cV.js";import{u as V}from"./useTranslation-D01I4oIt.js";function _({children:t,className:n="",colors:o=["#5227FF","#FF9FFC","#B19EEF"],animationSpeed:i=8,showBorder:a=!1,direction:r="horizontal",pauseOnHover:c=!1,yoyo:x=!0}){const[s,g]=l.useState(!1),u=R(0),j=l.useRef(0),m=l.useRef(null),p=i*1e3;I(d=>{if(s){m.current=null;return}if(m.current===null){m.current=d;return}const M=d-m.current;if(m.current=d,j.current+=M,x){const z=p*2,h=j.current%z;h{j.current=0,u.set(0)},[i,u,x]);const w=B(u,d=>r==="horizontal"?`${d}% 50%`:r==="vertical"?`50% ${d}%`:`${d}% 50%`),v=l.useCallback(()=>{c&&g(!0)},[c]),S=l.useCallback(()=>{c&&g(!1)},[c]),C=r==="horizontal"?"to right":r==="vertical"?"to bottom":"to bottom right",N=[...o,o[0]].join(", "),y={backgroundImage:`linear-gradient(${C}, ${N})`,backgroundSize:r==="horizontal"?"300% 100%":r==="vertical"?"100% 300%":"300% 300%",backgroundRepeat:"repeat"};return e.jsxs(k.div,{className:`relative mx-auto flex max-w-fit flex-row items-center justify-center rounded-[1.25rem] font-medium backdrop-blur transition-shadow duration-500 overflow-hidden cursor-pointer ${a?"py-1 px-2":""} ${n}`,onMouseEnter:v,onMouseLeave:S,children:[a&&e.jsx(k.div,{className:"absolute inset-0 z-0 pointer-events-none rounded-[1.25rem]",style:{...y,backgroundPosition:w},children:e.jsx("div",{className:"absolute bg-black rounded-[1.25rem] z-[-1]",style:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}})}),e.jsx(k.div,{className:"inline-block relative z-2 text-transparent bg-clip-text",style:{...y,backgroundPosition:w,WebkitBackgroundClip:"text"},children:t})]})}const W=(t,n)=>{const o=new Set([...Object.keys(t),...n.flatMap(a=>Object.keys(a))]),i={};return o.forEach(a=>{i[a]=[t[a],...n.map(r=>r[a])]}),i},G=({text:t="",delay:n=200,className:o="",animateBy:i="words",direction:a="top",threshold:r=.1,rootMargin:c="0px",animationFrom:x,animationTo:s,easing:g=m=>m,onAnimationComplete:u,stepDuration:j=.35})=>{const m=i==="words"?t.split(" "):t.split(""),[p,w]=l.useState(!1),v=l.useRef(null);l.useEffect(()=>{if(!v.current)return;const h=new IntersectionObserver(([b])=>{b.isIntersecting&&(w(!0),h.unobserve(v.current))},{threshold:r,rootMargin:c});return h.observe(v.current),()=>h.disconnect()},[r,c]);const S=l.useMemo(()=>a==="top"?{filter:"blur(10px)",opacity:0,y:-50}:{filter:"blur(10px)",opacity:0,y:50},[a]),C=l.useMemo(()=>[{filter:"blur(5px)",opacity:.5,y:a==="top"?5:-5},{filter:"blur(0px)",opacity:1,y:0}],[a]),N=x??S,y=s??C,d=y.length+1,M=j*(d-1),z=Array.from({length:d},(h,b)=>d===1?0:b/(d-1));return e.jsx("p",{ref:v,className:`blur-text ${o} flex flex-wrap`,children:m.map((h,b)=>{const D=W(N,y),$={duration:M,times:z,delay:b*n/1e3};return $.ease=g,e.jsxs(k.span,{className:"inline-block will-change-[transform,filter,opacity]",initial:N,animate:p?D:N,transition:$,onAnimationComplete:b===m.length-1?u:void 0,children:[h===" "?" ":h,i==="words"&&be.jsxs(t,{className:`relative inline-block overflow-hidden rounded-[20px] ${n}`,style:{padding:`${a}px 0`,...c.style},...c,children:[e.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 bottom-[-11px] right-[-250%] rounded-full animate-star-movement-bottom z-0",style:{background:`radial-gradient(circle, ${o}, transparent 10%)`,animationDuration:i}}),e.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 top-[-10px] left-[-250%] rounded-full animate-star-movement-top z-0",style:{background:`radial-gradient(circle, ${o}, transparent 10%)`,animationDuration:i}}),e.jsx("div",{className:"relative z-1 bg-gradient-to-b from-black to-gray-900 border border-gray-800 text-white text-center text-[16px] py-[16px] px-[26px] rounded-[20px]",children:r})]});function Q(){const{t}=V(),{user:n}=L(),{site:o}=E(),[i,a]=l.useState([]),[r,c]=l.useState([]);l.useEffect(()=>{P().then(s=>{s.data.success&&a(s.data.data||[])}).catch(()=>{}),A().then(s=>{s.data.success&&c(s.data.data||[])}).catch(()=>{})},[]);const x=i.filter(s=>s.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[800px] h-[600px] bg-gradient-radial from-brand-600/20 via-purple-600/5 to-transparent blur-3xl"}),e.jsx("div",{className:"absolute top-[400px] right-0 w-[500px] h-[500px] bg-gradient-radial from-pink-600/10 to-transparent blur-3xl"})]}),e.jsxs("section",{className:"relative max-w-7xl mx-auto px-6 pt-24 pb-20",children:[e.jsxs("div",{className:"text-center max-w-4xl mx-auto",children:[e.jsx("div",{className:"mb-6",children:e.jsx(_,{colors:["#818cf8","#c084fc","#f472b6","#818cf8"],animationSpeed:6,className:"text-5xl md:text-7xl font-extrabold leading-tight tracking-tight",children:(o==null?void 0:o.name)||t("home.defaultHeroTitle")})}),e.jsx(G,{text:t("home.heroSubtitle"),className:"text-lg md:text-xl text-neutral-400 max-w-2xl mx-auto mb-10 leading-relaxed",delay:50,animateBy:"words"}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsx(f,{to:"/dashboard",children:e.jsx(U,{as:"div",color:"#818cf8",speed:"5s",children:t("home.goToDashboard")})}):e.jsxs(e.Fragment,{children:[e.jsx(f,{to:"/register",className:"btn-primary text-base !px-8 !py-3",children:t("home.getStarted")}),e.jsx(f,{to:"/pricing",className:"btn-secondary text-base !px-8 !py-3",children:t("home.viewPricing")})]})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-6 max-w-xl mx-auto mt-20",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-3xl font-bold text-white",children:[e.jsx(F,{from:0,to:x.length||50,duration:2,separator:""}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-3xl font-bold text-white",children:[e.jsx(F,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-3xl font-bold text-white",children:["<",e.jsx(F,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t("home.latency")})]})]})]}),e.jsxs("section",{className:"relative max-w-7xl mx-auto px-6 py-20",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-3xl font-bold text-white mb-3",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-400",children:t("home.whyChooseUsDesc")})]}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[e.jsxs(T,{className:"!bg-neutral-900/60 !border-neutral-800/60",spotlightColor:"rgba(129,140,248,0.15)",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-brand-500/10 flex items-center justify-center mb-4",children:e.jsx("svg",{className:"w-6 h-6 text-brand-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),e.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:t("home.lightningFast")}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:t("home.lightningFastDesc")})]}),e.jsxs(T,{className:"!bg-neutral-900/60 !border-neutral-800/60",spotlightColor:"rgba(192,132,252,0.15)",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/10 flex items-center justify-center mb-4",children:e.jsx("svg",{className:"w-6 h-6 text-purple-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),e.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:t("home.securePrivate")}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:t("home.securePrivateDesc")})]}),e.jsxs(T,{className:"!bg-neutral-900/60 !border-neutral-800/60",spotlightColor:"rgba(244,114,182,0.15)",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-pink-500/10 flex items-center justify-center mb-4",children:e.jsx("svg",{className:"w-6 h-6 text-pink-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:t("home.payAsYouGo")}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:t("home.payAsYouGoDesc")})]})]})]}),x.length>0&&e.jsxs("section",{className:"relative max-w-7xl mx-auto px-6 py-20",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-3xl font-bold text-white mb-3",children:t("home.availableModels")}),e.jsx("p",{className:"text-neutral-400",children:t("home.availableModelsDesc",{count:x.length})})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:x.slice(0,12).map((s,g)=>e.jsxs("div",{className:"glass-sm px-4 py-3 flex items-center gap-3 hover:bg-white/[0.06] transition-colors group",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 flex-shrink-0"}),e.jsx("span",{className:"text-sm font-mono text-neutral-300 group-hover:text-white transition-colors truncate",children:s.display_name||s.model_name})]},s.id||g))}),x.length>12&&e.jsx("div",{className:"text-center mt-6",children:e.jsxs(f,{to:"/pricing",className:"text-sm text-brand-400 hover:text-brand-300 transition-colors",children:[t("home.viewAllModels",{count:x.length})," →"]})})]}),r.length>0&&e.jsxs("section",{className:"relative max-w-7xl mx-auto px-6 py-20",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-3xl font-bold text-white mb-3",children:t("home.plansPackages")}),e.jsx("p",{className:"text-neutral-400",children:t("home.choosePlan")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-6 max-w-4xl mx-auto",children:r.filter(s=>s.enabled).slice(0,3).map(s=>e.jsxs("div",{className:"glass rounded-2xl p-6 flex flex-col hover:border-brand-500/30 transition-colors",children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-400 mb-4",children:s.description}),e.jsxs("div",{className:"mt-auto pt-4",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-neutral-500 line-through",children:["$",s.original_price]})]}),s.duration>0&&e.jsx("p",{className:"text-xs text-neutral-500 mt-1",children:t("home.days",{count:s.duration})})]}),e.jsx(f,{to:n?"/packages":"/register",className:"btn-primary text-center mt-4 !py-2",children:t(n?"home.subscribe":"home.getStarted")})]},s.id))})]}),e.jsx("section",{className:"relative max-w-7xl mx-auto px-6 py-24",children:e.jsxs("div",{className:"glass rounded-3xl p-12 text-center relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-brand-600/10 via-transparent to-purple-600/10"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("h2",{className:"text-3xl font-bold text-white mb-4",children:t("home.readyToStart")}),e.jsx("p",{className:"text-neutral-400 mb-8 max-w-md mx-auto",children:t("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsx(f,{to:"/dashboard",className:"btn-primary text-base !px-8 !py-3",children:t("home.goToDashboard")}):e.jsxs(e.Fragment,{children:[e.jsx(f,{to:"/register",className:"btn-primary text-base !px-8 !py-3",children:t("home.createFreeAccount")}),e.jsx(f,{to:"/login",className:"btn-secondary text-base !px-8 !py-3",children:t("home.signIn")})]})})]})]})})]})}export{Q as default}; diff --git a/dist/assets/Home-CxIhmRKX.js b/dist/assets/Home-kTjmvjO3.js similarity index 99% rename from dist/assets/Home-CxIhmRKX.js rename to dist/assets/Home-kTjmvjO3.js index 4364f0d..3156c5b 100644 --- a/dist/assets/Home-CxIhmRKX.js +++ b/dist/assets/Home-kTjmvjO3.js @@ -1,4 +1,4 @@ -import{r as d,j as t,u as ee,a as te,l as se,k as re,L as E}from"./index-BSnGsuja.js";import{T as oe,a as Z,V as T,R as ae,G as ne,P as ie,M as le}from"./Mesh-CwXV3WjE.js";import{m as ce}from"./proxy-BY9NCDQu.js";import{C as de}from"./CountUp-CaPcnNrA.js";import{u as me}from"./useTranslation-fJCRxooE.js";const ue=new Z,he=new T,xe=new T;class fe extends oe{constructor(e,{near:a=.1,far:i=100,fov:c=45,aspect:u=1,left:f,right:h,bottom:r,top:k,zoom:b=1}={}){super(),Object.assign(this,{near:a,far:i,fov:c,aspect:u,left:f,right:h,bottom:r,top:k,zoom:b}),this.projectionMatrix=new Z,this.viewMatrix=new Z,this.projectionViewMatrix=new Z,this.worldPosition=new T,this.type=f||h?"orthographic":"perspective",this.type==="orthographic"?this.orthographic():this.perspective()}perspective({near:e=this.near,far:a=this.far,fov:i=this.fov,aspect:c=this.aspect}={}){return Object.assign(this,{near:e,far:a,fov:i,aspect:c}),this.projectionMatrix.fromPerspective({fov:i*(Math.PI/180),aspect:c,near:e,far:a}),this.type="perspective",this}orthographic({near:e=this.near,far:a=this.far,left:i=this.left||-1,right:c=this.right||1,bottom:u=this.bottom||-1,top:f=this.top||1,zoom:h=this.zoom}={}){return Object.assign(this,{near:e,far:a,left:i,right:c,bottom:u,top:f,zoom:h}),i/=h,c/=h,u/=h,f/=h,this.projectionMatrix.fromOrthogonal({left:i,right:c,bottom:u,top:f,near:e,far:a}),this.type="orthographic",this}updateMatrixWorld(){return super.updateMatrixWorld(),this.viewMatrix.inverse(this.worldMatrix),this.worldMatrix.getTranslation(this.worldPosition),this.projectionViewMatrix.multiply(this.projectionMatrix,this.viewMatrix),this}updateProjectionMatrix(){return this.type==="perspective"?this.perspective():this.orthographic()}lookAt(e){return super.lookAt(e,!0),this}project(e){return e.applyMatrix4(this.viewMatrix),e.applyMatrix4(this.projectionMatrix),this}unproject(e){return e.applyMatrix4(ue.inverse(this.projectionMatrix)),e.applyMatrix4(this.worldMatrix),this}updateFrustum(){this.frustum||(this.frustum=[new T,new T,new T,new T,new T,new T]);const e=this.projectionViewMatrix;this.frustum[0].set(e[3]-e[0],e[7]-e[4],e[11]-e[8]).constant=e[15]-e[12],this.frustum[1].set(e[3]+e[0],e[7]+e[4],e[11]+e[8]).constant=e[15]+e[12],this.frustum[2].set(e[3]+e[1],e[7]+e[5],e[11]+e[9]).constant=e[15]+e[13],this.frustum[3].set(e[3]-e[1],e[7]-e[5],e[11]-e[9]).constant=e[15]-e[13],this.frustum[4].set(e[3]-e[2],e[7]-e[6],e[11]-e[10]).constant=e[15]-e[14],this.frustum[5].set(e[3]+e[2],e[7]+e[6],e[11]+e[10]).constant=e[15]+e[14];for(let a=0;a<6;a++){const i=1/this.frustum[a].distance();this.frustum[a].multiply(i),this.frustum[a].constant*=i}}frustumIntersectsMesh(e,a=e.worldMatrix){if(!e.geometry.attributes.position||((!e.geometry.bounds||e.geometry.bounds.radius===1/0)&&e.geometry.computeBoundingSphere(),!e.geometry.bounds))return!0;const i=he;i.copy(e.geometry.bounds.center),i.applyMatrix4(a);const c=e.geometry.bounds.radius*a.getMaxScaleOnAxis();return this.frustumIntersectsSphere(i,c)}frustumIntersectsSphere(e,a){const i=xe;for(let c=0;c<6;c++){const u=this.frustum[c];if(i.copy(u).dot(e)+u.constant<-a)return!1}return!0}}const pe=["#ffffff","#ffffff","#ffffff"],ge=s=>{s=s.replace(/^#/,""),s.length===3&&(s=s.split("").map(u=>u+u).join(""));const e=parseInt(s,16),a=(e>>16&255)/255,i=(e>>8&255)/255,c=(e&255)/255;return[a,i,c]},ve=` +import{r as d,j as t,u as ee,a as te,l as se,k as re,L as E}from"./index-sl7kA1zY.js";import{T as oe,a as Z,V as T,R as ae,G as ne,P as ie,M as le}from"./Mesh-CwXV3WjE.js";import{m as ce}from"./proxy-Cyyan-lb.js";import{C as de}from"./CountUp-4XjqJEhr.js";import{u as me}from"./useTranslation-D01I4oIt.js";const ue=new Z,he=new T,xe=new T;class fe extends oe{constructor(e,{near:a=.1,far:i=100,fov:c=45,aspect:u=1,left:f,right:h,bottom:r,top:k,zoom:b=1}={}){super(),Object.assign(this,{near:a,far:i,fov:c,aspect:u,left:f,right:h,bottom:r,top:k,zoom:b}),this.projectionMatrix=new Z,this.viewMatrix=new Z,this.projectionViewMatrix=new Z,this.worldPosition=new T,this.type=f||h?"orthographic":"perspective",this.type==="orthographic"?this.orthographic():this.perspective()}perspective({near:e=this.near,far:a=this.far,fov:i=this.fov,aspect:c=this.aspect}={}){return Object.assign(this,{near:e,far:a,fov:i,aspect:c}),this.projectionMatrix.fromPerspective({fov:i*(Math.PI/180),aspect:c,near:e,far:a}),this.type="perspective",this}orthographic({near:e=this.near,far:a=this.far,left:i=this.left||-1,right:c=this.right||1,bottom:u=this.bottom||-1,top:f=this.top||1,zoom:h=this.zoom}={}){return Object.assign(this,{near:e,far:a,left:i,right:c,bottom:u,top:f,zoom:h}),i/=h,c/=h,u/=h,f/=h,this.projectionMatrix.fromOrthogonal({left:i,right:c,bottom:u,top:f,near:e,far:a}),this.type="orthographic",this}updateMatrixWorld(){return super.updateMatrixWorld(),this.viewMatrix.inverse(this.worldMatrix),this.worldMatrix.getTranslation(this.worldPosition),this.projectionViewMatrix.multiply(this.projectionMatrix,this.viewMatrix),this}updateProjectionMatrix(){return this.type==="perspective"?this.perspective():this.orthographic()}lookAt(e){return super.lookAt(e,!0),this}project(e){return e.applyMatrix4(this.viewMatrix),e.applyMatrix4(this.projectionMatrix),this}unproject(e){return e.applyMatrix4(ue.inverse(this.projectionMatrix)),e.applyMatrix4(this.worldMatrix),this}updateFrustum(){this.frustum||(this.frustum=[new T,new T,new T,new T,new T,new T]);const e=this.projectionViewMatrix;this.frustum[0].set(e[3]-e[0],e[7]-e[4],e[11]-e[8]).constant=e[15]-e[12],this.frustum[1].set(e[3]+e[0],e[7]+e[4],e[11]+e[8]).constant=e[15]+e[12],this.frustum[2].set(e[3]+e[1],e[7]+e[5],e[11]+e[9]).constant=e[15]+e[13],this.frustum[3].set(e[3]-e[1],e[7]-e[5],e[11]-e[9]).constant=e[15]-e[13],this.frustum[4].set(e[3]-e[2],e[7]-e[6],e[11]-e[10]).constant=e[15]-e[14],this.frustum[5].set(e[3]+e[2],e[7]+e[6],e[11]+e[10]).constant=e[15]+e[14];for(let a=0;a<6;a++){const i=1/this.frustum[a].distance();this.frustum[a].multiply(i),this.frustum[a].constant*=i}}frustumIntersectsMesh(e,a=e.worldMatrix){if(!e.geometry.attributes.position||((!e.geometry.bounds||e.geometry.bounds.radius===1/0)&&e.geometry.computeBoundingSphere(),!e.geometry.bounds))return!0;const i=he;i.copy(e.geometry.bounds.center),i.applyMatrix4(a);const c=e.geometry.bounds.radius*a.getMaxScaleOnAxis();return this.frustumIntersectsSphere(i,c)}frustumIntersectsSphere(e,a){const i=xe;for(let c=0;c<6;c++){const u=this.frustum[c];if(i.copy(u).dot(e)+u.constant<-a)return!1}return!0}}const pe=["#ffffff","#ffffff","#ffffff"],ge=s=>{s=s.replace(/^#/,""),s.length===3&&(s=s.split("").map(u=>u+u).join(""));const e=parseInt(s,16),a=(e>>16&255)/255,i=(e>>8&255)/255,c=(e&255)/255;return[a,i,c]},ve=` attribute vec3 position; attribute vec4 random; attribute vec3 color; diff --git a/dist/assets/LanguageSwitch-DeIkkoRt.js b/dist/assets/LanguageSwitch-gMrnCdQj.js similarity index 86% rename from dist/assets/LanguageSwitch-DeIkkoRt.js rename to dist/assets/LanguageSwitch-gMrnCdQj.js index d728988..f5b833b 100644 --- a/dist/assets/LanguageSwitch-DeIkkoRt.js +++ b/dist/assets/LanguageSwitch-gMrnCdQj.js @@ -1 +1 @@ -import{j as n}from"./index-BSnGsuja.js";import{u as a}from"./useTranslation-fJCRxooE.js";function u({className:t=""}){var s;const{i18n:e}=a(),o=(s=e.language)==null?void 0:s.startsWith("zh"),r=()=>{e.changeLanguage(o?"en":"zh")};return n.jsxs("button",{onClick:r,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs transition-colors ${t}`,"aria-label":"Switch language",children:[n.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,children:[n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.6 9h16.8M3.6 15h16.8"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3a15.3 15.3 0 0 1 4 9 15.3 15.3 0 0 1-4 9 15.3 15.3 0 0 1-4-9 15.3 15.3 0 0 1 4-9Z"})]}),n.jsx("span",{children:o?"EN":"中文"})]})}export{u as L}; +import{j as n}from"./index-sl7kA1zY.js";import{u as a}from"./useTranslation-D01I4oIt.js";function u({className:t=""}){var s;const{i18n:e}=a(),o=(s=e.language)==null?void 0:s.startsWith("zh"),r=()=>{e.changeLanguage(o?"en":"zh")};return n.jsxs("button",{onClick:r,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs transition-colors ${t}`,"aria-label":"Switch language",children:[n.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,children:[n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.6 9h16.8M3.6 15h16.8"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3a15.3 15.3 0 0 1 4 9 15.3 15.3 0 0 1-4 9 15.3 15.3 0 0 1-4-9 15.3 15.3 0 0 1 4-9Z"})]}),n.jsx("span",{children:o?"EN":"中文"})]})}export{u as L}; diff --git a/dist/assets/Layout-NOPO9qLh.js b/dist/assets/Layout-B5KtCqeF.js similarity index 96% rename from dist/assets/Layout-NOPO9qLh.js rename to dist/assets/Layout-B5KtCqeF.js index afe2825..8e572b4 100644 --- a/dist/assets/Layout-NOPO9qLh.js +++ b/dist/assets/Layout-B5KtCqeF.js @@ -1 +1 @@ -import{u as d,a as u,b as p,c as b,r as j,j as e,L as n,O as g}from"./index-BSnGsuja.js";import{L as v}from"./LanguageSwitch-DeIkkoRt.js";import{u as f}from"./useTranslation-fJCRxooE.js";function L(){const{t:s}=f(),{user:l,logout:m}=d(),{site:t}=u(),h=p(),i=b(),[r,c]=j.useState(!1),o=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:s("nav.home"),auth:!1},{to:"/pricing",label:s("nav.pricing"),auth:!1},{to:"/packages",label:s("nav.packages"),auth:!1},{to:"/dashboard",label:s("nav.dashboard"),auth:!0},{to:"/tokens",label:s("nav.apiKeys"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||l);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-neutral-950 text-white",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"border-b border-neutral-800/60 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-neutral-400",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-lg bg-neutral-950/80 border-b border-neutral-800/40",children:[e.jsxs("div",{className:"max-w-5xl mx-auto px-6 h-14 flex items-center justify-between",children:[e.jsxs(n,{to:"/",className:"flex items-center gap-2.5 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:o,className:"h-7 w-auto"}):e.jsx("span",{className:"text-base font-semibold text-white",children:o}),(t==null?void 0:t.logo)&&e.jsx("span",{className:"text-base font-semibold text-white",children:o})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-6",children:x.map(a=>e.jsx(n,{to:a.to,className:`text-sm transition-colors ${i.pathname===a.to?"text-white":"text-neutral-500 hover:text-white"}`,children:a.label},a.to))}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"text-neutral-500 hover:text-white hover:bg-white/5"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await m(),h("/")},className:"text-sm text-neutral-500 hover:text-white transition-colors",children:s("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(n,{to:"/login",className:"text-sm text-neutral-500 hover:text-white transition-colors hidden sm:block",children:s("nav.login")}),e.jsx(n,{to:"/register",className:"px-4 py-1.5 rounded-lg bg-white text-neutral-900 text-sm font-medium hover:bg-neutral-200 transition-colors",children:s("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1",onClick:()=>c(!r),children:e.jsx("svg",{className:"w-5 h-5 text-neutral-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-neutral-800/40 bg-neutral-950/95",children:e.jsx("nav",{className:"max-w-5xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(a=>e.jsx(n,{to:a.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded transition-colors ${i.pathname===a.to?"text-white":"text-neutral-500 hover:text-white"}`,children:a.label},a.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(g,{})}),e.jsx("footer",{className:"border-t border-neutral-800/40 mt-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-6 flex flex-col md:flex-row items-center justify-between gap-3",children:[e.jsxs("p",{className:"text-xs text-neutral-600",children:["© ",new Date().getFullYear()," ",o]}),(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-xs text-neutral-600 hover:text-white transition-colors",children:s("nav.contact")})]})})]})}export{L as default}; +import{u as d,a as u,b as p,c as b,r as j,j as e,L as n,O as g}from"./index-sl7kA1zY.js";import{L as v}from"./LanguageSwitch-gMrnCdQj.js";import{u as f}from"./useTranslation-D01I4oIt.js";function L(){const{t:s}=f(),{user:l,logout:m}=d(),{site:t}=u(),h=p(),i=b(),[r,c]=j.useState(!1),o=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:s("nav.home"),auth:!1},{to:"/pricing",label:s("nav.pricing"),auth:!1},{to:"/packages",label:s("nav.packages"),auth:!1},{to:"/dashboard",label:s("nav.dashboard"),auth:!0},{to:"/tokens",label:s("nav.apiKeys"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||l);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-neutral-950 text-white",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"border-b border-neutral-800/60 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-neutral-400",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-lg bg-neutral-950/80 border-b border-neutral-800/40",children:[e.jsxs("div",{className:"max-w-5xl mx-auto px-6 h-14 flex items-center justify-between",children:[e.jsxs(n,{to:"/",className:"flex items-center gap-2.5 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:o,className:"h-7 w-auto"}):e.jsx("span",{className:"text-base font-semibold text-white",children:o}),(t==null?void 0:t.logo)&&e.jsx("span",{className:"text-base font-semibold text-white",children:o})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-6",children:x.map(a=>e.jsx(n,{to:a.to,className:`text-sm transition-colors ${i.pathname===a.to?"text-white":"text-neutral-500 hover:text-white"}`,children:a.label},a.to))}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"text-neutral-500 hover:text-white hover:bg-white/5"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await m(),h("/")},className:"text-sm text-neutral-500 hover:text-white transition-colors",children:s("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(n,{to:"/login",className:"text-sm text-neutral-500 hover:text-white transition-colors hidden sm:block",children:s("nav.login")}),e.jsx(n,{to:"/register",className:"px-4 py-1.5 rounded-lg bg-white text-neutral-900 text-sm font-medium hover:bg-neutral-200 transition-colors",children:s("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1",onClick:()=>c(!r),children:e.jsx("svg",{className:"w-5 h-5 text-neutral-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-neutral-800/40 bg-neutral-950/95",children:e.jsx("nav",{className:"max-w-5xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(a=>e.jsx(n,{to:a.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded transition-colors ${i.pathname===a.to?"text-white":"text-neutral-500 hover:text-white"}`,children:a.label},a.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(g,{})}),e.jsx("footer",{className:"border-t border-neutral-800/40 mt-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-6 flex flex-col md:flex-row items-center justify-between gap-3",children:[e.jsxs("p",{className:"text-xs text-neutral-600",children:["© ",new Date().getFullYear()," ",o]}),(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-xs text-neutral-600 hover:text-white transition-colors",children:s("nav.contact")})]})})]})}export{L as default}; diff --git a/dist/assets/Layout-fYc3mUH3.js b/dist/assets/Layout-CAMk7KVY.js similarity index 97% rename from dist/assets/Layout-fYc3mUH3.js rename to dist/assets/Layout-CAMk7KVY.js index 2c1ea29..af7f58e 100644 --- a/dist/assets/Layout-fYc3mUH3.js +++ b/dist/assets/Layout-CAMk7KVY.js @@ -1 +1 @@ -import{u as h,a as u,b as p,c as b,r as f,j as e,L as s,O as g}from"./index-BSnGsuja.js";import{L as j}from"./LanguageSwitch-DeIkkoRt.js";import{u as v}from"./useTranslation-fJCRxooE.js";function L(){const{t:o}=v(),{user:r,logout:i}=h(),{site:t}=u(),x=p(),m=b(),[n,d]=f.useState(!1),l=(t==null?void 0:t.name)||"AI Platform",c=[{to:"/",label:o("nav.home"),auth:!1},{to:"/pricing",label:o("nav.pricing"),auth:!1},{to:"/packages",label:o("nav.packages"),auth:!1},{to:"/dashboard",label:o("nav.dashboard"),auth:!0},{to:"/tokens",label:o("nav.apiKeys"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:o("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||r);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-[#030712] text-white",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-emerald-500/5 border-b border-emerald-500/10 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-emerald-300/80 font-mono",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-xl bg-[#030712]/80 border-b border-emerald-500/[0.08]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:[e.jsxs(s,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:l,className:"h-7 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-emerald-400 font-bold font-mono text-sm",children:l.charAt(0)}),e.jsx("span",{className:"text-base font-semibold text-emerald-400 font-mono group-hover:text-emerald-300 transition-colors tracking-wide",children:l})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:c.map(a=>e.jsx(s,{to:a.to,className:`px-3 py-1.5 text-sm font-mono rounded transition-all ${m.pathname===a.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:a.label},a.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-neutral-500 hover:text-emerald-400 hover:bg-emerald-500/5 font-mono"}),r?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 font-mono hidden sm:block",children:r.display_name||r.username}),e.jsx("button",{onClick:async()=>{await i(),x("/")},className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors",children:o("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(s,{to:"/login",className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors hidden sm:block px-3 py-1.5",children:o("nav.login")}),e.jsx(s,{to:"/register",className:"px-4 py-1.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-sm font-mono hover:bg-emerald-500/15 transition-all",children:o("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded hover:bg-white/5",onClick:()=>d(!n),children:e.jsx("svg",{className:"w-5 h-5 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),n&&e.jsx("div",{className:"md:hidden border-t border-emerald-500/[0.08] bg-[#030712]/95 backdrop-blur-xl",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:c.map(a=>e.jsx(s,{to:a.to,onClick:()=>d(!1),className:`px-3 py-2 text-sm font-mono rounded transition-colors ${m.pathname===a.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:a.label},a.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(g,{})}),e.jsx("footer",{className:"border-t border-emerald-500/[0.08] mt-auto",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-6 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-xs text-neutral-600 font-mono",children:["© ",new Date().getFullYear()," ",l]}),(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-xs text-neutral-600 hover:text-emerald-400 font-mono transition-colors",children:o("nav.contact")})]})})]})}export{L as default}; +import{u as h,a as u,b as p,c as b,r as f,j as e,L as s,O as g}from"./index-sl7kA1zY.js";import{L as j}from"./LanguageSwitch-gMrnCdQj.js";import{u as v}from"./useTranslation-D01I4oIt.js";function L(){const{t:o}=v(),{user:r,logout:i}=h(),{site:t}=u(),x=p(),m=b(),[n,d]=f.useState(!1),l=(t==null?void 0:t.name)||"AI Platform",c=[{to:"/",label:o("nav.home"),auth:!1},{to:"/pricing",label:o("nav.pricing"),auth:!1},{to:"/packages",label:o("nav.packages"),auth:!1},{to:"/dashboard",label:o("nav.dashboard"),auth:!0},{to:"/tokens",label:o("nav.apiKeys"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:o("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||r);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-[#030712] text-white",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-emerald-500/5 border-b border-emerald-500/10 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-emerald-300/80 font-mono",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-xl bg-[#030712]/80 border-b border-emerald-500/[0.08]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:[e.jsxs(s,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:l,className:"h-7 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-emerald-400 font-bold font-mono text-sm",children:l.charAt(0)}),e.jsx("span",{className:"text-base font-semibold text-emerald-400 font-mono group-hover:text-emerald-300 transition-colors tracking-wide",children:l})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:c.map(a=>e.jsx(s,{to:a.to,className:`px-3 py-1.5 text-sm font-mono rounded transition-all ${m.pathname===a.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:a.label},a.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-neutral-500 hover:text-emerald-400 hover:bg-emerald-500/5 font-mono"}),r?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 font-mono hidden sm:block",children:r.display_name||r.username}),e.jsx("button",{onClick:async()=>{await i(),x("/")},className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors",children:o("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(s,{to:"/login",className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors hidden sm:block px-3 py-1.5",children:o("nav.login")}),e.jsx(s,{to:"/register",className:"px-4 py-1.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-sm font-mono hover:bg-emerald-500/15 transition-all",children:o("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded hover:bg-white/5",onClick:()=>d(!n),children:e.jsx("svg",{className:"w-5 h-5 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),n&&e.jsx("div",{className:"md:hidden border-t border-emerald-500/[0.08] bg-[#030712]/95 backdrop-blur-xl",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:c.map(a=>e.jsx(s,{to:a.to,onClick:()=>d(!1),className:`px-3 py-2 text-sm font-mono rounded transition-colors ${m.pathname===a.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:a.label},a.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(g,{})}),e.jsx("footer",{className:"border-t border-emerald-500/[0.08] mt-auto",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-6 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-xs text-neutral-600 font-mono",children:["© ",new Date().getFullYear()," ",l]}),(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-xs text-neutral-600 hover:text-emerald-400 font-mono transition-colors",children:o("nav.contact")})]})})]})}export{L as default}; diff --git a/dist/assets/Layout-Dodll0ro.js b/dist/assets/Layout-D55ZbQpE.js similarity index 97% rename from dist/assets/Layout-Dodll0ro.js rename to dist/assets/Layout-D55ZbQpE.js index bd8b1a0..4b111bb 100644 --- a/dist/assets/Layout-Dodll0ro.js +++ b/dist/assets/Layout-D55ZbQpE.js @@ -1 +1 @@ -import{u as h,a as u,b,c as p,r as g,j as e,L as l,O as v}from"./index-BSnGsuja.js";import{L as f}from"./LanguageSwitch-DeIkkoRt.js";import{u as j}from"./useTranslation-fJCRxooE.js";function L(){const{t:s}=j(),{user:o,logout:d}=h(),{site:t}=u(),m=b(),i=p(),[r,c]=g.useState(!1),n=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:s("nav.home"),auth:!1},{to:"/pricing",label:s("nav.pricing"),auth:!1},{to:"/packages",label:s("nav.packages"),auth:!1},{to:"/dashboard",label:s("nav.dashboard"),auth:!0},{to:"/tokens",label:s("nav.apiKeys"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||o);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-[#09090b]",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-gradient-to-r from-violet-600/10 via-blue-600/10 to-cyan-600/10 border-b border-white/[0.06] text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-neutral-300",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-2xl bg-[#09090b]/80 border-b border-white/[0.06]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:n,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-violet-500 via-blue-500 to-cyan-500 flex items-center justify-center text-white font-bold text-sm shadow-lg shadow-blue-500/20",children:n.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-white group-hover:text-blue-400 transition-colors",children:n})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1 bg-white/[0.04] rounded-full px-1.5 py-1 border border-white/[0.06]",children:x.map(a=>e.jsx(l,{to:a.to,className:`px-4 py-1.5 text-sm rounded-full transition-all ${i.pathname===a.to?"text-white bg-white/[0.08]":"text-neutral-400 hover:text-white"}`,children:a.label},a.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{className:"text-neutral-400 hover:text-white hover:bg-white/5"}),o?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-400 hidden sm:block",children:o.display_name||o.username}),e.jsx("button",{onClick:async()=>{await d(),m("/")},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:s("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-400 hover:text-white transition-colors px-3 py-1.5 hidden sm:block",children:s("nav.login")}),e.jsx(l,{to:"/register",className:"px-5 py-2 rounded-full bg-white text-black text-sm font-medium hover:bg-neutral-100 transition-all",children:s("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded-lg hover:bg-white/5 transition-colors",onClick:()=>c(!r),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-neutral-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-white/[0.06] bg-[#09090b]/95 backdrop-blur-2xl",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(a=>e.jsx(l,{to:a.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${i.pathname===a.to?"text-blue-400 bg-blue-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:a.label},a.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-white/[0.06] mt-auto bg-[#09090b]",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-neutral-500",children:["© ",new Date().getFullYear()," ",n,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-neutral-500 hover:text-neutral-300 transition-colors",children:s("nav.contact")})})]})})]})}export{L as default}; +import{u as h,a as u,b,c as p,r as g,j as e,L as l,O as v}from"./index-sl7kA1zY.js";import{L as f}from"./LanguageSwitch-gMrnCdQj.js";import{u as j}from"./useTranslation-D01I4oIt.js";function L(){const{t:s}=j(),{user:o,logout:d}=h(),{site:t}=u(),m=b(),i=p(),[r,c]=g.useState(!1),n=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:s("nav.home"),auth:!1},{to:"/pricing",label:s("nav.pricing"),auth:!1},{to:"/packages",label:s("nav.packages"),auth:!1},{to:"/dashboard",label:s("nav.dashboard"),auth:!0},{to:"/tokens",label:s("nav.apiKeys"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||o);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-[#09090b]",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-gradient-to-r from-violet-600/10 via-blue-600/10 to-cyan-600/10 border-b border-white/[0.06] text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-neutral-300",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-2xl bg-[#09090b]/80 border-b border-white/[0.06]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:n,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-violet-500 via-blue-500 to-cyan-500 flex items-center justify-center text-white font-bold text-sm shadow-lg shadow-blue-500/20",children:n.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-white group-hover:text-blue-400 transition-colors",children:n})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1 bg-white/[0.04] rounded-full px-1.5 py-1 border border-white/[0.06]",children:x.map(a=>e.jsx(l,{to:a.to,className:`px-4 py-1.5 text-sm rounded-full transition-all ${i.pathname===a.to?"text-white bg-white/[0.08]":"text-neutral-400 hover:text-white"}`,children:a.label},a.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{className:"text-neutral-400 hover:text-white hover:bg-white/5"}),o?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-400 hidden sm:block",children:o.display_name||o.username}),e.jsx("button",{onClick:async()=>{await d(),m("/")},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:s("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-400 hover:text-white transition-colors px-3 py-1.5 hidden sm:block",children:s("nav.login")}),e.jsx(l,{to:"/register",className:"px-5 py-2 rounded-full bg-white text-black text-sm font-medium hover:bg-neutral-100 transition-all",children:s("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded-lg hover:bg-white/5 transition-colors",onClick:()=>c(!r),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-neutral-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-white/[0.06] bg-[#09090b]/95 backdrop-blur-2xl",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(a=>e.jsx(l,{to:a.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${i.pathname===a.to?"text-blue-400 bg-blue-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:a.label},a.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-white/[0.06] mt-auto bg-[#09090b]",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-neutral-500",children:["© ",new Date().getFullYear()," ",n,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-neutral-500 hover:text-neutral-300 transition-colors",children:s("nav.contact")})})]})})]})}export{L as default}; diff --git a/dist/assets/Layout-C6Q_gq9r.js b/dist/assets/Layout-DIJS7qvD.js similarity index 97% rename from dist/assets/Layout-C6Q_gq9r.js rename to dist/assets/Layout-DIJS7qvD.js index bc8b5a8..b215645 100644 --- a/dist/assets/Layout-C6Q_gq9r.js +++ b/dist/assets/Layout-DIJS7qvD.js @@ -1 +1 @@ -import{u as h,a as u,b as p,c as b,r as g,j as e,L as l,O as v}from"./index-BSnGsuja.js";import{L as j}from"./LanguageSwitch-DeIkkoRt.js";import{u as f}from"./useTranslation-fJCRxooE.js";function M(){const{t:a}=f(),{user:n,logout:o}=h(),{site:t}=u(),m=p(),x=b(),[i,c]=g.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",d=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||n);return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-brand-600/20 border-b border-brand-500/20 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-brand-200",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-xl bg-black/60 border-b border-white/[0.06]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-8 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-brand-500 to-purple-600 flex items-center justify-center text-white font-bold text-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-white group-hover:text-brand-400 transition-colors",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:d.map(s=>e.jsx(N,{to:s.to,active:x.pathname===s.to,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-neutral-400 hover:text-white hover:bg-white/5"}),n?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-400 hidden sm:block",children:n.display_name||n.username}),e.jsx("button",{onClick:async()=>{await o(),m("/")},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-300 hover:text-white transition-colors px-3 py-1.5 hidden sm:block",children:a("nav.login")}),e.jsx(l,{to:"/register",className:"btn-primary text-sm !px-4 !py-1.5",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded-lg hover:bg-white/5 transition-colors",onClick:()=>c(!i),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-neutral-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),i&&e.jsx("div",{className:"md:hidden border-t border-white/[0.06] bg-black/90 backdrop-blur-xl",children:e.jsxs("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:[d.map(s=>e.jsx(l,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${x.pathname===s.to?"text-brand-400 bg-brand-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:s.label},s.to)),!n&&e.jsx(l,{to:"/login",onClick:()=>c(!1),className:"px-3 py-2 text-sm text-neutral-400 hover:text-white rounded-lg hover:bg-white/5 transition-colors sm:hidden",children:a("nav.login")})]})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-white/[0.06] mt-auto",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-neutral-500",children:["© ",new Date().getFullYear()," ",r,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-neutral-500 hover:text-neutral-300 transition-colors",children:a("nav.contact")})})]})})]})}function N({to:a,children:n,active:o}){return e.jsx(l,{to:a,className:`px-3 py-1.5 text-sm rounded-lg transition-all ${o?"text-brand-400 bg-brand-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:n})}export{M as default}; +import{u as h,a as u,b as p,c as b,r as g,j as e,L as l,O as v}from"./index-sl7kA1zY.js";import{L as j}from"./LanguageSwitch-gMrnCdQj.js";import{u as f}from"./useTranslation-D01I4oIt.js";function M(){const{t:a}=f(),{user:n,logout:o}=h(),{site:t}=u(),m=p(),x=b(),[i,c]=g.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",d=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||n);return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-brand-600/20 border-b border-brand-500/20 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-brand-200",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-xl bg-black/60 border-b border-white/[0.06]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-8 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-brand-500 to-purple-600 flex items-center justify-center text-white font-bold text-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-white group-hover:text-brand-400 transition-colors",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:d.map(s=>e.jsx(N,{to:s.to,active:x.pathname===s.to,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-neutral-400 hover:text-white hover:bg-white/5"}),n?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-400 hidden sm:block",children:n.display_name||n.username}),e.jsx("button",{onClick:async()=>{await o(),m("/")},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-300 hover:text-white transition-colors px-3 py-1.5 hidden sm:block",children:a("nav.login")}),e.jsx(l,{to:"/register",className:"btn-primary text-sm !px-4 !py-1.5",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded-lg hover:bg-white/5 transition-colors",onClick:()=>c(!i),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-neutral-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),i&&e.jsx("div",{className:"md:hidden border-t border-white/[0.06] bg-black/90 backdrop-blur-xl",children:e.jsxs("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:[d.map(s=>e.jsx(l,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${x.pathname===s.to?"text-brand-400 bg-brand-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:s.label},s.to)),!n&&e.jsx(l,{to:"/login",onClick:()=>c(!1),className:"px-3 py-2 text-sm text-neutral-400 hover:text-white rounded-lg hover:bg-white/5 transition-colors sm:hidden",children:a("nav.login")})]})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-white/[0.06] mt-auto",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-neutral-500",children:["© ",new Date().getFullYear()," ",r,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-neutral-500 hover:text-neutral-300 transition-colors",children:a("nav.contact")})})]})})]})}function N({to:a,children:n,active:o}){return e.jsx(l,{to:a,className:`px-3 py-1.5 text-sm rounded-lg transition-all ${o?"text-brand-400 bg-brand-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:n})}export{M as default}; diff --git a/dist/assets/Login-Berd1yuq.js b/dist/assets/Login-B7cfRnlm.js similarity index 94% rename from dist/assets/Login-Berd1yuq.js rename to dist/assets/Login-B7cfRnlm.js index ff887c6..a0f24a7 100644 --- a/dist/assets/Login-Berd1yuq.js +++ b/dist/assets/Login-B7cfRnlm.js @@ -1 +1 @@ -import{u as N,a as v,b as y,c as k,r as x,j as e,N as L,L as S,z as p}from"./index-BSnGsuja.js";import{u as C}from"./useTranslation-fJCRxooE.js";function A(){var c,m;const{t:s}=C(),{login:h,user:g}=N(),{site:n}=v(),f=y(),l=k(),[t,o]=x.useState({username:"",password:""}),[r,i]=x.useState(!1);if(g){const a=((m=(c=l.state)==null?void 0:c.from)==null?void 0:m.pathname)||"/dashboard";return e.jsx(L,{to:a,replace:!0})}const b=async a=>{var u,d;if(a.preventDefault(),!t.username||!t.password){p.error(s("login.fillAllFields"));return}i(!0);try{if((await h(t.username,t.password)).success){p.success(s("login.welcomeBackToast"));const w=((d=(u=l.state)==null?void 0:u.from)==null?void 0:d.pathname)||"/dashboard";f(w,{replace:!0});return}}catch{}i(!1)};return e.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-6",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"glass rounded-2xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("login.welcomeBack")}),e.jsx("p",{className:"text-sm text-neutral-400",children:n!=null&&n.name?s("login.signInTo",{name:n.name}):s("login.signInToDefault")})]}),e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:s("login.username")}),e.jsx("input",{type:"text",value:t.username,onChange:a=>o({...t,username:a.target.value}),className:"input",placeholder:s("login.enterUsername"),autoComplete:"username",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:s("login.password")}),e.jsx("input",{type:"password",value:t.password,onChange:a=>o({...t,password:a.target.value}),className:"input",placeholder:s("login.enterPassword"),autoComplete:"current-password",required:!0})]}),e.jsxs("button",{type:"submit",disabled:r,className:"btn-primary w-full flex items-center justify-center gap-2",children:[r&&e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),s(r?"login.signingIn":"login.signInBtn")]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-neutral-400",children:[s("login.noAccount")," ",e.jsx(S,{to:"/register",className:"text-brand-400 hover:text-brand-300 transition-colors font-medium",children:s("login.createOne")})]})})]})})})}export{A as default}; +import{u as N,a as v,b as y,c as k,r as x,j as e,N as L,L as S,z as p}from"./index-sl7kA1zY.js";import{u as C}from"./useTranslation-D01I4oIt.js";function A(){var c,m;const{t:s}=C(),{login:h,user:g}=N(),{site:n}=v(),f=y(),l=k(),[t,o]=x.useState({username:"",password:""}),[r,i]=x.useState(!1);if(g){const a=((m=(c=l.state)==null?void 0:c.from)==null?void 0:m.pathname)||"/dashboard";return e.jsx(L,{to:a,replace:!0})}const b=async a=>{var u,d;if(a.preventDefault(),!t.username||!t.password){p.error(s("login.fillAllFields"));return}i(!0);try{if((await h(t.username,t.password)).success){p.success(s("login.welcomeBackToast"));const w=((d=(u=l.state)==null?void 0:u.from)==null?void 0:d.pathname)||"/dashboard";f(w,{replace:!0});return}}catch{}i(!1)};return e.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-6",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"glass rounded-2xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("login.welcomeBack")}),e.jsx("p",{className:"text-sm text-neutral-400",children:n!=null&&n.name?s("login.signInTo",{name:n.name}):s("login.signInToDefault")})]}),e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:s("login.username")}),e.jsx("input",{type:"text",value:t.username,onChange:a=>o({...t,username:a.target.value}),className:"input",placeholder:s("login.enterUsername"),autoComplete:"username",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:s("login.password")}),e.jsx("input",{type:"password",value:t.password,onChange:a=>o({...t,password:a.target.value}),className:"input",placeholder:s("login.enterPassword"),autoComplete:"current-password",required:!0})]}),e.jsxs("button",{type:"submit",disabled:r,className:"btn-primary w-full flex items-center justify-center gap-2",children:[r&&e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),s(r?"login.signingIn":"login.signInBtn")]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-neutral-400",children:[s("login.noAccount")," ",e.jsx(S,{to:"/register",className:"text-brand-400 hover:text-brand-300 transition-colors font-medium",children:s("login.createOne")})]})})]})})})}export{A as default}; diff --git a/dist/assets/Packages-IQuzFQIK.js b/dist/assets/Packages-CG2LwjwE.js similarity index 97% rename from dist/assets/Packages-IQuzFQIK.js rename to dist/assets/Packages-CG2LwjwE.js index 57b9688..3f417a5 100644 --- a/dist/assets/Packages-IQuzFQIK.js +++ b/dist/assets/Packages-CG2LwjwE.js @@ -1 +1 @@ -import{u as w,b as y,r as l,k as L,j as e,L as C,Q as u,s as S,z as P}from"./index-BSnGsuja.js";import{S as B}from"./SpotlightCard-DMZC3L4x.js";import{u as _}from"./useTranslation-fJCRxooE.js";function W(){const{t}=_(),{user:r,refreshUser:h}=w(),p=y(),[b,g]=l.useState([]),[f,j]=l.useState(!0),[a,d]=l.useState(null),[i,c]=l.useState(null);l.useEffect(()=>{L().then(s=>{s.data.success&&g(s.data.data||[])}).catch(()=>{}).finally(()=>j(!1))},[]);const N=async s=>{if(!r){p("/register");return}c(s)},k=async()=>{if(!i)return;const s=i.id;d(s);try{(await S(s)).data.success&&(P.success(t("packages.subscribedSuccess")),c(null),await h())}catch{}d(null)};if(f)return e.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})});const x=b.filter(s=>s.enabled),m=["rgba(129,140,248,0.15)","rgba(192,132,252,0.15)","rgba(244,114,182,0.15)","rgba(34,197,94,0.15)"];return e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-3xl font-heading font-bold text-white mb-3",children:t("packages.title")}),e.jsx("p",{className:"text-neutral-400 max-w-xl mx-auto",children:t("packages.subtitle")})]}),x.length===0?e.jsxs("div",{className:"text-center py-12 text-neutral-400",children:[e.jsx("p",{children:t("packages.noPackages")}),e.jsxs(C,{to:"/pricing",className:"text-brand-400 hover:text-brand-300 transition-colors mt-2 inline-block",children:[t("packages.checkPricing")," →"]})]}):e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-5xl mx-auto",children:x.map((s,n)=>e.jsx(B,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-0 !rounded-2xl flex flex-col",spotlightColor:m[n%m.length],children:e.jsxs("div",{className:"p-6 flex-1 flex flex-col",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("h3",{className:"text-xl font-semibold text-white",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-400 mt-1",children:s.description})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-4xl font-bold text-white",children:["$",Number(s.price).toFixed(2)]}),s.original_price>0&&s.original_price>s.price&&e.jsxs("span",{className:"text-lg text-neutral-500 line-through",children:["$",Number(s.original_price).toFixed(2)]})]}),s.duration>0&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t("packages.daysAccess",{count:s.duration})})]}),e.jsxs("ul",{className:"space-y-2 mb-6 flex-1",children:[s.quota_amount>0&&e.jsxs("li",{className:"flex items-center gap-2 text-sm text-neutral-300",children:[e.jsx("svg",{className:"w-4 h-4 text-green-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),t("packages.creditIncluded",{amount:(s.quota_amount/u).toFixed(2)})]}),s.rate_limit>0&&e.jsxs("li",{className:"flex items-center gap-2 text-sm text-neutral-300",children:[e.jsx("svg",{className:"w-4 h-4 text-green-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),t("packages.requestsMin",{count:s.rate_limit})]}),e.jsxs("li",{className:"flex items-center gap-2 text-sm text-neutral-300",children:[e.jsx("svg",{className:"w-4 h-4 text-green-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),t("packages.allModels")]}),e.jsxs("li",{className:"flex items-center gap-2 text-sm text-neutral-300",children:[e.jsx("svg",{className:"w-4 h-4 text-green-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),t("packages.openaiApi")]})]}),e.jsx("button",{onClick:()=>N(s),disabled:a===s.id,className:"btn-primary w-full text-center",children:a===s.id?t("packages.processing"):t(r?"packages.subscribeNow":"packages.signUpToSubscribe")})]})},s.id))}),i&&(()=>{const s=((r==null?void 0:r.quota)||0)/u,n=Number(i.price),o=s!a&&c(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-sm",onClick:v=>v.stopPropagation(),children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-3",children:t("packages.confirmTitle")}),e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:t("packages.confirmDesc",{name:i.name,price:n.toFixed(2)})}),e.jsxs("p",{className:"text-sm text-neutral-400 mb-4",children:[t("packages.yourBalance")," ",e.jsxs("span",{className:`font-medium ${o?"text-red-400":"text-green-400"}`,children:["$",s.toFixed(2)]})]}),o&&e.jsx("div",{className:"bg-red-500/10 border border-red-500/20 rounded-xl p-3 mb-4",children:e.jsx("p",{className:"text-sm text-red-300",children:t("packages.insufficientBalance")})}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:()=>c(null),disabled:a,className:"btn-secondary",children:t("tokens.cancel")}),e.jsx("button",{onClick:k,disabled:o||a,className:"btn-primary",children:t(a?"packages.processing":"packages.confirm")})]})]})})})()]})}export{W as default}; +import{u as w,b as y,r as l,k as L,j as e,L as C,Q as u,s as S,z as P}from"./index-sl7kA1zY.js";import{S as B}from"./SpotlightCard-dMmfK1cV.js";import{u as _}from"./useTranslation-D01I4oIt.js";function W(){const{t}=_(),{user:r,refreshUser:h}=w(),p=y(),[b,g]=l.useState([]),[f,j]=l.useState(!0),[a,d]=l.useState(null),[i,c]=l.useState(null);l.useEffect(()=>{L().then(s=>{s.data.success&&g(s.data.data||[])}).catch(()=>{}).finally(()=>j(!1))},[]);const N=async s=>{if(!r){p("/register");return}c(s)},k=async()=>{if(!i)return;const s=i.id;d(s);try{(await S(s)).data.success&&(P.success(t("packages.subscribedSuccess")),c(null),await h())}catch{}d(null)};if(f)return e.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})});const x=b.filter(s=>s.enabled),m=["rgba(129,140,248,0.15)","rgba(192,132,252,0.15)","rgba(244,114,182,0.15)","rgba(34,197,94,0.15)"];return e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-3xl font-heading font-bold text-white mb-3",children:t("packages.title")}),e.jsx("p",{className:"text-neutral-400 max-w-xl mx-auto",children:t("packages.subtitle")})]}),x.length===0?e.jsxs("div",{className:"text-center py-12 text-neutral-400",children:[e.jsx("p",{children:t("packages.noPackages")}),e.jsxs(C,{to:"/pricing",className:"text-brand-400 hover:text-brand-300 transition-colors mt-2 inline-block",children:[t("packages.checkPricing")," →"]})]}):e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-5xl mx-auto",children:x.map((s,n)=>e.jsx(B,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-0 !rounded-2xl flex flex-col",spotlightColor:m[n%m.length],children:e.jsxs("div",{className:"p-6 flex-1 flex flex-col",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("h3",{className:"text-xl font-semibold text-white",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-400 mt-1",children:s.description})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-4xl font-bold text-white",children:["$",Number(s.price).toFixed(2)]}),s.original_price>0&&s.original_price>s.price&&e.jsxs("span",{className:"text-lg text-neutral-500 line-through",children:["$",Number(s.original_price).toFixed(2)]})]}),s.duration>0&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t("packages.daysAccess",{count:s.duration})})]}),e.jsxs("ul",{className:"space-y-2 mb-6 flex-1",children:[s.quota_amount>0&&e.jsxs("li",{className:"flex items-center gap-2 text-sm text-neutral-300",children:[e.jsx("svg",{className:"w-4 h-4 text-green-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),t("packages.creditIncluded",{amount:(s.quota_amount/u).toFixed(2)})]}),s.rate_limit>0&&e.jsxs("li",{className:"flex items-center gap-2 text-sm text-neutral-300",children:[e.jsx("svg",{className:"w-4 h-4 text-green-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),t("packages.requestsMin",{count:s.rate_limit})]}),e.jsxs("li",{className:"flex items-center gap-2 text-sm text-neutral-300",children:[e.jsx("svg",{className:"w-4 h-4 text-green-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),t("packages.allModels")]}),e.jsxs("li",{className:"flex items-center gap-2 text-sm text-neutral-300",children:[e.jsx("svg",{className:"w-4 h-4 text-green-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),t("packages.openaiApi")]})]}),e.jsx("button",{onClick:()=>N(s),disabled:a===s.id,className:"btn-primary w-full text-center",children:a===s.id?t("packages.processing"):t(r?"packages.subscribeNow":"packages.signUpToSubscribe")})]})},s.id))}),i&&(()=>{const s=((r==null?void 0:r.quota)||0)/u,n=Number(i.price),o=s!a&&c(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-sm",onClick:v=>v.stopPropagation(),children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-3",children:t("packages.confirmTitle")}),e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:t("packages.confirmDesc",{name:i.name,price:n.toFixed(2)})}),e.jsxs("p",{className:"text-sm text-neutral-400 mb-4",children:[t("packages.yourBalance")," ",e.jsxs("span",{className:`font-medium ${o?"text-red-400":"text-green-400"}`,children:["$",s.toFixed(2)]})]}),o&&e.jsx("div",{className:"bg-red-500/10 border border-red-500/20 rounded-xl p-3 mb-4",children:e.jsx("p",{className:"text-sm text-red-300",children:t("packages.insufficientBalance")})}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:()=>c(null),disabled:a,className:"btn-secondary",children:t("tokens.cancel")}),e.jsx("button",{onClick:k,disabled:o||a,className:"btn-primary",children:t(a?"packages.processing":"packages.confirm")})]})]})})})()]})}export{W as default}; diff --git a/dist/assets/Pricing-DP7ci81X.js b/dist/assets/Pricing-Do1DTRG_.js similarity index 96% rename from dist/assets/Pricing-DP7ci81X.js rename to dist/assets/Pricing-Do1DTRG_.js index 331d113..fbe2899 100644 --- a/dist/assets/Pricing-DP7ci81X.js +++ b/dist/assets/Pricing-Do1DTRG_.js @@ -1 +1 @@ -import{r as n,l as u,j as e}from"./index-BSnGsuja.js";import{u as h}from"./useTranslation-fJCRxooE.js";function f(){const{t:s}=h(),[l,i]=n.useState([]),[a,d]=n.useState(""),[c,o]=n.useState(!0);n.useEffect(()=>{u().then(t=>{t.data.success&&i(t.data.data||[])}).catch(()=>{}).finally(()=>o(!1))},[]);const r=l.filter(t=>t.enabled!==!1).filter(t=>!a||(t.display_name||t.model_name||"").toLowerCase().includes(a.toLowerCase()));return c?e.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h1",{className:"text-3xl font-heading font-bold text-white mb-3",children:s("pricing.title")}),e.jsx("p",{className:"text-neutral-400 max-w-xl mx-auto",children:s("pricing.subtitle")})]}),e.jsx("div",{className:"max-w-md mx-auto mb-8",children:e.jsxs("div",{className:"relative",children:[e.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("input",{type:"text",value:a,onChange:t=>d(t.target.value),className:"input !pl-10",placeholder:s("pricing.searchPlaceholder")})]})}),r.length===0?e.jsx("div",{className:"text-center py-12 text-neutral-400",children:s(a?"pricing.noMatch":"pricing.noModels")}):e.jsx("div",{className:"glass-sm rounded-xl overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-white/[0.06]",children:[e.jsx("th",{className:"text-left px-5 py-3.5 font-medium text-neutral-400",children:s("pricing.model")}),e.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-neutral-400",children:s("pricing.inputPrice")}),e.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-neutral-400",children:s("pricing.outputPrice")}),e.jsx("th",{className:"text-center px-5 py-3.5 font-medium text-neutral-400",children:s("pricing.status")})]})}),e.jsx("tbody",{children:r.map((t,x)=>e.jsxs("tr",{className:"border-b border-white/[0.04] last:border-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-5 py-3.5",children:e.jsx("span",{className:"font-mono text-white",children:t.display_name||t.model_name})}),e.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-neutral-300",children:t.input_price!=null?`$${(Number(t.input_price)*1e3).toFixed(4)}`:"-"}),e.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-neutral-300",children:t.output_price!=null?`$${(Number(t.output_price)*1e3).toFixed(4)}`:"-"}),e.jsx("td",{className:"px-5 py-3.5 text-center",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs border ${t.status==="healthy"?"bg-green-500/10 text-green-400 border-green-500/20":"bg-neutral-500/10 text-neutral-400 border-neutral-500/20"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${t.status==="healthy"?"bg-green-500":"bg-neutral-500"}`}),t.status==="healthy"?s("pricing.online"):s("pricing.unknown")]})})]},t.model_name||x))})]})})]})}export{f as default}; +import{r as n,l as u,j as e}from"./index-sl7kA1zY.js";import{u as h}from"./useTranslation-D01I4oIt.js";function f(){const{t:s}=h(),[l,i]=n.useState([]),[a,d]=n.useState(""),[c,o]=n.useState(!0);n.useEffect(()=>{u().then(t=>{t.data.success&&i(t.data.data||[])}).catch(()=>{}).finally(()=>o(!1))},[]);const r=l.filter(t=>t.enabled!==!1).filter(t=>!a||(t.display_name||t.model_name||"").toLowerCase().includes(a.toLowerCase()));return c?e.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h1",{className:"text-3xl font-heading font-bold text-white mb-3",children:s("pricing.title")}),e.jsx("p",{className:"text-neutral-400 max-w-xl mx-auto",children:s("pricing.subtitle")})]}),e.jsx("div",{className:"max-w-md mx-auto mb-8",children:e.jsxs("div",{className:"relative",children:[e.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("input",{type:"text",value:a,onChange:t=>d(t.target.value),className:"input !pl-10",placeholder:s("pricing.searchPlaceholder")})]})}),r.length===0?e.jsx("div",{className:"text-center py-12 text-neutral-400",children:s(a?"pricing.noMatch":"pricing.noModels")}):e.jsx("div",{className:"glass-sm rounded-xl overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-white/[0.06]",children:[e.jsx("th",{className:"text-left px-5 py-3.5 font-medium text-neutral-400",children:s("pricing.model")}),e.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-neutral-400",children:s("pricing.inputPrice")}),e.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-neutral-400",children:s("pricing.outputPrice")}),e.jsx("th",{className:"text-center px-5 py-3.5 font-medium text-neutral-400",children:s("pricing.status")})]})}),e.jsx("tbody",{children:r.map((t,x)=>e.jsxs("tr",{className:"border-b border-white/[0.04] last:border-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-5 py-3.5",children:e.jsx("span",{className:"font-mono text-white",children:t.display_name||t.model_name})}),e.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-neutral-300",children:t.input_price!=null?`$${(Number(t.input_price)*1e3).toFixed(4)}`:"-"}),e.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-neutral-300",children:t.output_price!=null?`$${(Number(t.output_price)*1e3).toFixed(4)}`:"-"}),e.jsx("td",{className:"px-5 py-3.5 text-center",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs border ${t.status==="healthy"?"bg-green-500/10 text-green-400 border-green-500/20":"bg-neutral-500/10 text-neutral-400 border-neutral-500/20"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${t.status==="healthy"?"bg-green-500":"bg-neutral-500"}`}),t.status==="healthy"?s("pricing.online"):s("pricing.unknown")]})})]},t.model_name||x))})]})})]})}export{f as default}; diff --git a/dist/assets/Register-BKTNrtKR.js b/dist/assets/Register-C7amt8Qy.js similarity index 96% rename from dist/assets/Register-BKTNrtKR.js rename to dist/assets/Register-C7amt8Qy.js index 318104c..5936af5 100644 --- a/dist/assets/Register-BKTNrtKR.js +++ b/dist/assets/Register-C7amt8Qy.js @@ -1 +1 @@ -import{u as h,a as g,b as w,r as d,j as e,N as f,L as j,z as a}from"./index-BSnGsuja.js";import{u as b}from"./useTranslation-fJCRxooE.js";function y(){const{t:s}=b(),{register:c,user:u}=h(),{site:n}=g(),m=w(),[r,i]=d.useState({username:"",password:"",password2:"",email:""}),[l,o]=d.useState(!1);if(u)return e.jsx(f,{to:"/dashboard",replace:!0});const p=async t=>{if(t.preventDefault(),!r.username||!r.password){a.error(s("register.fillRequired"));return}if(r.password!==r.password2){a.error(s("register.passwordMismatch"));return}if(r.password.length<8){a.error(s("register.passwordLength"));return}if(r.password.length>20){a.error(s("register.passwordLength"));return}o(!0);try{if((await c({username:r.username,password:r.password,email:r.email||void 0})).success){a.success(s("register.accountCreated")),m("/login",{replace:!0});return}}catch{}o(!1)};return e.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-6",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"glass rounded-2xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("register.createAccount")}),e.jsx("p",{className:"text-sm text-neutral-400",children:n!=null&&n.name?s("register.getStartedWith",{name:n.name}):s("register.getStartedDefault")})]}),e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:[s("register.username")," *"]}),e.jsx("input",{type:"text",value:r.username,onChange:t=>i({...r,username:t.target.value}),className:"input",placeholder:s("register.chooseUsername"),autoComplete:"username",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:s("register.email")}),e.jsx("input",{type:"email",value:r.email,onChange:t=>i({...r,email:t.target.value}),className:"input",placeholder:s("register.emailPlaceholder"),autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:[s("register.password")," *"]}),e.jsx("input",{type:"password",value:r.password,onChange:t=>i({...r,password:t.target.value}),className:"input",placeholder:s("register.passwordPlaceholder"),autoComplete:"new-password",required:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:[s("register.confirmPassword")," *"]}),e.jsx("input",{type:"password",value:r.password2,onChange:t=>i({...r,password2:t.target.value}),className:"input",placeholder:s("register.repeatPassword"),autoComplete:"new-password",required:!0})]}),e.jsxs("button",{type:"submit",disabled:l,className:"btn-primary w-full flex items-center justify-center gap-2",children:[l&&e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),s(l?"register.creating":"register.createAccountBtn")]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-neutral-400",children:[s("register.hasAccount")," ",e.jsx(j,{to:"/login",className:"text-brand-400 hover:text-brand-300 transition-colors font-medium",children:s("register.signIn")})]})})]})})})}export{y as default}; +import{u as h,a as g,b as w,r as d,j as e,N as f,L as j,z as a}from"./index-sl7kA1zY.js";import{u as b}from"./useTranslation-D01I4oIt.js";function y(){const{t:s}=b(),{register:c,user:u}=h(),{site:n}=g(),m=w(),[r,i]=d.useState({username:"",password:"",password2:"",email:""}),[l,o]=d.useState(!1);if(u)return e.jsx(f,{to:"/dashboard",replace:!0});const p=async t=>{if(t.preventDefault(),!r.username||!r.password){a.error(s("register.fillRequired"));return}if(r.password!==r.password2){a.error(s("register.passwordMismatch"));return}if(r.password.length<8){a.error(s("register.passwordLength"));return}if(r.password.length>20){a.error(s("register.passwordLength"));return}o(!0);try{if((await c({username:r.username,password:r.password,email:r.email||void 0})).success){a.success(s("register.accountCreated")),m("/login",{replace:!0});return}}catch{}o(!1)};return e.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-6",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"glass rounded-2xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("register.createAccount")}),e.jsx("p",{className:"text-sm text-neutral-400",children:n!=null&&n.name?s("register.getStartedWith",{name:n.name}):s("register.getStartedDefault")})]}),e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:[s("register.username")," *"]}),e.jsx("input",{type:"text",value:r.username,onChange:t=>i({...r,username:t.target.value}),className:"input",placeholder:s("register.chooseUsername"),autoComplete:"username",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:s("register.email")}),e.jsx("input",{type:"email",value:r.email,onChange:t=>i({...r,email:t.target.value}),className:"input",placeholder:s("register.emailPlaceholder"),autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:[s("register.password")," *"]}),e.jsx("input",{type:"password",value:r.password,onChange:t=>i({...r,password:t.target.value}),className:"input",placeholder:s("register.passwordPlaceholder"),autoComplete:"new-password",required:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:[s("register.confirmPassword")," *"]}),e.jsx("input",{type:"password",value:r.password2,onChange:t=>i({...r,password2:t.target.value}),className:"input",placeholder:s("register.repeatPassword"),autoComplete:"new-password",required:!0})]}),e.jsxs("button",{type:"submit",disabled:l,className:"btn-primary w-full flex items-center justify-center gap-2",children:[l&&e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),s(l?"register.creating":"register.createAccountBtn")]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-neutral-400",children:[s("register.hasAccount")," ",e.jsx(j,{to:"/login",className:"text-brand-400 hover:text-brand-300 transition-colors font-medium",children:s("register.signIn")})]})})]})})})}export{y as default}; diff --git a/dist/assets/SpotlightCard-DMZC3L4x.js b/dist/assets/SpotlightCard-dMmfK1cV.js similarity index 92% rename from dist/assets/SpotlightCard-DMZC3L4x.js rename to dist/assets/SpotlightCard-dMmfK1cV.js index d31d545..94eb0eb 100644 --- a/dist/assets/SpotlightCard-DMZC3L4x.js +++ b/dist/assets/SpotlightCard-dMmfK1cV.js @@ -1 +1 @@ -import{r as t,j as c}from"./index-BSnGsuja.js";const b=({children:i,className:u="",spotlightColor:l="rgba(255, 255, 255, 0.25)"})=>{const o=t.useRef(null),[d,n]=t.useState(!1),[s,p]=t.useState({x:0,y:0}),[x,e]=t.useState(0),v=r=>{if(!o.current||d)return;const a=o.current.getBoundingClientRect();p({x:r.clientX-a.left,y:r.clientY-a.top})},f=()=>{n(!0),e(.6)},h=()=>{n(!1),e(0)},y=()=>{e(.6)},M=()=>{e(0)};return c.jsxs("div",{ref:o,onMouseMove:v,onFocus:f,onBlur:h,onMouseEnter:y,onMouseLeave:M,className:`relative rounded-3xl border border-neutral-800 bg-neutral-900 overflow-hidden p-8 ${u}`,children:[c.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-500 ease-in-out",style:{opacity:x,background:`radial-gradient(circle at ${s.x}px ${s.y}px, ${l}, transparent 80%)`}}),i]})};export{b as S}; +import{r as t,j as c}from"./index-sl7kA1zY.js";const b=({children:i,className:u="",spotlightColor:l="rgba(255, 255, 255, 0.25)"})=>{const o=t.useRef(null),[d,n]=t.useState(!1),[s,p]=t.useState({x:0,y:0}),[x,e]=t.useState(0),v=r=>{if(!o.current||d)return;const a=o.current.getBoundingClientRect();p({x:r.clientX-a.left,y:r.clientY-a.top})},f=()=>{n(!0),e(.6)},h=()=>{n(!1),e(0)},y=()=>{e(.6)},M=()=>{e(0)};return c.jsxs("div",{ref:o,onMouseMove:v,onFocus:f,onBlur:h,onMouseEnter:y,onMouseLeave:M,className:`relative rounded-3xl border border-neutral-800 bg-neutral-900 overflow-hidden p-8 ${u}`,children:[c.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-500 ease-in-out",style:{opacity:x,background:`radial-gradient(circle at ${s.x}px ${s.y}px, ${l}, transparent 80%)`}}),i]})};export{b as S}; diff --git a/dist/assets/Tokens-S0Le-8_B.js b/dist/assets/Tokens-CzQLqzGA.js similarity index 99% rename from dist/assets/Tokens-S0Le-8_B.js rename to dist/assets/Tokens-CzQLqzGA.js index 42bf66b..08059fc 100644 --- a/dist/assets/Tokens-S0Le-8_B.js +++ b/dist/assets/Tokens-CzQLqzGA.js @@ -1 +1 @@ -import{r as n,e as z,j as e,z as m,f as D,h as H,i as E}from"./index-BSnGsuja.js";import{u as L}from"./useTranslation-fJCRxooE.js";function P(){const{t}=L(),[u,N]=n.useState([]),[g,h]=n.useState(!0),[v,l]=n.useState(!1),[x,p]=n.useState(""),[b,f]=n.useState(!1),[w,j]=n.useState(null),[o,k]=n.useState(null),[i,d]=n.useState(null),r=n.useCallback(async()=>{h(!0);try{const s=await z();s.data.success&&N(s.data.data||[])}catch{}h(!1)},[]);n.useEffect(()=>{r()},[r]);const C=async s=>{var c;if(s.preventDefault(),!x.trim()){m.error(t("tokens.enterName"));return}f(!0);try{const a=await D({name:x.trim()});if(a.data.success){p(""),l(!1);const y=(c=a.data.data)==null?void 0:c.key;y&&k(y),await r()}}catch{}f(!1)},S=async s=>{try{(await H(s.id,{status:s.status===1?2:1})).data.success&&(m.success(s.status===1?t("tokens.tokenDisabled"):t("tokens.tokenEnabled")),await r())}catch{}},T=async()=>{if(i)try{(await E(i.id)).data.success&&(m.success(t("tokens.tokenDeleted")),d(null),await r())}catch{}},K=async s=>{try{await navigator.clipboard.writeText(s)}catch{const a=document.createElement("textarea");a.value=s,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a)}j(s),m.success(t("tokens.copiedToClipboard")),setTimeout(()=>j(null),2e3)};return g?e.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-white",children:t("tokens.title")}),e.jsx("p",{className:"text-sm text-neutral-400 mt-1",children:t("tokens.subtitle")})]}),e.jsx("button",{onClick:()=>l(!0),className:"btn-primary",children:t("tokens.newKey")})]}),v&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:()=>l(!1),children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-md",onClick:s=>s.stopPropagation(),children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:t("tokens.createApiKey")}),e.jsxs("form",{onSubmit:C,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:t("tokens.name")}),e.jsx("input",{type:"text",value:x,onChange:s=>p(s.target.value),className:"input",placeholder:t("tokens.namePlaceholder"),autoFocus:!0,required:!0})]}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:()=>l(!1),className:"btn-secondary",children:t("tokens.cancel")}),e.jsx("button",{type:"submit",disabled:b,className:"btn-primary",children:t(b?"tokens.creating":"tokens.create")})]})]})]})}),o&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-lg",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-2",children:t("tokens.newApiKey")}),e.jsx("div",{className:"bg-yellow-500/10 border border-yellow-500/20 rounded-xl p-3 mb-4",children:e.jsx("p",{className:"text-sm text-yellow-300",children:t("tokens.keyWarning")})}),e.jsxs("div",{className:"bg-black/40 rounded-xl p-4 flex items-center gap-3",children:[e.jsx("code",{className:"text-sm font-mono text-green-400 flex-1 break-all select-all",children:o}),e.jsx("button",{onClick:()=>K(o),className:"btn-primary !px-4 !py-1.5 flex-shrink-0",children:t(w===o?"tokens.copied":"tokens.copy")})]}),e.jsx("div",{className:"flex justify-end mt-4",children:e.jsx("button",{onClick:()=>k(null),className:"btn-secondary",children:t("tokens.savedKey")})})]})}),i&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:()=>d(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-sm",onClick:s=>s.stopPropagation(),children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-3",children:t("tokens.deleteToken")}),e.jsx("p",{className:"text-sm text-neutral-400 mb-4",children:t("tokens.deleteConfirm",{name:i.name})}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:()=>d(null),className:"btn-secondary",children:t("tokens.cancel")}),e.jsx("button",{onClick:T,className:"px-6 py-2.5 rounded-xl bg-red-600 text-white text-sm font-medium hover:bg-red-500 transition-colors",children:t("tokens.delete")})]})]})}),u.length===0?e.jsxs("div",{className:"glass rounded-2xl p-12 text-center",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-neutral-800/50 flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-neutral-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})})}),e.jsx("p",{className:"text-neutral-400 mb-4",children:t("tokens.noKeys")}),e.jsx("button",{onClick:()=>l(!0),className:"btn-primary",children:t("tokens.createFirst")})]}):e.jsx("div",{className:"space-y-3",children:u.map(s=>e.jsxs("div",{className:"glass-sm rounded-xl p-5 flex items-center gap-4",children:[e.jsx("div",{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 ${s.status===1?"bg-green-500":"bg-neutral-600"}`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-white",children:s.name}),e.jsx("p",{className:"text-xs font-mono text-neutral-500 mt-1",children:"sk-***"})]}),e.jsx("span",{className:"text-xs text-neutral-500 hidden md:block",children:s.created_time?new Date(s.created_time*1e3).toLocaleDateString():""}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>S(s),className:`px-3 py-1 text-xs rounded-lg border transition-colors ${s.status===1?"border-green-500/30 text-green-400 hover:bg-green-500/10":"border-neutral-600 text-neutral-400 hover:bg-neutral-800"}`,children:s.status===1?t("tokens.enabled"):t("tokens.disabled")}),e.jsx("button",{onClick:()=>d(s),className:"px-3 py-1 text-xs rounded-lg border border-red-500/20 text-red-400 hover:bg-red-500/10 transition-colors",children:t("tokens.delete")})]})]},s.id))}),e.jsxs("div",{className:"glass rounded-2xl p-6 mt-8",children:[e.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:t("tokens.quickStart")}),e.jsxs("div",{className:"bg-black/40 rounded-xl p-4 font-mono text-sm",children:[e.jsx("p",{className:"text-neutral-500",children:t("tokens.quickStartComment")}),e.jsxs("p",{className:"text-green-400 mt-2",children:["curl ",window.location.origin,"/v1/chat/completions \\"]}),e.jsx("p",{className:"text-neutral-300 pl-4",children:'-H "Authorization: Bearer sk-your-key" \\'}),e.jsx("p",{className:"text-neutral-300 pl-4",children:'-H "Content-Type: application/json" \\'}),e.jsxs("p",{className:"text-neutral-300 pl-4",children:["-d '",'{"model":"gpt-4o","messages":[{"role":"user","content":"Hello!"}]}',"'"]})]})]})]})}export{P as default}; +import{r as n,e as z,j as e,z as m,f as D,h as H,i as E}from"./index-sl7kA1zY.js";import{u as L}from"./useTranslation-D01I4oIt.js";function P(){const{t}=L(),[u,N]=n.useState([]),[g,h]=n.useState(!0),[v,l]=n.useState(!1),[x,p]=n.useState(""),[b,f]=n.useState(!1),[w,j]=n.useState(null),[o,k]=n.useState(null),[i,d]=n.useState(null),r=n.useCallback(async()=>{h(!0);try{const s=await z();s.data.success&&N(s.data.data||[])}catch{}h(!1)},[]);n.useEffect(()=>{r()},[r]);const C=async s=>{var c;if(s.preventDefault(),!x.trim()){m.error(t("tokens.enterName"));return}f(!0);try{const a=await D({name:x.trim()});if(a.data.success){p(""),l(!1);const y=(c=a.data.data)==null?void 0:c.key;y&&k(y),await r()}}catch{}f(!1)},S=async s=>{try{(await H(s.id,{status:s.status===1?2:1})).data.success&&(m.success(s.status===1?t("tokens.tokenDisabled"):t("tokens.tokenEnabled")),await r())}catch{}},T=async()=>{if(i)try{(await E(i.id)).data.success&&(m.success(t("tokens.tokenDeleted")),d(null),await r())}catch{}},K=async s=>{try{await navigator.clipboard.writeText(s)}catch{const a=document.createElement("textarea");a.value=s,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a)}j(s),m.success(t("tokens.copiedToClipboard")),setTimeout(()=>j(null),2e3)};return g?e.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-white",children:t("tokens.title")}),e.jsx("p",{className:"text-sm text-neutral-400 mt-1",children:t("tokens.subtitle")})]}),e.jsx("button",{onClick:()=>l(!0),className:"btn-primary",children:t("tokens.newKey")})]}),v&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:()=>l(!1),children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-md",onClick:s=>s.stopPropagation(),children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:t("tokens.createApiKey")}),e.jsxs("form",{onSubmit:C,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-1.5",children:t("tokens.name")}),e.jsx("input",{type:"text",value:x,onChange:s=>p(s.target.value),className:"input",placeholder:t("tokens.namePlaceholder"),autoFocus:!0,required:!0})]}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:()=>l(!1),className:"btn-secondary",children:t("tokens.cancel")}),e.jsx("button",{type:"submit",disabled:b,className:"btn-primary",children:t(b?"tokens.creating":"tokens.create")})]})]})]})}),o&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-lg",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-2",children:t("tokens.newApiKey")}),e.jsx("div",{className:"bg-yellow-500/10 border border-yellow-500/20 rounded-xl p-3 mb-4",children:e.jsx("p",{className:"text-sm text-yellow-300",children:t("tokens.keyWarning")})}),e.jsxs("div",{className:"bg-black/40 rounded-xl p-4 flex items-center gap-3",children:[e.jsx("code",{className:"text-sm font-mono text-green-400 flex-1 break-all select-all",children:o}),e.jsx("button",{onClick:()=>K(o),className:"btn-primary !px-4 !py-1.5 flex-shrink-0",children:t(w===o?"tokens.copied":"tokens.copy")})]}),e.jsx("div",{className:"flex justify-end mt-4",children:e.jsx("button",{onClick:()=>k(null),className:"btn-secondary",children:t("tokens.savedKey")})})]})}),i&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:()=>d(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-sm",onClick:s=>s.stopPropagation(),children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-3",children:t("tokens.deleteToken")}),e.jsx("p",{className:"text-sm text-neutral-400 mb-4",children:t("tokens.deleteConfirm",{name:i.name})}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:()=>d(null),className:"btn-secondary",children:t("tokens.cancel")}),e.jsx("button",{onClick:T,className:"px-6 py-2.5 rounded-xl bg-red-600 text-white text-sm font-medium hover:bg-red-500 transition-colors",children:t("tokens.delete")})]})]})}),u.length===0?e.jsxs("div",{className:"glass rounded-2xl p-12 text-center",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-neutral-800/50 flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-neutral-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})})}),e.jsx("p",{className:"text-neutral-400 mb-4",children:t("tokens.noKeys")}),e.jsx("button",{onClick:()=>l(!0),className:"btn-primary",children:t("tokens.createFirst")})]}):e.jsx("div",{className:"space-y-3",children:u.map(s=>e.jsxs("div",{className:"glass-sm rounded-xl p-5 flex items-center gap-4",children:[e.jsx("div",{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 ${s.status===1?"bg-green-500":"bg-neutral-600"}`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-white",children:s.name}),e.jsx("p",{className:"text-xs font-mono text-neutral-500 mt-1",children:"sk-***"})]}),e.jsx("span",{className:"text-xs text-neutral-500 hidden md:block",children:s.created_time?new Date(s.created_time*1e3).toLocaleDateString():""}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>S(s),className:`px-3 py-1 text-xs rounded-lg border transition-colors ${s.status===1?"border-green-500/30 text-green-400 hover:bg-green-500/10":"border-neutral-600 text-neutral-400 hover:bg-neutral-800"}`,children:s.status===1?t("tokens.enabled"):t("tokens.disabled")}),e.jsx("button",{onClick:()=>d(s),className:"px-3 py-1 text-xs rounded-lg border border-red-500/20 text-red-400 hover:bg-red-500/10 transition-colors",children:t("tokens.delete")})]})]},s.id))}),e.jsxs("div",{className:"glass rounded-2xl p-6 mt-8",children:[e.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:t("tokens.quickStart")}),e.jsxs("div",{className:"bg-black/40 rounded-xl p-4 font-mono text-sm",children:[e.jsx("p",{className:"text-neutral-500",children:t("tokens.quickStartComment")}),e.jsxs("p",{className:"text-green-400 mt-2",children:["curl ",window.location.origin,"/v1/chat/completions \\"]}),e.jsx("p",{className:"text-neutral-300 pl-4",children:'-H "Authorization: Bearer sk-your-key" \\'}),e.jsx("p",{className:"text-neutral-300 pl-4",children:'-H "Content-Type: application/json" \\'}),e.jsxs("p",{className:"text-neutral-300 pl-4",children:["-d '",'{"model":"gpt-4o","messages":[{"role":"user","content":"Hello!"}]}',"'"]})]})]})]})}export{P as default}; diff --git a/dist/assets/Topup-Bl3onU8Y.js b/dist/assets/Topup-Bl3onU8Y.js new file mode 100644 index 0000000..820154e --- /dev/null +++ b/dist/assets/Topup-Bl3onU8Y.js @@ -0,0 +1 @@ +import{u as $e,a as Te,r as n,g as Oe,m as Me,j as e,Q as se,d as Ee,z as d,n as Le,o as Ue,p as He,q as Re,t as De,v as Fe,w as ze}from"./index-sl7kA1zY.js";import{S as L}from"./SpotlightCard-dMmfK1cV.js";import{C as U}from"./CountUp-4XjqJEhr.js";import{u as Be}from"./useTranslation-D01I4oIt.js";function Ke(){var I;const{t:s}=Be(),{user:i,refreshUser:H}=$e(),{site:r}=Te(),[m,ae]=n.useState(null),[l,le]=n.useState(null),[ne,R]=n.useState(!0),[T,D]=n.useState(""),[F,z]=n.useState(!1),[b,O]=n.useState(""),[re,M]=n.useState(null),[B,W]=n.useState(null),[oe,Q]=n.useState(!1),[g,y]=n.useState(!1),[E,f]=n.useState(""),[C,S]=n.useState(null),[ce,j]=n.useState(!1),[u,J]=n.useState(""),[k,de]=n.useState("usdt"),[N,ie]=n.useState(null),[P,me]=n.useState(!1),[V,ue]=n.useState([]),[pe,G]=n.useState(!1);r!=null&&r.enable_topup,r==null||r.topup_config;const A=n.useCallback(async()=>{var t;R(!0);try{const[a,o]=await Promise.all([Oe(),r!=null&&r.enable_topup?Me().catch(()=>null):Promise.resolve(null)]);a.data.success&&ae(a.data.data),(t=o==null?void 0:o.data)!=null&&t.data&&le(o.data.data)}catch{}R(!1)},[r==null?void 0:r.enable_topup]);n.useEffect(()=>{A()},[A]);const K=(m==null?void 0:m.quota)??(i==null?void 0:i.quota)??0,xe=(m==null?void 0:m.used_quota)??(i==null?void 0:i.used_quota)??0,he=(m==null?void 0:m.request_count)??(i==null?void 0:i.request_count)??0,be=K/se,ge=async t=>{if(t.preventDefault(),!!T.trim()){z(!0);try{(await Ee(T.trim())).data.success&&(d.success(s("topup.redeemSuccess")),D(""),await Promise.all([A(),H()]))}catch{}z(!1)}},X=async t=>{if(!t||t<=0){W(null);return}Q(!0);try{const a=await Le({amount:parseInt(t)});a.data.message==="success"&&W(a.data.data)}catch{}Q(!1)},ye=t=>{M(t),O(t),X(t)},fe=t=>["stripe","alipay","wxpay"].includes(t)&&!t.startsWith("epay_"),je=async t=>{var o;const a=parseInt(b);if(!a||a<=0){d.error(s("topup.enterAmount"));return}y(!0),f(t);try{const p=window.location.origin+"/topup",_={amount:a,payment_method:t,return_url:p};if(fe(t)){const c=await Ue(_);if(c.data.message==="success"&&((o=c.data.data)!=null&&o.pay_link))window.open(c.data.data.pay_link,"_blank");else if(c.data.message!=="success"){const x=typeof c.data.data=="string"?c.data.data:c.data.message;d.error(x||s("common.requestFailed"))}}else{const c=await He(_);if(c.data.message==="success"){const x=c.data.data,ee=c.data.url;if(ee&&x){const h=document.createElement("form");h.action=ee,h.method="POST",navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")<1||(h.target="_blank");for(const te in x){const $=document.createElement("input");$.type="hidden",$.name=te,$.value=x[te],h.appendChild($)}document.body.appendChild(h),h.submit(),document.body.removeChild(h)}}else{const x=typeof c.data.data=="string"?c.data.data:c.data.message;d.error(x||s("common.requestFailed"))}}}catch{}y(!1),f("")},Ne=async t=>{var a;y(!0),f("creem");try{const o=await Re({product_id:t.productId,payment_method:"creem"});if(o.data.message==="success"&&((a=o.data.data)!=null&&a.checkout_url))window.open(o.data.data.checkout_url,"_blank");else if(o.data.message!=="success"){const p=typeof o.data.data=="string"?o.data.data:o.data.message;d.error(p||s("common.requestFailed"))}}catch{}y(!1),f("")},we=async()=>{const t=parseInt(b);if(!t||t<=0){d.error(s("topup.enterAmount"));return}if(!u){d.error(s("topup.selectChain"));return}if(!k){d.error(s("topup.selectToken"));return}y(!0),f("crypto");try{const a=await De({amount:t,chain:u,token:k});if(a.data.message==="success"&&a.data.data)S(a.data.data),ve(a.data.data.trade_no);else if(a.data.message!=="success"){const o=typeof a.data.data=="string"?a.data.data:a.data.message;d.error(o||s("common.requestFailed"))}}catch{}y(!1),f("")},ve=t=>{j(!0);const a=setInterval(async()=>{var p,_;try{const c=await Fe(t);((p=c.data.data)==null?void 0:p.status)==="success"?(clearInterval(a),j(!1),S(null),d.success(s("topup.paymentSuccess")),await Promise.all([A(),H()])):((_=c.data.data)==null?void 0:_.status)==="expired"&&(clearInterval(a),j(!1),d.error(s("topup.orderExpired")))}catch{clearInterval(a),j(!1)}},5e3),o=((l==null?void 0:l.crypto_expiry_minutes)||30)*60*1e3;setTimeout(()=>{clearInterval(a),j(!1)},o)},w=(l==null?void 0:l.crypto_wallets)||{},v=n.useMemo(()=>{const t=[];return w.tron&&t.push({key:"tron",label:"TRON (TRC20)"}),w.eth&&t.push({key:"eth",label:"Ethereum (ERC20)"}),w.bsc&&t.push({key:"bsc",label:"BSC (BEP20)"}),t},[w.tron,w.eth,w.bsc]);n.useEffect(()=>{v.length>0&&!u&&J(v[0].key)},[v,u]);const Y=n.useMemo(()=>{if(!(l!=null&&l.creem_products))return[];try{const t=typeof l.creem_products=="string"?JSON.parse(l.creem_products):l.creem_products;return Array.isArray(t)?t:[]}catch{return[]}},[l==null?void 0:l.creem_products]),Ce=async()=>{var t;G(!0);try{const a=await ze({page:1,page_size:20});(t=a.data.data)!=null&&t.items&&ue(a.data.data.items)}catch{}G(!1)},_e=(l==null?void 0:l.amount_options)||[1,5,10,20,50,100],q=(l==null?void 0:l.min_topup)||1,Se=(l==null?void 0:l.pay_methods)||[],ke=l==null?void 0:l.enable_online_topup,Pe=l==null?void 0:l.enable_stripe_topup,Ae=l==null?void 0:l.enable_creem_topup,qe=l==null?void 0:l.enable_crypto_topup,Z=Se.filter(t=>t.type!=="creem"&&t.type!=="crypto");return ne?e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-white mb-1",children:s("topup.title")}),e.jsx("p",{className:"text-sm text-neutral-400",children:s("topup.subtitle")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[e.jsxs(L,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(34,197,94,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.balance")}),e.jsxs("div",{className:"text-3xl font-bold text-white",children:["$",e.jsx(U,{from:0,to:be,duration:1.5})]}),e.jsx("p",{className:"text-xs text-neutral-500 mt-1",children:s("dashboard.quotaUnits",{count:K.toLocaleString()})})]}),e.jsxs(L,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(129,140,248,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.used")}),e.jsxs("div",{className:"text-3xl font-bold text-white",children:["$",e.jsx(U,{from:0,to:xe/se,duration:1.5})]})]}),e.jsxs(L,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(244,114,182,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.totalRequests")}),e.jsx("div",{className:"text-3xl font-bold text-white",children:e.jsx(U,{from:0,to:he,duration:1.5})})]})]}),(r==null?void 0:r.enable_topup)&&(ke||Pe)&&Z.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white",children:s("topup.onlineTopup")}),e.jsx("button",{onClick:()=>{me(!P),P||Ce()},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:s(P?"topup.hideHistory":"topup.viewHistory")})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-3",children:s("topup.selectAmount")}),e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:_e.map(t=>e.jsxs("button",{onClick:()=>ye(t),className:`py-2.5 px-3 rounded-xl text-sm font-medium transition-all ${re===t?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-neutral-300 hover:text-white hover:bg-white/[0.08]"}`,children:["$",t]},t))})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-2",children:s("topup.customAmount")}),e.jsx("div",{className:"flex gap-3",children:e.jsx("input",{type:"number",value:b,onChange:t=>{O(t.target.value),M(null)},onBlur:t=>X(t.target.value),min:q,placeholder:s("topup.amountPlaceholder",{min:q}),className:"input flex-1"})}),oe?e.jsx("p",{className:"text-xs text-neutral-500 mt-2",children:s("topup.calculating")}):B?e.jsxs("p",{className:"text-xs text-neutral-400 mt-2",children:[s("topup.payAmountLabel"),": ",e.jsxs("span",{className:"text-green-400 font-medium",children:["$",B]})]}):null]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-3",children:s("topup.paymentMethod")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Z.map(t=>{const a=g&&E===t.type;return e.jsx("button",{onClick:()=>je(t.type),disabled:g||!b,className:"px-4 py-2.5 rounded-xl text-sm font-medium glass-sm text-neutral-300 hover:text-white hover:bg-white/[0.08] disabled:opacity-40 disabled:cursor-not-allowed transition-all",children:a?s("topup.processing"):t.name},t.type)})})]})]}),(r==null?void 0:r.enable_topup)&&Ae&&Y.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("topup.creemPayment")||"Creem Payment"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Y.map(t=>e.jsxs("div",{className:`glass-sm rounded-xl p-4 cursor-pointer transition-all ${(N==null?void 0:N.productId)===t.productId?"ring-2 ring-brand-500 bg-brand-500/10":"hover:bg-white/[0.06]"}`,onClick:()=>ie(t),children:[e.jsx("h3",{className:"text-sm font-semibold text-white mb-1",children:t.name}),e.jsxs("p",{className:"text-xl font-bold text-green-400 mb-1",children:["$",t.price," ",e.jsx("span",{className:"text-xs text-neutral-500 font-normal",children:t.currency||"USD"})]}),t.quota&&e.jsx("p",{className:"text-xs text-neutral-400",children:s("topup.quotaIncluded")||`${t.quota} quota`})]},t.productId))}),N&&e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx("button",{onClick:()=>Ne(N),disabled:g,className:"btn-primary px-6",children:g&&E==="creem"?s("topup.processing"):`${s("topup.payNow")||"Pay"} $${N.price}`})})]}),(r==null?void 0:r.enable_topup)&&qe&&v.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("topup.cryptoPayment")}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-2",children:s("topup.amount")}),e.jsx("input",{type:"number",value:b,onChange:t=>{O(t.target.value),M(null)},min:q,placeholder:s("topup.amountPlaceholder",{min:q}),className:"input w-full"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-2",children:s("topup.chain")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:v.map(t=>e.jsx("button",{onClick:()=>J(t.key),className:`px-4 py-2 rounded-xl text-sm font-medium transition-all ${u===t.key?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-neutral-300 hover:text-white hover:bg-white/[0.08]"}`,children:t.label},t.key))})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-2",children:s("topup.token")||"Token"}),e.jsx("div",{className:"flex gap-2",children:["usdt","usdc"].map(t=>e.jsx("button",{onClick:()=>de(t),className:`px-4 py-2 rounded-xl text-sm font-medium transition-all ${k===t?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-neutral-300 hover:text-white hover:bg-white/[0.08]"}`,children:t.toUpperCase()},t))})]}),e.jsx("button",{onClick:we,disabled:g||!b,className:"btn-primary w-full",children:g&&E==="crypto"?s("topup.processing"):`${s("topup.payWith")||"Pay with"} ${k.toUpperCase()} (${((I=v.find(t=>t.key===u))==null?void 0:I.label)||u})`})]}),C&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:()=>S(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 max-w-md w-full mx-4",onClick:t=>t.stopPropagation(),children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:s("topup.cryptoPayment")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"glass-sm rounded-xl p-4",children:[e.jsx("p",{className:"text-xs text-neutral-400 mb-1",children:s("topup.walletAddress")}),e.jsx("p",{className:"text-sm text-white font-mono break-all",children:C.wallet})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"glass-sm rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-neutral-400 mb-1",children:s("topup.amount")}),e.jsxs("p",{className:"text-sm text-white font-medium",children:[C.amount," ",C.token]})]}),e.jsxs("div",{className:"glass-sm rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-neutral-400 mb-1",children:s("topup.chain")}),e.jsx("p",{className:"text-sm text-white font-medium",children:C.chain})]})]}),ce&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral-400",children:[e.jsx("div",{className:"w-4 h-4 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"}),s("topup.waitingPayment")]}),e.jsx("button",{onClick:()=>{S(null),j(!1)},className:"w-full py-2 rounded-xl text-sm glass-sm text-neutral-400 hover:text-white transition-colors",children:s("topup.close")})]})]})}),P&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("topup.history")}),pe?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx("div",{className:"w-6 h-6 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):V.length===0?e.jsx("p",{className:"text-sm text-neutral-500 text-center py-8",children:s("topup.noHistory")}):e.jsx("div",{className:"space-y-2",children:V.map((t,a)=>e.jsxs("div",{className:"flex items-center justify-between glass-sm rounded-xl px-4 py-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-white",children:["$",t.amount]}),e.jsxs("p",{className:"text-xs text-neutral-500",children:[new Date(t.create_time*1e3).toLocaleString()," · ",t.payment_method||s("topup.redeemCode")]})]}),e.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${t.status==="success"?"bg-green-500/10 text-green-400":t.status==="pending"?"bg-yellow-500/10 text-yellow-400":"bg-red-500/10 text-red-400"}`,children:t.status==="success"?s("topup.statusSuccess"):t.status==="pending"?s("topup.statusPending"):s("topup.statusFailed")})]},a))})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("topup.redeemTitle")}),e.jsxs("form",{onSubmit:ge,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:T,onChange:t=>D(t.target.value),className:"input flex-1",placeholder:s("topup.enterRedeemCode")}),e.jsx("button",{type:"submit",disabled:F,className:"btn-primary whitespace-nowrap",children:s(F?"topup.redeeming":"topup.redeem")})]})]})]})}export{Ke as default}; diff --git a/dist/assets/Topup-CUjaIN3g.js b/dist/assets/Topup-CUjaIN3g.js deleted file mode 100644 index dc3a125..0000000 --- a/dist/assets/Topup-CUjaIN3g.js +++ /dev/null @@ -1 +0,0 @@ -import{u as qe,a as $e,r as n,g as Te,m as Oe,j as e,Q as te,d as Me,z as i,n as Ee,o as Le,p as He,q as Re,t as Ue,v as De,w as Fe}from"./index-BSnGsuja.js";import{S as E}from"./SpotlightCard-DMZC3L4x.js";import{C as L}from"./CountUp-CaPcnNrA.js";import{u as ze}from"./useTranslation-fJCRxooE.js";function Ge(){var Z;const{t:s}=ze(),{user:m,refreshUser:H}=qe(),{site:r}=$e(),[u,se]=n.useState(null),[l,ae]=n.useState(null),[le,R]=n.useState(!0),[$,U]=n.useState(""),[D,F]=n.useState(!1),[b,T]=n.useState(""),[ne,O]=n.useState(null),[z,B]=n.useState(null),[re,W]=n.useState(!1),[g,y]=n.useState(!1),[M,f]=n.useState(""),[C,S]=n.useState(null),[oe,j]=n.useState(!1),[x,Q]=n.useState(""),[_,ce]=n.useState("usdt"),[N,de]=n.useState(null),[k,ie]=n.useState(!1),[J,me]=n.useState([]),[ue,V]=n.useState(!1);r!=null&&r.enable_topup,r==null||r.topup_config;const P=n.useCallback(async()=>{var t;R(!0);try{const[a,o]=await Promise.all([Te(),r!=null&&r.enable_topup?Oe().catch(()=>null):Promise.resolve(null)]);a.data.success&&se(a.data.data),(t=o==null?void 0:o.data)!=null&&t.data&&ae(o.data.data)}catch{}R(!1)},[r==null?void 0:r.enable_topup]);n.useEffect(()=>{P()},[P]);const G=(u==null?void 0:u.quota)??(m==null?void 0:m.quota)??0,pe=(u==null?void 0:u.used_quota)??(m==null?void 0:m.used_quota)??0,xe=(u==null?void 0:u.request_count)??(m==null?void 0:m.request_count)??0,he=G/te,be=async t=>{if(t.preventDefault(),!!$.trim()){F(!0);try{(await Me($.trim())).data.success&&(i.success(s("topup.redeemSuccess")),U(""),await Promise.all([P(),H()]))}catch{}F(!1)}},K=async t=>{if(!t||t<=0){B(null);return}W(!0);try{const a=await Ee({amount:parseInt(t)});a.data.message==="success"&&B(a.data.data)}catch{}W(!1)},ge=t=>{O(t),T(t),K(t)},ye=t=>["stripe","alipay","wxpay"].includes(t)&&!t.startsWith("epay_"),fe=async t=>{var o;const a=parseInt(b);if(!a||a<=0){i.error(s("topup.enterAmount"));return}y(!0),f(t);try{const p={amount:a,payment_method:t};if(ye(t)){const c=await Le(p);if(c.data.message==="success"&&((o=c.data.data)!=null&&o.pay_link))window.open(c.data.data.pay_link,"_blank");else if(c.data.message!=="success"){const d=typeof c.data.data=="string"?c.data.data:c.data.message;i.error(d||s("common.requestFailed"))}}else{const c=await He(p);if(c.data.message==="success"){const d=c.data.data,I=c.data.url;if(I&&d){const h=document.createElement("form");h.action=I,h.method="POST",navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")<1||(h.target="_blank");for(const ee in d){const q=document.createElement("input");q.type="hidden",q.name=ee,q.value=d[ee],h.appendChild(q)}document.body.appendChild(h),h.submit(),document.body.removeChild(h)}}else{const d=typeof c.data.data=="string"?c.data.data:c.data.message;i.error(d||s("common.requestFailed"))}}}catch{}y(!1),f("")},je=async t=>{var a;y(!0),f("creem");try{const o=await Re({product_id:t.productId,payment_method:"creem"});if(o.data.message==="success"&&((a=o.data.data)!=null&&a.checkout_url))window.open(o.data.data.checkout_url,"_blank");else if(o.data.message!=="success"){const p=typeof o.data.data=="string"?o.data.data:o.data.message;i.error(p||s("common.requestFailed"))}}catch{}y(!1),f("")},Ne=async()=>{const t=parseInt(b);if(!t||t<=0){i.error(s("topup.enterAmount"));return}if(!x){i.error(s("topup.selectChain"));return}if(!_){i.error(s("topup.selectToken"));return}y(!0),f("crypto");try{const a=await Ue({amount:t,chain:x,token:_});if(a.data.message==="success"&&a.data.data)S(a.data.data),we(a.data.data.trade_no);else if(a.data.message!=="success"){const o=typeof a.data.data=="string"?a.data.data:a.data.message;i.error(o||s("common.requestFailed"))}}catch{}y(!1),f("")},we=t=>{j(!0);const a=setInterval(async()=>{var p,c;try{const d=await De(t);((p=d.data.data)==null?void 0:p.status)==="success"?(clearInterval(a),j(!1),S(null),i.success(s("topup.paymentSuccess")),await Promise.all([P(),H()])):((c=d.data.data)==null?void 0:c.status)==="expired"&&(clearInterval(a),j(!1),i.error(s("topup.orderExpired")))}catch{clearInterval(a),j(!1)}},5e3),o=((l==null?void 0:l.crypto_expiry_minutes)||30)*60*1e3;setTimeout(()=>{clearInterval(a),j(!1)},o)},w=(l==null?void 0:l.crypto_wallets)||{},v=n.useMemo(()=>{const t=[];return w.tron&&t.push({key:"tron",label:"TRON (TRC20)"}),w.eth&&t.push({key:"eth",label:"Ethereum (ERC20)"}),w.bsc&&t.push({key:"bsc",label:"BSC (BEP20)"}),t},[w.tron,w.eth,w.bsc]);n.useEffect(()=>{v.length>0&&!x&&Q(v[0].key)},[v,x]);const X=n.useMemo(()=>{if(!(l!=null&&l.creem_products))return[];try{const t=typeof l.creem_products=="string"?JSON.parse(l.creem_products):l.creem_products;return Array.isArray(t)?t:[]}catch{return[]}},[l==null?void 0:l.creem_products]),ve=async()=>{var t;V(!0);try{const a=await Fe({page:1,page_size:20});(t=a.data.data)!=null&&t.items&&me(a.data.data.items)}catch{}V(!1)},Ce=(l==null?void 0:l.amount_options)||[1,5,10,20,50,100],A=(l==null?void 0:l.min_topup)||1,Se=(l==null?void 0:l.pay_methods)||[],_e=l==null?void 0:l.enable_online_topup,ke=l==null?void 0:l.enable_stripe_topup,Pe=l==null?void 0:l.enable_creem_topup,Ae=l==null?void 0:l.enable_crypto_topup,Y=Se.filter(t=>t.type!=="creem"&&t.type!=="crypto");return le?e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-white mb-1",children:s("topup.title")}),e.jsx("p",{className:"text-sm text-neutral-400",children:s("topup.subtitle")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[e.jsxs(E,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(34,197,94,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.balance")}),e.jsxs("div",{className:"text-3xl font-bold text-white",children:["$",e.jsx(L,{from:0,to:he,duration:1.5})]}),e.jsx("p",{className:"text-xs text-neutral-500 mt-1",children:s("dashboard.quotaUnits",{count:G.toLocaleString()})})]}),e.jsxs(E,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(129,140,248,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.used")}),e.jsxs("div",{className:"text-3xl font-bold text-white",children:["$",e.jsx(L,{from:0,to:pe/te,duration:1.5})]})]}),e.jsxs(E,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(244,114,182,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:s("dashboard.totalRequests")}),e.jsx("div",{className:"text-3xl font-bold text-white",children:e.jsx(L,{from:0,to:xe,duration:1.5})})]})]}),(r==null?void 0:r.enable_topup)&&(_e||ke)&&Y.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white",children:s("topup.onlineTopup")}),e.jsx("button",{onClick:()=>{ie(!k),k||ve()},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:s(k?"topup.hideHistory":"topup.viewHistory")})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-3",children:s("topup.selectAmount")}),e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:Ce.map(t=>e.jsxs("button",{onClick:()=>ge(t),className:`py-2.5 px-3 rounded-xl text-sm font-medium transition-all ${ne===t?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-neutral-300 hover:text-white hover:bg-white/[0.08]"}`,children:["$",t]},t))})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-2",children:s("topup.customAmount")}),e.jsx("div",{className:"flex gap-3",children:e.jsx("input",{type:"number",value:b,onChange:t=>{T(t.target.value),O(null)},onBlur:t=>K(t.target.value),min:A,placeholder:s("topup.amountPlaceholder",{min:A}),className:"input flex-1"})}),re?e.jsx("p",{className:"text-xs text-neutral-500 mt-2",children:s("topup.calculating")}):z?e.jsxs("p",{className:"text-xs text-neutral-400 mt-2",children:[s("topup.payAmountLabel"),": ",e.jsxs("span",{className:"text-green-400 font-medium",children:["$",z]})]}):null]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-3",children:s("topup.paymentMethod")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Y.map(t=>{const a=g&&M===t.type;return e.jsx("button",{onClick:()=>fe(t.type),disabled:g||!b,className:"px-4 py-2.5 rounded-xl text-sm font-medium glass-sm text-neutral-300 hover:text-white hover:bg-white/[0.08] disabled:opacity-40 disabled:cursor-not-allowed transition-all",children:a?s("topup.processing"):t.name},t.type)})})]})]}),(r==null?void 0:r.enable_topup)&&Pe&&X.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("topup.creemPayment")||"Creem Payment"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:X.map(t=>e.jsxs("div",{className:`glass-sm rounded-xl p-4 cursor-pointer transition-all ${(N==null?void 0:N.productId)===t.productId?"ring-2 ring-brand-500 bg-brand-500/10":"hover:bg-white/[0.06]"}`,onClick:()=>de(t),children:[e.jsx("h3",{className:"text-sm font-semibold text-white mb-1",children:t.name}),e.jsxs("p",{className:"text-xl font-bold text-green-400 mb-1",children:["$",t.price," ",e.jsx("span",{className:"text-xs text-neutral-500 font-normal",children:t.currency||"USD"})]}),t.quota&&e.jsx("p",{className:"text-xs text-neutral-400",children:s("topup.quotaIncluded")||`${t.quota} quota`})]},t.productId))}),N&&e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx("button",{onClick:()=>je(N),disabled:g,className:"btn-primary px-6",children:g&&M==="creem"?s("topup.processing"):`${s("topup.payNow")||"Pay"} $${N.price}`})})]}),(r==null?void 0:r.enable_topup)&&Ae&&v.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("topup.cryptoPayment")}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-2",children:s("topup.amount")}),e.jsx("input",{type:"number",value:b,onChange:t=>{T(t.target.value),O(null)},min:A,placeholder:s("topup.amountPlaceholder",{min:A}),className:"input w-full"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-2",children:s("topup.chain")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:v.map(t=>e.jsx("button",{onClick:()=>Q(t.key),className:`px-4 py-2 rounded-xl text-sm font-medium transition-all ${x===t.key?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-neutral-300 hover:text-white hover:bg-white/[0.08]"}`,children:t.label},t.key))})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-neutral-300 mb-2",children:s("topup.token")||"Token"}),e.jsx("div",{className:"flex gap-2",children:["usdt","usdc"].map(t=>e.jsx("button",{onClick:()=>ce(t),className:`px-4 py-2 rounded-xl text-sm font-medium transition-all ${_===t?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-neutral-300 hover:text-white hover:bg-white/[0.08]"}`,children:t.toUpperCase()},t))})]}),e.jsx("button",{onClick:Ne,disabled:g||!b,className:"btn-primary w-full",children:g&&M==="crypto"?s("topup.processing"):`${s("topup.payWith")||"Pay with"} ${_.toUpperCase()} (${((Z=v.find(t=>t.key===x))==null?void 0:Z.label)||x})`})]}),C&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:()=>S(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 max-w-md w-full mx-4",onClick:t=>t.stopPropagation(),children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:s("topup.cryptoPayment")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"glass-sm rounded-xl p-4",children:[e.jsx("p",{className:"text-xs text-neutral-400 mb-1",children:s("topup.walletAddress")}),e.jsx("p",{className:"text-sm text-white font-mono break-all",children:C.wallet})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"glass-sm rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-neutral-400 mb-1",children:s("topup.amount")}),e.jsxs("p",{className:"text-sm text-white font-medium",children:[C.amount," ",C.token]})]}),e.jsxs("div",{className:"glass-sm rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-neutral-400 mb-1",children:s("topup.chain")}),e.jsx("p",{className:"text-sm text-white font-medium",children:C.chain})]})]}),oe&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral-400",children:[e.jsx("div",{className:"w-4 h-4 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"}),s("topup.waitingPayment")]}),e.jsx("button",{onClick:()=>{S(null),j(!1)},className:"w-full py-2 rounded-xl text-sm glass-sm text-neutral-400 hover:text-white transition-colors",children:s("topup.close")})]})]})}),k&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("topup.history")}),ue?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx("div",{className:"w-6 h-6 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):J.length===0?e.jsx("p",{className:"text-sm text-neutral-500 text-center py-8",children:s("topup.noHistory")}):e.jsx("div",{className:"space-y-2",children:J.map((t,a)=>e.jsxs("div",{className:"flex items-center justify-between glass-sm rounded-xl px-4 py-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-white",children:["$",t.amount]}),e.jsxs("p",{className:"text-xs text-neutral-500",children:[new Date(t.create_time*1e3).toLocaleString()," · ",t.payment_method||s("topup.redeemCode")]})]}),e.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${t.status==="success"?"bg-green-500/10 text-green-400":t.status==="pending"?"bg-yellow-500/10 text-yellow-400":"bg-red-500/10 text-red-400"}`,children:t.status==="success"?s("topup.statusSuccess"):t.status==="pending"?s("topup.statusPending"):s("topup.statusFailed")})]},a))})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:s("topup.redeemTitle")}),e.jsxs("form",{onSubmit:be,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:$,onChange:t=>U(t.target.value),className:"input flex-1",placeholder:s("topup.enterRedeemCode")}),e.jsx("button",{type:"submit",disabled:D,className:"btn-primary whitespace-nowrap",children:s(D?"topup.redeeming":"topup.redeem")})]})]})]})}export{Ge as default}; diff --git a/dist/assets/index-BSnGsuja.js b/dist/assets/index-sl7kA1zY.js similarity index 99% rename from dist/assets/index-BSnGsuja.js rename to dist/assets/index-sl7kA1zY.js index 813a9c8..50e4f82 100644 --- a/dist/assets/index-BSnGsuja.js +++ b/dist/assets/index-sl7kA1zY.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-Csp4uo9R.js","assets/CountUp-CaPcnNrA.js","assets/use-animation-frame-D5p6ytsV.js","assets/proxy-BY9NCDQu.js","assets/SpotlightCard-DMZC3L4x.js","assets/useTranslation-fJCRxooE.js","assets/Layout-C6Q_gq9r.js","assets/LanguageSwitch-DeIkkoRt.js","assets/Home-Cv07XbCn.js","assets/Mesh-CwXV3WjE.js","assets/Layout-Dodll0ro.js","assets/Home-CxIhmRKX.js","assets/Layout-fYc3mUH3.js","assets/Home-CfWfC9v3.js","assets/Layout-NOPO9qLh.js","assets/Login-Berd1yuq.js","assets/Register-BKTNrtKR.js","assets/Dashboard-zYeILO9k.js","assets/Tokens-S0Le-8_B.js","assets/Packages-IQuzFQIK.js","assets/Pricing-DP7ci81X.js","assets/Topup-CUjaIN3g.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-DYyowgIk.js","assets/CountUp-4XjqJEhr.js","assets/use-animation-frame-BTHnf9ip.js","assets/proxy-Cyyan-lb.js","assets/SpotlightCard-dMmfK1cV.js","assets/useTranslation-D01I4oIt.js","assets/Layout-DIJS7qvD.js","assets/LanguageSwitch-gMrnCdQj.js","assets/Home-DKZDwMrJ.js","assets/Mesh-CwXV3WjE.js","assets/Layout-D55ZbQpE.js","assets/Home-kTjmvjO3.js","assets/Layout-CAMk7KVY.js","assets/Home-BiUxfnQ8.js","assets/Layout-B5KtCqeF.js","assets/Login-B7cfRnlm.js","assets/Register-C7amt8Qy.js","assets/Dashboard-BywtYNhH.js","assets/Tokens-CzQLqzGA.js","assets/Packages-CG2LwjwE.js","assets/Pricing-Do1DTRG_.js","assets/Topup-Bl3onU8Y.js"])))=>i.map(i=>d[i]); function Vp(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Hp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ic={exports:{}},go={},Dc={exports:{}},z={};/** * @license React * react.production.min.js @@ -246,4 +246,4 @@ to { `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[rc]=this[rc]={accessors:{}}).accessors,i=this.prototype;function o(s){const l=lr(s);r[l]||(x0(i,s),r[l]=!0)}return S.isArray(t)?t.forEach(o):o(t),this}};Ie.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);S.reduceDescriptors(Ie.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});S.freezeMethods(Ie);function ys(e,t){const n=this||ei,r=t||n,i=Ie.from(r.headers);let o=r.data;return S.forEach(e,function(l){o=l.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function Ep(e){return!!(e&&e.__CANCEL__)}let ti=class extends A{constructor(t,n,r){super(t??"canceled",A.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function Cp(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new A("Request failed with status code "+n.status,[A.ERR_BAD_REQUEST,A.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function E0(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function C0(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(a){const u=Date.now(),c=r[o];s||(s=u),n[i]=a,r[i]=u;let f=o,p=0;for(;f!==i;)p+=n[f++],f=f%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),u-s{n=c,i=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const c=Date.now(),f=c-n;f>=r?s(u,c):(i=u,o||(o=setTimeout(()=>{o=null,s(i)},r-f)))},()=>i&&s(i)]}const fo=(e,t,n=3)=>{let r=0;const i=C0(50,250);return P0(o=>{const s=o.loaded,l=o.lengthComputable?o.total:void 0,a=s-r,u=i(a),c=s<=l;r=s;const f={loaded:s,total:l,progress:l?s/l:void 0,bytes:a,rate:u||void 0,estimated:u&&l&&c?(l-s)/u:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},ic=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},oc=e=>(...t)=>S.asap(()=>e(...t)),O0=ye.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,R0=ye.hasStandardBrowserEnv?{write(e,t,n,r,i,o,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),S.isString(r)&&l.push(`path=${r}`),S.isString(i)&&l.push(`domain=${i}`),o===!0&&l.push("secure"),S.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function _0(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function L0(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Pp(e,t,n){let r=!_0(t);return e&&(r||n==!1)?L0(e,t):t}const sc=e=>e instanceof Ie?{...e}:e;function hn(e,t){t=t||{};const n={};function r(u,c,f,p){return S.isPlainObject(u)&&S.isPlainObject(c)?S.merge.call({caseless:p},u,c):S.isPlainObject(c)?S.merge({},c):S.isArray(c)?c.slice():c}function i(u,c,f,p){if(S.isUndefined(c)){if(!S.isUndefined(u))return r(void 0,u,f,p)}else return r(u,c,f,p)}function o(u,c){if(!S.isUndefined(c))return r(void 0,c)}function s(u,c){if(S.isUndefined(c)){if(!S.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function l(u,c,f){if(f in t)return r(u,c);if(f in e)return r(void 0,u)}const a={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(u,c,f)=>i(sc(u),sc(c),f,!0)};return S.forEach(Object.keys({...e,...t}),function(c){if(c==="__proto__"||c==="constructor"||c==="prototype")return;const f=S.hasOwnProp(a,c)?a[c]:i,p=f(e[c],t[c],c);S.isUndefined(p)&&f!==l||(n[c]=p)}),n}const Op=e=>{const t=hn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:l}=t;if(t.headers=s=Ie.from(s),t.url=kp(Pp(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(n)){if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(S.isFunction(n.getHeaders)){const a=n.getHeaders(),u=["content-type","content-length"];Object.entries(a).forEach(([c,f])=>{u.includes(c.toLowerCase())&&s.set(c,f)})}}if(ye.hasStandardBrowserEnv&&(r&&S.isFunction(r)&&(r=r(t)),r||r!==!1&&O0(t.url))){const a=i&&o&&R0.read(o);a&&s.set(i,a)}return t},T0=typeof XMLHttpRequest<"u",N0=T0&&function(e){return new Promise(function(n,r){const i=Op(e);let o=i.data;const s=Ie.from(i.headers).normalize();let{responseType:l,onUploadProgress:a,onDownloadProgress:u}=i,c,f,p,y,d;function v(){y&&y(),d&&d(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let w=new XMLHttpRequest;w.open(i.method.toUpperCase(),i.url,!0),w.timeout=i.timeout;function m(){if(!w)return;const g=Ie.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),E={data:!l||l==="text"||l==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:g,config:e,request:w};Cp(function(P){n(P),v()},function(P){r(P),v()},E),w=null}"onloadend"in w?w.onloadend=m:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(m)},w.onabort=function(){w&&(r(new A("Request aborted",A.ECONNABORTED,e,w)),w=null)},w.onerror=function(k){const E=k&&k.message?k.message:"Network Error",R=new A(E,A.ERR_NETWORK,e,w);R.event=k||null,r(R),w=null},w.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const E=i.transitional||La;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),r(new A(k,E.clarifyTimeoutError?A.ETIMEDOUT:A.ECONNABORTED,e,w)),w=null},o===void 0&&s.setContentType(null),"setRequestHeader"in w&&S.forEach(s.toJSON(),function(k,E){w.setRequestHeader(E,k)}),S.isUndefined(i.withCredentials)||(w.withCredentials=!!i.withCredentials),l&&l!=="json"&&(w.responseType=i.responseType),u&&([p,d]=fo(u,!0),w.addEventListener("progress",p)),a&&w.upload&&([f,y]=fo(a),w.upload.addEventListener("progress",f),w.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(c=g=>{w&&(r(!g||g.type?new ti(null,e,w):g),w.abort(),w=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const h=E0(i.url);if(h&&ye.protocols.indexOf(h)===-1){r(new A("Unsupported protocol "+h+":",A.ERR_BAD_REQUEST,e));return}w.send(o||null)})},A0=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(u){if(!i){i=!0,l();const c=u instanceof Error?u:this.reason;r.abort(c instanceof A?c:new ti(c instanceof Error?c.message:c))}};let s=t&&setTimeout(()=>{s=null,o(new A(`timeout of ${t}ms exceeded`,A.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>S.asap(l),a}},I0=function*(e,t){let n=e.byteLength;if(n{const i=D0(e,t);let o=0,s,l=a=>{s||(s=!0,r&&r(a))};return new ReadableStream({async pull(a){try{const{done:u,value:c}=await i.next();if(u){l(),a.close();return}let f=c.byteLength;if(n){let p=o+=f;n(p)}a.enqueue(new Uint8Array(c))}catch(u){throw l(u),u}},cancel(a){return l(a),i.return()}},{highWaterMark:2})},ac=64*1024,{isFunction:ki}=S,j0=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:uc,TextEncoder:cc}=S.global,fc=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$0=e=>{e=S.merge.call({skipUndefined:!0},j0,e);const{fetch:t,Request:n,Response:r}=e,i=t?ki(t):typeof fetch=="function",o=ki(n),s=ki(r);if(!i)return!1;const l=i&&ki(uc),a=i&&(typeof cc=="function"?(d=>v=>d.encode(v))(new cc):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=o&&l&&fc(()=>{let d=!1;const v=new n(ye.origin,{body:new uc,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!v}),c=s&&l&&fc(()=>S.isReadableStream(new r("").body)),f={stream:c&&(d=>d.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!f[d]&&(f[d]=(v,w)=>{let m=v&&v[d];if(m)return m.call(v);throw new A(`Response type '${d}' is not supported`,A.ERR_NOT_SUPPORT,w)})});const p=async d=>{if(d==null)return 0;if(S.isBlob(d))return d.size;if(S.isSpecCompliantForm(d))return(await new n(ye.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(S.isArrayBufferView(d)||S.isArrayBuffer(d))return d.byteLength;if(S.isURLSearchParams(d)&&(d=d+""),S.isString(d))return(await a(d)).byteLength},y=async(d,v)=>{const w=S.toFiniteNumber(d.getContentLength());return w??p(v)};return async d=>{let{url:v,method:w,data:m,signal:h,cancelToken:g,timeout:k,onDownloadProgress:E,onUploadProgress:R,responseType:P,headers:L,withCredentials:$="same-origin",fetchOptions:T}=Op(d),de=t||fetch;P=P?(P+"").toLowerCase():"text";let Me=A0([h,g&&g.toAbortSignal()],k),V=null;const X=Me&&Me.unsubscribe&&(()=>{Me.unsubscribe()});let Yt;try{if(R&&u&&w!=="get"&&w!=="head"&&(Yt=await y(L,m))!==0){let F=new n(v,{method:"POST",body:m,duplex:"half"}),U;if(S.isFormData(m)&&(U=F.headers.get("content-type"))&&L.setContentType(U),F.body){const[Oe,we]=ic(Yt,fo(oc(R)));m=lc(F.body,ac,Oe,we)}}S.isString($)||($=$?"include":"omit");const B=o&&"credentials"in n.prototype,pe={...T,signal:Me,method:w.toUpperCase(),headers:L.normalize().toJSON(),body:m,duplex:"half",credentials:B?$:void 0};V=o&&new n(v,pe);let O=await(o?de(V,T):de(v,pe));const N=c&&(P==="stream"||P==="response");if(c&&(E||N&&X)){const F={};["status","statusText","headers"].forEach(ft=>{F[ft]=O[ft]});const U=S.toFiniteNumber(O.headers.get("content-length")),[Oe,we]=E&&ic(U,fo(oc(E),!0))||[];O=new r(lc(O.body,ac,Oe,()=>{we&&we(),X&&X()}),F)}P=P||"text";let j=await f[S.findKey(f,P)||"text"](O,d);return!N&&X&&X(),await new Promise((F,U)=>{Cp(F,U,{data:j,headers:Ie.from(O.headers),status:O.status,statusText:O.statusText,config:d,request:V})})}catch(B){throw X&&X(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new A("Network Error",A.ERR_NETWORK,d,V,B&&B.response),{cause:B.cause||B}):A.from(B,B&&B.code,d,V,B&&B.response)}}},z0=new Map,Rp=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let s=o.length,l=s,a,u,c=z0;for(;l--;)a=o[l],u=c.get(a),u===void 0&&c.set(a,u=l?new Map:$0(t)),c=u;return u};Rp();const Na={http:t0,xhr:N0,fetch:{get:Rp}};S.forEach(Na,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const dc=e=>`- ${e}`,U0=e=>S.isFunction(e)||e===null||e===!1;function M0(e,t){e=S.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let s=0;s`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=n?s.length>1?`since : `+s.map(dc).join(` `):" "+dc(s[0]):"as no adapter specified";throw new A("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return i}const _p={getAdapter:M0,adapters:Na};function vs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ti(null,e)}function pc(e){return vs(e),e.headers=Ie.from(e.headers),e.data=ys.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),_p.getAdapter(e.adapter||ei.adapter,e)(e).then(function(r){return vs(e),r.data=ys.call(e,e.transformResponse,r),r.headers=Ie.from(r.headers),r},function(r){return Ep(r)||(vs(e),r&&r.response&&(r.response.data=ys.call(e,e.transformResponse,r.response),r.response.headers=Ie.from(r.response.headers))),Promise.reject(r)})}const Lp="1.13.6",Uo={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Uo[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const hc={};Uo.transitional=function(t,n,r){function i(o,s){return"[Axios v"+Lp+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,l)=>{if(t===!1)throw new A(i(s," has been removed"+(n?" in "+n:"")),A.ERR_DEPRECATED);return n&&!hc[s]&&(hc[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,l):!0}};Uo.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function B0(e,t,n){if(typeof e!="object")throw new A("options must be an object",A.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const l=e[o],a=l===void 0||s(l,o,e);if(a!==!0)throw new A("option "+o+" must be "+a,A.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new A("Unknown option "+o,A.ERR_BAD_OPTION)}}const zi={assertOptions:B0,validators:Uo},Be=zi.validators;let an=class{constructor(t){this.defaults=t||{},this.interceptors={request:new nc,response:new nc}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=hn(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&zi.assertOptions(r,{silentJSONParsing:Be.transitional(Be.boolean),forcedJSONParsing:Be.transitional(Be.boolean),clarifyTimeoutError:Be.transitional(Be.boolean),legacyInterceptorReqResOrdering:Be.transitional(Be.boolean)},!1),i!=null&&(S.isFunction(i)?n.paramsSerializer={serialize:i}:zi.assertOptions(i,{encode:Be.function,serialize:Be.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),zi.assertOptions(n,{baseUrl:Be.spelling("baseURL"),withXsrfToken:Be.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&S.merge(o.common,o[n.method]);o&&S.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=Ie.concat(s,o);const l=[];let a=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;a=a&&v.synchronous;const w=n.transitional||La;w&&w.legacyInterceptorReqResOrdering?l.unshift(v.fulfilled,v.rejected):l.push(v.fulfilled,v.rejected)});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,f=0,p;if(!a){const d=[pc.bind(this),void 0];for(d.unshift(...l),d.push(...u),p=d.length,c=Promise.resolve(n);f{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(l=>{r.subscribe(l),o=l}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,l){r.reason||(r.reason=new ti(o,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Tp(function(i){t=i}),cancel:t}}};function V0(e){return function(n){return e.apply(null,n)}}function H0(e){return S.isObject(e)&&e.isAxiosError===!0}const Cl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Cl).forEach(([e,t])=>{Cl[t]=e});function Np(e){const t=new an(e),n=cp(an.prototype.request,t);return S.extend(n,an.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Np(hn(e,i))},n}const ne=Np(ei);ne.Axios=an;ne.CanceledError=ti;ne.CancelToken=b0;ne.isCancel=Ep;ne.VERSION=Lp;ne.toFormData=zo;ne.AxiosError=A;ne.Cancel=ne.CanceledError;ne.all=function(t){return Promise.all(t)};ne.spread=V0;ne.isAxiosError=H0;ne.mergeConfig=hn;ne.AxiosHeaders=Ie;ne.formToJSON=e=>xp(S.isHTMLForm(e)?new FormData(e):e);ne.getAdapter=_p.getAdapter;ne.HttpStatusCode=Cl;ne.default=ne;const{Axios:dw,AxiosError:pw,CanceledError:hw,isCancel:mw,CancelToken:gw,VERSION:yw,all:vw,Cancel:ww,isAxiosError:Sw,spread:kw,toFormData:xw,AxiosHeaders:Ew,HttpStatusCode:Cw,formToJSON:Pw,getAdapter:Ow,mergeConfig:Rw}=ne,_w=5e5,q=ne.create({baseURL:"",timeout:3e4,withCredentials:!0,headers:{"Content-Type":"application/json"}});q.interceptors.request.use(e=>{const t=localStorage.getItem("dist_user_id");return t&&(e.headers["New-Api-User"]=t),e});q.interceptors.response.use(e=>(e.data&&e.data.success===!1&&e.data.message&&hs.error(e.data.message),e),e=>{var n,r,i;const t=((r=(n=e.response)==null?void 0:n.data)==null?void 0:r.message)||e.message||"Request failed";return((i=e.response)==null?void 0:i.status)===401?(localStorage.removeItem("dist_user_id"),window.dispatchEvent(new Event("auth:logout")),hs.error("Session expired, please log in again")):hs.error(t),Promise.reject(e)});const W0=()=>q.get("/api/dist/site/info"),Lw=()=>q.get("/api/dist/site/models"),Tw=()=>q.get("/api/dist/site/packages"),K0=e=>q.post("/api/dist/user/register",e),Q0=e=>q.post("/api/dist/user/login",e),q0=()=>q.post("/api/dist/user/logout"),ws=()=>q.get("/api/dist/user/self"),Nw=()=>q.get("/api/dist/user/usage"),Aw=()=>q.get("/api/dist/token/list"),Iw=e=>q.post("/api/dist/token/create",e),Dw=(e,t)=>q.put(`/api/dist/token/${e}`,t),Fw=e=>q.delete(`/api/dist/token/${e}`),jw=e=>q.post("/api/dist/topup/redeem",{key:e}),$w=e=>q.post("/api/dist/package/subscribe",{package_id:e}),zw=()=>q.get("/api/dist/topup/info"),Uw=e=>q.post("/api/dist/topup/amount",e),Mw=e=>q.post("/api/dist/topup/pay",e),Bw=e=>q.post("/api/dist/topup/stripe/pay",e),bw=e=>q.post("/api/dist/topup/creem/pay",e),Vw=e=>q.post("/api/dist/topup/crypto/pay",e),Hw=e=>q.get(`/api/dist/topup/crypto/status?trade_no=${e}`),Ww=e=>q.get("/api/dist/topup/history",{params:e}),Ap=x.createContext(null);function J0({children:e}){const[t,n]=x.useState(null),[r,i]=x.useState(!0),o=x.useCallback(async()=>{try{const u=await ws();if(u.data.success)return n(u.data.data),u.data.data}catch{}return null},[]);x.useEffect(()=>{localStorage.getItem("dist_user_id")?ws().then(c=>{c.data.success?n(c.data.data):localStorage.removeItem("dist_user_id")}).catch(()=>{localStorage.removeItem("dist_user_id")}).finally(()=>i(!1)):i(!1)},[]),x.useEffect(()=>{const u=()=>{n(null)};return window.addEventListener("auth:logout",u),()=>window.removeEventListener("auth:logout",u)},[]);const s=x.useCallback(async(u,c)=>{const f=await Q0({username:u,password:c});if(f.data.success){const p=f.data.data;p!=null&&p.id&&localStorage.setItem("dist_user_id",String(p.id));const y=await ws();return y.data.success?n(y.data.data):n(p),{success:!0}}return{success:!1,message:f.data.message}},[]),l=x.useCallback(async u=>{const c=await K0(u);return c.data.success?{success:!0,needsLogin:!0}:{success:!1,message:c.data.message}},[]),a=x.useCallback(async()=>{try{await q0()}catch{}localStorage.removeItem("dist_user_id"),n(null)},[]);return I.jsx(Ap.Provider,{value:{user:t,loading:r,login:s,register:l,logout:a,refreshUser:o},children:e})}function Y0(){const e=x.useContext(Ap);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function G0(){const{user:e,loading:t}=Y0(),n=Gn();return t?I.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:I.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e?I.jsx(cy,{}):I.jsx(np,{to:"/login",state:{from:n},replace:!0})}const Ip=x.createContext(null);function X0({children:e}){const[t,n]=x.useState(null),[r,i]=x.useState(!0);return x.useEffect(()=>{W0().then(o=>{var s,l;if(o.data.success&&(n(o.data.data),(s=o.data.data)!=null&&s.name&&(document.title=o.data.data.name),(l=o.data.data)!=null&&l.favicon)){const a=document.querySelector("link[rel~='icon']")||document.createElement("link");a.rel="icon",a.href=o.data.data.favicon,document.head.appendChild(a)}}).catch(()=>{}).finally(()=>i(!1))},[]),I.jsx(Ip.Provider,{value:{site:t,loading:r},children:e})}function Z0(){const e=x.useContext(Ip);if(!e)throw new Error("useSite must be used within SiteProvider");return e}const Dp=x.createContext(null),mc={starter:{Home:it.lazy(()=>ke(()=>import("./Home-Csp4uo9R.js"),__vite__mapDeps([0,1,2,3,4,5]))),Layout:it.lazy(()=>ke(()=>import("./Layout-C6Q_gq9r.js"),__vite__mapDeps([6,7,5])))},default:{Home:it.lazy(()=>ke(()=>import("./Home-Cv07XbCn.js"),__vite__mapDeps([8,9,3,1,4,5]))),Layout:it.lazy(()=>ke(()=>import("./Layout-Dodll0ro.js"),__vite__mapDeps([10,7,5])))},dark:{Home:it.lazy(()=>ke(()=>import("./Home-CxIhmRKX.js"),__vite__mapDeps([11,9,3,1,5]))),Layout:it.lazy(()=>ke(()=>import("./Layout-fYc3mUH3.js"),__vite__mapDeps([12,7,5])))},minimal:{Home:it.lazy(()=>ke(()=>import("./Home-CfWfC9v3.js"),__vite__mapDeps([13,1,5]))),Layout:it.lazy(()=>ke(()=>import("./Layout-NOPO9qLh.js"),__vite__mapDeps([14,7,5])))}};function e1(){return I.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-950",children:I.jsx("div",{className:"w-8 h-8 border-2 border-white/20 border-t-white/70 rounded-full animate-spin"})})}function t1({children:e}){const{site:t,loading:n}=Z0();if(n)return I.jsx(e1,{});const r=(t==null?void 0:t.theme_template)||"starter";return I.jsx(n1,{themeName:r,children:e})}function n1({themeName:e,children:t}){const n=x.useMemo(()=>{const r=mc[e]||mc.starter;return{name:e,...r}},[e]);return I.jsx(Dp.Provider,{value:n,children:t})}function r1(){const e=x.useContext(Dp);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const i1=x.lazy(()=>ke(()=>import("./Login-Berd1yuq.js"),__vite__mapDeps([15,5]))),o1=x.lazy(()=>ke(()=>import("./Register-BKTNrtKR.js"),__vite__mapDeps([16,5]))),s1=x.lazy(()=>ke(()=>import("./Dashboard-zYeILO9k.js"),__vite__mapDeps([17,4,1,3,2,5]))),l1=x.lazy(()=>ke(()=>import("./Tokens-S0Le-8_B.js"),__vite__mapDeps([18,5]))),a1=x.lazy(()=>ke(()=>import("./Packages-IQuzFQIK.js"),__vite__mapDeps([19,4,5]))),u1=x.lazy(()=>ke(()=>import("./Pricing-DP7ci81X.js"),__vite__mapDeps([20,5]))),c1=x.lazy(()=>ke(()=>import("./Topup-CUjaIN3g.js"),__vite__mapDeps([21,4,1,5]))),f1=()=>I.jsx("div",{className:"flex items-center justify-center min-h-screen",children:I.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})});function d1(){const{Home:e,Layout:t}=r1();return I.jsx(x.Suspense,{fallback:I.jsx(f1,{}),children:I.jsxs(dy,{children:[I.jsxs(be,{element:I.jsx(t,{}),children:[I.jsx(be,{path:"/",element:I.jsx(e,{})}),I.jsx(be,{path:"/pricing",element:I.jsx(u1,{})}),I.jsx(be,{path:"/packages",element:I.jsx(a1,{})}),I.jsx(be,{path:"/login",element:I.jsx(i1,{})}),I.jsx(be,{path:"/register",element:I.jsx(o1,{})}),I.jsxs(be,{element:I.jsx(G0,{}),children:[I.jsx(be,{path:"/dashboard",element:I.jsx(s1,{})}),I.jsx(be,{path:"/tokens",element:I.jsx(l1,{})}),I.jsx(be,{path:"/topup",element:I.jsx(c1,{})})]})]}),I.jsx(be,{path:"*",element:I.jsx(np,{to:"/",replace:!0})})]})})}function p1(){return I.jsx(t1,{children:I.jsx(d1,{})})}const D=e=>typeof e=="string",ar=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},gc=e=>e==null?"":""+e,h1=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},m1=/###/g,yc=e=>e&&e.indexOf("###")>-1?e.replace(m1,"."):e,vc=e=>!e||D(e),xr=(e,t,n)=>{const r=D(t)?t.split("."):t;let i=0;for(;i{const{obj:r,k:i}=xr(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],s=t.slice(0,t.length-1),l=xr(e,s,Object);for(;l.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),l=xr(e,s,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${o}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=n},g1=(e,t,n,r)=>{const{obj:i,k:o}=xr(e,t,Object);i[o]=i[o]||[],i[o].push(n)},po=(e,t)=>{const{obj:n,k:r}=xr(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},y1=(e,t,n)=>{const r=po(e,n);return r!==void 0?r:po(t,n)},Fp=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?D(e[r])||e[r]instanceof String||D(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Fp(e[r],t[r],n):e[r]=t[r]);return e},Xt=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var v1={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const w1=e=>D(e)?e.replace(/[&<>"'\/]/g,t=>v1[t]):e;class S1{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const k1=[" ",",","?","!",";"],x1=new S1(20),E1=(e,t,n)=>{t=t||"",n=n||"";const r=k1.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const i=x1.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(e);if(!o){const s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o},Pl=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o-1&&ae==null?void 0:e.replace(/_/g,"-"),C1={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class ho{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||C1,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(D(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new ho(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new ho(this.logger,t)}}var at=new ho;class Mo{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,o])=>{for(let s=0;s{for(let s=0;s-1&&this.options.ns.splice(n,1)}getResource(t,n,r,i={}){var u,c;const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):D(r)&&o?l.push(...r.split(o)):l.push(r)));const a=po(this.data,l);return!a&&!n&&!r&&t.indexOf(".")>-1&&(t=l[0],n=l[1],r=l.slice(2).join(".")),a||!s||!D(r)?a:Pl((c=(u=this.data)==null?void 0:u[t])==null?void 0:c[n],r,o)}addResource(t,n,r,i,o={silent:!1}){const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(l=t.split("."),i=n,n=l[1]),this.addNamespaces(n),wc(this.data,l,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r,i={silent:!1}){for(const o in r)(D(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o,s={silent:!1,skipCopy:!1}){let l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),i=r,r=n,n=l[1]),this.addNamespaces(n);let a=po(this.data,l)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Fp(a,r,o):a={...a,...r},wc(this.data,l,a),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var jp={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{var s;t=((s=this.processors[o])==null?void 0:s.process(t,n,r,i))??t}),t}};const $p=Symbol("i18next/PATH_KEY");function P1(){const e=[],t=Object.create(null);let n;return t.get=(r,i)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),i===$p?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Er(e,t){const{[$p]:n}=e(P1()),r=(t==null?void 0:t.keySeparator)??".",i=(t==null?void 0:t.nsSeparator)??":";if(n.length>1&&i){const o=t==null?void 0:t.ns,s=Array.isArray(o)?o:null;if(s&&s.length>1&&s.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}const kc={},Ss=e=>!D(e)&&typeof e!="boolean"&&typeof e!="number";class mo extends Mo{constructor(t,n={}){super(),h1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=at.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const i=this.resolve(t,r);if((i==null?void 0:i.res)===void 0)return!1;const o=Ss(i.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!E1(t,r,i);if(s&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:D(o)?[o]:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return{key:t,namespaces:D(o)?[o]:o}}translate(t,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";typeof t=="function"&&(t=Er(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(V=>typeof V=="function"?Er(V,{...this.options,...i}):String(V));const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:l,namespaces:a}=this.extractFromKey(t[t.length-1],i),u=a[a.length-1];let c=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=i.lng||this.language,p=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return p?o?{res:`${u}${c}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${c}${l}`:o?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:l;const y=this.resolve(t,i);let d=y==null?void 0:y.res;const v=(y==null?void 0:y.usedKey)||l,w=(y==null?void 0:y.exactUsedKey)||l,m=["[object Number]","[object Function]","[object RegExp]"],h=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,k=i.count!==void 0&&!D(i.count),E=mo.hasDefaultValue(i),R=k?this.pluralResolver.getSuffix(f,i.count,i):"",P=i.ordinal&&k?this.pluralResolver.getSuffix(f,i.count,{ordinal:!1}):"",L=k&&!i.ordinal&&i.count===0,$=L&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${R}`]||i[`defaultValue${P}`]||i.defaultValue;let T=d;g&&!d&&E&&(T=$);const de=Ss(T),Me=Object.prototype.toString.apply(T);if(g&&T&&de&&m.indexOf(Me)<0&&!(D(h)&&Array.isArray(T))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,T,{...i,ns:a}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(y.res=V,y.usedParams=this.getUsedParamsDetails(i),y):V}if(s){const V=Array.isArray(T),X=V?[]:{},Yt=V?w:v;for(const B in T)if(Object.prototype.hasOwnProperty.call(T,B)){const pe=`${Yt}${s}${B}`;E&&!d?X[B]=this.translate(pe,{...i,defaultValue:Ss($)?$[B]:void 0,joinArrays:!1,ns:a}):X[B]=this.translate(pe,{...i,joinArrays:!1,ns:a}),X[B]===pe&&(X[B]=T[B])}d=X}}else if(g&&D(h)&&Array.isArray(d))d=d.join(h),d&&(d=this.extendTranslation(d,t,i,r));else{let V=!1,X=!1;!this.isValidLookup(d)&&E&&(V=!0,d=$),this.isValidLookup(d)||(X=!0,d=l);const B=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&X?void 0:d,pe=E&&$!==d&&this.options.updateMissing;if(X||V||pe){if(this.logger.log(pe?"updateKey":"missingKey",f,u,l,pe?$:d),s){const F=this.resolve(l,{...i,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let O=[];const N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&N&&N[0])for(let F=0;F{var ft;const we=E&&Oe!==d?Oe:B;this.options.missingKeyHandler?this.options.missingKeyHandler(F,u,U,we,pe,i):(ft=this.backendConnector)!=null&&ft.saveMissing&&this.backendConnector.saveMissing(F,u,U,we,pe,i),this.emit("missingKey",F,u,U,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?O.forEach(F=>{const U=this.pluralResolver.getSuffixes(F,i);L&&i[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(Oe=>{j([F],l+Oe,i[`defaultValue${Oe}`]||$)})}):j(O,l,$))}d=this.extendTranslation(d,t,i,y,r),X&&d===l&&this.options.appendNamespaceToMissingKey&&(d=`${u}${c}${l}`),(X||V)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${l}`:l,V?d:void 0,i))}return o?(y.res=d,y.usedParams=this.getUsedParamsDetails(i),y):d}extendTranslation(t,n,r,i,o){var a,u;if((a=this.i18nFormat)!=null&&a.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=D(t)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(c){const y=t.match(this.interpolator.nestingRegexp);f=y&&y.length}let p=r.replace&&!D(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language||i.usedLng,r),c){const y=t.match(this.interpolator.nestingRegexp),d=y&&y.length;f(o==null?void 0:o[0])===y[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):this.translate(...y,n),r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=D(s)?[s]:s;return t!=null&&(l!=null&&l.length)&&r.applyPostProcessor!==!1&&(t=jp.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,i,o,s,l;return D(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(a=>typeof a=="function"?Er(a,{...this.options,...n}):a)),t.forEach(a=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(a,n),c=u.key;i=c;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=n.count!==void 0&&!D(n.count),y=p&&!n.ordinal&&n.count===0,d=n.context!==void 0&&(D(n.context)||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(w=>{var m,h;this.isValidLookup(r)||(l=w,!kc[`${v[0]}-${w}`]&&((m=this.utils)!=null&&m.hasLoadedNamespace)&&!((h=this.utils)!=null&&h.hasLoadedNamespace(l))&&(kc[`${v[0]}-${w}`]=!0,this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(g=>{var R;if(this.isValidLookup(r))return;s=g;const k=[c];if((R=this.i18nFormat)!=null&&R.addLookupKeys)this.i18nFormat.addLookupKeys(k,c,g,w,n);else{let P;p&&(P=this.pluralResolver.getSuffix(g,n.count,n));const L=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(n.ordinal&&P.indexOf($)===0&&k.push(c+P.replace($,this.options.pluralSeparator)),k.push(c+P),y&&k.push(c+L)),d){const T=`${c}${this.options.contextSeparator||"_"}${n.context}`;k.push(T),p&&(n.ordinal&&P.indexOf($)===0&&k.push(T+P.replace($,this.options.pluralSeparator)),k.push(T+P),y&&k.push(T+L))}}let E;for(;E=k.pop();)this.isValidLookup(r)||(o=E,r=this.getResource(g,w,E,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,i={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!D(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class xc{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=at.create("languageUtils")}getScriptPartFromCode(t){if(t=Hr(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Hr(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(D(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(s=>{if(s===o)return s;if(!(s.indexOf("-")<0&&o.indexOf("-")<0)&&(s.indexOf("-")>0&&o.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===o||s.indexOf(o)===0&&o.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),D(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),i=[],o=s=>{s&&(this.isSupportedCode(s)?i.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return D(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):D(t)&&o(this.formatLanguageCode(t)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}const Ec={zero:0,one:1,two:2,few:3,many:4,other:5},Cc={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class O1{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=at.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=Hr(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let s;try{s=new Intl.PluralRules(r,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Cc;if(!t.match(/-|_/))return Cc;const a=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(a,n)}return this.pluralRulesCache[o]=s,s}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>Ec[i]-Ec[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n,r={}){const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Pc=(e,t,n,r=".",i=!0)=>{let o=y1(e,t,n);return!o&&i&&D(n)&&(o=Pl(e,n,r),o===void 0&&(o=Pl(t,n,r))),o},ks=e=>e.replace(/\$/g,"$$$$");class Oc{constructor(t={}){var n;this.logger=at.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:s,suffix:l,suffixEscaped:a,formatSeparator:u,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:y,nestingSuffix:d,nestingSuffixEscaped:v,nestingOptionsSeparator:w,maxReplaces:m,alwaysFormat:h}=t.interpolation;this.escape=n!==void 0?n:w1,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Xt(o):s||"{{",this.suffix=l?Xt(l):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=p?Xt(p):y||Xt("$t("),this.nestingSuffix=d?Xt(d):v||Xt(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=m||1e3,this.alwaysFormat=h!==void 0?h:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,i){var y;let o,s,l;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=d=>{if(d.indexOf(this.formatSeparator)<0){const h=Pc(n,a,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(h,void 0,r,{...i,...n,interpolationkey:d}):h}const v=d.split(this.formatSeparator),w=v.shift().trim(),m=v.join(this.formatSeparator).trim();return this.format(Pc(n,a,w,this.options.keySeparator,this.options.ignoreJSONStructure),m,r,{...i,...n,interpolationkey:w})};this.resetRegExp();const c=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((y=i==null?void 0:i.interpolation)==null?void 0:y.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>ks(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?ks(this.escape(d)):ks(d)}].forEach(d=>{for(l=0;o=d.regex.exec(t);){const v=o[1].trim();if(s=u(v),s===void 0)if(typeof c=="function"){const m=c(t,o,i);s=D(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,v))s="";else if(f){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),s="";else!D(s)&&!this.useRawValueToEscape&&(s=gc(s));const w=d.safeValue(s);if(t=t.replace(o[0],w),f?(d.regex.lastIndex+=s.length,d.regex.lastIndex-=o[0].length):d.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,r={}){let i,o,s;const l=(a,u)=>{const c=this.nestingOptionsSeparator;if(a.indexOf(c)<0)return a;const f=a.split(new RegExp(`${Xt(c)}[ ]*{`));let p=`{${f[1]}`;a=f[0],p=this.interpolate(p,s);const y=p.match(/'/g),d=p.match(/"/g);(((y==null?void 0:y.length)??0)%2===0&&!d||((d==null?void 0:d.length)??0)%2!==0)&&(p=p.replace(/'/g,'"'));try{s=JSON.parse(p),u&&(s={...u,...s})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,v),`${a}${c}${p}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,a};for(;i=this.nestingRegexp.exec(t);){let a=[];s={...r},s=s.replace&&!D(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const u=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(a=i[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),o=n(l.call(this,i[1].trim(),s),s),o&&i[0]===t&&!D(o))return o;D(o)||(o=gc(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),a.length&&(o=a.reduce((c,f)=>this.format(c,f,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const R1=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(s=>{if(s){const[l,...a]=s.split(":"),u=a.join(":").trim().replace(/^'+|'+$/g,""),c=l.trim();n[c]||(n[c]=u),u==="false"&&(n[c]=!1),u==="true"&&(n[c]=!0),isNaN(u)||(n[c]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},Rc=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=r+JSON.stringify(o);let l=t[s];return l||(l=e(Hr(r),i),t[s]=l),l(n)}},_1=e=>(t,n,r)=>e(Hr(n),r)(t);class L1{constructor(t={}){this.logger=at.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?Rc:_1;this.formats={number:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o});return l=>s.format(l)}),currency:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o,style:"currency"});return l=>s.format(l)}),datetime:r((i,o)=>{const s=new Intl.DateTimeFormat(i,{...o});return l=>s.format(l)}),relativetime:r((i,o)=>{const s=new Intl.RelativeTimeFormat(i,{...o});return l=>s.format(l,o.range||"day")}),list:r((i,o)=>{const s=new Intl.ListFormat(i,{...o});return l=>s.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Rc(n)}format(t,n,r,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(l=>l.indexOf(")")>-1)){const l=o.findIndex(a=>a.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,l)].join(this.formatSeparator)}return o.reduce((l,a)=>{var f;const{formatName:u,formatOptions:c}=R1(a);if(this.formats[u]){let p=l;try{const y=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},d=y.locale||y.lng||i.locale||i.lng||r;p=this.formats[u](l,d,{...c,...i,...y})}catch(y){this.logger.warn(y)}return p}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const T1=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class N1 extends Mo{constructor(t,n,r,i={}){var o,s;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=at.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(s=(o=this.backend)==null?void 0:o.init)==null||s.call(o,r,i.backend,i)}queueLoad(t,n,r,i){const o={},s={},l={},a={};return t.forEach(u=>{let c=!0;n.forEach(f=>{const p=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?s[p]===void 0&&(s[p]=!0):(this.state[p]=1,c=!1,s[p]===void 0&&(s[p]=!0),o[p]===void 0&&(o[p]=!0),a[f]===void 0&&(a[f]=!0)))}),c||(l[u]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,n,r){const i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),!n&&r&&this.store.addResourceBundle(o,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(a=>{g1(a.loaded,[o],s),T1(a,t),n&&a.errors.push(n),a.pendingCount===0&&!a.done&&(Object.keys(a.loaded).forEach(u=>{l[u]||(l[u]={});const c=a.loaded[u];c.length&&c.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),a.done=!0,a.errors.length?a.callback(a.errors):a.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(a=>!a.done)}read(t,n,r,i=0,o=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:s});return}this.readingCalls++;const l=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&c&&i{this.read.call(this,t,n,r,i+1,o*2,s)},o);return}s(u,c)},a=this.backend[r].bind(this.backend);if(a.length===2){try{const u=a(t,n);u&&typeof u.then=="function"?u.then(c=>l(null,c)).catch(l):l(null,u)}catch(u){l(u)}return}return a(t,n,l)}prepareLoading(t,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();D(t)&&(t=this.languageUtils.toResolveHierarchy(t)),D(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,l)=>{s&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,s),!s&&l&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,l),this.loaded(t,s,l)})}saveMissing(t,n,r,i,o,s={},l=()=>{}){var a,u,c,f,p;if((u=(a=this.services)==null?void 0:a.utils)!=null&&u.hasLoadedNamespace&&!((f=(c=this.services)==null?void 0:c.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((p=this.backend)!=null&&p.create){const y={...s,isUpdate:o},d=this.backend.create.bind(this.backend);if(d.length<6)try{let v;d.length===5?v=d(t,n,r,i,y):v=d(t,n,r,i),v&&typeof v.then=="function"?v.then(w=>l(null,w)).catch(l):l(null,v)}catch(v){l(v)}else d(t,n,r,i,l,y)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const xs=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),D(e[1])&&(t.defaultValue=e[1]),D(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_c=e=>{var t,n;return D(e.ns)&&(e.ns=[e.ns]),D(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),D(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},xi=()=>{},A1=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},zp="__i18next_supportNoticeShown",I1=()=>typeof globalThis<"u"&&!!globalThis[zp],D1=()=>{typeof globalThis<"u"&&(globalThis[zp]=!0)},F1=e=>{var t,n,r,i,o,s,l,a,u,c,f,p,y;return!!(((r=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((l=(s=(o=(i=e==null?void 0:e.modules)==null?void 0:i.backend)==null?void 0:o.constructor)==null?void 0:s.name)==null?void 0:l.indexOf("Locize"))>0||(u=(a=e==null?void 0:e.options)==null?void 0:a.backend)!=null&&u.backends&&e.options.backend.backends.some(d=>{var v,w,m;return((v=d==null?void 0:d.name)==null?void 0:v.indexOf("Locize"))>0||((m=(w=d==null?void 0:d.constructor)==null?void 0:w.name)==null?void 0:m.indexOf("Locize"))>0})||(f=(c=e==null?void 0:e.options)==null?void 0:c.backend)!=null&&f.projectId||(y=(p=e==null?void 0:e.options)==null?void 0:p.backend)!=null&&y.backendOptions&&e.options.backend.backendOptions.some(d=>d==null?void 0:d.projectId))};class Cr extends Mo{constructor(t={},n){if(super(),this.options=_c(t),this.services={},this.logger=at,this.modules={external:[]},A1(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(D(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=xs();this.options={...r,...this.options,..._c(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!F1(this)&&!I1()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),D1());const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?at.init(i(this.modules.logger),this.options):at.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=L1;const c=new xc(this.options);this.store=new Sc(this.options.resources,this.options);const f=this.services;f.logger=at,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new O1(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=i(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Oc(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new N1(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(y,...d)=>{this.emit(y,...d)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new mo(this.services,this.options),this.translator.on("*",(y,...d)=>{this.emit(y,...d)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,n||(n=xi),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...c)=>this.store[u](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...c)=>(this.store[u](...c),this)});const l=ar(),a=()=>{const u=(c,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(c,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),l}loadResources(t,n=xi){var o,s;let r=n;const i=D(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const l=[],a=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&l.indexOf(f)<0&&l.push(f)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),(s=(o=this.options.preload)==null?void 0:o.forEach)==null||s.call(o,u=>a(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const i=ar();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=xi),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&jp.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=ar();this.emit("languageChanging",t);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,a)=>{a?this.isLanguageChangingTo===t&&(i(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},s=l=>{var c,f;!t&&!l&&this.services.languageDetector&&(l=[]);const a=D(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(a)?a:this.services.languageUtils.getBestMatchFromCodes(D(l)?[l]:l);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),(f=(c=this.services.languageDetector)==null?void 0:c.cacheUserLanguage)==null||f.call(c,u)),this.loadResources(u,p=>{o(p,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),r}getFixedT(t,n,r){const i=(o,s,...l)=>{let a;typeof s!="object"?a=this.options.overloadTranslationOptionHandler([o,s].concat(l)):a={...s},a.lng=a.lng||i.lng,a.lngs=a.lngs||i.lngs,a.ns=a.ns||i.ns,a.keyPrefix!==""&&(a.keyPrefix=a.keyPrefix||r||i.keyPrefix);const u={...this.options,...a},c=this.options.keySeparator||".";let f;return a.keyPrefix&&Array.isArray(o)?f=o.map(p=>(typeof p=="function"&&(p=Er(p,u)),`${a.keyPrefix}${c}${p}`)):(typeof o=="function"&&(o=Er(o,u)),f=a.keyPrefix?`${a.keyPrefix}${c}${o}`:o),this.t(f,a)};return D(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(l,a)=>{const u=this.services.backendConnector.state[`${l}|${a}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,s);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}loadNamespaces(t,n){const r=ar();return this.options.ns?(D(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ar();D(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(s=>i.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return o.length?(this.options.preload=i.concat(o),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){var i,o;if(t||(t=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const s=new Intl.Locale(t);if(s&&s.getTextInfo){const l=s.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((o=this.services)==null?void 0:o.languageUtils)||new xc(xs());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new Cr(t,n);return r.createInstance=Cr.createInstance,r}cloneInstance(t={},n=xi){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Cr(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(l=>{o[l]=this[l]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const l=Object.keys(this.store.data).reduce((a,u)=>(a[u]={...this.store.data[u]},a[u]=Object.keys(a[u]).reduce((c,f)=>(c[f]={...a[u][f]},c),a[u]),a),{});o.store=new Sc(l,i),o.services.resourceStore=o.store}if(t.interpolation){const a={...xs().interpolation,...this.options.interpolation,...t.interpolation},u={...i,interpolation:a};o.services.interpolator=new Oc(u)}return o.translator=new mo(o.services,i),o.translator.on("*",(l,...a)=>{o.emit(l,...a)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Pe=Cr.createInstance();Pe.createInstance;Pe.dir;Pe.init;Pe.loadResources;Pe.reloadResources;Pe.use;Pe.changeLanguage;Pe.getFixedT;Pe.t;Pe.exists;Pe.setDefaultNamespace;Pe.hasLoadedNamespace;Pe.loadNamespaces;Pe.loadLanguages;const j1=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,$1={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},z1=e=>$1[e],U1=e=>e.replace(j1,z1);let Ol={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:U1,transDefaultProps:void 0};const M1=(e={})=>{Ol={...Ol,...e}},Kw=()=>Ol;let Up;const B1=e=>{Up=e},Qw=()=>Up,b1={type:"3rdParty",init(e){M1(e.options.react),B1(e)}},{slice:V1,forEach:H1}=[];function W1(e){return H1.call(V1.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function K1(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const Lc=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Q1=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const s=r.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(s)}`}if(r.domain){if(!Lc.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!Lc.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},Tc={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Q1(e,t,i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const s=i.substring(1).split("&");for(let l=0;l0&&s[l].substring(0,a)===t&&(n=s[l].substring(a+1))}}return n}},Y1={name:"hash",lookup(e){var i;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const s=o.substring(1);if(t){const l=s.split("&");for(let a=0;a0&&l[a].substring(0,u)===t&&(r=l[a].substring(u+1))}}if(r)return r;if(!r&&n>-1){const l=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(i=l[typeof n=="number"?n:0])==null?void 0:i.replace("/",""):void 0}}}return r}};let vn=null;const Nc=()=>{if(vn!==null)return vn;try{if(vn=typeof window<"u"&&window.localStorage!==null,!vn)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{vn=!1}return vn};var G1={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Nc())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Nc()&&window.localStorage.setItem(n,e)}};let wn=null;const Ac=()=>{if(wn!==null)return wn;try{if(wn=typeof window<"u"&&window.sessionStorage!==null,!wn)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{wn=!1}return wn};var X1={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Ac())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Ac()&&window.sessionStorage.setItem(n,e)}},Z1={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o0?t:void 0}},ew={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},tw={name:"path",lookup(e){var i;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof t=="number"?t:0])==null?void 0:i.replace("/",""):void 0}},nw={name:"subdomain",lookup(e){var i,o;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((o=(i=window.location)==null?void 0:i.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let Mp=!1;try{document.cookie,Mp=!0}catch{}const Bp=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Mp||Bp.splice(1,1);const rw=()=>({order:Bp,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class bp{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=W1(n,this.options||{},rw()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(q1),this.addDetector(J1),this.addDetector(G1),this.addDetector(X1),this.addDetector(Z1),this.addDetector(ew),this.addDetector(tw),this.addDetector(nw),this.addDetector(Y1)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!K1(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}bp.type="languageDetector";const iw={"nav.home":"Home","nav.pricing":"Pricing","nav.packages":"Packages","nav.dashboard":"Dashboard","nav.apiKeys":"API Keys","nav.login":"Login","nav.signUp":"Sign Up","nav.logout":"Logout","nav.contact":"Contact","home.heroSubtitle":"Access the world's most powerful AI models through a single API endpoint. Simple, affordable, reliable.","home.getStarted":"Get Started Free","home.viewPricing":"View Pricing","home.goToDashboard":"Go to Dashboard","home.aiModels":"AI Models","home.uptime":"Uptime","home.latency":"Latency","home.whyChooseUs":"Why Choose Us","home.whyChooseUsDesc":"Everything you need to build AI-powered applications","home.lightningFast":"Lightning Fast","home.lightningFastDesc":"Optimized routing and caching deliver responses with minimal latency. Load-balanced across multiple providers for maximum reliability.","home.securePrivate":"Secure & Private","home.securePrivateDesc":"Enterprise-grade security with encrypted API keys. No request logging by default. Your data stays your data.","home.payAsYouGo":"Pay As You Go","home.payAsYouGoDesc":"Transparent pricing with no hidden fees. Only pay for what you use. Multiple top-up options and subscription packages available.","home.availableModels":"Available Models","home.availableModelsDesc":"Access {{count}} AI models through a unified API","home.viewAllModels":"View all {{count}} models","home.plansPackages":"Plans & Packages","home.choosePlan":"Choose a plan that fits your needs","home.subscribe":"Subscribe","home.days":"{{count}} days","home.readyToStart":"Ready to Get Started?","home.readyToStartDesc":"Create your account and start building with AI in minutes. No credit card required.","home.createFreeAccount":"Create Free Account","home.signIn":"Sign In","home.defaultHeroTitle":"AI API Platform","login.welcomeBack":"Welcome Back","login.signInTo":"Sign in to {{name}}","login.signInToDefault":"Sign in to your account","login.username":"Username","login.password":"Password","login.enterUsername":"Enter your username","login.enterPassword":"Enter your password","login.signingIn":"Signing in...","login.signInBtn":"Sign In","login.noAccount":"Don't have an account?","login.createOne":"Create one","login.fillAllFields":"Please fill in all fields","login.welcomeBackToast":"Welcome back!","register.createAccount":"Create Account","register.getStartedWith":"Get started with {{name}}","register.getStartedDefault":"Get started with our platform","register.username":"Username","register.email":"Email","register.password":"Password","register.confirmPassword":"Confirm Password","register.chooseUsername":"Choose a username","register.emailPlaceholder":"your@email.com (optional)","register.passwordPlaceholder":"8-20 characters","register.repeatPassword":"Repeat your password","register.creating":"Creating...","register.createAccountBtn":"Create Account","register.hasAccount":"Already have an account?","register.signIn":"Sign in","register.fillRequired":"Please fill in all required fields","register.passwordMismatch":"Passwords do not match","register.passwordLength":"Password must be 8-20 characters","register.accountCreated":"Account created! Please sign in.","dashboard.welcome":"Welcome,","dashboard.manageDesc":"Manage your API usage, keys, and account","dashboard.balance":"Balance","dashboard.quotaUnits":"{{count}} quota units","dashboard.used":"Used","dashboard.totalRequests":"Total Requests","dashboard.redeemCode":"Redeem Code","dashboard.enterCode":"Enter redemption code","dashboard.redeeming":"Redeeming...","dashboard.redeem":"Redeem","dashboard.redeemSuccess":"Code redeemed successfully!","dashboard.quickLinks":"Quick Links","dashboard.apiKeys":"API Keys","dashboard.manageKeys":"Manage your keys","dashboard.packages":"Packages","dashboard.viewPlans":"View plans","dashboard.pricing":"Pricing","dashboard.modelPrices":"Model prices","dashboard.apiDocs":"API Docs","dashboard.comingSoon":"Coming soon","tokens.title":"API Keys","tokens.subtitle":"Manage your API access tokens","tokens.newKey":"+ New Key","tokens.createApiKey":"Create API Key","tokens.name":"Name","tokens.namePlaceholder":"e.g. my-app-key","tokens.cancel":"Cancel","tokens.creating":"Creating...","tokens.create":"Create","tokens.newApiKey":"Your New API Key","tokens.keyWarning":"This is the only time you'll see this key. Copy it now and store it securely.","tokens.copied":"Copied!","tokens.copy":"Copy","tokens.copiedToClipboard":"Copied to clipboard!","tokens.savedKey":"I've saved my key","tokens.deleteToken":"Delete Token","tokens.deleteConfirm":'Delete "{{name}}"? This cannot be undone.',"tokens.delete":"Delete","tokens.noKeys":"No API keys yet","tokens.createFirst":"Create Your First Key","tokens.enabled":"Enabled","tokens.disabled":"Disabled","tokens.tokenDisabled":"Token disabled","tokens.tokenEnabled":"Token enabled","tokens.tokenDeleted":"Token deleted","tokens.enterName":"Please enter a name","tokens.quickStart":"Quick Start","tokens.quickStartComment":"# Use your API key with OpenAI-compatible endpoint","pricing.title":"Model Pricing","pricing.subtitle":"Transparent, pay-as-you-go pricing for all available models. Prices shown per 1M tokens.","pricing.searchPlaceholder":"Search models...","pricing.noMatch":"No models match your search","pricing.noModels":"No models available","pricing.model":"Model","pricing.inputPrice":"Input / 1M tokens","pricing.outputPrice":"Output / 1M tokens","pricing.status":"Status","pricing.online":"Online","pricing.unknown":"Unknown","packages.title":"Packages & Plans","packages.subtitle":"Choose a package that fits your usage. All plans include access to all available models.","packages.noPackages":"No packages available at the moment.","packages.checkPricing":"Check model pricing","packages.daysAccess":"{{count}} days access","packages.creditIncluded":"${{amount}} credit included","packages.requestsMin":"{{count}} requests/min","packages.allModels":"All models access","packages.openaiApi":"OpenAI-compatible API","packages.subscribeNow":"Subscribe Now","packages.signUpToSubscribe":"Sign Up to Subscribe","packages.processing":"Processing...","packages.confirmTitle":"Confirm Subscription","packages.confirmDesc":"Subscribe to {{name}} for ${{price}}?","packages.yourBalance":"Your balance:","packages.insufficientBalance":"Insufficient balance. Please top up before subscribing.","packages.confirm":"Confirm","packages.subscribedSuccess":"Subscribed successfully!","common.sessionExpired":"Session expired, please log in again","common.requestFailed":"Request failed","nav.topup":"Top Up","topup.title":"Top Up","topup.subtitle":"Recharge your account balance via online payment or redemption code","topup.onlineTopup":"Online Top Up","topup.selectAmount":"Select Amount","topup.customAmount":"Custom Amount","topup.amountPlaceholder":"Enter amount (min ${{min}})","topup.paymentMethod":"Payment Method","topup.processing":"Processing...","topup.calculating":"Calculating...","topup.payAmountLabel":"Amount to pay","topup.enterAmount":"Please enter a top-up amount","topup.paymentSuccess":"Payment successful! Balance updated.","topup.orderExpired":"Payment order expired","topup.viewHistory":"View History","topup.hideHistory":"Hide History","topup.history":"Top-Up History","topup.noHistory":"No top-up records yet","topup.statusSuccess":"Success","topup.statusPending":"Pending","topup.statusFailed":"Failed","topup.redeemTitle":"Redeem Code","topup.enterRedeemCode":"Enter redemption code","topup.redeeming":"Redeeming...","topup.redeem":"Redeem","topup.redeemCode":"Redeem Code","topup.redeemSuccess":"Code redeemed successfully!","topup.cryptoPayment":"Crypto Payment","topup.walletAddress":"Wallet Address","topup.amount":"Amount","topup.chain":"Chain","topup.waitingPayment":"Waiting for payment...","topup.close":"Close","topup.selectChain":"Please select a blockchain network","topup.selectToken":"Please select a token","topup.token":"Token","topup.payWith":"Pay with","topup.payNow":"Pay","topup.quotaIncluded":"{{count}} quota included","topup.creemPayment":"Creem Payment"},ow={translation:iw},sw={"nav.home":"首页","nav.pricing":"定价","nav.packages":"套餐","nav.dashboard":"控制台","nav.apiKeys":"API 密钥","nav.login":"登录","nav.signUp":"注册","nav.logout":"退出","nav.contact":"联系我们","home.heroSubtitle":"通过单一 API 端点访问全球最强大的 AI 模型。简单、实惠、可靠。","home.getStarted":"免费开始","home.viewPricing":"查看定价","home.goToDashboard":"进入控制台","home.aiModels":"AI 模型","home.uptime":"在线率","home.latency":"延迟","home.whyChooseUs":"为什么选择我们","home.whyChooseUsDesc":"构建 AI 应用所需的一切","home.lightningFast":"极速响应","home.lightningFastDesc":"优化的路由和缓存以最低延迟交付响应。跨多个供应商负载均衡,确保最大可靠性。","home.securePrivate":"安全可靠","home.securePrivateDesc":"企业级安全性,API 密钥加密存储。默认不记录请求日志。您的数据由您掌控。","home.payAsYouGo":"按量付费","home.payAsYouGoDesc":"透明定价,无隐藏费用。按使用量付费。提供多种充值方式和订阅套餐。","home.availableModels":"可用模型","home.availableModelsDesc":"通过统一 API 访问 {{count}} 个 AI 模型","home.viewAllModels":"查看全部 {{count}} 个模型","home.plansPackages":"套餐方案","home.choosePlan":"选择适合您需求的方案","home.subscribe":"订阅","home.days":"{{count}} 天","home.readyToStart":"准备好了吗?","home.readyToStartDesc":"创建账户,几分钟内即可开始使用 AI 构建应用。无需信用卡。","home.createFreeAccount":"免费创建账户","home.signIn":"登录","home.defaultHeroTitle":"AI API 平台","login.welcomeBack":"欢迎回来","login.signInTo":"登录到 {{name}}","login.signInToDefault":"登录您的账户","login.username":"用户名","login.password":"密码","login.enterUsername":"请输入用户名","login.enterPassword":"请输入密码","login.signingIn":"登录中...","login.signInBtn":"登录","login.noAccount":"还没有账户?","login.createOne":"立即注册","login.fillAllFields":"请填写所有字段","login.welcomeBackToast":"欢迎回来!","register.createAccount":"创建账户","register.getStartedWith":"开始使用 {{name}}","register.getStartedDefault":"开始使用我们的平台","register.username":"用户名","register.email":"邮箱","register.password":"密码","register.confirmPassword":"确认密码","register.chooseUsername":"请选择用户名","register.emailPlaceholder":"your@email.com(可选)","register.passwordPlaceholder":"8-20 个字符","register.repeatPassword":"请再次输入密码","register.creating":"创建中...","register.createAccountBtn":"创建账户","register.hasAccount":"已有账户?","register.signIn":"立即登录","register.fillRequired":"请填写所有必填字段","register.passwordMismatch":"两次密码不一致","register.passwordLength":"密码长度需为 8-20 个字符","register.accountCreated":"账户创建成功!请登录。","dashboard.welcome":"欢迎,","dashboard.manageDesc":"管理您的 API 用量、密钥和账户","dashboard.balance":"余额","dashboard.quotaUnits":"{{count}} 额度单位","dashboard.used":"已使用","dashboard.totalRequests":"总请求数","dashboard.redeemCode":"兑换码","dashboard.enterCode":"请输入兑换码","dashboard.redeeming":"兑换中...","dashboard.redeem":"兑换","dashboard.redeemSuccess":"兑换码兑换成功!","dashboard.quickLinks":"快捷入口","dashboard.apiKeys":"API 密钥","dashboard.manageKeys":"管理您的密钥","dashboard.packages":"套餐","dashboard.viewPlans":"查看方案","dashboard.pricing":"定价","dashboard.modelPrices":"模型价格","dashboard.apiDocs":"API 文档","dashboard.comingSoon":"即将推出","tokens.title":"API 密钥","tokens.subtitle":"管理您的 API 访问令牌","tokens.newKey":"+ 新建密钥","tokens.createApiKey":"创建 API 密钥","tokens.name":"名称","tokens.namePlaceholder":"例如 my-app-key","tokens.cancel":"取消","tokens.creating":"创建中...","tokens.create":"创建","tokens.newApiKey":"您的新 API 密钥","tokens.keyWarning":"这是您唯一一次看到此密钥的机会。请立即复制并安全保存。","tokens.copied":"已复制!","tokens.copy":"复制","tokens.copiedToClipboard":"已复制到剪贴板!","tokens.savedKey":"我已保存密钥","tokens.deleteToken":"删除令牌","tokens.deleteConfirm":'删除 "{{name}}"?此操作不可撤销。',"tokens.delete":"删除","tokens.noKeys":"暂无 API 密钥","tokens.createFirst":"创建您的第一个密钥","tokens.enabled":"已启用","tokens.disabled":"已禁用","tokens.tokenDisabled":"令牌已禁用","tokens.tokenEnabled":"令牌已启用","tokens.tokenDeleted":"令牌已删除","tokens.enterName":"请输入名称","tokens.quickStart":"快速开始","tokens.quickStartComment":"# 使用 OpenAI 兼容端点调用 API","pricing.title":"模型定价","pricing.subtitle":"透明的按量付费定价。价格以每百万 token 计。","pricing.searchPlaceholder":"搜索模型...","pricing.noMatch":"没有匹配的模型","pricing.noModels":"暂无可用模型","pricing.model":"模型","pricing.inputPrice":"输入 / 百万 token","pricing.outputPrice":"输出 / 百万 token","pricing.status":"状态","pricing.online":"在线","pricing.unknown":"未知","packages.title":"套餐方案","packages.subtitle":"选择适合您用量的套餐。所有方案均可访问全部可用模型。","packages.noPackages":"暂无可用套餐。","packages.checkPricing":"查看模型定价","packages.daysAccess":"{{count}} 天有效期","packages.creditIncluded":"含 ${{amount}} 额度","packages.requestsMin":"{{count}} 次请求/分钟","packages.allModels":"全部模型可用","packages.openaiApi":"OpenAI 兼容 API","packages.subscribeNow":"立即订阅","packages.signUpToSubscribe":"注册后订阅","packages.processing":"处理中...","packages.confirmTitle":"确认订阅","packages.confirmDesc":"订阅 {{name}},价格 ${{price}}?","packages.yourBalance":"您的余额:","packages.insufficientBalance":"余额不足,请先充值。","packages.confirm":"确认","packages.subscribedSuccess":"订阅成功!","common.sessionExpired":"会话已过期,请重新登录","common.requestFailed":"请求失败","nav.topup":"充值","topup.title":"充值中心","topup.subtitle":"通过在线支付或兑换码为账户充值","topup.onlineTopup":"在线充值","topup.selectAmount":"选择金额","topup.customAmount":"自定义金额","topup.amountPlaceholder":"输入金额(最低 ${{min}})","topup.paymentMethod":"支付方式","topup.processing":"处理中...","topup.calculating":"计算中...","topup.payAmountLabel":"实付金额","topup.enterAmount":"请输入充值金额","topup.paymentSuccess":"支付成功!余额已更新。","topup.orderExpired":"支付订单已过期","topup.viewHistory":"查看记录","topup.hideHistory":"隐藏记录","topup.history":"充值记录","topup.noHistory":"暂无充值记录","topup.statusSuccess":"成功","topup.statusPending":"待支付","topup.statusFailed":"失败","topup.redeemTitle":"兑换码充值","topup.enterRedeemCode":"请输入兑换码","topup.redeeming":"兑换中...","topup.redeem":"兑换","topup.redeemCode":"兑换码","topup.redeemSuccess":"兑换码兑换成功!","topup.cryptoPayment":"加密货币支付","topup.walletAddress":"钱包地址","topup.amount":"金额","topup.chain":"链","topup.waitingPayment":"等待支付中...","topup.close":"关闭","topup.selectChain":"请选择区块链网络","topup.selectToken":"请选择代币","topup.token":"代币","topup.payWith":"使用","topup.payNow":"支付","topup.quotaIncluded":"含 {{count}} 额度","topup.creemPayment":"Creem 支付"},lw={translation:sw};Pe.use(bp).use(b1).init({load:"languageOnly",resources:{en:ow,zh:lw},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag","querystring"],caches:["localStorage"]}});Es.createRoot(document.getElementById("root")).render(I.jsx(it.StrictMode,{children:I.jsx(wy,{children:I.jsx(X0,{children:I.jsxs(J0,{children:[I.jsx(p1,{}),I.jsx(cv,{position:"top-center",toastOptions:{duration:3e3,style:{background:"#1a1a2e",color:"#fff",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",fontSize:"14px"}}})]})})})}));export{aw as L,np as N,cy as O,_w as Q,Z0 as a,Gd as b,Gn as c,jw as d,Aw as e,Iw as f,Nw as g,Dw as h,Fw as i,I as j,Tw as k,Lw as l,zw as m,Uw as n,Bw as o,Mw as p,bw as q,x as r,$w as s,Vw as t,Y0 as u,Hw as v,Ww as w,Kw as x,Qw as y,hs as z}; +`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=hn(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&zi.assertOptions(r,{silentJSONParsing:Be.transitional(Be.boolean),forcedJSONParsing:Be.transitional(Be.boolean),clarifyTimeoutError:Be.transitional(Be.boolean),legacyInterceptorReqResOrdering:Be.transitional(Be.boolean)},!1),i!=null&&(S.isFunction(i)?n.paramsSerializer={serialize:i}:zi.assertOptions(i,{encode:Be.function,serialize:Be.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),zi.assertOptions(n,{baseUrl:Be.spelling("baseURL"),withXsrfToken:Be.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&S.merge(o.common,o[n.method]);o&&S.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=Ie.concat(s,o);const l=[];let a=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;a=a&&v.synchronous;const w=n.transitional||La;w&&w.legacyInterceptorReqResOrdering?l.unshift(v.fulfilled,v.rejected):l.push(v.fulfilled,v.rejected)});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,f=0,p;if(!a){const d=[pc.bind(this),void 0];for(d.unshift(...l),d.push(...u),p=d.length,c=Promise.resolve(n);f{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(l=>{r.subscribe(l),o=l}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,l){r.reason||(r.reason=new ti(o,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Tp(function(i){t=i}),cancel:t}}};function V0(e){return function(n){return e.apply(null,n)}}function H0(e){return S.isObject(e)&&e.isAxiosError===!0}const Cl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Cl).forEach(([e,t])=>{Cl[t]=e});function Np(e){const t=new an(e),n=cp(an.prototype.request,t);return S.extend(n,an.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Np(hn(e,i))},n}const ne=Np(ei);ne.Axios=an;ne.CanceledError=ti;ne.CancelToken=b0;ne.isCancel=Ep;ne.VERSION=Lp;ne.toFormData=zo;ne.AxiosError=A;ne.Cancel=ne.CanceledError;ne.all=function(t){return Promise.all(t)};ne.spread=V0;ne.isAxiosError=H0;ne.mergeConfig=hn;ne.AxiosHeaders=Ie;ne.formToJSON=e=>xp(S.isHTMLForm(e)?new FormData(e):e);ne.getAdapter=_p.getAdapter;ne.HttpStatusCode=Cl;ne.default=ne;const{Axios:dw,AxiosError:pw,CanceledError:hw,isCancel:mw,CancelToken:gw,VERSION:yw,all:vw,Cancel:ww,isAxiosError:Sw,spread:kw,toFormData:xw,AxiosHeaders:Ew,HttpStatusCode:Cw,formToJSON:Pw,getAdapter:Ow,mergeConfig:Rw}=ne,_w=5e5,q=ne.create({baseURL:"",timeout:3e4,withCredentials:!0,headers:{"Content-Type":"application/json"}});q.interceptors.request.use(e=>{const t=localStorage.getItem("dist_user_id");return t&&(e.headers["New-Api-User"]=t),e});q.interceptors.response.use(e=>(e.data&&e.data.success===!1&&e.data.message&&hs.error(e.data.message),e),e=>{var n,r,i;const t=((r=(n=e.response)==null?void 0:n.data)==null?void 0:r.message)||e.message||"Request failed";return((i=e.response)==null?void 0:i.status)===401?(localStorage.removeItem("dist_user_id"),window.dispatchEvent(new Event("auth:logout")),hs.error("Session expired, please log in again")):hs.error(t),Promise.reject(e)});const W0=()=>q.get("/api/dist/site/info"),Lw=()=>q.get("/api/dist/site/models"),Tw=()=>q.get("/api/dist/site/packages"),K0=e=>q.post("/api/dist/user/register",e),Q0=e=>q.post("/api/dist/user/login",e),q0=()=>q.post("/api/dist/user/logout"),ws=()=>q.get("/api/dist/user/self"),Nw=()=>q.get("/api/dist/user/usage"),Aw=()=>q.get("/api/dist/token/list"),Iw=e=>q.post("/api/dist/token/create",e),Dw=(e,t)=>q.put(`/api/dist/token/${e}`,t),Fw=e=>q.delete(`/api/dist/token/${e}`),jw=e=>q.post("/api/dist/topup/redeem",{key:e}),$w=e=>q.post("/api/dist/package/subscribe",{package_id:e}),zw=()=>q.get("/api/dist/topup/info"),Uw=e=>q.post("/api/dist/topup/amount",e),Mw=e=>q.post("/api/dist/topup/pay",e),Bw=e=>q.post("/api/dist/topup/stripe/pay",e),bw=e=>q.post("/api/dist/topup/creem/pay",e),Vw=e=>q.post("/api/dist/topup/crypto/pay",e),Hw=e=>q.get(`/api/dist/topup/crypto/status?trade_no=${e}`),Ww=e=>q.get("/api/dist/topup/history",{params:e}),Ap=x.createContext(null);function J0({children:e}){const[t,n]=x.useState(null),[r,i]=x.useState(!0),o=x.useCallback(async()=>{try{const u=await ws();if(u.data.success)return n(u.data.data),u.data.data}catch{}return null},[]);x.useEffect(()=>{localStorage.getItem("dist_user_id")?ws().then(c=>{c.data.success?n(c.data.data):localStorage.removeItem("dist_user_id")}).catch(()=>{localStorage.removeItem("dist_user_id")}).finally(()=>i(!1)):i(!1)},[]),x.useEffect(()=>{const u=()=>{n(null)};return window.addEventListener("auth:logout",u),()=>window.removeEventListener("auth:logout",u)},[]);const s=x.useCallback(async(u,c)=>{const f=await Q0({username:u,password:c});if(f.data.success){const p=f.data.data;p!=null&&p.id&&localStorage.setItem("dist_user_id",String(p.id));const y=await ws();return y.data.success?n(y.data.data):n(p),{success:!0}}return{success:!1,message:f.data.message}},[]),l=x.useCallback(async u=>{const c=await K0(u);return c.data.success?{success:!0,needsLogin:!0}:{success:!1,message:c.data.message}},[]),a=x.useCallback(async()=>{try{await q0()}catch{}localStorage.removeItem("dist_user_id"),n(null)},[]);return I.jsx(Ap.Provider,{value:{user:t,loading:r,login:s,register:l,logout:a,refreshUser:o},children:e})}function Y0(){const e=x.useContext(Ap);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function G0(){const{user:e,loading:t}=Y0(),n=Gn();return t?I.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:I.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e?I.jsx(cy,{}):I.jsx(np,{to:"/login",state:{from:n},replace:!0})}const Ip=x.createContext(null);function X0({children:e}){const[t,n]=x.useState(null),[r,i]=x.useState(!0);return x.useEffect(()=>{W0().then(o=>{var s,l;if(o.data.success&&(n(o.data.data),(s=o.data.data)!=null&&s.name&&(document.title=o.data.data.name),(l=o.data.data)!=null&&l.favicon)){const a=document.querySelector("link[rel~='icon']")||document.createElement("link");a.rel="icon",a.href=o.data.data.favicon,document.head.appendChild(a)}}).catch(()=>{}).finally(()=>i(!1))},[]),I.jsx(Ip.Provider,{value:{site:t,loading:r},children:e})}function Z0(){const e=x.useContext(Ip);if(!e)throw new Error("useSite must be used within SiteProvider");return e}const Dp=x.createContext(null),mc={starter:{Home:it.lazy(()=>ke(()=>import("./Home-DYyowgIk.js"),__vite__mapDeps([0,1,2,3,4,5]))),Layout:it.lazy(()=>ke(()=>import("./Layout-DIJS7qvD.js"),__vite__mapDeps([6,7,5])))},default:{Home:it.lazy(()=>ke(()=>import("./Home-DKZDwMrJ.js"),__vite__mapDeps([8,9,3,1,4,5]))),Layout:it.lazy(()=>ke(()=>import("./Layout-D55ZbQpE.js"),__vite__mapDeps([10,7,5])))},dark:{Home:it.lazy(()=>ke(()=>import("./Home-kTjmvjO3.js"),__vite__mapDeps([11,9,3,1,5]))),Layout:it.lazy(()=>ke(()=>import("./Layout-CAMk7KVY.js"),__vite__mapDeps([12,7,5])))},minimal:{Home:it.lazy(()=>ke(()=>import("./Home-BiUxfnQ8.js"),__vite__mapDeps([13,1,5]))),Layout:it.lazy(()=>ke(()=>import("./Layout-B5KtCqeF.js"),__vite__mapDeps([14,7,5])))}};function e1(){return I.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-950",children:I.jsx("div",{className:"w-8 h-8 border-2 border-white/20 border-t-white/70 rounded-full animate-spin"})})}function t1({children:e}){const{site:t,loading:n}=Z0();if(n)return I.jsx(e1,{});const r=(t==null?void 0:t.theme_template)||"starter";return I.jsx(n1,{themeName:r,children:e})}function n1({themeName:e,children:t}){const n=x.useMemo(()=>{const r=mc[e]||mc.starter;return{name:e,...r}},[e]);return I.jsx(Dp.Provider,{value:n,children:t})}function r1(){const e=x.useContext(Dp);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const i1=x.lazy(()=>ke(()=>import("./Login-B7cfRnlm.js"),__vite__mapDeps([15,5]))),o1=x.lazy(()=>ke(()=>import("./Register-C7amt8Qy.js"),__vite__mapDeps([16,5]))),s1=x.lazy(()=>ke(()=>import("./Dashboard-BywtYNhH.js"),__vite__mapDeps([17,4,1,3,2,5]))),l1=x.lazy(()=>ke(()=>import("./Tokens-CzQLqzGA.js"),__vite__mapDeps([18,5]))),a1=x.lazy(()=>ke(()=>import("./Packages-CG2LwjwE.js"),__vite__mapDeps([19,4,5]))),u1=x.lazy(()=>ke(()=>import("./Pricing-Do1DTRG_.js"),__vite__mapDeps([20,5]))),c1=x.lazy(()=>ke(()=>import("./Topup-Bl3onU8Y.js"),__vite__mapDeps([21,4,1,5]))),f1=()=>I.jsx("div",{className:"flex items-center justify-center min-h-screen",children:I.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})});function d1(){const{Home:e,Layout:t}=r1();return I.jsx(x.Suspense,{fallback:I.jsx(f1,{}),children:I.jsxs(dy,{children:[I.jsxs(be,{element:I.jsx(t,{}),children:[I.jsx(be,{path:"/",element:I.jsx(e,{})}),I.jsx(be,{path:"/pricing",element:I.jsx(u1,{})}),I.jsx(be,{path:"/packages",element:I.jsx(a1,{})}),I.jsx(be,{path:"/login",element:I.jsx(i1,{})}),I.jsx(be,{path:"/register",element:I.jsx(o1,{})}),I.jsxs(be,{element:I.jsx(G0,{}),children:[I.jsx(be,{path:"/dashboard",element:I.jsx(s1,{})}),I.jsx(be,{path:"/tokens",element:I.jsx(l1,{})}),I.jsx(be,{path:"/topup",element:I.jsx(c1,{})})]})]}),I.jsx(be,{path:"*",element:I.jsx(np,{to:"/",replace:!0})})]})})}function p1(){return I.jsx(t1,{children:I.jsx(d1,{})})}const D=e=>typeof e=="string",ar=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},gc=e=>e==null?"":""+e,h1=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},m1=/###/g,yc=e=>e&&e.indexOf("###")>-1?e.replace(m1,"."):e,vc=e=>!e||D(e),xr=(e,t,n)=>{const r=D(t)?t.split("."):t;let i=0;for(;i{const{obj:r,k:i}=xr(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],s=t.slice(0,t.length-1),l=xr(e,s,Object);for(;l.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),l=xr(e,s,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${o}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=n},g1=(e,t,n,r)=>{const{obj:i,k:o}=xr(e,t,Object);i[o]=i[o]||[],i[o].push(n)},po=(e,t)=>{const{obj:n,k:r}=xr(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},y1=(e,t,n)=>{const r=po(e,n);return r!==void 0?r:po(t,n)},Fp=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?D(e[r])||e[r]instanceof String||D(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Fp(e[r],t[r],n):e[r]=t[r]);return e},Xt=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var v1={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const w1=e=>D(e)?e.replace(/[&<>"'\/]/g,t=>v1[t]):e;class S1{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const k1=[" ",",","?","!",";"],x1=new S1(20),E1=(e,t,n)=>{t=t||"",n=n||"";const r=k1.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const i=x1.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(e);if(!o){const s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o},Pl=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o-1&&ae==null?void 0:e.replace(/_/g,"-"),C1={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class ho{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||C1,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(D(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new ho(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new ho(this.logger,t)}}var at=new ho;class Mo{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,o])=>{for(let s=0;s{for(let s=0;s-1&&this.options.ns.splice(n,1)}getResource(t,n,r,i={}){var u,c;const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):D(r)&&o?l.push(...r.split(o)):l.push(r)));const a=po(this.data,l);return!a&&!n&&!r&&t.indexOf(".")>-1&&(t=l[0],n=l[1],r=l.slice(2).join(".")),a||!s||!D(r)?a:Pl((c=(u=this.data)==null?void 0:u[t])==null?void 0:c[n],r,o)}addResource(t,n,r,i,o={silent:!1}){const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(l=t.split("."),i=n,n=l[1]),this.addNamespaces(n),wc(this.data,l,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r,i={silent:!1}){for(const o in r)(D(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o,s={silent:!1,skipCopy:!1}){let l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),i=r,r=n,n=l[1]),this.addNamespaces(n);let a=po(this.data,l)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Fp(a,r,o):a={...a,...r},wc(this.data,l,a),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var jp={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{var s;t=((s=this.processors[o])==null?void 0:s.process(t,n,r,i))??t}),t}};const $p=Symbol("i18next/PATH_KEY");function P1(){const e=[],t=Object.create(null);let n;return t.get=(r,i)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),i===$p?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Er(e,t){const{[$p]:n}=e(P1()),r=(t==null?void 0:t.keySeparator)??".",i=(t==null?void 0:t.nsSeparator)??":";if(n.length>1&&i){const o=t==null?void 0:t.ns,s=Array.isArray(o)?o:null;if(s&&s.length>1&&s.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}const kc={},Ss=e=>!D(e)&&typeof e!="boolean"&&typeof e!="number";class mo extends Mo{constructor(t,n={}){super(),h1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=at.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const i=this.resolve(t,r);if((i==null?void 0:i.res)===void 0)return!1;const o=Ss(i.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!E1(t,r,i);if(s&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:D(o)?[o]:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return{key:t,namespaces:D(o)?[o]:o}}translate(t,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";typeof t=="function"&&(t=Er(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(V=>typeof V=="function"?Er(V,{...this.options,...i}):String(V));const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:l,namespaces:a}=this.extractFromKey(t[t.length-1],i),u=a[a.length-1];let c=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=i.lng||this.language,p=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return p?o?{res:`${u}${c}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${c}${l}`:o?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:l;const y=this.resolve(t,i);let d=y==null?void 0:y.res;const v=(y==null?void 0:y.usedKey)||l,w=(y==null?void 0:y.exactUsedKey)||l,m=["[object Number]","[object Function]","[object RegExp]"],h=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,k=i.count!==void 0&&!D(i.count),E=mo.hasDefaultValue(i),R=k?this.pluralResolver.getSuffix(f,i.count,i):"",P=i.ordinal&&k?this.pluralResolver.getSuffix(f,i.count,{ordinal:!1}):"",L=k&&!i.ordinal&&i.count===0,$=L&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${R}`]||i[`defaultValue${P}`]||i.defaultValue;let T=d;g&&!d&&E&&(T=$);const de=Ss(T),Me=Object.prototype.toString.apply(T);if(g&&T&&de&&m.indexOf(Me)<0&&!(D(h)&&Array.isArray(T))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,T,{...i,ns:a}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(y.res=V,y.usedParams=this.getUsedParamsDetails(i),y):V}if(s){const V=Array.isArray(T),X=V?[]:{},Yt=V?w:v;for(const B in T)if(Object.prototype.hasOwnProperty.call(T,B)){const pe=`${Yt}${s}${B}`;E&&!d?X[B]=this.translate(pe,{...i,defaultValue:Ss($)?$[B]:void 0,joinArrays:!1,ns:a}):X[B]=this.translate(pe,{...i,joinArrays:!1,ns:a}),X[B]===pe&&(X[B]=T[B])}d=X}}else if(g&&D(h)&&Array.isArray(d))d=d.join(h),d&&(d=this.extendTranslation(d,t,i,r));else{let V=!1,X=!1;!this.isValidLookup(d)&&E&&(V=!0,d=$),this.isValidLookup(d)||(X=!0,d=l);const B=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&X?void 0:d,pe=E&&$!==d&&this.options.updateMissing;if(X||V||pe){if(this.logger.log(pe?"updateKey":"missingKey",f,u,l,pe?$:d),s){const F=this.resolve(l,{...i,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let O=[];const N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&N&&N[0])for(let F=0;F{var ft;const we=E&&Oe!==d?Oe:B;this.options.missingKeyHandler?this.options.missingKeyHandler(F,u,U,we,pe,i):(ft=this.backendConnector)!=null&&ft.saveMissing&&this.backendConnector.saveMissing(F,u,U,we,pe,i),this.emit("missingKey",F,u,U,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?O.forEach(F=>{const U=this.pluralResolver.getSuffixes(F,i);L&&i[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(Oe=>{j([F],l+Oe,i[`defaultValue${Oe}`]||$)})}):j(O,l,$))}d=this.extendTranslation(d,t,i,y,r),X&&d===l&&this.options.appendNamespaceToMissingKey&&(d=`${u}${c}${l}`),(X||V)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${l}`:l,V?d:void 0,i))}return o?(y.res=d,y.usedParams=this.getUsedParamsDetails(i),y):d}extendTranslation(t,n,r,i,o){var a,u;if((a=this.i18nFormat)!=null&&a.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=D(t)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(c){const y=t.match(this.interpolator.nestingRegexp);f=y&&y.length}let p=r.replace&&!D(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language||i.usedLng,r),c){const y=t.match(this.interpolator.nestingRegexp),d=y&&y.length;f(o==null?void 0:o[0])===y[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):this.translate(...y,n),r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=D(s)?[s]:s;return t!=null&&(l!=null&&l.length)&&r.applyPostProcessor!==!1&&(t=jp.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,i,o,s,l;return D(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(a=>typeof a=="function"?Er(a,{...this.options,...n}):a)),t.forEach(a=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(a,n),c=u.key;i=c;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=n.count!==void 0&&!D(n.count),y=p&&!n.ordinal&&n.count===0,d=n.context!==void 0&&(D(n.context)||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(w=>{var m,h;this.isValidLookup(r)||(l=w,!kc[`${v[0]}-${w}`]&&((m=this.utils)!=null&&m.hasLoadedNamespace)&&!((h=this.utils)!=null&&h.hasLoadedNamespace(l))&&(kc[`${v[0]}-${w}`]=!0,this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(g=>{var R;if(this.isValidLookup(r))return;s=g;const k=[c];if((R=this.i18nFormat)!=null&&R.addLookupKeys)this.i18nFormat.addLookupKeys(k,c,g,w,n);else{let P;p&&(P=this.pluralResolver.getSuffix(g,n.count,n));const L=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(n.ordinal&&P.indexOf($)===0&&k.push(c+P.replace($,this.options.pluralSeparator)),k.push(c+P),y&&k.push(c+L)),d){const T=`${c}${this.options.contextSeparator||"_"}${n.context}`;k.push(T),p&&(n.ordinal&&P.indexOf($)===0&&k.push(T+P.replace($,this.options.pluralSeparator)),k.push(T+P),y&&k.push(T+L))}}let E;for(;E=k.pop();)this.isValidLookup(r)||(o=E,r=this.getResource(g,w,E,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,i={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!D(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class xc{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=at.create("languageUtils")}getScriptPartFromCode(t){if(t=Hr(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Hr(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(D(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(s=>{if(s===o)return s;if(!(s.indexOf("-")<0&&o.indexOf("-")<0)&&(s.indexOf("-")>0&&o.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===o||s.indexOf(o)===0&&o.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),D(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),i=[],o=s=>{s&&(this.isSupportedCode(s)?i.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return D(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):D(t)&&o(this.formatLanguageCode(t)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}const Ec={zero:0,one:1,two:2,few:3,many:4,other:5},Cc={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class O1{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=at.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=Hr(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let s;try{s=new Intl.PluralRules(r,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Cc;if(!t.match(/-|_/))return Cc;const a=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(a,n)}return this.pluralRulesCache[o]=s,s}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>Ec[i]-Ec[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n,r={}){const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Pc=(e,t,n,r=".",i=!0)=>{let o=y1(e,t,n);return!o&&i&&D(n)&&(o=Pl(e,n,r),o===void 0&&(o=Pl(t,n,r))),o},ks=e=>e.replace(/\$/g,"$$$$");class Oc{constructor(t={}){var n;this.logger=at.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:s,suffix:l,suffixEscaped:a,formatSeparator:u,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:y,nestingSuffix:d,nestingSuffixEscaped:v,nestingOptionsSeparator:w,maxReplaces:m,alwaysFormat:h}=t.interpolation;this.escape=n!==void 0?n:w1,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Xt(o):s||"{{",this.suffix=l?Xt(l):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=p?Xt(p):y||Xt("$t("),this.nestingSuffix=d?Xt(d):v||Xt(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=m||1e3,this.alwaysFormat=h!==void 0?h:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,i){var y;let o,s,l;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=d=>{if(d.indexOf(this.formatSeparator)<0){const h=Pc(n,a,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(h,void 0,r,{...i,...n,interpolationkey:d}):h}const v=d.split(this.formatSeparator),w=v.shift().trim(),m=v.join(this.formatSeparator).trim();return this.format(Pc(n,a,w,this.options.keySeparator,this.options.ignoreJSONStructure),m,r,{...i,...n,interpolationkey:w})};this.resetRegExp();const c=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((y=i==null?void 0:i.interpolation)==null?void 0:y.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>ks(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?ks(this.escape(d)):ks(d)}].forEach(d=>{for(l=0;o=d.regex.exec(t);){const v=o[1].trim();if(s=u(v),s===void 0)if(typeof c=="function"){const m=c(t,o,i);s=D(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,v))s="";else if(f){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),s="";else!D(s)&&!this.useRawValueToEscape&&(s=gc(s));const w=d.safeValue(s);if(t=t.replace(o[0],w),f?(d.regex.lastIndex+=s.length,d.regex.lastIndex-=o[0].length):d.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,r={}){let i,o,s;const l=(a,u)=>{const c=this.nestingOptionsSeparator;if(a.indexOf(c)<0)return a;const f=a.split(new RegExp(`${Xt(c)}[ ]*{`));let p=`{${f[1]}`;a=f[0],p=this.interpolate(p,s);const y=p.match(/'/g),d=p.match(/"/g);(((y==null?void 0:y.length)??0)%2===0&&!d||((d==null?void 0:d.length)??0)%2!==0)&&(p=p.replace(/'/g,'"'));try{s=JSON.parse(p),u&&(s={...u,...s})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,v),`${a}${c}${p}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,a};for(;i=this.nestingRegexp.exec(t);){let a=[];s={...r},s=s.replace&&!D(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const u=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(a=i[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),o=n(l.call(this,i[1].trim(),s),s),o&&i[0]===t&&!D(o))return o;D(o)||(o=gc(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),a.length&&(o=a.reduce((c,f)=>this.format(c,f,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const R1=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(s=>{if(s){const[l,...a]=s.split(":"),u=a.join(":").trim().replace(/^'+|'+$/g,""),c=l.trim();n[c]||(n[c]=u),u==="false"&&(n[c]=!1),u==="true"&&(n[c]=!0),isNaN(u)||(n[c]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},Rc=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=r+JSON.stringify(o);let l=t[s];return l||(l=e(Hr(r),i),t[s]=l),l(n)}},_1=e=>(t,n,r)=>e(Hr(n),r)(t);class L1{constructor(t={}){this.logger=at.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?Rc:_1;this.formats={number:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o});return l=>s.format(l)}),currency:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o,style:"currency"});return l=>s.format(l)}),datetime:r((i,o)=>{const s=new Intl.DateTimeFormat(i,{...o});return l=>s.format(l)}),relativetime:r((i,o)=>{const s=new Intl.RelativeTimeFormat(i,{...o});return l=>s.format(l,o.range||"day")}),list:r((i,o)=>{const s=new Intl.ListFormat(i,{...o});return l=>s.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Rc(n)}format(t,n,r,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(l=>l.indexOf(")")>-1)){const l=o.findIndex(a=>a.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,l)].join(this.formatSeparator)}return o.reduce((l,a)=>{var f;const{formatName:u,formatOptions:c}=R1(a);if(this.formats[u]){let p=l;try{const y=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},d=y.locale||y.lng||i.locale||i.lng||r;p=this.formats[u](l,d,{...c,...i,...y})}catch(y){this.logger.warn(y)}return p}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const T1=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class N1 extends Mo{constructor(t,n,r,i={}){var o,s;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=at.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(s=(o=this.backend)==null?void 0:o.init)==null||s.call(o,r,i.backend,i)}queueLoad(t,n,r,i){const o={},s={},l={},a={};return t.forEach(u=>{let c=!0;n.forEach(f=>{const p=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?s[p]===void 0&&(s[p]=!0):(this.state[p]=1,c=!1,s[p]===void 0&&(s[p]=!0),o[p]===void 0&&(o[p]=!0),a[f]===void 0&&(a[f]=!0)))}),c||(l[u]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,n,r){const i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),!n&&r&&this.store.addResourceBundle(o,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(a=>{g1(a.loaded,[o],s),T1(a,t),n&&a.errors.push(n),a.pendingCount===0&&!a.done&&(Object.keys(a.loaded).forEach(u=>{l[u]||(l[u]={});const c=a.loaded[u];c.length&&c.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),a.done=!0,a.errors.length?a.callback(a.errors):a.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(a=>!a.done)}read(t,n,r,i=0,o=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:s});return}this.readingCalls++;const l=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&c&&i{this.read.call(this,t,n,r,i+1,o*2,s)},o);return}s(u,c)},a=this.backend[r].bind(this.backend);if(a.length===2){try{const u=a(t,n);u&&typeof u.then=="function"?u.then(c=>l(null,c)).catch(l):l(null,u)}catch(u){l(u)}return}return a(t,n,l)}prepareLoading(t,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();D(t)&&(t=this.languageUtils.toResolveHierarchy(t)),D(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,l)=>{s&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,s),!s&&l&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,l),this.loaded(t,s,l)})}saveMissing(t,n,r,i,o,s={},l=()=>{}){var a,u,c,f,p;if((u=(a=this.services)==null?void 0:a.utils)!=null&&u.hasLoadedNamespace&&!((f=(c=this.services)==null?void 0:c.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((p=this.backend)!=null&&p.create){const y={...s,isUpdate:o},d=this.backend.create.bind(this.backend);if(d.length<6)try{let v;d.length===5?v=d(t,n,r,i,y):v=d(t,n,r,i),v&&typeof v.then=="function"?v.then(w=>l(null,w)).catch(l):l(null,v)}catch(v){l(v)}else d(t,n,r,i,l,y)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const xs=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),D(e[1])&&(t.defaultValue=e[1]),D(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_c=e=>{var t,n;return D(e.ns)&&(e.ns=[e.ns]),D(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),D(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},xi=()=>{},A1=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},zp="__i18next_supportNoticeShown",I1=()=>typeof globalThis<"u"&&!!globalThis[zp],D1=()=>{typeof globalThis<"u"&&(globalThis[zp]=!0)},F1=e=>{var t,n,r,i,o,s,l,a,u,c,f,p,y;return!!(((r=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((l=(s=(o=(i=e==null?void 0:e.modules)==null?void 0:i.backend)==null?void 0:o.constructor)==null?void 0:s.name)==null?void 0:l.indexOf("Locize"))>0||(u=(a=e==null?void 0:e.options)==null?void 0:a.backend)!=null&&u.backends&&e.options.backend.backends.some(d=>{var v,w,m;return((v=d==null?void 0:d.name)==null?void 0:v.indexOf("Locize"))>0||((m=(w=d==null?void 0:d.constructor)==null?void 0:w.name)==null?void 0:m.indexOf("Locize"))>0})||(f=(c=e==null?void 0:e.options)==null?void 0:c.backend)!=null&&f.projectId||(y=(p=e==null?void 0:e.options)==null?void 0:p.backend)!=null&&y.backendOptions&&e.options.backend.backendOptions.some(d=>d==null?void 0:d.projectId))};class Cr extends Mo{constructor(t={},n){if(super(),this.options=_c(t),this.services={},this.logger=at,this.modules={external:[]},A1(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(D(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=xs();this.options={...r,...this.options,..._c(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!F1(this)&&!I1()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),D1());const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?at.init(i(this.modules.logger),this.options):at.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=L1;const c=new xc(this.options);this.store=new Sc(this.options.resources,this.options);const f=this.services;f.logger=at,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new O1(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=i(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Oc(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new N1(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(y,...d)=>{this.emit(y,...d)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new mo(this.services,this.options),this.translator.on("*",(y,...d)=>{this.emit(y,...d)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,n||(n=xi),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...c)=>this.store[u](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...c)=>(this.store[u](...c),this)});const l=ar(),a=()=>{const u=(c,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(c,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),l}loadResources(t,n=xi){var o,s;let r=n;const i=D(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const l=[],a=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&l.indexOf(f)<0&&l.push(f)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),(s=(o=this.options.preload)==null?void 0:o.forEach)==null||s.call(o,u=>a(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const i=ar();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=xi),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&jp.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=ar();this.emit("languageChanging",t);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,a)=>{a?this.isLanguageChangingTo===t&&(i(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},s=l=>{var c,f;!t&&!l&&this.services.languageDetector&&(l=[]);const a=D(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(a)?a:this.services.languageUtils.getBestMatchFromCodes(D(l)?[l]:l);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),(f=(c=this.services.languageDetector)==null?void 0:c.cacheUserLanguage)==null||f.call(c,u)),this.loadResources(u,p=>{o(p,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),r}getFixedT(t,n,r){const i=(o,s,...l)=>{let a;typeof s!="object"?a=this.options.overloadTranslationOptionHandler([o,s].concat(l)):a={...s},a.lng=a.lng||i.lng,a.lngs=a.lngs||i.lngs,a.ns=a.ns||i.ns,a.keyPrefix!==""&&(a.keyPrefix=a.keyPrefix||r||i.keyPrefix);const u={...this.options,...a},c=this.options.keySeparator||".";let f;return a.keyPrefix&&Array.isArray(o)?f=o.map(p=>(typeof p=="function"&&(p=Er(p,u)),`${a.keyPrefix}${c}${p}`)):(typeof o=="function"&&(o=Er(o,u)),f=a.keyPrefix?`${a.keyPrefix}${c}${o}`:o),this.t(f,a)};return D(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(l,a)=>{const u=this.services.backendConnector.state[`${l}|${a}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,s);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}loadNamespaces(t,n){const r=ar();return this.options.ns?(D(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ar();D(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(s=>i.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return o.length?(this.options.preload=i.concat(o),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){var i,o;if(t||(t=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const s=new Intl.Locale(t);if(s&&s.getTextInfo){const l=s.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((o=this.services)==null?void 0:o.languageUtils)||new xc(xs());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new Cr(t,n);return r.createInstance=Cr.createInstance,r}cloneInstance(t={},n=xi){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Cr(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(l=>{o[l]=this[l]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const l=Object.keys(this.store.data).reduce((a,u)=>(a[u]={...this.store.data[u]},a[u]=Object.keys(a[u]).reduce((c,f)=>(c[f]={...a[u][f]},c),a[u]),a),{});o.store=new Sc(l,i),o.services.resourceStore=o.store}if(t.interpolation){const a={...xs().interpolation,...this.options.interpolation,...t.interpolation},u={...i,interpolation:a};o.services.interpolator=new Oc(u)}return o.translator=new mo(o.services,i),o.translator.on("*",(l,...a)=>{o.emit(l,...a)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Pe=Cr.createInstance();Pe.createInstance;Pe.dir;Pe.init;Pe.loadResources;Pe.reloadResources;Pe.use;Pe.changeLanguage;Pe.getFixedT;Pe.t;Pe.exists;Pe.setDefaultNamespace;Pe.hasLoadedNamespace;Pe.loadNamespaces;Pe.loadLanguages;const j1=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,$1={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},z1=e=>$1[e],U1=e=>e.replace(j1,z1);let Ol={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:U1,transDefaultProps:void 0};const M1=(e={})=>{Ol={...Ol,...e}},Kw=()=>Ol;let Up;const B1=e=>{Up=e},Qw=()=>Up,b1={type:"3rdParty",init(e){M1(e.options.react),B1(e)}},{slice:V1,forEach:H1}=[];function W1(e){return H1.call(V1.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function K1(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const Lc=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Q1=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const s=r.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(s)}`}if(r.domain){if(!Lc.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!Lc.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},Tc={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Q1(e,t,i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const s=i.substring(1).split("&");for(let l=0;l0&&s[l].substring(0,a)===t&&(n=s[l].substring(a+1))}}return n}},Y1={name:"hash",lookup(e){var i;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const s=o.substring(1);if(t){const l=s.split("&");for(let a=0;a0&&l[a].substring(0,u)===t&&(r=l[a].substring(u+1))}}if(r)return r;if(!r&&n>-1){const l=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(i=l[typeof n=="number"?n:0])==null?void 0:i.replace("/",""):void 0}}}return r}};let vn=null;const Nc=()=>{if(vn!==null)return vn;try{if(vn=typeof window<"u"&&window.localStorage!==null,!vn)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{vn=!1}return vn};var G1={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Nc())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Nc()&&window.localStorage.setItem(n,e)}};let wn=null;const Ac=()=>{if(wn!==null)return wn;try{if(wn=typeof window<"u"&&window.sessionStorage!==null,!wn)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{wn=!1}return wn};var X1={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Ac())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Ac()&&window.sessionStorage.setItem(n,e)}},Z1={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o0?t:void 0}},ew={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},tw={name:"path",lookup(e){var i;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof t=="number"?t:0])==null?void 0:i.replace("/",""):void 0}},nw={name:"subdomain",lookup(e){var i,o;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((o=(i=window.location)==null?void 0:i.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let Mp=!1;try{document.cookie,Mp=!0}catch{}const Bp=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Mp||Bp.splice(1,1);const rw=()=>({order:Bp,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class bp{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=W1(n,this.options||{},rw()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(q1),this.addDetector(J1),this.addDetector(G1),this.addDetector(X1),this.addDetector(Z1),this.addDetector(ew),this.addDetector(tw),this.addDetector(nw),this.addDetector(Y1)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!K1(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}bp.type="languageDetector";const iw={"nav.home":"Home","nav.pricing":"Pricing","nav.packages":"Packages","nav.dashboard":"Dashboard","nav.apiKeys":"API Keys","nav.login":"Login","nav.signUp":"Sign Up","nav.logout":"Logout","nav.contact":"Contact","home.heroSubtitle":"Access the world's most powerful AI models through a single API endpoint. Simple, affordable, reliable.","home.getStarted":"Get Started Free","home.viewPricing":"View Pricing","home.goToDashboard":"Go to Dashboard","home.aiModels":"AI Models","home.uptime":"Uptime","home.latency":"Latency","home.whyChooseUs":"Why Choose Us","home.whyChooseUsDesc":"Everything you need to build AI-powered applications","home.lightningFast":"Lightning Fast","home.lightningFastDesc":"Optimized routing and caching deliver responses with minimal latency. Load-balanced across multiple providers for maximum reliability.","home.securePrivate":"Secure & Private","home.securePrivateDesc":"Enterprise-grade security with encrypted API keys. No request logging by default. Your data stays your data.","home.payAsYouGo":"Pay As You Go","home.payAsYouGoDesc":"Transparent pricing with no hidden fees. Only pay for what you use. Multiple top-up options and subscription packages available.","home.availableModels":"Available Models","home.availableModelsDesc":"Access {{count}} AI models through a unified API","home.viewAllModels":"View all {{count}} models","home.plansPackages":"Plans & Packages","home.choosePlan":"Choose a plan that fits your needs","home.subscribe":"Subscribe","home.days":"{{count}} days","home.readyToStart":"Ready to Get Started?","home.readyToStartDesc":"Create your account and start building with AI in minutes. No credit card required.","home.createFreeAccount":"Create Free Account","home.signIn":"Sign In","home.defaultHeroTitle":"AI API Platform","login.welcomeBack":"Welcome Back","login.signInTo":"Sign in to {{name}}","login.signInToDefault":"Sign in to your account","login.username":"Username","login.password":"Password","login.enterUsername":"Enter your username","login.enterPassword":"Enter your password","login.signingIn":"Signing in...","login.signInBtn":"Sign In","login.noAccount":"Don't have an account?","login.createOne":"Create one","login.fillAllFields":"Please fill in all fields","login.welcomeBackToast":"Welcome back!","register.createAccount":"Create Account","register.getStartedWith":"Get started with {{name}}","register.getStartedDefault":"Get started with our platform","register.username":"Username","register.email":"Email","register.password":"Password","register.confirmPassword":"Confirm Password","register.chooseUsername":"Choose a username","register.emailPlaceholder":"your@email.com (optional)","register.passwordPlaceholder":"8-20 characters","register.repeatPassword":"Repeat your password","register.creating":"Creating...","register.createAccountBtn":"Create Account","register.hasAccount":"Already have an account?","register.signIn":"Sign in","register.fillRequired":"Please fill in all required fields","register.passwordMismatch":"Passwords do not match","register.passwordLength":"Password must be 8-20 characters","register.accountCreated":"Account created! Please sign in.","dashboard.welcome":"Welcome,","dashboard.manageDesc":"Manage your API usage, keys, and account","dashboard.balance":"Balance","dashboard.quotaUnits":"{{count}} quota units","dashboard.used":"Used","dashboard.totalRequests":"Total Requests","dashboard.redeemCode":"Redeem Code","dashboard.enterCode":"Enter redemption code","dashboard.redeeming":"Redeeming...","dashboard.redeem":"Redeem","dashboard.redeemSuccess":"Code redeemed successfully!","dashboard.quickLinks":"Quick Links","dashboard.apiKeys":"API Keys","dashboard.manageKeys":"Manage your keys","dashboard.packages":"Packages","dashboard.viewPlans":"View plans","dashboard.pricing":"Pricing","dashboard.modelPrices":"Model prices","dashboard.apiDocs":"API Docs","dashboard.comingSoon":"Coming soon","tokens.title":"API Keys","tokens.subtitle":"Manage your API access tokens","tokens.newKey":"+ New Key","tokens.createApiKey":"Create API Key","tokens.name":"Name","tokens.namePlaceholder":"e.g. my-app-key","tokens.cancel":"Cancel","tokens.creating":"Creating...","tokens.create":"Create","tokens.newApiKey":"Your New API Key","tokens.keyWarning":"This is the only time you'll see this key. Copy it now and store it securely.","tokens.copied":"Copied!","tokens.copy":"Copy","tokens.copiedToClipboard":"Copied to clipboard!","tokens.savedKey":"I've saved my key","tokens.deleteToken":"Delete Token","tokens.deleteConfirm":'Delete "{{name}}"? This cannot be undone.',"tokens.delete":"Delete","tokens.noKeys":"No API keys yet","tokens.createFirst":"Create Your First Key","tokens.enabled":"Enabled","tokens.disabled":"Disabled","tokens.tokenDisabled":"Token disabled","tokens.tokenEnabled":"Token enabled","tokens.tokenDeleted":"Token deleted","tokens.enterName":"Please enter a name","tokens.quickStart":"Quick Start","tokens.quickStartComment":"# Use your API key with OpenAI-compatible endpoint","pricing.title":"Model Pricing","pricing.subtitle":"Transparent, pay-as-you-go pricing for all available models. Prices shown per 1M tokens.","pricing.searchPlaceholder":"Search models...","pricing.noMatch":"No models match your search","pricing.noModels":"No models available","pricing.model":"Model","pricing.inputPrice":"Input / 1M tokens","pricing.outputPrice":"Output / 1M tokens","pricing.status":"Status","pricing.online":"Online","pricing.unknown":"Unknown","packages.title":"Packages & Plans","packages.subtitle":"Choose a package that fits your usage. All plans include access to all available models.","packages.noPackages":"No packages available at the moment.","packages.checkPricing":"Check model pricing","packages.daysAccess":"{{count}} days access","packages.creditIncluded":"${{amount}} credit included","packages.requestsMin":"{{count}} requests/min","packages.allModels":"All models access","packages.openaiApi":"OpenAI-compatible API","packages.subscribeNow":"Subscribe Now","packages.signUpToSubscribe":"Sign Up to Subscribe","packages.processing":"Processing...","packages.confirmTitle":"Confirm Subscription","packages.confirmDesc":"Subscribe to {{name}} for ${{price}}?","packages.yourBalance":"Your balance:","packages.insufficientBalance":"Insufficient balance. Please top up before subscribing.","packages.confirm":"Confirm","packages.subscribedSuccess":"Subscribed successfully!","common.sessionExpired":"Session expired, please log in again","common.requestFailed":"Request failed","nav.topup":"Top Up","topup.title":"Top Up","topup.subtitle":"Recharge your account balance via online payment or redemption code","topup.onlineTopup":"Online Top Up","topup.selectAmount":"Select Amount","topup.customAmount":"Custom Amount","topup.amountPlaceholder":"Enter amount (min ${{min}})","topup.paymentMethod":"Payment Method","topup.processing":"Processing...","topup.calculating":"Calculating...","topup.payAmountLabel":"Amount to pay","topup.enterAmount":"Please enter a top-up amount","topup.paymentSuccess":"Payment successful! Balance updated.","topup.orderExpired":"Payment order expired","topup.viewHistory":"View History","topup.hideHistory":"Hide History","topup.history":"Top-Up History","topup.noHistory":"No top-up records yet","topup.statusSuccess":"Success","topup.statusPending":"Pending","topup.statusFailed":"Failed","topup.redeemTitle":"Redeem Code","topup.enterRedeemCode":"Enter redemption code","topup.redeeming":"Redeeming...","topup.redeem":"Redeem","topup.redeemCode":"Redeem Code","topup.redeemSuccess":"Code redeemed successfully!","topup.cryptoPayment":"Crypto Payment","topup.walletAddress":"Wallet Address","topup.amount":"Amount","topup.chain":"Chain","topup.waitingPayment":"Waiting for payment...","topup.close":"Close","topup.selectChain":"Please select a blockchain network","topup.selectToken":"Please select a token","topup.token":"Token","topup.payWith":"Pay with","topup.payNow":"Pay","topup.quotaIncluded":"{{count}} quota included","topup.creemPayment":"Creem Payment"},ow={translation:iw},sw={"nav.home":"首页","nav.pricing":"定价","nav.packages":"套餐","nav.dashboard":"控制台","nav.apiKeys":"API 密钥","nav.login":"登录","nav.signUp":"注册","nav.logout":"退出","nav.contact":"联系我们","home.heroSubtitle":"通过单一 API 端点访问全球最强大的 AI 模型。简单、实惠、可靠。","home.getStarted":"免费开始","home.viewPricing":"查看定价","home.goToDashboard":"进入控制台","home.aiModels":"AI 模型","home.uptime":"在线率","home.latency":"延迟","home.whyChooseUs":"为什么选择我们","home.whyChooseUsDesc":"构建 AI 应用所需的一切","home.lightningFast":"极速响应","home.lightningFastDesc":"优化的路由和缓存以最低延迟交付响应。跨多个供应商负载均衡,确保最大可靠性。","home.securePrivate":"安全可靠","home.securePrivateDesc":"企业级安全性,API 密钥加密存储。默认不记录请求日志。您的数据由您掌控。","home.payAsYouGo":"按量付费","home.payAsYouGoDesc":"透明定价,无隐藏费用。按使用量付费。提供多种充值方式和订阅套餐。","home.availableModels":"可用模型","home.availableModelsDesc":"通过统一 API 访问 {{count}} 个 AI 模型","home.viewAllModels":"查看全部 {{count}} 个模型","home.plansPackages":"套餐方案","home.choosePlan":"选择适合您需求的方案","home.subscribe":"订阅","home.days":"{{count}} 天","home.readyToStart":"准备好了吗?","home.readyToStartDesc":"创建账户,几分钟内即可开始使用 AI 构建应用。无需信用卡。","home.createFreeAccount":"免费创建账户","home.signIn":"登录","home.defaultHeroTitle":"AI API 平台","login.welcomeBack":"欢迎回来","login.signInTo":"登录到 {{name}}","login.signInToDefault":"登录您的账户","login.username":"用户名","login.password":"密码","login.enterUsername":"请输入用户名","login.enterPassword":"请输入密码","login.signingIn":"登录中...","login.signInBtn":"登录","login.noAccount":"还没有账户?","login.createOne":"立即注册","login.fillAllFields":"请填写所有字段","login.welcomeBackToast":"欢迎回来!","register.createAccount":"创建账户","register.getStartedWith":"开始使用 {{name}}","register.getStartedDefault":"开始使用我们的平台","register.username":"用户名","register.email":"邮箱","register.password":"密码","register.confirmPassword":"确认密码","register.chooseUsername":"请选择用户名","register.emailPlaceholder":"your@email.com(可选)","register.passwordPlaceholder":"8-20 个字符","register.repeatPassword":"请再次输入密码","register.creating":"创建中...","register.createAccountBtn":"创建账户","register.hasAccount":"已有账户?","register.signIn":"立即登录","register.fillRequired":"请填写所有必填字段","register.passwordMismatch":"两次密码不一致","register.passwordLength":"密码长度需为 8-20 个字符","register.accountCreated":"账户创建成功!请登录。","dashboard.welcome":"欢迎,","dashboard.manageDesc":"管理您的 API 用量、密钥和账户","dashboard.balance":"余额","dashboard.quotaUnits":"{{count}} 额度单位","dashboard.used":"已使用","dashboard.totalRequests":"总请求数","dashboard.redeemCode":"兑换码","dashboard.enterCode":"请输入兑换码","dashboard.redeeming":"兑换中...","dashboard.redeem":"兑换","dashboard.redeemSuccess":"兑换码兑换成功!","dashboard.quickLinks":"快捷入口","dashboard.apiKeys":"API 密钥","dashboard.manageKeys":"管理您的密钥","dashboard.packages":"套餐","dashboard.viewPlans":"查看方案","dashboard.pricing":"定价","dashboard.modelPrices":"模型价格","dashboard.apiDocs":"API 文档","dashboard.comingSoon":"即将推出","tokens.title":"API 密钥","tokens.subtitle":"管理您的 API 访问令牌","tokens.newKey":"+ 新建密钥","tokens.createApiKey":"创建 API 密钥","tokens.name":"名称","tokens.namePlaceholder":"例如 my-app-key","tokens.cancel":"取消","tokens.creating":"创建中...","tokens.create":"创建","tokens.newApiKey":"您的新 API 密钥","tokens.keyWarning":"这是您唯一一次看到此密钥的机会。请立即复制并安全保存。","tokens.copied":"已复制!","tokens.copy":"复制","tokens.copiedToClipboard":"已复制到剪贴板!","tokens.savedKey":"我已保存密钥","tokens.deleteToken":"删除令牌","tokens.deleteConfirm":'删除 "{{name}}"?此操作不可撤销。',"tokens.delete":"删除","tokens.noKeys":"暂无 API 密钥","tokens.createFirst":"创建您的第一个密钥","tokens.enabled":"已启用","tokens.disabled":"已禁用","tokens.tokenDisabled":"令牌已禁用","tokens.tokenEnabled":"令牌已启用","tokens.tokenDeleted":"令牌已删除","tokens.enterName":"请输入名称","tokens.quickStart":"快速开始","tokens.quickStartComment":"# 使用 OpenAI 兼容端点调用 API","pricing.title":"模型定价","pricing.subtitle":"透明的按量付费定价。价格以每百万 token 计。","pricing.searchPlaceholder":"搜索模型...","pricing.noMatch":"没有匹配的模型","pricing.noModels":"暂无可用模型","pricing.model":"模型","pricing.inputPrice":"输入 / 百万 token","pricing.outputPrice":"输出 / 百万 token","pricing.status":"状态","pricing.online":"在线","pricing.unknown":"未知","packages.title":"套餐方案","packages.subtitle":"选择适合您用量的套餐。所有方案均可访问全部可用模型。","packages.noPackages":"暂无可用套餐。","packages.checkPricing":"查看模型定价","packages.daysAccess":"{{count}} 天有效期","packages.creditIncluded":"含 ${{amount}} 额度","packages.requestsMin":"{{count}} 次请求/分钟","packages.allModels":"全部模型可用","packages.openaiApi":"OpenAI 兼容 API","packages.subscribeNow":"立即订阅","packages.signUpToSubscribe":"注册后订阅","packages.processing":"处理中...","packages.confirmTitle":"确认订阅","packages.confirmDesc":"订阅 {{name}},价格 ${{price}}?","packages.yourBalance":"您的余额:","packages.insufficientBalance":"余额不足,请先充值。","packages.confirm":"确认","packages.subscribedSuccess":"订阅成功!","common.sessionExpired":"会话已过期,请重新登录","common.requestFailed":"请求失败","nav.topup":"充值","topup.title":"充值中心","topup.subtitle":"通过在线支付或兑换码为账户充值","topup.onlineTopup":"在线充值","topup.selectAmount":"选择金额","topup.customAmount":"自定义金额","topup.amountPlaceholder":"输入金额(最低 ${{min}})","topup.paymentMethod":"支付方式","topup.processing":"处理中...","topup.calculating":"计算中...","topup.payAmountLabel":"实付金额","topup.enterAmount":"请输入充值金额","topup.paymentSuccess":"支付成功!余额已更新。","topup.orderExpired":"支付订单已过期","topup.viewHistory":"查看记录","topup.hideHistory":"隐藏记录","topup.history":"充值记录","topup.noHistory":"暂无充值记录","topup.statusSuccess":"成功","topup.statusPending":"待支付","topup.statusFailed":"失败","topup.redeemTitle":"兑换码充值","topup.enterRedeemCode":"请输入兑换码","topup.redeeming":"兑换中...","topup.redeem":"兑换","topup.redeemCode":"兑换码","topup.redeemSuccess":"兑换码兑换成功!","topup.cryptoPayment":"加密货币支付","topup.walletAddress":"钱包地址","topup.amount":"金额","topup.chain":"链","topup.waitingPayment":"等待支付中...","topup.close":"关闭","topup.selectChain":"请选择区块链网络","topup.selectToken":"请选择代币","topup.token":"代币","topup.payWith":"使用","topup.payNow":"支付","topup.quotaIncluded":"含 {{count}} 额度","topup.creemPayment":"Creem 支付"},lw={translation:sw};Pe.use(bp).use(b1).init({load:"languageOnly",resources:{en:ow,zh:lw},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag","querystring"],caches:["localStorage"]}});Es.createRoot(document.getElementById("root")).render(I.jsx(it.StrictMode,{children:I.jsx(wy,{children:I.jsx(X0,{children:I.jsxs(J0,{children:[I.jsx(p1,{}),I.jsx(cv,{position:"top-center",toastOptions:{duration:3e3,style:{background:"#1a1a2e",color:"#fff",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",fontSize:"14px"}}})]})})})}));export{aw as L,np as N,cy as O,_w as Q,Z0 as a,Gd as b,Gn as c,jw as d,Aw as e,Iw as f,Nw as g,Dw as h,Fw as i,I as j,Tw as k,Lw as l,zw as m,Uw as n,Bw as o,Mw as p,bw as q,x as r,$w as s,Vw as t,Y0 as u,Hw as v,Ww as w,Kw as x,Qw as y,hs as z}; diff --git a/dist/assets/proxy-BY9NCDQu.js b/dist/assets/proxy-Cyyan-lb.js similarity index 99% rename from dist/assets/proxy-BY9NCDQu.js rename to dist/assets/proxy-Cyyan-lb.js index c0625af..a672f72 100644 --- a/dist/assets/proxy-BY9NCDQu.js +++ b/dist/assets/proxy-Cyyan-lb.js @@ -1 +1 @@ -import{r as w,j as Yt}from"./index-BSnGsuja.js";import{n as ve,p,f as S,g as Ss,i as Vs,W as Jn,e as As,h as xe,m as Tt,s as X,j as W,k as Cs,l as bs,o as Es,r as Ds,J as bt,t as et,q as Te,v as F,w as ct,x as Qn,y as nt,z as b,A as ht,B as O,D as Ms,E as Rs,F as Ls,G as He,H as _t,I as yt,K as B,L as Bs,N as ze,O as ks,P as ti,c as Z,S as ei,Q as V,R as ni,T as Zt,U as Is,V as ii,X as qt,Y as M,Z as jt,b as js,M as si,d as Fs,_ as oi}from"./CountUp-CaPcnNrA.js";const ri=w.createContext({}),we=w.createContext(null),ai=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function li(t){return typeof t=="object"&&t!==null}const ui=t=>/^0[^.\s]+$/u.test(t);function ci(t){let e;return()=>(e===void 0&&(e=t()),e)}function Os(t){for(let e=1;et*180/Math.PI,Jt=t=>{const e=$(Math.atan2(t[1],t[0]));return Qt(e)},Ns={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Jt,rotateZ:Jt,skewX:t=>$(Math.atan(t[1])),skewY:t=>$(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Qt=t=>(t=t%360,t<0&&(t+=360),t),Ge=Jt,$e=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Xe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Us={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$e,scaleY:Xe,scale:t=>($e(t)+Xe(t))/2,rotateX:t=>Qt($(Math.atan2(t[6],t[5]))),rotateY:t=>Qt($(Math.atan2(-t[2],t[0]))),rotateZ:Ge,rotate:Ge,skewX:t=>$(Math.atan(t[4])),skewY:t=>$(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function te(t){return t.includes("scale")?1:0}function ee(t,e){if(!t||t==="none")return te(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Us,s=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Ns,s=a}if(!s)return te(e);const r=i[e],o=s[1].split(",").map(Ks);return typeof r=="function"?r(o):o[r]}const Ws=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ee(n,e)};function Ks(t){return parseFloat(t.trim())}const it=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],st=new Set(it),Ye=t=>t===ve||t===p,Hs=new Set(["x","y","z"]),zs=it.filter(t=>!Hs.has(t));function Gs(t){const e=[];return zs.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const U={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return i==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return i==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ee(e,"x"),y:(t,{transform:e})=>ee(e,"y")};U.translateX=U.x;U.translateY=U.y;const Y=new Set;let ne=!1,ie=!1,se=!1;function hi(){if(ie){const t=Array.from(Y).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const s=Gs(i);s.length&&(n.set(i,s),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const s=n.get(i);s&&s.forEach(([r,o])=>{var a;(a=i.getValue(r))==null||a.set(o)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}ie=!1,ne=!1,Y.forEach(t=>t.complete(se)),Y.clear()}function fi(){Y.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ie=!0)})}function $s(){se=!0,fi(),hi(),se=!1}class Pe{constructor(e,n,i,s,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=s,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Y.add(this),ne||(ne=!0,S.read(fi),S.resolveKeyframes(hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:s}=this;if(e[0]===null){const r=s==null?void 0:s.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(i&&n){const a=i.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),s&&r===void 0&&s.set(e[0])}Os(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Y.delete(this)}cancel(){this.state==="scheduled"&&(Y.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Xs=t=>t.startsWith("--");function di(t,e,n){Xs(e)?t.style.setProperty(e,n):t.style[e]=n}const Ys={};function mi(t,e){const n=ci(t);return()=>Ys[e]??n()}const _s=mi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),pi=mi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),at=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,_e={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:at([0,.65,.55,1]),circOut:at([.55,0,1,.45]),backIn:at([.31,.01,.66,-.59]),backOut:at([.33,1.53,.69,.99])};function gi(t,e){if(t)return typeof t=="function"?pi()?Ss(t,e):"ease-out":Vs(t)?at(t):Array.isArray(t)?t.map(n=>gi(n,e)||_e.easeOut):_e[t]}function Zs(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=gi(a,s);Array.isArray(h)&&(u.easing=h);const f={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(u,f)}function yi(t){return typeof t=="function"&&"applyToOptions"in t}function qs({type:t,...e}){return yi(t)&&pi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class vi extends Jn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,As(typeof e.type!="string");const c=qs(e);this.animation=Zs(n,i,s,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=xe(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),di(n,i,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,i,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(i=this.animation).commitStyles)==null||s.call(i))}get duration(){var n,i;const e=((i=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:i.call(n).duration)||0;return Tt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Tt(e)}get time(){return Tt(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=X(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:i,observe:s}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&_s()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),W):s(this)}}const xi={anticipate:Es,backInOut:bs,circInOut:Cs};function Js(t){return t in xi}function Qs(t){typeof t.ease=="string"&&Js(t.ease)&&(t.ease=xi[t.ease])}const Ft=10;class to extends vi{constructor(e){Qs(e),Ds(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:s,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new bt({...o,autoplay:!1}),l=Math.max(Ft,et.now()-this.startTime),c=Te(0,Ft,l-Ft),u=a.sample(l).value,{name:h}=this.options;r&&h&&di(r,h,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const Ze=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(F.test(t)||t==="0")&&!t.startsWith("url("));function eo(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function ao(t){var h;const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o,keyframes:a}=t;if(!(((h=e==null?void 0:e.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return ro()&&n&&(Ti.has(n)||oo.has(n)&&so(a))&&(n!=="transform"||!u)&&!c&&!i&&s!=="mirror"&&r!==0&&o!=="inertia"}const lo=40;class uo extends Jn{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...h}){var m;super(),this.stop=()=>{var x,g;this._animation&&(this._animation.stop(),(x=this.stopTimeline)==null||x.call(this)),(g=this.keyframeResolver)==null||g.cancel()},this.createdAt=et.now();const f={autoplay:e,delay:n,type:i,repeat:s,repeatDelay:r,repeatType:o,name:l,motionValue:c,element:u,...h},d=(u==null?void 0:u.KeyframeResolver)||Pe;this.keyframeResolver=new d(a,(x,g,T)=>this.onKeyframesResolved(x,g,f,!T),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,i,s){var T,y;this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=et.now();let h=!0;no(e,r,o,a)||(h=!1,(ct.instantAnimations||!l)&&(u==null||u(xe(e,i,n))),e[0]=e[e.length-1],oe(i),i.repeat=0);const d={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>lo?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},m=h&&!c&&ao(d),x=(y=(T=d.motionValue)==null?void 0:T.owner)==null?void 0:y.current;let g;if(m)try{g=new to({...d,element:x})}catch{g=new bt(d)}else g=new bt(d);g.finished.then(()=>{this.notifyFinished()}).catch(W),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),$s()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function wi(t,e,n,i=0,s=1){const r=Array.from(t).sort((c,u)=>c.sortNodePosition(u)).indexOf(e),o=t.size,a=(o-1)*i;return typeof n=="function"?n(r,o):s===1?r*i:a-r*i}const co=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ho(t){const e=co.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Pi(t,e,n=1){const[i,s]=ho(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const o=r.trim();return ai(o)?parseFloat(o):o}return Qn(s)?Pi(s,e,n+1):s}const fo={type:"spring",stiffness:500,damping:25,restSpeed:10},mo=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),po={type:"keyframes",duration:.8},go={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},yo=(t,{keyframes:e})=>e.length>2?po:st.has(t)?t.startsWith("scale")?mo(e[1]):fo:go;function Si(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Se(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Si(n,t):n}const vo=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function xo(t){for(const e in t)if(!vo.has(e))return!0;return!1}const Ve=(t,e,n,i={},s,r)=>o=>{const a=Se(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-X(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};xo(a)||Object.assign(u,yo(t,u)),u.duration&&(u.duration=X(u.duration)),u.repeatDelay&&(u.repeatDelay=X(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(oe(u),u.delay===0&&(h=!0)),(ct.instantAnimations||ct.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(h=!0,oe(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=xe(u.keyframes,a);if(f!==void 0){S.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new bt(u):new uo(u)};function qe(t){const e=[{},{}];return t==null||t.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function Ae(t,e,n,i){if(typeof e=="function"){const[s,r]=qe(i);e=e(n!==void 0?n:t.custom,s,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,r]=qe(i);e=e(n!==void 0?n:t.custom,s,r)}return e}function _(t,e,n){const i=t.getProps();return Ae(i,e,n!==void 0?n:i.custom,t)}const Vi=new Set(["width","height","top","left","right","bottom",...it]),re=t=>Array.isArray(t);function To(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,nt(n))}function wo(t){return re(t)?t[t.length-1]||0:t}function Po(t,e){const n=_(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const o in r){const a=wo(r[o]);To(t,o,a)}}function So(t){return!!(b(t)&&t.add)}function ae(t,e){const n=t.getValue("willChange");if(So(n))return n.add(e);if(!n&&ct.WillChange){const i=new ct.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function Ce(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Vo="framerAppearId",Ai="data-"+Ce(Vo);function Ci(t){return t.props[Ai]}function Ao({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function bi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:o,...a}=e;const l=t.getDefaultTransition();r=r?Si(r,l):l;const c=r==null?void 0:r.reduceMotion;i&&(r=i);const u=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),m=a[f];if(m===void 0||h&&Ao(h,f))continue;const x={delay:n,...Se(r||{},f)},g=d.get();if(g!==void 0&&!d.isAnimating()&&!Array.isArray(m)&&m===g&&!x.velocity){S.update(()=>d.set(m));continue}let T=!1;if(window.MotionHandoffAnimation){const P=Ci(t);if(P){const E=window.MotionHandoffAnimation(P,f,S);E!==null&&(x.startTime=E,T=!0)}}ae(t,f);const y=c??t.shouldReduceMotion;d.start(Ve(f,d,m,y&&Vi.has(f)?{type:!1}:x,t,T));const v=d.animation;v&&u.push(v)}if(o){const f=()=>S.update(()=>{o&&Po(t,o)});u.length?Promise.all(u).then(f):f()}return u}function le(t,e,n={}){var l;const i=_(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(bi(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:f}=s;return Co(t,e,c,u,h,f,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,u]=a==="beforeChildren"?[r,o]:[o,r];return c().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function Co(t,e,n=0,i=0,s=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(le(l,e,{...o,delay:n+(typeof i=="function"?0:i)+wi(t.variantChildren,l,i,s,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function bo(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const s=e.map(r=>le(t,r,n));i=Promise.all(s)}else if(typeof e=="string")i=le(t,e,n);else{const s=typeof e=="function"?_(t,e,n.custom):e;i=Promise.all(bi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Eo={test:t=>t==="auto",parse:t=>t},Ei=t=>e=>e.test(t),Di=[ve,p,ht,O,Ms,Rs,Eo],Je=t=>Di.find(Ei(t));function Do(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ui(t):!0}const Mo=new Set(["brightness","contrast","saturate","opacity"]);function Ro(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(Ls)||[];if(!i)return t;const s=n.replace(i,"");let r=Mo.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const Lo=/\b([a-z-]*)\(.*?\)/gu,ue={...F,getAnimatableNone:t=>{const e=t.match(Lo);return e?e.map(Ro).join(" "):t}},ce={...F,getAnimatableNone:t=>{const e=F.parse(t);return F.createTransformer(t)(e.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},Qe={...ve,transform:Math.round},Bo={rotate:O,rotateX:O,rotateY:O,rotateZ:O,scale:yt,scaleX:yt,scaleY:yt,scaleZ:yt,skew:O,skewX:O,skewY:O,distance:p,translateX:p,translateY:p,translateZ:p,x:p,y:p,z:p,perspective:p,transformPerspective:p,opacity:_t,originX:He,originY:He,originZ:p},be={borderWidth:p,borderTopWidth:p,borderRightWidth:p,borderBottomWidth:p,borderLeftWidth:p,borderRadius:p,borderTopLeftRadius:p,borderTopRightRadius:p,borderBottomRightRadius:p,borderBottomLeftRadius:p,width:p,maxWidth:p,height:p,maxHeight:p,top:p,right:p,bottom:p,left:p,inset:p,insetBlock:p,insetBlockStart:p,insetBlockEnd:p,insetInline:p,insetInlineStart:p,insetInlineEnd:p,padding:p,paddingTop:p,paddingRight:p,paddingBottom:p,paddingLeft:p,paddingBlock:p,paddingBlockStart:p,paddingBlockEnd:p,paddingInline:p,paddingInlineStart:p,paddingInlineEnd:p,margin:p,marginTop:p,marginRight:p,marginBottom:p,marginLeft:p,marginBlock:p,marginBlockStart:p,marginBlockEnd:p,marginInline:p,marginInlineStart:p,marginInlineEnd:p,fontSize:p,backgroundPositionX:p,backgroundPositionY:p,...Bo,zIndex:Qe,fillOpacity:_t,strokeOpacity:_t,numOctaves:Qe},ko={...be,color:B,backgroundColor:B,outlineColor:B,fill:B,stroke:B,borderColor:B,borderTopColor:B,borderRightColor:B,borderBottomColor:B,borderLeftColor:B,filter:ue,WebkitFilter:ue,mask:ce,WebkitMask:ce},Mi=t=>ko[t],Io=new Set([ue,ce]);function Ri(t,e){let n=Mi(t);return Io.has(n)||(n=F),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const jo=new Set(["auto","none","0"]);function Fo(t,e,n){let i=0,s;for(;i{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Li=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function No(t){return li(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Ee}=ks(queueMicrotask,!1),k={x:!1,y:!1};function Bi(){return k.x||k.y}function Uo(t){return t==="x"||t==="y"?k[t]?null:(k[t]=!0,()=>{k[t]=!1}):k.x||k.y?null:(k.x=k.y=!0,()=>{k.x=k.y=!1})}function ki(t,e){const n=ti(t),i=new AbortController,s={passive:!0,...e,signal:i.signal};return[n,s,()=>i.abort()]}function Wo(t){return!(t.pointerType==="touch"||Bi())}function Ko(t,e,n={}){const[i,s,r]=ki(t,n);return i.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},h=g=>{c&&(c(g),c=void 0),u()},f=g=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,h(g))},d=()=>{a=!0,window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",f,s)},m=g=>{if(g.pointerType!=="touch"){if(a){l=!0;return}h(g)}},x=g=>{if(!Wo(g))return;l=!1;const T=e(o,g);typeof T=="function"&&(c=T,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",x,s),o.addEventListener("pointerdown",d,s)}),r}const Ii=(t,e)=>e?t===e?!0:Ii(t,e.parentElement):!1,De=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ho=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zo(t){return Ho.has(t.tagName)||t.isContentEditable===!0}const Go=new Set(["INPUT","SELECT","TEXTAREA"]);function $o(t){return Go.has(t.tagName)||t.isContentEditable===!0}const wt=new WeakSet;function tn(t){return e=>{e.key==="Enter"&&t(e)}}function Ot(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Xo=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=tn(()=>{if(wt.has(n))return;Ot(n,"down");const s=tn(()=>{Ot(n,"up")}),r=()=>Ot(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function en(t){return De(t)&&!Bi()}const nn=new WeakSet;function Yo(t,e,n={}){const[i,s,r]=ki(t,n),o=a=>{const l=a.currentTarget;if(!en(a)||nn.has(a))return;wt.add(l),n.stopPropagation&&nn.add(a);const c=e(l,a),u=(d,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),wt.has(l)&&wt.delete(l),en(d)&&typeof c=="function"&&c(d,{success:m})},h=d=>{u(d,l===window||l===document||n.useGlobalTarget||Ii(l,d.target))},f=d=>{u(d,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",f,s)};return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),No(a)&&(a.addEventListener("focus",c=>Xo(c,s)),!zo(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function Me(t){return li(t)&&"ownerSVGElement"in t}const Pt=new WeakMap;let N;const ji=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Me(i)&&"getBBox"in i?i.getBBox()[e]:i[n],_o=ji("inline","width","offsetWidth"),Zo=ji("block","height","offsetHeight");function qo({target:t,borderBoxSize:e}){var n;(n=Pt.get(t))==null||n.forEach(i=>{i(t,{get width(){return _o(t,e)},get height(){return Zo(t,e)}})})}function Jo(t){t.forEach(qo)}function Qo(){typeof ResizeObserver>"u"||(N=new ResizeObserver(Jo))}function tr(t,e){N||Qo();const n=ti(t);return n.forEach(i=>{let s=Pt.get(i);s||(s=new Set,Pt.set(i,s)),s.add(e),N==null||N.observe(i)}),()=>{n.forEach(i=>{const s=Pt.get(i);s==null||s.delete(e),s!=null&&s.size||N==null||N.unobserve(i)})}}const St=new Set;let Q;function er(){Q=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};St.forEach(e=>e(t))},window.addEventListener("resize",Q)}function nr(t){return St.add(t),Q||er(),()=>{St.delete(t),!St.size&&typeof Q=="function"&&(window.removeEventListener("resize",Q),Q=void 0)}}function sn(t,e){return typeof t=="function"?nr(t):tr(t,e)}function ir(t){return Me(t)&&t.tagName==="svg"}const sr=[...Di,B,F],or=t=>sr.find(Ei(t)),on=()=>({translate:0,scale:1,origin:0,originPoint:0}),tt=()=>({x:on(),y:on()}),rn=()=>({min:0,max:0}),A=()=>({x:rn(),y:rn()}),rr=new WeakMap;function Lt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function ft(t){return typeof t=="string"||Array.isArray(t)}const Re=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Le=["initial",...Re];function Bt(t){return Lt(t.animate)||Le.some(e=>ft(t[e]))}function Fi(t){return!!(Bt(t)||t.variants)}function ar(t,e,n){for(const i in e){const s=e[i],r=n[i];if(b(s))t.addValue(i,s);else if(b(r))t.addValue(i,nt(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const o=t.getValue(i);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(i);t.addValue(i,nt(o!==void 0?o:s,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const he={current:null},Oi={current:!1},lr=typeof window<"u";function ur(){if(Oi.current=!0,!!lr)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>he.current=t.matches;t.addEventListener("change",e),e()}else he.current=!1}const an=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Et={};function Ni(t){Et=t}function cr(){return Et}class hr{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:s,skipAnimations:r,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Pe,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=et.now();this.renderScheduledAtthis.bindToMotionValue(r,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Oi.current||ur(),this.shouldReduceMotion=he.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(i=this.parent)==null||i.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Z(this.notifyUpdate),Z(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const i=this.features[n];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Ti.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,h=new vi({element:this.current,name:e,keyframes:a,times:l,ease:c,duration:X(u)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const i=st.has(e);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&S.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Et){const n=Et[e];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):A()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=nt(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(ai(i)||ui(i))?i=parseFloat(i):!or(i)&&F.test(n)&&(i=Ri(e,n)),this.setBaseTarget(e,b(i)?i.get():i)),b(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var r;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=Ae(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!b(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new ei),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Ee.render(this.render)}}class Ui extends hr{constructor(){super(...arguments),this.KeyframeResolver=Oo}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const i=e.style;return i?i[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;b(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class K{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Wi({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function fr({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function dr(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Nt(t){return t===void 0||t===1}function fe({scale:t,scaleX:e,scaleY:n}){return!Nt(t)||!Nt(e)||!Nt(n)}function G(t){return fe(t)||Ki(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ki(t){return ln(t.x)||ln(t.y)}function ln(t){return t&&t!=="0%"}function Dt(t,e,n){const i=t-n,s=e*i;return n+s}function un(t,e,n,i,s){return s!==void 0&&(t=Dt(t,s,i)),Dt(t,n,i)+e}function de(t,e=0,n=1,i,s){t.min=un(t.min,e,n,i,s),t.max=un(t.max,e,n,i,s)}function Hi(t,{x:e,y:n}){de(t.x,e.translate,e.scale,e.originPoint),de(t.y,n.translate,n.scale,n.originPoint)}const cn=.999999999999,hn=1.0000000000001;function mr(t,e,n,i=!1){var a;const s=n.length;if(!s)return;e.x=e.y=1;let r,o;for(let l=0;lcn&&(e.x=1),e.ycn&&(e.y=1)}function j(t,e){t.min+=e,t.max+=e}function fn(t,e,n,i,s=.5){const r=V(t.min,t.max,s);de(t,e,n,r,i)}function dn(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Vt(t,e,n){const i=n??t;fn(t.x,dn(e.x,i.x),e.scaleX,e.scale,e.originX),fn(t.y,dn(e.y,i.y),e.scaleY,e.scale,e.originY)}function zi(t,e){return Wi(dr(t.getBoundingClientRect(),e))}function pr(t,e,n){const i=zi(t,n),{scroll:s}=e;return s&&(j(i.x,s.offset.x),j(i.y,s.offset.y)),i}const gr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yr=it.length;function vr(t,e,n){let i="",s=!0;for(let r=0;r{if(!e.target)return t;if(typeof t=="string")if(p.test(t))t=parseFloat(t);else return t;const n=mn(t,e.target.x),i=mn(t,e.target.y);return`${n}% ${i}%`}},xr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=F.parse(t);if(s.length>5)return i;const r=F.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const c=V(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}},me={borderRadius:{...rt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomLeftRadius:rt,borderBottomRightRadius:rt,boxShadow:xr};function $i(t,{layout:e,layoutId:n}){return st.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!me[t]||t==="opacity")}function ke(t,e,n){var o;const i=t.style,s=e==null?void 0:e.style,r={};if(!i)return r;for(const a in i)(b(i[a])||s&&b(s[a])||$i(a,t)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(r[a]=i[a]);return r}function Tr(t){return window.getComputedStyle(t)}class wr extends Ui{constructor(){super(...arguments),this.type="html",this.renderInstance=Gi}readValueFromInstance(e,n){var i;if(st.has(n))return(i=this.projection)!=null&&i.isProjecting?te(n):Ws(e,n);{const s=Tr(e),r=(ni(n)?s.getPropertyValue(n):s[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return zi(e,n)}build(e,n,i){Be(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return ke(e,n,i)}}const Pr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Sr={offset:"strokeDashoffset",array:"strokeDasharray"};function Vr(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Pr:Sr;t[r.offset]=`${-i}`,t[r.array]=`${e} ${n}`}const Ar=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Xi(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:o=0,...a},l,c,u){if(Be(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox);for(const d of Ar)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),i!==void 0&&(h.scale=i),s!==void 0&&Vr(h,s,r,o,!1)}const Yi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),_i=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Cr(t,e,n,i){Gi(t,e,void 0,i);for(const s in e.attrs)t.setAttribute(Yi.has(s)?s:Ce(s),e.attrs[s])}function Zi(t,e,n){const i=ke(t,e,n);for(const s in t)if(b(t[s])||b(e[s])){const r=it.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[r]=t[s]}return i}class br extends Ui{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=A}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(st.has(n)){const i=Mi(n);return i&&i.default||0}return n=Yi.has(n)?n:Ce(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return Zi(e,n,i)}build(e,n,i){Xi(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,s){Cr(e,n,i,s)}mount(e){this.isSVGTag=_i(e.tagName),super.mount(e)}}const Er=Le.length;function qi(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?qi(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;nPromise.all(e.map(({animation:n,options:i})=>bo(t,n,i)))}function Lr(t){let e=Rr(t),n=pn(),i=!0,s=!1;const r=c=>(u,h)=>{var d;const f=_(t,h,c==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(f){const{transition:m,transitionEnd:x,...g}=f;u={...u,...g,...x}}return u};function o(c){e=c(t)}function a(c){const{props:u}=t,h=qi(t.parent)||{},f=[],d=new Set;let m={},x=1/0;for(let T=0;Tx&&E,Oe=!1;const Ne=Array.isArray(P)?P:[P];let ot=Ne.reduce(r(y),{});pt===!1&&(ot={});const{prevResolvedValues:Ue={}}=v,ws={...Ue,...ot},We=C=>{It=!0,d.has(C)&&(Oe=!0,d.delete(C)),v.needsAnimating[C]=!0;const R=t.getValue(C);R&&(R.liveStyle=!1)};for(const C in ws){const R=ot[C],H=Ue[C];if(m.hasOwnProperty(C))continue;let q=!1;re(R)&&re(H)?q=!Ji(R,H):q=R!==H,q?R!=null?We(C):d.add(C):R!==void 0&&d.has(C)?We(C):v.protectedKeys[C]=!0}v.prevProp=P,v.prevResolvedValues=ot,v.isActive&&(m={...m,...ot}),(i||s)&&t.blockInitialAnimation&&(It=!1);const Ke=gt&&Fe;It&&(!Ke||Oe)&&f.push(...Ne.map(C=>{const R={type:y};if(typeof C=="string"&&(i||s)&&!Ke&&t.manuallyAnimateOnMount&&t.parent){const{parent:H}=t,q=_(H,C);if(H.enteringChildren&&q){const{delayChildren:Ps}=q.transition||{};R.delay=wi(H.enteringChildren,t,Ps)}}return{animation:C,options:R}}))}if(d.size){const T={};if(typeof u.initial!="boolean"){const y=_(t,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(T.transition=y.transition)}d.forEach(y=>{const v=t.getBaseTarget(y),P=t.getValue(y);P&&(P.liveStyle=!0),T[y]=v??null}),f.push({animation:T})}let g=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(g=!1),i=!1,s=!1,g?e(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(d=>{var m;return(m=d.animationState)==null?void 0:m.setActive(c,u)}),n[c].isActive=u;const h=a(c);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=pn(),s=!0}}}function Br(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Ji(e,t):!1}function z(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pn(){return{animate:z(!0),whileInView:z(),whileHover:z(),whileTap:z(),whileDrag:z(),whileFocus:z(),exit:z()}}function pe(t,e){t.min=e.min,t.max=e.max}function L(t,e){pe(t.x,e.x),pe(t.y,e.y)}function gn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Qi=1e-4,kr=1-Qi,Ir=1+Qi,ts=.01,jr=0-ts,Fr=0+ts;function D(t){return t.max-t.min}function Or(t,e,n){return Math.abs(t-e)<=n}function yn(t,e,n,i=.5){t.origin=i,t.originPoint=V(e.min,e.max,t.origin),t.scale=D(n)/D(e),t.translate=V(n.min,n.max,t.origin)-t.originPoint,(t.scale>=kr&&t.scale<=Ir||isNaN(t.scale))&&(t.scale=1),(t.translate>=jr&&t.translate<=Fr||isNaN(t.translate))&&(t.translate=0)}function lt(t,e,n,i){yn(t.x,e.x,n.x,i?i.originX:void 0),yn(t.y,e.y,n.y,i?i.originY:void 0)}function vn(t,e,n,i=0){const s=i?V(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+D(e)}function Nr(t,e,n,i){vn(t.x,e.x,n.x,i==null?void 0:i.x),vn(t.y,e.y,n.y,i==null?void 0:i.y)}function xn(t,e,n,i=0){const s=i?V(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+D(e)}function Mt(t,e,n,i){xn(t.x,e.x,n.x,i==null?void 0:i.x),xn(t.y,e.y,n.y,i==null?void 0:i.y)}function Tn(t,e,n,i,s){return t-=e,t=Dt(t,1/n,i),s!==void 0&&(t=Dt(t,1/s,i)),t}function Ur(t,e=0,n=1,i=.5,s,r=t,o=t){if(ht.test(e)&&(e=parseFloat(e),e=V(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=V(r.min,r.max,i);t===r&&(a-=e),t.min=Tn(t.min,e,n,a,s),t.max=Tn(t.max,e,n,a,s)}function wn(t,e,[n,i,s],r,o){Ur(t,e[n],e[i],e[s],e.scale,r,o)}const Wr=["x","scaleX","originX"],Kr=["y","scaleY","originY"];function Pn(t,e,n,i){wn(t.x,e,Wr,n?n.x:void 0,i?i.x:void 0),wn(t.y,e,Kr,n?n.y:void 0,i?i.y:void 0)}function Sn(t){return t.translate===0&&t.scale===1}function es(t){return Sn(t.x)&&Sn(t.y)}function Vn(t,e){return t.min===e.min&&t.max===e.max}function Hr(t,e){return Vn(t.x,e.x)&&Vn(t.y,e.y)}function An(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function ns(t,e){return An(t.x,e.x)&&An(t.y,e.y)}function Cn(t){return D(t.x)/D(t.y)}function bn(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function I(t){return[t("x"),t("y")]}function zr(t,e,n){let i="";const s=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||r||o)&&(i=`translate3d(${s}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;c&&(i=`perspective(${c}px) ${i}`),u&&(i+=`rotate(${u}deg) `),h&&(i+=`rotateX(${h}deg) `),f&&(i+=`rotateY(${f}deg) `),d&&(i+=`skewX(${d}deg) `),m&&(i+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const is=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Gr=is.length,En=t=>typeof t=="string"?parseFloat(t):t,Dn=t=>typeof t=="number"||p.test(t);function $r(t,e,n,i,s,r){s?(t.opacity=V(0,n.opacity??1,Xr(i)),t.opacityExit=V(e.opacity??1,0,Yr(i))):r&&(t.opacity=V(e.opacity??1,n.opacity??1,i));for(let o=0;oie?1:n(Zt(t,e,i))}function _r(t,e,n){const i=b(t)?t:nt(t);return i.start(Ve("",i,e,n)),i.animation}function dt(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const Zr=(t,e)=>t.depth-e.depth;class qr{constructor(){this.children=[],this.isDirty=!1}add(e){ii(this.children,e),this.isDirty=!0}remove(e){qt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Zr),this.isDirty=!1,this.children.forEach(e)}}function Jr(t,e){const n=et.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(Z(i),t(r-e))};return S.setup(i,!0),()=>Z(i)}function At(t){return b(t)?t.get():t}class Qr{constructor(){this.members=[]}add(e){ii(this.members,e);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===e||i===this.lead||i===this.prevLead)continue;const s=i.instance;(!s||s.isConnected===!1)&&!i.snapshot&&(qt(this.members,i),i.unmount())}e.scheduleRender()}remove(e){if(qt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let i=this.members.indexOf(e)-1;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=i.options,{layoutDependency:o}=e.options;(r===void 0||r!==o)&&(e.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,i,s,r,o;(i=(n=e.options).onExitComplete)==null||i.call(n),(o=(s=e.resumingFrom)==null?void 0:(r=s.options).onExitComplete)==null||o.call(r)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Ct={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ut=["","X","Y","Z"],ta=1e3;let ea=0;function Wt(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function os(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ci(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",S,!(s||r))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&os(i)}function rs({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=ea++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(sa),this.nodes.forEach(ca),this.nodes.forEach(ha),this.nodes.forEach(oa)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;S.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,u&&u(),u=Jr(f,250),Ct.hasAnimatedSinceResize&&(Ct.hasAnimatedSinceResize=!1,this.nodes.forEach(Bn)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||ga,{onLayoutAnimationStart:x,onLayoutAnimationComplete:g}=c.getProps(),T=!this.targetLayout||!ns(this.targetLayout,d),y=!h&&f;if(this.options.layoutRoot||this.resumeFrom||y||h&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Se(m,"layout"),onPlay:x,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,y)}else h||Bn(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Z(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(fa),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&os(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!D(this.snapshot.measuredBox.x)&&!D(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const E=P/1e3;kn(h.x,o.x,E),kn(h.y,o.y,E),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),ma(this.relativeTarget,this.relativeTargetOrigin,f,E),v&&Hr(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=A()),L(v,this.relativeTarget)),x&&(this.animationValues=u,$r(u,c,this.latestValues,E,y,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Z(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=S.update(()=>{Ct.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=nt(0)),this.motionValue.jump(0,!1),this.currentAnimation=_r(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ta),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&as(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||A();const h=D(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=D(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}L(a,l),Vt(a,u),lt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Qr),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Wt("z",o,c,this.animationValues);for(let u=0;u{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Rn),this.root.sharedNodes.clear()}}}function na(t){t.updateLayout()}function ia(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;if(r==="size")I(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=D(f);f.min=i[h].min,f.max=f.min+d});else if(r==="x"||r==="y"){const h=r==="x"?"y":"x";pe(o?e.measuredBox[h]:e.layoutBox[h],i[h])}else as(r,e.layoutBox,i)&&I(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=D(i[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=tt();lt(a,i,e.layoutBox);const l=tt();o?lt(l,t.applyTransform(s,!0),e.measuredBox):lt(l,i,e.layoutBox);const c=!es(a);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const m=t.options.layoutAnchor||void 0,x=A();Mt(x,e.layoutBox,f.layoutBox,m);const g=A();Mt(g,i,d.layoutBox,m),ns(x,g)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=x,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:i}=t.options;i&&i()}t.options.transition=void 0}function sa(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function oa(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ra(t){t.clearSnapshot()}function Rn(t){t.clearMeasurements()}function aa(t){t.isLayoutDirty=!0,t.updateLayout()}function Ln(t){t.isLayoutDirty=!1}function la(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ua(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Bn(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ca(t){t.resolveTargetDelta()}function ha(t){t.calcProjection()}function fa(t){t.resetSkewAndRotation()}function da(t){t.removeLeadSnapshot()}function kn(t,e,n){t.translate=V(e.translate,0,n),t.scale=V(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function In(t,e,n,i){t.min=V(e.min,n.min,i),t.max=V(e.max,n.max,i)}function ma(t,e,n,i){In(t.x,e.x,n.x,i),In(t.y,e.y,n.y,i)}function pa(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const ga={duration:.45,ease:[.4,0,.1,1]},jn=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Fn=jn("applewebkit/")&&!jn("chrome/")?Math.round:W;function On(t){t.min=Fn(t.min),t.max=Fn(t.max)}function ya(t){On(t.x),On(t.y)}function as(t,e,n){return t==="position"||t==="preserve-aspect"&&!Or(Cn(e),Cn(n),.2)}function va(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const xa=rs({attachResizeListener:(t,e)=>dt(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Kt={current:void 0},ls=rs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Kt.current){const t=new xa({});t.mount(window),t.setOptions({layoutScroll:!0}),Kt.current=t}return Kt.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});function Ta(t=!0){const e=w.useContext(we);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=e,r=w.useId();w.useEffect(()=>{if(t)return s(r)},[t]);const o=w.useCallback(()=>t&&i&&i(r),[r,i,t]);return!n&&i?[!1,o]:[!0]}const us=w.createContext({strict:!1}),Nn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Un=!1;function wa(){if(Un)return;const t={};for(const e in Nn)t[e]={isEnabled:n=>Nn[e].some(i=>!!n[i])};Ni(t),Un=!0}function cs(){return wa(),cr()}function Pa(t){const e=cs();for(const n in t)e[n]={...e[n],...t[n]};Ni(e)}const Sa=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Rt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Sa.has(t)}let hs=t=>!Rt(t);function Va(t){typeof t=="function"&&(hs=e=>e.startsWith("on")?!Rt(e):t(e))}try{Va(require("@emotion/is-prop-valid").default)}catch{}function Aa(t,e,n){const i={};for(const s in t)s==="values"&&typeof t.values=="object"||b(t[s])||(hs(s)||n===!0&&Rt(s)||!e&&!Rt(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}const kt=w.createContext({});function Ca(t,e){if(Bt(t)){const{initial:n,animate:i}=t;return{initial:n===!1||ft(n)?n:void 0,animate:ft(i)?i:void 0}}return t.inherit!==!1?e:{}}function ba(t){const{initial:e,animate:n}=Ca(t,w.useContext(kt));return w.useMemo(()=>({initial:e,animate:n}),[Wn(e),Wn(n)])}function Wn(t){return Array.isArray(t)?t.join(" "):t}const Ie=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fs(t,e,n){for(const i in e)!b(e[i])&&!$i(i,n)&&(t[i]=e[i])}function Ea({transformTemplate:t},e){return w.useMemo(()=>{const n=Ie();return Be(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Da(t,e){const n=t.style||{},i={};return fs(i,n,t),Object.assign(i,Ea(t,e)),i}function Ma(t,e){const n={},i=Da(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const ds=()=>({...Ie(),attrs:{}});function Ra(t,e,n,i){const s=w.useMemo(()=>{const r=ds();return Xi(r,e,_i(i),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};fs(r,t.style,t),s.style={...r,...s.style}}return s}const La=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function je(t){return typeof t!="string"||t.includes("-")?!1:!!(La.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ba(t,e,n,{latestValues:i},s,r=!1,o){const l=(o??je(t)?Ra:Ma)(e,i,s,t),c=Aa(e,typeof t=="string",r),u=t!==w.Fragment?{...c,...l,ref:n}:{},{children:h}=e,f=w.useMemo(()=>b(h)?h.get():h,[h]);return w.createElement(t,{...u,children:f})}function ka({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Ia(n,i,s,t),renderState:e()}}function Ia(t,e,n,i){const s={},r=i(t,{});for(const f in r)s[f]=At(r[f]);let{initial:o,animate:a}=t;const l=Bt(t),c=Fi(t);e&&c&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const h=u?a:o;if(h&&typeof h!="boolean"&&!Lt(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d(e,n)=>{const i=w.useContext(kt),s=w.useContext(we),r=()=>ka(t,e,i,s);return n?r():js(r)},ja=ms({scrapeMotionValuesFromProps:ke,createRenderState:Ie}),Fa=ms({scrapeMotionValuesFromProps:Zi,createRenderState:ds}),Oa=Symbol.for("motionComponentSymbol");function Na(t,e,n){const i=w.useRef(n);w.useInsertionEffect(()=>{i.current=n});const s=w.useRef(null);return w.useCallback(r=>{var a;r&&((a=t.onMount)==null||a.call(t,r));const o=i.current;if(typeof o=="function")if(r){const l=o(r);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(r);else o&&(o.current=r);e&&(r?e.mount(r):e.unmount())},[e])}const ps=w.createContext({});function J(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ua(t,e,n,i,s,r){var v,P;const{visualElement:o}=w.useContext(kt),a=w.useContext(us),l=w.useContext(we),c=w.useContext(si),u=c.reducedMotion,h=c.skipAnimations,f=w.useRef(null),d=w.useRef(!1);i=i||a.renderer,!f.current&&i&&(f.current=i(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,x=w.useContext(ps);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&Wa(f.current,n,s,x);const g=w.useRef(!1);w.useInsertionEffect(()=>{m&&g.current&&m.update(n,l)});const T=n[Ai],y=w.useRef(!!T&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,T))&&((P=window.MotionHasOptimisedAnimation)==null?void 0:P.call(window,T)));return Fs(()=>{d.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),w.useEffect(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)==null||E.call(window,T)}),y.current=!1),m.enteringChildren=void 0)}),m}function Wa(t,e,n,i){const{layoutId:s,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:gs(t.parent)),t.projection.setOptions({layoutId:s,layout:r,alwaysMeasureLayout:!!o||a&&J(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function gs(t){if(t)return t.options.allowProjection!==!1?t.projection:gs(t.parent)}function Ht(t,{forwardMotionProps:e=!1,type:n}={},i,s){i&&Pa(i);const r=n?n==="svg":je(t),o=r?Fa:ja;function a(c,u){let h;const f={...w.useContext(si),...c,layoutId:Ka(c)},{isStatic:d}=f,m=ba(c),x=o(c,d);if(!d&&typeof window<"u"){Ha();const g=za(f);h=g.MeasureLayout,m.visualElement=Ua(t,x,f,s,g.ProjectionNode,r)}return Yt.jsxs(kt.Provider,{value:m,children:[h&&m.visualElement?Yt.jsx(h,{visualElement:m.visualElement,...f}):null,Ba(t,c,Na(x,m.visualElement,u),x,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=w.forwardRef(a);return l[Oa]=t,l}function Ka({layoutId:t}){const e=w.useContext(ri).id;return e&&t!==void 0?e+"-"+t:t}function Ha(t,e){w.useContext(us).strict}function za(t){const e=cs(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n!=null&&n.isEnabled(t)||i!=null&&i.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Ga(t,e){if(typeof Proxy>"u")return Ht;const n=new Map,i=(r,o)=>Ht(r,o,t,e),s=(r,o)=>i(r,o);return new Proxy(s,{get:(r,o)=>o==="create"?i:(n.has(o)||n.set(o,Ht(o,void 0,t,e)),n.get(o))})}const $a=(t,e)=>e.isSVG??je(t)?new br(e):new wr(e,{allowProjection:t!==w.Fragment});class Xa extends K{constructor(e){super(e),e.animationState||(e.animationState=Lr(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Lt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let Ya=0;class _a extends K{constructor(){super(...arguments),this.id=Ya++,this.isExitComplete=!1}update(){var r;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;if(e&&i===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"){const l=_(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...h}=l;for(const f in h)(r=this.node.getValue(f))==null||r.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Za={animation:{Feature:Xa},exit:{Feature:_a}};function mt(t){return{point:{x:t.pageX,y:t.pageY}}}const qa=t=>e=>De(e)&&t(e,mt(e));function ut(t,e,n,i){return dt(t,e,qa(n),i)}const ys=({current:t})=>t?t.ownerDocument.defaultView:null,Kn=(t,e)=>Math.abs(t-e);function Ja(t,e){const n=Kn(t.x,e.x),i=Kn(t.y,e.y);return Math.sqrt(n**2+i**2)}const Hn=new Set(["auto","scroll"]);class vs{constructor(e,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=vt(this.lastRawMoveEventInfo,this.transformPagePoint));const d=zt(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,x=Ja(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!x)return;const{point:g}=d,{timestamp:T}=M;this.history.push({...g,timestamp:T});const{onStart:y,onMove:v}=this.handlers;m||(y&&y(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=vt(m,this.transformPagePoint),S.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:x,onSessionEnd:g,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=zt(d.type==="pointercancel"?this.lastMoveEventInfo:vt(m,this.transformPagePoint),this.history);this.startEvent&&x&&x(d,y),g&&g(d,y)},!De(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=s||window;const l=mt(e),c=vt(l,this.transformPagePoint),{point:u}=c,{timestamp:h}=M;this.history=[{...u,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,zt(c,this.history)),this.removeListeners=oi(ut(this.contextWindow,"pointermove",this.handlePointerMove),ut(this.contextWindow,"pointerup",this.handlePointerUp),ut(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(Hn.has(i.overflowX)||Hn.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,s=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:s.x-n.x,y:s.y-n.y};r.x===0&&r.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,s),S.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Z(this.updatePoint)}}function vt(t,e){return e?{point:e(t.point)}:t}function zn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function zt({point:t},e){return{point:t,delta:zn(t,xs(e)),offset:zn(t,Qa(e)),velocity:tl(e,.1)}}function Qa(t){return t[0]}function xs(t){return t[t.length-1]}function tl(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=xs(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>X(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>X(e)*2&&(i=t[1]);const r=Tt(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function el(t,{min:e,max:n},i){return e!==void 0&&tn&&(t=i?V(n,t,i.max):Math.min(t,n)),t}function Gn(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function nl(t,{top:e,left:n,bottom:i,right:s}){return{x:Gn(t.x,n,s),y:Gn(t.y,e,i)}}function $n(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.mini?n=Zt(e.min,e.max-i,t.min):i>s&&(n=Zt(t.min,t.max-s,e.min)),Te(0,1,n)}function ol(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const ge=.35;function rl(t=ge){return t===!1?t=0:t===!0&&(t=ge),{x:Xn(t,"left","right"),y:Xn(t,"top","bottom")}}function Xn(t,e,n){return{min:Yn(t,e),max:Yn(t,n)}}function Yn(t,e){return typeof t=="number"?t:t[e]||0}const al=new WeakMap;class ll{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=A(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(mt(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:m,onDragStart:x}=this.getProps();if(d&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Uo(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),I(T=>{let y=this.getAxisMotionValue(T).get()||0;if(ht.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const P=v.layout.layoutBox[T];P&&(y=D(P)*(parseFloat(y)/100))}}this.originPoint[T]=y}),x&&S.update(()=>x(h,f),!1,!0),ae(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:m,onDirectionLock:x,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:T}=f;if(m&&this.currentDirection===null){this.currentDirection=cl(T),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,T),this.updateAxis("y",f.point,T),this.visualElement.render(),g&&S.update(()=>g(h,f),!1,!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new vs(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:i,contextWindow:ys(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,s=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!s||!i)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&S.postRender(()=>a(i,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,i){const{drag:s}=this.getProps();if(!i||!xt(e,s,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=el(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var r;const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,s=this.constraints;e&&J(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=nl(i.layoutBox,e):this.constraints=!1,this.elastic=rl(n),s!==this.constraints&&!J(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&I(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=ol(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!J(e))return!1;const i=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=pr(i,s.root,this.visualElement.getTransformPagePoint());let o=il(s.layout.layoutBox,r);if(n){const a=n(fr(o));this.hasMutatedConstraints=!!a,a&&(o=Wi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=I(u=>{if(!xt(u,n,this.currentDirection))return;let h=l&&l[u]||{};(o===!0||o===u)&&(h={min:0,max:0});const f=s?200:1e6,d=s?40:1e7,m={type:"inertia",velocity:i?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return ae(this.visualElement,e),i.start(Ve(e,i,0,n,this.visualElement,!1))}stopAnimation(){I(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){I(n=>{const{drag:i}=this.getProps();if(!xt(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],l=r.get()||0;r.set(e[n]-V(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!J(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};I(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=sl({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),I(o=>{if(!xt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(V(l,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;al.set(this.visualElement,this);const e=this.visualElement.current,n=ut(e,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps(),f=c.target,d=f!==e&&$o(f);u&&h&&!d&&this.start(c)});let i;const s=()=>{const{dragConstraints:c}=this.getProps();J(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),i||(i=ul(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",s);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),S.read(s);const a=dt(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(I(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=c[h].translate,f.set(f.get()+c[h].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=ge,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function _n(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function ul(t,e,n){const i=sn(t,_n(n)),s=sn(e,_n(n));return()=>{i(),s()}}function xt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function cl(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class hl extends K{constructor(e){super(e),this.removeGroupControls=W,this.removeListeners=W,this.controls=new ll(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||W}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Gt=t=>(e,n)=>{t&&S.update(()=>t(e,n),!1,!0)};class fl extends K{constructor(){super(...arguments),this.removePointerDownListener=W}onPointerDown(e){this.session=new vs(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ys(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:Gt(e),onStart:Gt(n),onMove:Gt(i),onEnd:(r,o)=>{delete this.session,s&&S.postRender(()=>s(r,o))}}}mount(){this.removePointerDownListener=ut(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let $t=!1;class dl extends w.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),i&&i.register&&s&&i.register(r),$t&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ct.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:s,isPresent:r}=this.props,{projection:o}=i;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),$t=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||S.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:i}=e;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),Ee.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=e;$t=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ts(t){const[e,n]=Ta(),i=w.useContext(ri);return Yt.jsx(dl,{...t,layoutGroup:i,switchLayoutGroup:w.useContext(ps),isPresent:e,safeToRemove:n})}const ml={pan:{Feature:fl},drag:{Feature:hl,ProjectionNode:ls,MeasureLayout:Ts}};function Zn(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,r=i[s];r&&S.postRender(()=>r(e,mt(e)))}class pl extends K{mount(){const{current:e}=this.node;e&&(this.unmount=Ko(e,(n,i)=>(Zn(this.node,i,"Start"),s=>Zn(this.node,s,"End"))))}unmount(){}}class gl extends K{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=oi(dt(this.node.current,"focus",()=>this.onFocus()),dt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function qn(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),r=i[s];r&&S.postRender(()=>r(e,mt(e)))}class yl extends K{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=Yo(e,(s,r)=>(qn(this.node,r,"Start"),(o,{success:a})=>qn(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(i==null?void 0:i.tap)===!1})}unmount(){}}const ye=new WeakMap,Xt=new WeakMap,vl=t=>{const e=ye.get(t.target);e&&e(t)},xl=t=>{t.forEach(vl)};function Tl({root:t,...e}){const n=t||document;Xt.has(n)||Xt.set(n,{});const i=Xt.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(xl,{root:t,...e})),i[s]}function wl(t,e,n){const i=Tl(e);return ye.set(t,n),i.observe(t),()=>{ye.delete(t),i.unobserve(t)}}const Pl={some:0,all:1};class Sl extends K{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:Pl[s]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),d=u?h:f;d&&d(c)};this.stopObserver=wl(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Vl(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Vl({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Al={inView:{Feature:Sl},tap:{Feature:yl},focus:{Feature:gl},hover:{Feature:pl}},Cl={layout:{ProjectionNode:ls,MeasureLayout:Ts}},bl={...Za,...Al,...ml,...Cl},Ll=Ga(bl,$a);export{ri as L,we as P,No as i,Ll as m,Ta as u}; +import{r as w,j as Yt}from"./index-sl7kA1zY.js";import{n as ve,p,f as S,g as Ss,i as Vs,W as Jn,e as As,h as xe,m as Tt,s as X,j as W,k as Cs,l as bs,o as Es,r as Ds,J as bt,t as et,q as Te,v as F,w as ct,x as Qn,y as nt,z as b,A as ht,B as O,D as Ms,E as Rs,F as Ls,G as He,H as _t,I as yt,K as B,L as Bs,N as ze,O as ks,P as ti,c as Z,S as ei,Q as V,R as ni,T as Zt,U as Is,V as ii,X as qt,Y as M,Z as jt,b as js,M as si,d as Fs,_ as oi}from"./CountUp-4XjqJEhr.js";const ri=w.createContext({}),we=w.createContext(null),ai=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function li(t){return typeof t=="object"&&t!==null}const ui=t=>/^0[^.\s]+$/u.test(t);function ci(t){let e;return()=>(e===void 0&&(e=t()),e)}function Os(t){for(let e=1;et*180/Math.PI,Jt=t=>{const e=$(Math.atan2(t[1],t[0]));return Qt(e)},Ns={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Jt,rotateZ:Jt,skewX:t=>$(Math.atan(t[1])),skewY:t=>$(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Qt=t=>(t=t%360,t<0&&(t+=360),t),Ge=Jt,$e=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Xe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Us={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$e,scaleY:Xe,scale:t=>($e(t)+Xe(t))/2,rotateX:t=>Qt($(Math.atan2(t[6],t[5]))),rotateY:t=>Qt($(Math.atan2(-t[2],t[0]))),rotateZ:Ge,rotate:Ge,skewX:t=>$(Math.atan(t[4])),skewY:t=>$(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function te(t){return t.includes("scale")?1:0}function ee(t,e){if(!t||t==="none")return te(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Us,s=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Ns,s=a}if(!s)return te(e);const r=i[e],o=s[1].split(",").map(Ks);return typeof r=="function"?r(o):o[r]}const Ws=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ee(n,e)};function Ks(t){return parseFloat(t.trim())}const it=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],st=new Set(it),Ye=t=>t===ve||t===p,Hs=new Set(["x","y","z"]),zs=it.filter(t=>!Hs.has(t));function Gs(t){const e=[];return zs.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const U={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return i==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return i==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ee(e,"x"),y:(t,{transform:e})=>ee(e,"y")};U.translateX=U.x;U.translateY=U.y;const Y=new Set;let ne=!1,ie=!1,se=!1;function hi(){if(ie){const t=Array.from(Y).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const s=Gs(i);s.length&&(n.set(i,s),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const s=n.get(i);s&&s.forEach(([r,o])=>{var a;(a=i.getValue(r))==null||a.set(o)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}ie=!1,ne=!1,Y.forEach(t=>t.complete(se)),Y.clear()}function fi(){Y.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ie=!0)})}function $s(){se=!0,fi(),hi(),se=!1}class Pe{constructor(e,n,i,s,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=s,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Y.add(this),ne||(ne=!0,S.read(fi),S.resolveKeyframes(hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:s}=this;if(e[0]===null){const r=s==null?void 0:s.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(i&&n){const a=i.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),s&&r===void 0&&s.set(e[0])}Os(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Y.delete(this)}cancel(){this.state==="scheduled"&&(Y.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Xs=t=>t.startsWith("--");function di(t,e,n){Xs(e)?t.style.setProperty(e,n):t.style[e]=n}const Ys={};function mi(t,e){const n=ci(t);return()=>Ys[e]??n()}const _s=mi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),pi=mi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),at=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,_e={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:at([0,.65,.55,1]),circOut:at([.55,0,1,.45]),backIn:at([.31,.01,.66,-.59]),backOut:at([.33,1.53,.69,.99])};function gi(t,e){if(t)return typeof t=="function"?pi()?Ss(t,e):"ease-out":Vs(t)?at(t):Array.isArray(t)?t.map(n=>gi(n,e)||_e.easeOut):_e[t]}function Zs(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=gi(a,s);Array.isArray(h)&&(u.easing=h);const f={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(u,f)}function yi(t){return typeof t=="function"&&"applyToOptions"in t}function qs({type:t,...e}){return yi(t)&&pi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class vi extends Jn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,As(typeof e.type!="string");const c=qs(e);this.animation=Zs(n,i,s,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=xe(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),di(n,i,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,i,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(i=this.animation).commitStyles)==null||s.call(i))}get duration(){var n,i;const e=((i=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:i.call(n).duration)||0;return Tt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Tt(e)}get time(){return Tt(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=X(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:i,observe:s}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&_s()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),W):s(this)}}const xi={anticipate:Es,backInOut:bs,circInOut:Cs};function Js(t){return t in xi}function Qs(t){typeof t.ease=="string"&&Js(t.ease)&&(t.ease=xi[t.ease])}const Ft=10;class to extends vi{constructor(e){Qs(e),Ds(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:s,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new bt({...o,autoplay:!1}),l=Math.max(Ft,et.now()-this.startTime),c=Te(0,Ft,l-Ft),u=a.sample(l).value,{name:h}=this.options;r&&h&&di(r,h,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const Ze=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(F.test(t)||t==="0")&&!t.startsWith("url("));function eo(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function ao(t){var h;const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o,keyframes:a}=t;if(!(((h=e==null?void 0:e.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return ro()&&n&&(Ti.has(n)||oo.has(n)&&so(a))&&(n!=="transform"||!u)&&!c&&!i&&s!=="mirror"&&r!==0&&o!=="inertia"}const lo=40;class uo extends Jn{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...h}){var m;super(),this.stop=()=>{var x,g;this._animation&&(this._animation.stop(),(x=this.stopTimeline)==null||x.call(this)),(g=this.keyframeResolver)==null||g.cancel()},this.createdAt=et.now();const f={autoplay:e,delay:n,type:i,repeat:s,repeatDelay:r,repeatType:o,name:l,motionValue:c,element:u,...h},d=(u==null?void 0:u.KeyframeResolver)||Pe;this.keyframeResolver=new d(a,(x,g,T)=>this.onKeyframesResolved(x,g,f,!T),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,i,s){var T,y;this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=et.now();let h=!0;no(e,r,o,a)||(h=!1,(ct.instantAnimations||!l)&&(u==null||u(xe(e,i,n))),e[0]=e[e.length-1],oe(i),i.repeat=0);const d={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>lo?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},m=h&&!c&&ao(d),x=(y=(T=d.motionValue)==null?void 0:T.owner)==null?void 0:y.current;let g;if(m)try{g=new to({...d,element:x})}catch{g=new bt(d)}else g=new bt(d);g.finished.then(()=>{this.notifyFinished()}).catch(W),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),$s()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function wi(t,e,n,i=0,s=1){const r=Array.from(t).sort((c,u)=>c.sortNodePosition(u)).indexOf(e),o=t.size,a=(o-1)*i;return typeof n=="function"?n(r,o):s===1?r*i:a-r*i}const co=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ho(t){const e=co.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Pi(t,e,n=1){const[i,s]=ho(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const o=r.trim();return ai(o)?parseFloat(o):o}return Qn(s)?Pi(s,e,n+1):s}const fo={type:"spring",stiffness:500,damping:25,restSpeed:10},mo=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),po={type:"keyframes",duration:.8},go={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},yo=(t,{keyframes:e})=>e.length>2?po:st.has(t)?t.startsWith("scale")?mo(e[1]):fo:go;function Si(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Se(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Si(n,t):n}const vo=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function xo(t){for(const e in t)if(!vo.has(e))return!0;return!1}const Ve=(t,e,n,i={},s,r)=>o=>{const a=Se(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-X(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};xo(a)||Object.assign(u,yo(t,u)),u.duration&&(u.duration=X(u.duration)),u.repeatDelay&&(u.repeatDelay=X(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(oe(u),u.delay===0&&(h=!0)),(ct.instantAnimations||ct.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(h=!0,oe(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=xe(u.keyframes,a);if(f!==void 0){S.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new bt(u):new uo(u)};function qe(t){const e=[{},{}];return t==null||t.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function Ae(t,e,n,i){if(typeof e=="function"){const[s,r]=qe(i);e=e(n!==void 0?n:t.custom,s,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,r]=qe(i);e=e(n!==void 0?n:t.custom,s,r)}return e}function _(t,e,n){const i=t.getProps();return Ae(i,e,n!==void 0?n:i.custom,t)}const Vi=new Set(["width","height","top","left","right","bottom",...it]),re=t=>Array.isArray(t);function To(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,nt(n))}function wo(t){return re(t)?t[t.length-1]||0:t}function Po(t,e){const n=_(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const o in r){const a=wo(r[o]);To(t,o,a)}}function So(t){return!!(b(t)&&t.add)}function ae(t,e){const n=t.getValue("willChange");if(So(n))return n.add(e);if(!n&&ct.WillChange){const i=new ct.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function Ce(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Vo="framerAppearId",Ai="data-"+Ce(Vo);function Ci(t){return t.props[Ai]}function Ao({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function bi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:o,...a}=e;const l=t.getDefaultTransition();r=r?Si(r,l):l;const c=r==null?void 0:r.reduceMotion;i&&(r=i);const u=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),m=a[f];if(m===void 0||h&&Ao(h,f))continue;const x={delay:n,...Se(r||{},f)},g=d.get();if(g!==void 0&&!d.isAnimating()&&!Array.isArray(m)&&m===g&&!x.velocity){S.update(()=>d.set(m));continue}let T=!1;if(window.MotionHandoffAnimation){const P=Ci(t);if(P){const E=window.MotionHandoffAnimation(P,f,S);E!==null&&(x.startTime=E,T=!0)}}ae(t,f);const y=c??t.shouldReduceMotion;d.start(Ve(f,d,m,y&&Vi.has(f)?{type:!1}:x,t,T));const v=d.animation;v&&u.push(v)}if(o){const f=()=>S.update(()=>{o&&Po(t,o)});u.length?Promise.all(u).then(f):f()}return u}function le(t,e,n={}){var l;const i=_(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(bi(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:f}=s;return Co(t,e,c,u,h,f,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,u]=a==="beforeChildren"?[r,o]:[o,r];return c().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function Co(t,e,n=0,i=0,s=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(le(l,e,{...o,delay:n+(typeof i=="function"?0:i)+wi(t.variantChildren,l,i,s,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function bo(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const s=e.map(r=>le(t,r,n));i=Promise.all(s)}else if(typeof e=="string")i=le(t,e,n);else{const s=typeof e=="function"?_(t,e,n.custom):e;i=Promise.all(bi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Eo={test:t=>t==="auto",parse:t=>t},Ei=t=>e=>e.test(t),Di=[ve,p,ht,O,Ms,Rs,Eo],Je=t=>Di.find(Ei(t));function Do(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ui(t):!0}const Mo=new Set(["brightness","contrast","saturate","opacity"]);function Ro(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(Ls)||[];if(!i)return t;const s=n.replace(i,"");let r=Mo.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const Lo=/\b([a-z-]*)\(.*?\)/gu,ue={...F,getAnimatableNone:t=>{const e=t.match(Lo);return e?e.map(Ro).join(" "):t}},ce={...F,getAnimatableNone:t=>{const e=F.parse(t);return F.createTransformer(t)(e.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},Qe={...ve,transform:Math.round},Bo={rotate:O,rotateX:O,rotateY:O,rotateZ:O,scale:yt,scaleX:yt,scaleY:yt,scaleZ:yt,skew:O,skewX:O,skewY:O,distance:p,translateX:p,translateY:p,translateZ:p,x:p,y:p,z:p,perspective:p,transformPerspective:p,opacity:_t,originX:He,originY:He,originZ:p},be={borderWidth:p,borderTopWidth:p,borderRightWidth:p,borderBottomWidth:p,borderLeftWidth:p,borderRadius:p,borderTopLeftRadius:p,borderTopRightRadius:p,borderBottomRightRadius:p,borderBottomLeftRadius:p,width:p,maxWidth:p,height:p,maxHeight:p,top:p,right:p,bottom:p,left:p,inset:p,insetBlock:p,insetBlockStart:p,insetBlockEnd:p,insetInline:p,insetInlineStart:p,insetInlineEnd:p,padding:p,paddingTop:p,paddingRight:p,paddingBottom:p,paddingLeft:p,paddingBlock:p,paddingBlockStart:p,paddingBlockEnd:p,paddingInline:p,paddingInlineStart:p,paddingInlineEnd:p,margin:p,marginTop:p,marginRight:p,marginBottom:p,marginLeft:p,marginBlock:p,marginBlockStart:p,marginBlockEnd:p,marginInline:p,marginInlineStart:p,marginInlineEnd:p,fontSize:p,backgroundPositionX:p,backgroundPositionY:p,...Bo,zIndex:Qe,fillOpacity:_t,strokeOpacity:_t,numOctaves:Qe},ko={...be,color:B,backgroundColor:B,outlineColor:B,fill:B,stroke:B,borderColor:B,borderTopColor:B,borderRightColor:B,borderBottomColor:B,borderLeftColor:B,filter:ue,WebkitFilter:ue,mask:ce,WebkitMask:ce},Mi=t=>ko[t],Io=new Set([ue,ce]);function Ri(t,e){let n=Mi(t);return Io.has(n)||(n=F),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const jo=new Set(["auto","none","0"]);function Fo(t,e,n){let i=0,s;for(;i{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Li=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function No(t){return li(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Ee}=ks(queueMicrotask,!1),k={x:!1,y:!1};function Bi(){return k.x||k.y}function Uo(t){return t==="x"||t==="y"?k[t]?null:(k[t]=!0,()=>{k[t]=!1}):k.x||k.y?null:(k.x=k.y=!0,()=>{k.x=k.y=!1})}function ki(t,e){const n=ti(t),i=new AbortController,s={passive:!0,...e,signal:i.signal};return[n,s,()=>i.abort()]}function Wo(t){return!(t.pointerType==="touch"||Bi())}function Ko(t,e,n={}){const[i,s,r]=ki(t,n);return i.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},h=g=>{c&&(c(g),c=void 0),u()},f=g=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,h(g))},d=()=>{a=!0,window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",f,s)},m=g=>{if(g.pointerType!=="touch"){if(a){l=!0;return}h(g)}},x=g=>{if(!Wo(g))return;l=!1;const T=e(o,g);typeof T=="function"&&(c=T,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",x,s),o.addEventListener("pointerdown",d,s)}),r}const Ii=(t,e)=>e?t===e?!0:Ii(t,e.parentElement):!1,De=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ho=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zo(t){return Ho.has(t.tagName)||t.isContentEditable===!0}const Go=new Set(["INPUT","SELECT","TEXTAREA"]);function $o(t){return Go.has(t.tagName)||t.isContentEditable===!0}const wt=new WeakSet;function tn(t){return e=>{e.key==="Enter"&&t(e)}}function Ot(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Xo=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=tn(()=>{if(wt.has(n))return;Ot(n,"down");const s=tn(()=>{Ot(n,"up")}),r=()=>Ot(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function en(t){return De(t)&&!Bi()}const nn=new WeakSet;function Yo(t,e,n={}){const[i,s,r]=ki(t,n),o=a=>{const l=a.currentTarget;if(!en(a)||nn.has(a))return;wt.add(l),n.stopPropagation&&nn.add(a);const c=e(l,a),u=(d,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),wt.has(l)&&wt.delete(l),en(d)&&typeof c=="function"&&c(d,{success:m})},h=d=>{u(d,l===window||l===document||n.useGlobalTarget||Ii(l,d.target))},f=d=>{u(d,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",f,s)};return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),No(a)&&(a.addEventListener("focus",c=>Xo(c,s)),!zo(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function Me(t){return li(t)&&"ownerSVGElement"in t}const Pt=new WeakMap;let N;const ji=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Me(i)&&"getBBox"in i?i.getBBox()[e]:i[n],_o=ji("inline","width","offsetWidth"),Zo=ji("block","height","offsetHeight");function qo({target:t,borderBoxSize:e}){var n;(n=Pt.get(t))==null||n.forEach(i=>{i(t,{get width(){return _o(t,e)},get height(){return Zo(t,e)}})})}function Jo(t){t.forEach(qo)}function Qo(){typeof ResizeObserver>"u"||(N=new ResizeObserver(Jo))}function tr(t,e){N||Qo();const n=ti(t);return n.forEach(i=>{let s=Pt.get(i);s||(s=new Set,Pt.set(i,s)),s.add(e),N==null||N.observe(i)}),()=>{n.forEach(i=>{const s=Pt.get(i);s==null||s.delete(e),s!=null&&s.size||N==null||N.unobserve(i)})}}const St=new Set;let Q;function er(){Q=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};St.forEach(e=>e(t))},window.addEventListener("resize",Q)}function nr(t){return St.add(t),Q||er(),()=>{St.delete(t),!St.size&&typeof Q=="function"&&(window.removeEventListener("resize",Q),Q=void 0)}}function sn(t,e){return typeof t=="function"?nr(t):tr(t,e)}function ir(t){return Me(t)&&t.tagName==="svg"}const sr=[...Di,B,F],or=t=>sr.find(Ei(t)),on=()=>({translate:0,scale:1,origin:0,originPoint:0}),tt=()=>({x:on(),y:on()}),rn=()=>({min:0,max:0}),A=()=>({x:rn(),y:rn()}),rr=new WeakMap;function Lt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function ft(t){return typeof t=="string"||Array.isArray(t)}const Re=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Le=["initial",...Re];function Bt(t){return Lt(t.animate)||Le.some(e=>ft(t[e]))}function Fi(t){return!!(Bt(t)||t.variants)}function ar(t,e,n){for(const i in e){const s=e[i],r=n[i];if(b(s))t.addValue(i,s);else if(b(r))t.addValue(i,nt(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const o=t.getValue(i);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(i);t.addValue(i,nt(o!==void 0?o:s,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const he={current:null},Oi={current:!1},lr=typeof window<"u";function ur(){if(Oi.current=!0,!!lr)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>he.current=t.matches;t.addEventListener("change",e),e()}else he.current=!1}const an=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Et={};function Ni(t){Et=t}function cr(){return Et}class hr{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:s,skipAnimations:r,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Pe,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=et.now();this.renderScheduledAtthis.bindToMotionValue(r,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Oi.current||ur(),this.shouldReduceMotion=he.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(i=this.parent)==null||i.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Z(this.notifyUpdate),Z(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const i=this.features[n];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Ti.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,h=new vi({element:this.current,name:e,keyframes:a,times:l,ease:c,duration:X(u)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const i=st.has(e);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&S.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Et){const n=Et[e];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):A()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=nt(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(ai(i)||ui(i))?i=parseFloat(i):!or(i)&&F.test(n)&&(i=Ri(e,n)),this.setBaseTarget(e,b(i)?i.get():i)),b(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var r;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=Ae(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!b(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new ei),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Ee.render(this.render)}}class Ui extends hr{constructor(){super(...arguments),this.KeyframeResolver=Oo}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const i=e.style;return i?i[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;b(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class K{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Wi({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function fr({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function dr(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Nt(t){return t===void 0||t===1}function fe({scale:t,scaleX:e,scaleY:n}){return!Nt(t)||!Nt(e)||!Nt(n)}function G(t){return fe(t)||Ki(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ki(t){return ln(t.x)||ln(t.y)}function ln(t){return t&&t!=="0%"}function Dt(t,e,n){const i=t-n,s=e*i;return n+s}function un(t,e,n,i,s){return s!==void 0&&(t=Dt(t,s,i)),Dt(t,n,i)+e}function de(t,e=0,n=1,i,s){t.min=un(t.min,e,n,i,s),t.max=un(t.max,e,n,i,s)}function Hi(t,{x:e,y:n}){de(t.x,e.translate,e.scale,e.originPoint),de(t.y,n.translate,n.scale,n.originPoint)}const cn=.999999999999,hn=1.0000000000001;function mr(t,e,n,i=!1){var a;const s=n.length;if(!s)return;e.x=e.y=1;let r,o;for(let l=0;lcn&&(e.x=1),e.ycn&&(e.y=1)}function j(t,e){t.min+=e,t.max+=e}function fn(t,e,n,i,s=.5){const r=V(t.min,t.max,s);de(t,e,n,r,i)}function dn(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Vt(t,e,n){const i=n??t;fn(t.x,dn(e.x,i.x),e.scaleX,e.scale,e.originX),fn(t.y,dn(e.y,i.y),e.scaleY,e.scale,e.originY)}function zi(t,e){return Wi(dr(t.getBoundingClientRect(),e))}function pr(t,e,n){const i=zi(t,n),{scroll:s}=e;return s&&(j(i.x,s.offset.x),j(i.y,s.offset.y)),i}const gr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yr=it.length;function vr(t,e,n){let i="",s=!0;for(let r=0;r{if(!e.target)return t;if(typeof t=="string")if(p.test(t))t=parseFloat(t);else return t;const n=mn(t,e.target.x),i=mn(t,e.target.y);return`${n}% ${i}%`}},xr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=F.parse(t);if(s.length>5)return i;const r=F.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const c=V(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}},me={borderRadius:{...rt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomLeftRadius:rt,borderBottomRightRadius:rt,boxShadow:xr};function $i(t,{layout:e,layoutId:n}){return st.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!me[t]||t==="opacity")}function ke(t,e,n){var o;const i=t.style,s=e==null?void 0:e.style,r={};if(!i)return r;for(const a in i)(b(i[a])||s&&b(s[a])||$i(a,t)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(r[a]=i[a]);return r}function Tr(t){return window.getComputedStyle(t)}class wr extends Ui{constructor(){super(...arguments),this.type="html",this.renderInstance=Gi}readValueFromInstance(e,n){var i;if(st.has(n))return(i=this.projection)!=null&&i.isProjecting?te(n):Ws(e,n);{const s=Tr(e),r=(ni(n)?s.getPropertyValue(n):s[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return zi(e,n)}build(e,n,i){Be(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return ke(e,n,i)}}const Pr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Sr={offset:"strokeDashoffset",array:"strokeDasharray"};function Vr(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Pr:Sr;t[r.offset]=`${-i}`,t[r.array]=`${e} ${n}`}const Ar=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Xi(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:o=0,...a},l,c,u){if(Be(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox);for(const d of Ar)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),i!==void 0&&(h.scale=i),s!==void 0&&Vr(h,s,r,o,!1)}const Yi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),_i=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Cr(t,e,n,i){Gi(t,e,void 0,i);for(const s in e.attrs)t.setAttribute(Yi.has(s)?s:Ce(s),e.attrs[s])}function Zi(t,e,n){const i=ke(t,e,n);for(const s in t)if(b(t[s])||b(e[s])){const r=it.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[r]=t[s]}return i}class br extends Ui{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=A}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(st.has(n)){const i=Mi(n);return i&&i.default||0}return n=Yi.has(n)?n:Ce(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return Zi(e,n,i)}build(e,n,i){Xi(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,s){Cr(e,n,i,s)}mount(e){this.isSVGTag=_i(e.tagName),super.mount(e)}}const Er=Le.length;function qi(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?qi(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;nPromise.all(e.map(({animation:n,options:i})=>bo(t,n,i)))}function Lr(t){let e=Rr(t),n=pn(),i=!0,s=!1;const r=c=>(u,h)=>{var d;const f=_(t,h,c==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(f){const{transition:m,transitionEnd:x,...g}=f;u={...u,...g,...x}}return u};function o(c){e=c(t)}function a(c){const{props:u}=t,h=qi(t.parent)||{},f=[],d=new Set;let m={},x=1/0;for(let T=0;Tx&&E,Oe=!1;const Ne=Array.isArray(P)?P:[P];let ot=Ne.reduce(r(y),{});pt===!1&&(ot={});const{prevResolvedValues:Ue={}}=v,ws={...Ue,...ot},We=C=>{It=!0,d.has(C)&&(Oe=!0,d.delete(C)),v.needsAnimating[C]=!0;const R=t.getValue(C);R&&(R.liveStyle=!1)};for(const C in ws){const R=ot[C],H=Ue[C];if(m.hasOwnProperty(C))continue;let q=!1;re(R)&&re(H)?q=!Ji(R,H):q=R!==H,q?R!=null?We(C):d.add(C):R!==void 0&&d.has(C)?We(C):v.protectedKeys[C]=!0}v.prevProp=P,v.prevResolvedValues=ot,v.isActive&&(m={...m,...ot}),(i||s)&&t.blockInitialAnimation&&(It=!1);const Ke=gt&&Fe;It&&(!Ke||Oe)&&f.push(...Ne.map(C=>{const R={type:y};if(typeof C=="string"&&(i||s)&&!Ke&&t.manuallyAnimateOnMount&&t.parent){const{parent:H}=t,q=_(H,C);if(H.enteringChildren&&q){const{delayChildren:Ps}=q.transition||{};R.delay=wi(H.enteringChildren,t,Ps)}}return{animation:C,options:R}}))}if(d.size){const T={};if(typeof u.initial!="boolean"){const y=_(t,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(T.transition=y.transition)}d.forEach(y=>{const v=t.getBaseTarget(y),P=t.getValue(y);P&&(P.liveStyle=!0),T[y]=v??null}),f.push({animation:T})}let g=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(g=!1),i=!1,s=!1,g?e(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(d=>{var m;return(m=d.animationState)==null?void 0:m.setActive(c,u)}),n[c].isActive=u;const h=a(c);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=pn(),s=!0}}}function Br(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Ji(e,t):!1}function z(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pn(){return{animate:z(!0),whileInView:z(),whileHover:z(),whileTap:z(),whileDrag:z(),whileFocus:z(),exit:z()}}function pe(t,e){t.min=e.min,t.max=e.max}function L(t,e){pe(t.x,e.x),pe(t.y,e.y)}function gn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Qi=1e-4,kr=1-Qi,Ir=1+Qi,ts=.01,jr=0-ts,Fr=0+ts;function D(t){return t.max-t.min}function Or(t,e,n){return Math.abs(t-e)<=n}function yn(t,e,n,i=.5){t.origin=i,t.originPoint=V(e.min,e.max,t.origin),t.scale=D(n)/D(e),t.translate=V(n.min,n.max,t.origin)-t.originPoint,(t.scale>=kr&&t.scale<=Ir||isNaN(t.scale))&&(t.scale=1),(t.translate>=jr&&t.translate<=Fr||isNaN(t.translate))&&(t.translate=0)}function lt(t,e,n,i){yn(t.x,e.x,n.x,i?i.originX:void 0),yn(t.y,e.y,n.y,i?i.originY:void 0)}function vn(t,e,n,i=0){const s=i?V(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+D(e)}function Nr(t,e,n,i){vn(t.x,e.x,n.x,i==null?void 0:i.x),vn(t.y,e.y,n.y,i==null?void 0:i.y)}function xn(t,e,n,i=0){const s=i?V(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+D(e)}function Mt(t,e,n,i){xn(t.x,e.x,n.x,i==null?void 0:i.x),xn(t.y,e.y,n.y,i==null?void 0:i.y)}function Tn(t,e,n,i,s){return t-=e,t=Dt(t,1/n,i),s!==void 0&&(t=Dt(t,1/s,i)),t}function Ur(t,e=0,n=1,i=.5,s,r=t,o=t){if(ht.test(e)&&(e=parseFloat(e),e=V(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=V(r.min,r.max,i);t===r&&(a-=e),t.min=Tn(t.min,e,n,a,s),t.max=Tn(t.max,e,n,a,s)}function wn(t,e,[n,i,s],r,o){Ur(t,e[n],e[i],e[s],e.scale,r,o)}const Wr=["x","scaleX","originX"],Kr=["y","scaleY","originY"];function Pn(t,e,n,i){wn(t.x,e,Wr,n?n.x:void 0,i?i.x:void 0),wn(t.y,e,Kr,n?n.y:void 0,i?i.y:void 0)}function Sn(t){return t.translate===0&&t.scale===1}function es(t){return Sn(t.x)&&Sn(t.y)}function Vn(t,e){return t.min===e.min&&t.max===e.max}function Hr(t,e){return Vn(t.x,e.x)&&Vn(t.y,e.y)}function An(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function ns(t,e){return An(t.x,e.x)&&An(t.y,e.y)}function Cn(t){return D(t.x)/D(t.y)}function bn(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function I(t){return[t("x"),t("y")]}function zr(t,e,n){let i="";const s=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||r||o)&&(i=`translate3d(${s}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;c&&(i=`perspective(${c}px) ${i}`),u&&(i+=`rotate(${u}deg) `),h&&(i+=`rotateX(${h}deg) `),f&&(i+=`rotateY(${f}deg) `),d&&(i+=`skewX(${d}deg) `),m&&(i+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const is=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Gr=is.length,En=t=>typeof t=="string"?parseFloat(t):t,Dn=t=>typeof t=="number"||p.test(t);function $r(t,e,n,i,s,r){s?(t.opacity=V(0,n.opacity??1,Xr(i)),t.opacityExit=V(e.opacity??1,0,Yr(i))):r&&(t.opacity=V(e.opacity??1,n.opacity??1,i));for(let o=0;oie?1:n(Zt(t,e,i))}function _r(t,e,n){const i=b(t)?t:nt(t);return i.start(Ve("",i,e,n)),i.animation}function dt(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const Zr=(t,e)=>t.depth-e.depth;class qr{constructor(){this.children=[],this.isDirty=!1}add(e){ii(this.children,e),this.isDirty=!0}remove(e){qt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Zr),this.isDirty=!1,this.children.forEach(e)}}function Jr(t,e){const n=et.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(Z(i),t(r-e))};return S.setup(i,!0),()=>Z(i)}function At(t){return b(t)?t.get():t}class Qr{constructor(){this.members=[]}add(e){ii(this.members,e);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===e||i===this.lead||i===this.prevLead)continue;const s=i.instance;(!s||s.isConnected===!1)&&!i.snapshot&&(qt(this.members,i),i.unmount())}e.scheduleRender()}remove(e){if(qt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let i=this.members.indexOf(e)-1;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=i.options,{layoutDependency:o}=e.options;(r===void 0||r!==o)&&(e.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,i,s,r,o;(i=(n=e.options).onExitComplete)==null||i.call(n),(o=(s=e.resumingFrom)==null?void 0:(r=s.options).onExitComplete)==null||o.call(r)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Ct={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ut=["","X","Y","Z"],ta=1e3;let ea=0;function Wt(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function os(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ci(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",S,!(s||r))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&os(i)}function rs({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=ea++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(sa),this.nodes.forEach(ca),this.nodes.forEach(ha),this.nodes.forEach(oa)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;S.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,u&&u(),u=Jr(f,250),Ct.hasAnimatedSinceResize&&(Ct.hasAnimatedSinceResize=!1,this.nodes.forEach(Bn)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||ga,{onLayoutAnimationStart:x,onLayoutAnimationComplete:g}=c.getProps(),T=!this.targetLayout||!ns(this.targetLayout,d),y=!h&&f;if(this.options.layoutRoot||this.resumeFrom||y||h&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Se(m,"layout"),onPlay:x,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,y)}else h||Bn(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Z(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(fa),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&os(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!D(this.snapshot.measuredBox.x)&&!D(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const E=P/1e3;kn(h.x,o.x,E),kn(h.y,o.y,E),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),ma(this.relativeTarget,this.relativeTargetOrigin,f,E),v&&Hr(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=A()),L(v,this.relativeTarget)),x&&(this.animationValues=u,$r(u,c,this.latestValues,E,y,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Z(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=S.update(()=>{Ct.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=nt(0)),this.motionValue.jump(0,!1),this.currentAnimation=_r(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ta),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&as(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||A();const h=D(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=D(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}L(a,l),Vt(a,u),lt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Qr),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Wt("z",o,c,this.animationValues);for(let u=0;u{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Rn),this.root.sharedNodes.clear()}}}function na(t){t.updateLayout()}function ia(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;if(r==="size")I(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=D(f);f.min=i[h].min,f.max=f.min+d});else if(r==="x"||r==="y"){const h=r==="x"?"y":"x";pe(o?e.measuredBox[h]:e.layoutBox[h],i[h])}else as(r,e.layoutBox,i)&&I(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=D(i[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=tt();lt(a,i,e.layoutBox);const l=tt();o?lt(l,t.applyTransform(s,!0),e.measuredBox):lt(l,i,e.layoutBox);const c=!es(a);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const m=t.options.layoutAnchor||void 0,x=A();Mt(x,e.layoutBox,f.layoutBox,m);const g=A();Mt(g,i,d.layoutBox,m),ns(x,g)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=x,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:i}=t.options;i&&i()}t.options.transition=void 0}function sa(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function oa(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ra(t){t.clearSnapshot()}function Rn(t){t.clearMeasurements()}function aa(t){t.isLayoutDirty=!0,t.updateLayout()}function Ln(t){t.isLayoutDirty=!1}function la(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ua(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Bn(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ca(t){t.resolveTargetDelta()}function ha(t){t.calcProjection()}function fa(t){t.resetSkewAndRotation()}function da(t){t.removeLeadSnapshot()}function kn(t,e,n){t.translate=V(e.translate,0,n),t.scale=V(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function In(t,e,n,i){t.min=V(e.min,n.min,i),t.max=V(e.max,n.max,i)}function ma(t,e,n,i){In(t.x,e.x,n.x,i),In(t.y,e.y,n.y,i)}function pa(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const ga={duration:.45,ease:[.4,0,.1,1]},jn=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Fn=jn("applewebkit/")&&!jn("chrome/")?Math.round:W;function On(t){t.min=Fn(t.min),t.max=Fn(t.max)}function ya(t){On(t.x),On(t.y)}function as(t,e,n){return t==="position"||t==="preserve-aspect"&&!Or(Cn(e),Cn(n),.2)}function va(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const xa=rs({attachResizeListener:(t,e)=>dt(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Kt={current:void 0},ls=rs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Kt.current){const t=new xa({});t.mount(window),t.setOptions({layoutScroll:!0}),Kt.current=t}return Kt.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});function Ta(t=!0){const e=w.useContext(we);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=e,r=w.useId();w.useEffect(()=>{if(t)return s(r)},[t]);const o=w.useCallback(()=>t&&i&&i(r),[r,i,t]);return!n&&i?[!1,o]:[!0]}const us=w.createContext({strict:!1}),Nn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Un=!1;function wa(){if(Un)return;const t={};for(const e in Nn)t[e]={isEnabled:n=>Nn[e].some(i=>!!n[i])};Ni(t),Un=!0}function cs(){return wa(),cr()}function Pa(t){const e=cs();for(const n in t)e[n]={...e[n],...t[n]};Ni(e)}const Sa=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Rt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Sa.has(t)}let hs=t=>!Rt(t);function Va(t){typeof t=="function"&&(hs=e=>e.startsWith("on")?!Rt(e):t(e))}try{Va(require("@emotion/is-prop-valid").default)}catch{}function Aa(t,e,n){const i={};for(const s in t)s==="values"&&typeof t.values=="object"||b(t[s])||(hs(s)||n===!0&&Rt(s)||!e&&!Rt(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}const kt=w.createContext({});function Ca(t,e){if(Bt(t)){const{initial:n,animate:i}=t;return{initial:n===!1||ft(n)?n:void 0,animate:ft(i)?i:void 0}}return t.inherit!==!1?e:{}}function ba(t){const{initial:e,animate:n}=Ca(t,w.useContext(kt));return w.useMemo(()=>({initial:e,animate:n}),[Wn(e),Wn(n)])}function Wn(t){return Array.isArray(t)?t.join(" "):t}const Ie=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fs(t,e,n){for(const i in e)!b(e[i])&&!$i(i,n)&&(t[i]=e[i])}function Ea({transformTemplate:t},e){return w.useMemo(()=>{const n=Ie();return Be(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Da(t,e){const n=t.style||{},i={};return fs(i,n,t),Object.assign(i,Ea(t,e)),i}function Ma(t,e){const n={},i=Da(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const ds=()=>({...Ie(),attrs:{}});function Ra(t,e,n,i){const s=w.useMemo(()=>{const r=ds();return Xi(r,e,_i(i),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};fs(r,t.style,t),s.style={...r,...s.style}}return s}const La=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function je(t){return typeof t!="string"||t.includes("-")?!1:!!(La.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ba(t,e,n,{latestValues:i},s,r=!1,o){const l=(o??je(t)?Ra:Ma)(e,i,s,t),c=Aa(e,typeof t=="string",r),u=t!==w.Fragment?{...c,...l,ref:n}:{},{children:h}=e,f=w.useMemo(()=>b(h)?h.get():h,[h]);return w.createElement(t,{...u,children:f})}function ka({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Ia(n,i,s,t),renderState:e()}}function Ia(t,e,n,i){const s={},r=i(t,{});for(const f in r)s[f]=At(r[f]);let{initial:o,animate:a}=t;const l=Bt(t),c=Fi(t);e&&c&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const h=u?a:o;if(h&&typeof h!="boolean"&&!Lt(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d(e,n)=>{const i=w.useContext(kt),s=w.useContext(we),r=()=>ka(t,e,i,s);return n?r():js(r)},ja=ms({scrapeMotionValuesFromProps:ke,createRenderState:Ie}),Fa=ms({scrapeMotionValuesFromProps:Zi,createRenderState:ds}),Oa=Symbol.for("motionComponentSymbol");function Na(t,e,n){const i=w.useRef(n);w.useInsertionEffect(()=>{i.current=n});const s=w.useRef(null);return w.useCallback(r=>{var a;r&&((a=t.onMount)==null||a.call(t,r));const o=i.current;if(typeof o=="function")if(r){const l=o(r);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(r);else o&&(o.current=r);e&&(r?e.mount(r):e.unmount())},[e])}const ps=w.createContext({});function J(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ua(t,e,n,i,s,r){var v,P;const{visualElement:o}=w.useContext(kt),a=w.useContext(us),l=w.useContext(we),c=w.useContext(si),u=c.reducedMotion,h=c.skipAnimations,f=w.useRef(null),d=w.useRef(!1);i=i||a.renderer,!f.current&&i&&(f.current=i(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,x=w.useContext(ps);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&Wa(f.current,n,s,x);const g=w.useRef(!1);w.useInsertionEffect(()=>{m&&g.current&&m.update(n,l)});const T=n[Ai],y=w.useRef(!!T&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,T))&&((P=window.MotionHasOptimisedAnimation)==null?void 0:P.call(window,T)));return Fs(()=>{d.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),w.useEffect(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)==null||E.call(window,T)}),y.current=!1),m.enteringChildren=void 0)}),m}function Wa(t,e,n,i){const{layoutId:s,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:gs(t.parent)),t.projection.setOptions({layoutId:s,layout:r,alwaysMeasureLayout:!!o||a&&J(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function gs(t){if(t)return t.options.allowProjection!==!1?t.projection:gs(t.parent)}function Ht(t,{forwardMotionProps:e=!1,type:n}={},i,s){i&&Pa(i);const r=n?n==="svg":je(t),o=r?Fa:ja;function a(c,u){let h;const f={...w.useContext(si),...c,layoutId:Ka(c)},{isStatic:d}=f,m=ba(c),x=o(c,d);if(!d&&typeof window<"u"){Ha();const g=za(f);h=g.MeasureLayout,m.visualElement=Ua(t,x,f,s,g.ProjectionNode,r)}return Yt.jsxs(kt.Provider,{value:m,children:[h&&m.visualElement?Yt.jsx(h,{visualElement:m.visualElement,...f}):null,Ba(t,c,Na(x,m.visualElement,u),x,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=w.forwardRef(a);return l[Oa]=t,l}function Ka({layoutId:t}){const e=w.useContext(ri).id;return e&&t!==void 0?e+"-"+t:t}function Ha(t,e){w.useContext(us).strict}function za(t){const e=cs(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n!=null&&n.isEnabled(t)||i!=null&&i.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Ga(t,e){if(typeof Proxy>"u")return Ht;const n=new Map,i=(r,o)=>Ht(r,o,t,e),s=(r,o)=>i(r,o);return new Proxy(s,{get:(r,o)=>o==="create"?i:(n.has(o)||n.set(o,Ht(o,void 0,t,e)),n.get(o))})}const $a=(t,e)=>e.isSVG??je(t)?new br(e):new wr(e,{allowProjection:t!==w.Fragment});class Xa extends K{constructor(e){super(e),e.animationState||(e.animationState=Lr(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Lt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let Ya=0;class _a extends K{constructor(){super(...arguments),this.id=Ya++,this.isExitComplete=!1}update(){var r;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;if(e&&i===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"){const l=_(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...h}=l;for(const f in h)(r=this.node.getValue(f))==null||r.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Za={animation:{Feature:Xa},exit:{Feature:_a}};function mt(t){return{point:{x:t.pageX,y:t.pageY}}}const qa=t=>e=>De(e)&&t(e,mt(e));function ut(t,e,n,i){return dt(t,e,qa(n),i)}const ys=({current:t})=>t?t.ownerDocument.defaultView:null,Kn=(t,e)=>Math.abs(t-e);function Ja(t,e){const n=Kn(t.x,e.x),i=Kn(t.y,e.y);return Math.sqrt(n**2+i**2)}const Hn=new Set(["auto","scroll"]);class vs{constructor(e,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=vt(this.lastRawMoveEventInfo,this.transformPagePoint));const d=zt(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,x=Ja(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!x)return;const{point:g}=d,{timestamp:T}=M;this.history.push({...g,timestamp:T});const{onStart:y,onMove:v}=this.handlers;m||(y&&y(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=vt(m,this.transformPagePoint),S.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:x,onSessionEnd:g,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=zt(d.type==="pointercancel"?this.lastMoveEventInfo:vt(m,this.transformPagePoint),this.history);this.startEvent&&x&&x(d,y),g&&g(d,y)},!De(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=s||window;const l=mt(e),c=vt(l,this.transformPagePoint),{point:u}=c,{timestamp:h}=M;this.history=[{...u,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,zt(c,this.history)),this.removeListeners=oi(ut(this.contextWindow,"pointermove",this.handlePointerMove),ut(this.contextWindow,"pointerup",this.handlePointerUp),ut(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(Hn.has(i.overflowX)||Hn.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,s=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:s.x-n.x,y:s.y-n.y};r.x===0&&r.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,s),S.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Z(this.updatePoint)}}function vt(t,e){return e?{point:e(t.point)}:t}function zn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function zt({point:t},e){return{point:t,delta:zn(t,xs(e)),offset:zn(t,Qa(e)),velocity:tl(e,.1)}}function Qa(t){return t[0]}function xs(t){return t[t.length-1]}function tl(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=xs(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>X(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>X(e)*2&&(i=t[1]);const r=Tt(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function el(t,{min:e,max:n},i){return e!==void 0&&tn&&(t=i?V(n,t,i.max):Math.min(t,n)),t}function Gn(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function nl(t,{top:e,left:n,bottom:i,right:s}){return{x:Gn(t.x,n,s),y:Gn(t.y,e,i)}}function $n(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.mini?n=Zt(e.min,e.max-i,t.min):i>s&&(n=Zt(t.min,t.max-s,e.min)),Te(0,1,n)}function ol(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const ge=.35;function rl(t=ge){return t===!1?t=0:t===!0&&(t=ge),{x:Xn(t,"left","right"),y:Xn(t,"top","bottom")}}function Xn(t,e,n){return{min:Yn(t,e),max:Yn(t,n)}}function Yn(t,e){return typeof t=="number"?t:t[e]||0}const al=new WeakMap;class ll{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=A(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(mt(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:m,onDragStart:x}=this.getProps();if(d&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Uo(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),I(T=>{let y=this.getAxisMotionValue(T).get()||0;if(ht.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const P=v.layout.layoutBox[T];P&&(y=D(P)*(parseFloat(y)/100))}}this.originPoint[T]=y}),x&&S.update(()=>x(h,f),!1,!0),ae(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:m,onDirectionLock:x,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:T}=f;if(m&&this.currentDirection===null){this.currentDirection=cl(T),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,T),this.updateAxis("y",f.point,T),this.visualElement.render(),g&&S.update(()=>g(h,f),!1,!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new vs(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:i,contextWindow:ys(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,s=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!s||!i)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&S.postRender(()=>a(i,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,i){const{drag:s}=this.getProps();if(!i||!xt(e,s,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=el(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var r;const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,s=this.constraints;e&&J(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=nl(i.layoutBox,e):this.constraints=!1,this.elastic=rl(n),s!==this.constraints&&!J(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&I(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=ol(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!J(e))return!1;const i=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=pr(i,s.root,this.visualElement.getTransformPagePoint());let o=il(s.layout.layoutBox,r);if(n){const a=n(fr(o));this.hasMutatedConstraints=!!a,a&&(o=Wi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=I(u=>{if(!xt(u,n,this.currentDirection))return;let h=l&&l[u]||{};(o===!0||o===u)&&(h={min:0,max:0});const f=s?200:1e6,d=s?40:1e7,m={type:"inertia",velocity:i?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return ae(this.visualElement,e),i.start(Ve(e,i,0,n,this.visualElement,!1))}stopAnimation(){I(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){I(n=>{const{drag:i}=this.getProps();if(!xt(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],l=r.get()||0;r.set(e[n]-V(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!J(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};I(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=sl({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),I(o=>{if(!xt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(V(l,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;al.set(this.visualElement,this);const e=this.visualElement.current,n=ut(e,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps(),f=c.target,d=f!==e&&$o(f);u&&h&&!d&&this.start(c)});let i;const s=()=>{const{dragConstraints:c}=this.getProps();J(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),i||(i=ul(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",s);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),S.read(s);const a=dt(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(I(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=c[h].translate,f.set(f.get()+c[h].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=ge,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function _n(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function ul(t,e,n){const i=sn(t,_n(n)),s=sn(e,_n(n));return()=>{i(),s()}}function xt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function cl(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class hl extends K{constructor(e){super(e),this.removeGroupControls=W,this.removeListeners=W,this.controls=new ll(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||W}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Gt=t=>(e,n)=>{t&&S.update(()=>t(e,n),!1,!0)};class fl extends K{constructor(){super(...arguments),this.removePointerDownListener=W}onPointerDown(e){this.session=new vs(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ys(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:Gt(e),onStart:Gt(n),onMove:Gt(i),onEnd:(r,o)=>{delete this.session,s&&S.postRender(()=>s(r,o))}}}mount(){this.removePointerDownListener=ut(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let $t=!1;class dl extends w.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),i&&i.register&&s&&i.register(r),$t&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ct.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:s,isPresent:r}=this.props,{projection:o}=i;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),$t=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||S.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:i}=e;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),Ee.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=e;$t=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ts(t){const[e,n]=Ta(),i=w.useContext(ri);return Yt.jsx(dl,{...t,layoutGroup:i,switchLayoutGroup:w.useContext(ps),isPresent:e,safeToRemove:n})}const ml={pan:{Feature:fl},drag:{Feature:hl,ProjectionNode:ls,MeasureLayout:Ts}};function Zn(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,r=i[s];r&&S.postRender(()=>r(e,mt(e)))}class pl extends K{mount(){const{current:e}=this.node;e&&(this.unmount=Ko(e,(n,i)=>(Zn(this.node,i,"Start"),s=>Zn(this.node,s,"End"))))}unmount(){}}class gl extends K{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=oi(dt(this.node.current,"focus",()=>this.onFocus()),dt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function qn(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),r=i[s];r&&S.postRender(()=>r(e,mt(e)))}class yl extends K{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=Yo(e,(s,r)=>(qn(this.node,r,"Start"),(o,{success:a})=>qn(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(i==null?void 0:i.tap)===!1})}unmount(){}}const ye=new WeakMap,Xt=new WeakMap,vl=t=>{const e=ye.get(t.target);e&&e(t)},xl=t=>{t.forEach(vl)};function Tl({root:t,...e}){const n=t||document;Xt.has(n)||Xt.set(n,{});const i=Xt.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(xl,{root:t,...e})),i[s]}function wl(t,e,n){const i=Tl(e);return ye.set(t,n),i.observe(t),()=>{ye.delete(t),i.unobserve(t)}}const Pl={some:0,all:1};class Sl extends K{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:Pl[s]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),d=u?h:f;d&&d(c)};this.stopObserver=wl(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Vl(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Vl({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Al={inView:{Feature:Sl},tap:{Feature:yl},focus:{Feature:gl},hover:{Feature:pl}},Cl={layout:{ProjectionNode:ls,MeasureLayout:Ts}},bl={...Za,...Al,...ml,...Cl},Ll=Ga(bl,$a);export{ri as L,we as P,No as i,Ll as m,Ta as u}; diff --git a/dist/assets/use-animation-frame-D5p6ytsV.js b/dist/assets/use-animation-frame-BTHnf9ip.js similarity index 59% rename from dist/assets/use-animation-frame-D5p6ytsV.js rename to dist/assets/use-animation-frame-BTHnf9ip.js index bcb2b67..e7ad351 100644 --- a/dist/assets/use-animation-frame-D5p6ytsV.js +++ b/dist/assets/use-animation-frame-BTHnf9ip.js @@ -1 +1 @@ -import{r as e}from"./index-BSnGsuja.js";import{M as a,f as u,c}from"./CountUp-CaPcnNrA.js";function p(r){const t=e.useRef(0),{isStatic:o}=e.useContext(a);e.useEffect(()=>{if(o)return;const n=({timestamp:i,delta:s})=>{t.current||(t.current=i),r(i-t.current,s)};return u.update(n,!0),()=>c(n)},[r])}export{p as u}; +import{r as e}from"./index-sl7kA1zY.js";import{M as a,f as u,c}from"./CountUp-4XjqJEhr.js";function p(r){const t=e.useRef(0),{isStatic:o}=e.useContext(a);e.useEffect(()=>{if(o)return;const n=({timestamp:i,delta:s})=>{t.current||(t.current=i),r(i-t.current,s)};return u.update(n,!0),()=>c(n)},[r])}export{p as u}; diff --git a/dist/assets/useTranslation-fJCRxooE.js b/dist/assets/useTranslation-D01I4oIt.js similarity index 98% rename from dist/assets/useTranslation-fJCRxooE.js rename to dist/assets/useTranslation-D01I4oIt.js index 5f848a6..e84a6b1 100644 --- a/dist/assets/useTranslation-fJCRxooE.js +++ b/dist/assets/useTranslation-D01I4oIt.js @@ -1,4 +1,4 @@ -import{r as l,x as q,y as B}from"./index-BSnGsuja.js";const H=(e,t,r,i)=>{var n,d,y,g;const s=[r,{code:t,...i||{}}];if((d=(n=e==null?void 0:e.services)==null?void 0:n.logger)!=null&&d.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);p(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(g=(y=e==null?void 0:e.services)==null?void 0:y.logger)!=null&&g.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},z={},U=(e,t,r,i)=>{p(r)&&z[r]||(p(r)&&(z[r]=new Date),H(e,t,r,i))},F=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},O=(e,t,r)=>{e.loadNamespaces(t,F(e,r))},A=(e,t,r,i)=>{if(p(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return O(e,r,i);r.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,F(e,i))},J=(e,t,r={})=>!t.languages||!t.languages.length?(U(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:r.lng,precheck:(i,s)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,e))return!1}}),p=e=>typeof e=="string",K=e=>typeof e=="object"&&e!==null,Q=l.createContext();class V{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var M={exports:{}},$={};/** +import{r as l,x as q,y as B}from"./index-sl7kA1zY.js";const H=(e,t,r,i)=>{var n,d,y,g;const s=[r,{code:t,...i||{}}];if((d=(n=e==null?void 0:e.services)==null?void 0:n.logger)!=null&&d.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);p(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(g=(y=e==null?void 0:e.services)==null?void 0:y.logger)!=null&&g.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},z={},U=(e,t,r,i)=>{p(r)&&z[r]||(p(r)&&(z[r]=new Date),H(e,t,r,i))},F=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},O=(e,t,r)=>{e.loadNamespaces(t,F(e,r))},A=(e,t,r,i)=>{if(p(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return O(e,r,i);r.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,F(e,i))},J=(e,t,r={})=>!t.languages||!t.languages.length?(U(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:r.lng,precheck:(i,s)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,e))return!1}}),p=e=>typeof e=="string",K=e=>typeof e=="object"&&e!==null,Q=l.createContext();class V{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var M={exports:{}},$={};/** * @license React * use-sync-external-store-shim.production.js * diff --git a/dist/index.html b/dist/index.html index 948ea7f..3dd4b80 100644 --- a/dist/index.html +++ b/dist/index.html @@ -7,7 +7,7 @@ AI Platform - + diff --git a/src/pages/Topup.jsx b/src/pages/Topup.jsx index f2307ad..e58f8d1 100644 --- a/src/pages/Topup.jsx +++ b/src/pages/Topup.jsx @@ -120,7 +120,8 @@ export default function Topup() { setPaymentLoading(true); setPayingMethod(method); try { - const data = { amount: payAmount, payment_method: method }; + const returnUrl = window.location.origin + '/topup'; + const data = { amount: payAmount, payment_method: method, return_url: returnUrl }; if (isStripePayment(method)) { // Stripe payment