PageSourceSearch

https://solarsales-pro-simulateur.web.app/assets/Parametres-COEVYPba.js

js solarsales-pro-simulateur.web.app collected 2026-10-03 12:36:26 UTC 137,252 bytes, 19 lines download raw bytes

1import{c as Hs,V as E,u as ia,P as vs,e as Un,g as On,h as Hn,w as Tn,f as Bn,b as $n,r as b,a5 as Fr,a6 as _n,Q as zn,j as e,a7 as Ut,d as H,a8 as Wn,Y as Gn,C as pt,a9 as Ur,G as ft,X as Ot,M as Vn,aa as Qn,ab as Yn,I as Ns,J as Cs,ac as Ht,Z as Ss,_ as Es,$ as Or,a0 as Hr,a1 as Kn,a2 as Xn,ad as Tr,ae as qn,af as As,H as Br}from"./index-CSUpUFLA.js";import{a as $r}from"./index-DEN4EAHB.js";import{f as Jn,h as Zn,i as ei,j as ti,c as Is,k as si,u as ri,l as ai,m as ni}from"./stripe-CU_y6kiY.js";import{a as ii}from"./adminApi-CbQWWF3R.js";import{P as R}from"./index-CVUIdKFf.js";import{U as oi}from"./user-pk192CiO.js";import{B as li}from"./building-2-oehfiyFF.js";import{B as _r,S as ci}from"./shield-check-Du8mf0lQ.js";import{T as ks}from"./trash-2-r3NYbMIn.js";import{E as di}from"./external-link-Dz8bi_bM.js";import{R as Te,C as ui}from"./rotate-ccw-CZ8DuEG_.js";import{P as zr}from"./pencil-Dhg_rcOY.js";import{D as mi}from"./download-DiE1Csgo.js";import{S as hi}from"./send-CsMUguCV.js";import{S as pi,M as fi}from"./smartphone-B7u87AoP.js";import{M as xi}from"./map-pin-BmYzkKbX.js";const gi=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],bi=Hs("arrow-right",gi);const yi=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],wi=Hs("camera",yi);const ji=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],vi=Hs("file-down",ji);const Ni=t=>{const s=new ArrayBuffer(8),r=new Uint8Array(s);let n=t;for(let c=7;c>=0&&n!==0;c--)r[c]=n&255,n-=r[c],n/=256;return r};function Ci(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Wt(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function tt(t,...s){if(!Ci(t))throw new Error("Uint8Array expected");if(s.length>0&&!s.includes(t.length))throw new Error("Uint8Array expected of length "+s+", got length="+t.length)}function Si(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Wt(t.outputLen),Wt(t.blockLen)}function st(t,s=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(s&&t.finished)throw new Error("Hash#digest() has already been called")}function oa(t,s){tt(t);const r=s.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Ei(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function xe(...t){for(let s=0;s<t.length;s++)t[s].fill(0)}function Ps(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function fe(t,s){return t<<32-s|t>>>s}function Ls(t,s){return t<<s|t>>>32-s>>>0}const Ai=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Ii(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function ki(t){for(let s=0;s<t.length;s++)t[s]=Ii(t[s]);return t}const Wr=Ai?t=>t:ki;function Pi(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Vt(t){return typeof t=="string"&&(t=Pi(t)),tt(t),t}class Ts{}function nt(t){const s=n=>t().update(Vt(n)).digest(),r=t();return s.outputLen=r.outputLen,s.blockLen=r.blockLen,s.create=()=>t(),s}class la extends Ts{update(s){return st(this),this.iHash.update(s),this}digestInto(s){st(this),tt(s,this.outputLen),this.finished=!0,this.iHash.digestInto(s),this.oHash.update(s),this.oHash.digestInto(s),this.destroy()}digest(){const s=new Uint8Array(this.oHash.outputLen);return this.digestInto(s),s}_cloneInto(s){s||(s=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:c,destroyed:d,blockLen:h,outputLen:p}=this;return s=s,s.finished=c,s.destroyed=d,s.blockLen=h,s.outputLen=p,s.oHash=r._cloneInto(s.oHash),s.iHash=n._cloneInto(s.iHash),s}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}constructor(s,r){super(),this.finished=!1,this.destroyed=!1,Si(s);const n=Vt(r);if(this.iHash=s.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const c=this.blockLen,d=new Uint8Array(c);d.set(n.length>c?s.create().update(n).digest():n);for(let h=0;h<d.length;h++)d[h]^=54;this.iHash.update(d),this.oHash=s.create();for(let h=0;h<d.length;h++)d[h]^=106;this.oHash.update(d),xe(d)}}const Ms=(t,s,r)=>new la(t,s).update(r).digest();Ms.create=(t,s)=>new la(t,s);function Li(t,s,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(s,r,n);const c=BigInt(32),d=BigInt(4294967295),h=Number(r>>c&d),p=Number(r&d),i=n?4:0,o=n?0:4;t.setUint32(s+i,h,n),t.setUint32(s+o,p,n)}function ca(t,s,r){return t&s^~t&r}function da(t,s,r){return t&s^t&r^s&r}class Bs extends Ts{update(s){st(this),s=Vt(s),tt(s);const{view:r,buffer:n,blockLen:c}=this,d=s.length;for(let h=0;h<d;){const p=Math.min(c-this.pos,d-h);if(p===c){const i=Ps(s);for(;c<=d-h;h+=c)this.process(i,h);continue}n.set(s.subarray(h,h+p),this.pos),this.pos+=p,h+=p,this.pos===c&&(this.process(r,0),this.pos=0)}return this.length+=s.length,this.roundClean(),this}digestInto(s){st(this),oa(s,this),this.finished=!0;const{buffer:r,view:n,blockLen:c,isLE:d}=this;let{pos:h}=this;r[h++]=128,xe(this.buffer.subarray(h)),this.padOffset>c-h&&(this.process(n,0),h=0);for(let m=h;m<c;m++)r[m]=0;Li(n,c-8,BigInt(this.length*8),d),this.process(n,0);const p=Ps(s),i=this.outputLen;if(i%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const o=i/4,l=this.get();if(o>l.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<o;m++)p.setUint32(4*m,l[m],d)}digest(){const{buffer:s,outputLen:r}=this;this.digestInto(s);const n=s.slice(0,r);return this.destroy(),n}_cloneInto(s){s||(s=new this.constructor),s.set(...this.get());const{blockLen:r,buffer:n,length:c,finished:d,destroyed:h,pos:p}=this;return s.destroyed=h,s.finished=d,s.length=c,s.pos=p,c%r&&s.buffer.set(n),s}clone(){return this._cloneInto()}constructor(s,r,n,c){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=s,this.outputLen=r,this.padOffset=n,this.isLE=c,this.buffer=new Uint8Array(s),this.view=Ps(this.buffer)}}const ve=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ne=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Z=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),ee=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),xt=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),Ce=new Uint32Array(80);class Mi extends Bs{get(){const{A:s,B:r,C:n,D:c,E:d}=this;return[s,r,n,c,d]}set(s,r,n,c,d){this.A=s|0,this.B=r|0,this.C=n|0,this.D=c|0,this.E=d|0}process(s,r){for(let i=0;i<16;i++,r+=4)Ce[i]=s.getUint32(r,!1);for(let i=16;i<80;
1i++)Ce[i]=Ls(Ce[i-3]^Ce[i-8]^Ce[i-14]^Ce[i-16],1);let{A:n,B:c,C:d,D:h,E:p}=this;for(let i=0;i<80;i++){let o,l;i<20?(o=ca(c,d,h),l=1518500249):i<40?(o=c^d^h,l=1859775393):i<60?(o=da(c,d,h),l=2400959708):(o=c^d^h,l=3395469782);const m=Ls(n,5)+o+p+l+Ce[i]|0;p=h,h=d,d=Ls(c,30),c=n,n=m}n=n+this.A|0,c=c+this.B|0,d=d+this.C|0,h=h+this.D|0,p=p+this.E|0,this.set(n,c,d,h,p)}roundClean(){xe(Ce)}destroy(){this.set(0,0,0,0,0),xe(this.buffer)}constructor(){super(64,20,8,!1),this.A=xt[0]|0,this.B=xt[1]|0,this.C=xt[2]|0,this.D=xt[3]|0,this.E=xt[4]|0}}const Ri=nt(()=>new Mi),Tt=BigInt(2**32-1),Gr=BigInt(32);function Di(t,s=!1){return s?{h:Number(t&Tt),l:Number(t>>Gr&Tt)}:{h:Number(t>>Gr&Tt)|0,l:Number(t&Tt)|0}}function ua(t,s=!1){const r=t.length;let n=new Uint32Array(r),c=new Uint32Array(r);for(let d=0;d<r;d++){const{h,l:p}=Di(t[d],s);[n[d],c[d]]=[h,p]}return[n,c]}const Vr=(t,s,r)=>t>>>r,Qr=(t,s,r)=>t<<32-r|s>>>r,Je=(t,s,r)=>t>>>r|s<<32-r,Ze=(t,s,r)=>t<<32-r|s>>>r,Bt=(t,s,r)=>t<<64-r|s>>>r-32,$t=(t,s,r)=>t>>>r-32|s<<64-r,Fi=(t,s,r)=>t<<r|s>>>32-r,Ui=(t,s,r)=>s<<r|t>>>32-r,Oi=(t,s,r)=>s<<r-32|t>>>64-r,Hi=(t,s,r)=>t<<r-32|s>>>64-r;function be(t,s,r,n){const c=(s>>>0)+(n>>>0);return{h:t+r+(c/2**32|0)|0,l:c|0}}const Ti=(t,s,r)=>(t>>>0)+(s>>>0)+(r>>>0),Bi=(t,s,r,n)=>s+r+n+(t/2**32|0)|0,$i=(t,s,r,n)=>(t>>>0)+(s>>>0)+(r>>>0)+(n>>>0),_i=(t,s,r,n,c)=>s+r+n+c+(t/2**32|0)|0,zi=(t,s,r,n,c)=>(t>>>0)+(s>>>0)+(r>>>0)+(n>>>0)+(c>>>0),Wi=(t,s,r,n,c,d)=>s+r+n+c+d+(t/2**32|0)|0,Gi=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Se=new Uint32Array(64);class ma extends Bs{get(){const{A:s,B:r,C:n,D:c,E:d,F:h,G:p,H:i}=this;return[s,r,n,c,d,h,p,i]}set(s,r,n,c,d,h,p,i){this.A=s|0,this.B=r|0,this.C=n|0,this.D=c|0,this.E=d|0,this.F=h|0,this.G=p|0,this.H=i|0}process(s,r){for(let m=0;m<16;m++,r+=4)Se[m]=s.getUint32(r,!1);for(let m=16;m<64;m++){const u=Se[m-15],y=Se[m-2],g=fe(u,7)^fe(u,18)^u>>>3,x=fe(y,17)^fe(y,19)^y>>>10;Se[m]=x+Se[m-7]+g+Se[m-16]|0}let{A:n,B:c,C:d,D:h,E:p,F:i,G:o,H:l}=this;for(let m=0;m<64;m++){const u=fe(p,6)^fe(p,11)^fe(p,25),y=l+u+ca(p,i,o)+Gi[m]+Se[m]|0,x=(fe(n,2)^fe(n,13)^fe(n,22))+da(n,c,d)|0;l=o,o=i,i=p,p=h+y|0,h=d,d=c,c=n,n=y+x|0}n=n+this.A|0,c=c+this.B|0,d=d+this.C|0,h=h+this.D|0,p=p+this.E|0,i=i+this.F|0,o=o+this.G|0,l=l+this.H|0,this.set(n,c,d,h,p,i,o,l)}roundClean(){xe(Se)}destroy(){this.set(0,0,0,0,0,0,0,0),xe(this.buffer)}constructor(s=32){super(64,s,8,!1),this.A=ve[0]|0,this.B=ve[1]|0,this.C=ve[2]|0,this.D=ve[3]|0,this.E=ve[4]|0,this.F=ve[5]|0,this.G=ve[6]|0,this.H=ve[7]|0}}class Vi extends ma{constructor(){super(28),this.A=Ne[0]|0,this.B=Ne[1]|0,this.C=Ne[2]|0,this.D=Ne[3]|0,this.E=Ne[4]|0,this.F=Ne[5]|0,this.G=Ne[6]|0,this.H=Ne[7]|0}}const ha=ua(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0
1xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Qi=ha[0],Yi=ha[1],Ee=new Uint32Array(80),Ae=new Uint32Array(80);class pa extends Bs{get(){const{Ah:s,Al:r,Bh:n,Bl:c,Ch:d,Cl:h,Dh:p,Dl:i,Eh:o,El:l,Fh:m,Fl:u,Gh:y,Gl:g,Hh:x,Hl:j}=this;return[s,r,n,c,d,h,p,i,o,l,m,u,y,g,x,j]}set(s,r,n,c,d,h,p,i,o,l,m,u,y,g,x,j){this.Ah=s|0,this.Al=r|0,this.Bh=n|0,this.Bl=c|0,this.Ch=d|0,this.Cl=h|0,this.Dh=p|0,this.Dl=i|0,this.Eh=o|0,this.El=l|0,this.Fh=m|0,this.Fl=u|0,this.Gh=y|0,this.Gl=g|0,this.Hh=x|0,this.Hl=j|0}process(s,r){for(let w=0;w<16;w++,r+=4)Ee[w]=s.getUint32(r),Ae[w]=s.getUint32(r+=4);for(let w=16;w<80;w++){const N=Ee[w-15]|0,U=Ae[w-15]|0,A=Je(N,U,1)^Je(N,U,8)^Vr(N,U,7),z=Ze(N,U,1)^Ze(N,U,8)^Qr(N,U,7),W=Ee[w-2]|0,X=Ae[w-2]|0,ne=Je(W,X,19)^Bt(W,X,61)^Vr(W,X,6),$=Ze(W,X,19)^$t(W,X,61)^Qr(W,X,6),G=$i(z,$,Ae[w-7],Ae[w-16]),ae=_i(G,A,ne,Ee[w-7],Ee[w-16]);Ee[w]=ae|0,Ae[w]=G|0}let{Ah:n,Al:c,Bh:d,Bl:h,Ch:p,Cl:i,Dh:o,Dl:l,Eh:m,El:u,Fh:y,Fl:g,Gh:x,Gl:j,Hh:L,Hl:k}=this;for(let w=0;w<80;w++){const N=Je(m,u,14)^Je(m,u,18)^Bt(m,u,41),U=Ze(m,u,14)^Ze(m,u,18)^$t(m,u,41),A=m&y^~m&x,z=u&g^~u&j,W=zi(k,U,z,Yi[w],Ae[w]),X=Wi(W,L,N,A,Qi[w],Ee[w]),ne=W|0,$=Je(n,c,28)^Bt(n,c,34)^Bt(n,c,39),G=Ze(n,c,28)^$t(n,c,34)^$t(n,c,39),ae=n&d^n&p^d&p,P=c&h^c&i^h&i;L=x|0,k=j|0,x=y|0,j=g|0,y=m|0,g=u|0,{h:m,l:u}=be(o|0,l|0,X|0,ne|0),o=p|0,l=i|0,p=d|0,i=h|0,d=n|0,h=c|0;const D=Ti(ne,G,P);n=Bi(D,X,$,ae),c=D|0}({h:n,l:c}=be(this.Ah|0,this.Al|0,n|0,c|0)),{h:d,l:h}=be(this.Bh|0,this.Bl|0,d|0,h|0),{h:p,l:i}=be(this.Ch|0,this.Cl|0,p|0,i|0),{h:o,l}=be(this.Dh|0,this.Dl|0,o|0,l|0),{h:m,l:u}=be(this.Eh|0,this.El|0,m|0,u|0),{h:y,l:g}=be(this.Fh|0,this.Fl|0,y|0,g|0),{h:x,l:j}=be(this.Gh|0,this.Gl|0,x|0,j|0),{h:L,l:k}=be(this.Hh|0,this.Hl|0,L|0,k|0),this.set(n,c,d,h,p,i,o,l,m,u,y,g,x,j,L,k)}roundClean(){xe(Ee,Ae)}destroy(){xe(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}constructor(s=64){super(128,s,16,!1),this.Ah=ee[0]|0,this.Al=ee[1]|0,this.Bh=ee[2]|0,this.Bl=ee[3]|0,this.Ch=ee[4]|0,this.Cl=ee[5]|0,this.Dh=ee[6]|0,this.Dl=ee[7]|0,this.Eh=ee[8]|0,this.El=ee[9]|0,this.Fh=ee[10]|0,this.Fl=ee[11]|0,this.Gh=ee[12]|0,this.Gl=ee[13]|0,this.Hh=ee[14]|0,this.Hl=ee[15]|0}}class Ki extends pa{constructor(){super(48),this.Ah=Z[0]|0,this.Al=Z[1]|0,this.Bh=Z[2]|0,this.Bl=Z[3]|0,this.Ch=Z[4]|0,this.Cl=Z[5]|0,this.Dh=Z[6]|0,this.Dl=Z[7]|0,this.Eh=Z[8]|0,this.El=Z[9]|0,this.Fh=Z[10]|0,this.Fl=Z[11]|0,this.Gh=Z[12]|0,this.Gl=Z[13]|0,this.Hh=Z[14]|0,this.Hl=Z[15]|0}}const Xi=nt(()=>new ma),qi=nt(()=>new Vi),Ji=nt(()=>new pa),Zi=nt(()=>new Ki),eo=BigInt(0),gt=BigInt(1),to=BigInt(2),so=BigInt(7),ro=BigInt(256),ao=BigInt(113),fa=[],xa=[],ga=[];for(let t=0,s=gt,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],fa.push(2*(5*n+r)),xa.push((t+1)*(t+2)/2%64);let c=eo;for(let d=0;d<7;d++)s=(s<<gt^(s>>so)*ao)%ro,s&to&&(c^=gt<<(gt<<BigInt(d))-gt);ga.push(c)}const ba=ua(ga,!0),no=ba[0],io=ba[1],Yr=(t,s,r)=>r>32?Oi(t,s,r):Fi(t,s,r),Kr=(t,s,r)=>r>32?Hi(t,s,r):Ui(t,s,r);function oo(t,s=24){const r=new Uint32Array(10);for(let n=24-s;n<24;n++){for(let h=0;h<10;h++)r[h]=t[h]^t[h+10]^t[h+20]^t[h+30]^t[h+40];for(let h=0;h<10;h+=2){const p=(h+8)%10,i=(h+2)%10,o=r[i],l=r[i+1],m=Yr(o,l,1)^r[p],u=Kr(o,l,1)^r[p+1];for(let y=0;y<50;y+=10)t[h+y]^=m,t[h+y+1]^=u}let c=t[2],d=t[3];for(let h=0;h<24;h++){const p=xa[h],i=Yr(c,d,p),o=Kr(c,d,p),l=fa[h];c=t[l],d=t[l+1],t[l]=i,t[l+1]=o}for(let h=0;h<50;h+=10){for(let p=0;p<10;p++)r[p]=t[h+p];for(let p=0;p<10;p++)t[h+p]^=~r[(p+2)%10]&r[(p+4)%10]}t[0]^=no[n],t[1]^=io[n]}xe(r)}class $s extends Ts{clone(){return this._cloneInto()}keccak(){Wr(this.state32),oo(this.state32,this.rounds),Wr(this.state32),this.posOut=0,this.pos=0}update(s){st(this),s=Vt(s),tt(s);const{blockLen:r,state:n}=this,c=s.length;for(let d=0;d<c;){const h=Math.min(r-this.pos,c-d);for(let p=0;p<h;p++)n[this.pos++]^=s[d++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:s,suffix:r,pos:n,blockLen:c}=this;s[n]^=r,(r&128)!==0&&n===c-1&&this.keccak(),s[c-1]^=128,this.keccak()}writeInto(s){st(this,!1),tt(s),this.finish();const r=this.state,{blockLen:n}=this;for(let c=0,d=s.length;c<d;){this.posOut>=n&&this.keccak();const h=Math.min(n-this.posOut,d-c);s.set(r.subarray(this.posOut,this.posOut+h),c),this.posOut+=h,c+=h}return s}xofInto(s){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(s)}xof(s){return Wt(s),this.xofInto(new Uint8Array(s))}digestInto(s){if(oa(s,this),this.finished)throw new Error("digest() was already called");return this.writeInto(s),this.destroy(),s}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,xe(this.state)}_cloneInto(s){const{blockLen:r,suffix:n,outputLen:c,rounds:d,enableXOF:h}=this;return s||(s=new $s(r,n,c,h,d)),s.state32.set(this.state32),s.pos=this.pos,s.posOut=this.posOut,s.finished=this.finished,s.roun
1ds=d,s.suffix=n,s.outputLen=c,s.enableXOF=h,s.destroyed=this.destroyed,s}constructor(s,r,n,c=!1,d=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=s,this.suffix=r,this.outputLen=n,this.enableXOF=c,this.rounds=d,Wt(n),!(0<s&&s<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Ei(this.state)}}const Qt=(t,s,r)=>nt(()=>new $s(s,t,r)),lo=Qt(6,144,224/8),co=Qt(6,136,256/8),uo=Qt(6,104,384/8),mo=Qt(6,72,512/8),rt=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__<"u")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis})(),Xr={SHA1:Ri,SHA224:qi,SHA256:Xi,SHA384:Zi,SHA512:Ji,"SHA3-224":lo,"SHA3-256":co,"SHA3-384":uo,"SHA3-512":mo},_s=t=>{switch(!0){case/^(?:SHA-?1|SSL3-SHA1)$/i.test(t):return"SHA1";case/^SHA(?:2?-)?224$/i.test(t):return"SHA224";case/^SHA(?:2?-)?256$/i.test(t):return"SHA256";case/^SHA(?:2?-)?384$/i.test(t):return"SHA384";case/^SHA(?:2?-)?512$/i.test(t):return"SHA512";case/^SHA3-224$/i.test(t):return"SHA3-224";case/^SHA3-256$/i.test(t):return"SHA3-256";case/^SHA3-384$/i.test(t):return"SHA3-384";case/^SHA3-512$/i.test(t):return"SHA3-512";default:throw new TypeError(`Unknown hash algorithm: ${t}`)}},ho=(t,s,r)=>{if(Ms){const n=Xr[t]??Xr[_s(t)];return Ms(n,s,r)}else throw new Error("Missing HMAC function")},Rs="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",po=t=>{t=t.replace(/ /g,"");let s=t.length;for(;t[s-1]==="=";)--s;t=(s<t.length?t.substring(0,s):t).toUpperCase();const r=new ArrayBuffer(t.length*5/8|0),n=new Uint8Array(r);let c=0,d=0,h=0;for(let p=0;p<t.length;p++){const i=Rs.indexOf(t[p]);if(i===-1)throw new TypeError(`Invalid character found: ${t[p]}`);d=d<<5|i,c+=5,c>=8&&(c-=8,n[h++]=d>>>c)}return n},fo=t=>{let s=0,r=0,n="";for(let c=0;c<t.length;c++)for(r=r<<8|t[c],s+=8;s>=5;)n+=Rs[r>>>s-5&31],s-=5;return s>0&&(n+=Rs[r<<5-s&31]),n},xo=t=>{t=t.replace(/ /g,"");const s=new ArrayBuffer(t.length/2),r=new Uint8Array(s);for(let n=0;n<t.length;n+=2)r[n/2]=parseInt(t.substring(n,n+2),16);return r},go=t=>{let s="";for(let r=0;r<t.length;r++){const n=t[r].toString(16);n.length===1&&(s+="0"),s+=n}return s.toUpperCase()},bo=t=>
1{const s=new ArrayBuffer(t.length),r=new Uint8Array(s);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n)&255;return r},yo=t=>{let s="";for(let r=0;r<t.length;r++)s+=String.fromCharCode(t[r]);return s},qr=rt.TextEncoder?new rt.TextEncoder:null,Jr=rt.TextDecoder?new rt.TextDecoder:null,wo=t=>{if(!qr)throw new Error("Encoding API not available");return qr.encode(t)},jo=t=>{if(!Jr)throw new Error("Encoding API not available");return Jr.decode(t)},vo=t=>{if(rt.crypto?.getRandomValues)return rt.crypto.getRandomValues(new Uint8Array(t));throw new Error("Cryptography API not available")};class ce{static fromLatin1(s){return new ce({buffer:bo(s).buffer})}static fromUTF8(s){return new ce({buffer:wo(s).buffer})}static fromBase32(s){return new ce({buffer:po(s).buffer})}static fromHex(s){return new ce({buffer:xo(s).buffer})}get buffer(){return this.bytes.buffer}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,writable:!1,configurable:!1,value:yo(this.bytes)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,writable:!1,configurable:!1,value:jo(this.bytes)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,writable:!1,configurable:!1,value:fo(this.bytes)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,writable:!1,configurable:!1,value:go(this.bytes)}),this.hex}constructor({buffer:s,size:r=20}={}){this.bytes=typeof s>"u"?vo(r):new Uint8Array(s),Object.defineProperty(this,"bytes",{enumerable:!0,writable:!1,configurable:!1,value:this.bytes})}}const No=(t,s)=>{{if(t.length!==s.length)throw new TypeError("Input strings must have the same length");let r=-1,n=0;for(;++r<t.length;)n|=t.charCodeAt(r)^s.charCodeAt(r);return n===0}};class K{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,counter:0,window:1}}static generate({secret:s,algorithm:r=K.defaults.algorithm,digits:n=K.defaults.digits,counter:c=K.defaults.counter}){const d=ho(r,s.bytes,Ni(c)),h=d[d.byteLength-1]&15;return(((d[h]&127)<<24|(d[h+1]&255)<<16|(d[h+2]&255)<<8|d[h+3]&255)%10**n).toString().padStart(n,"0")}generate({counter:s=this.counter++}={}){return K.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:s})}static validate({token:s,secret:r,algorithm:n,digits:c=K.defaults.digits,counter:d=K.defaults.counter,window:h=K.defaults.window}){if(s.length!==c)return null;let p=null;const i=o=>{const l=K.generate({secret:r,algorithm:n,digits:c,counter:o});No(s,l)&&(p=o-d)};i(d);for(let o=1;o<=h&&p===null&&(i(d-o),!(p!==null||(i(d+o),p!==null)));++o);return p}validate({token:s,counter:r=this.counter,window:n}){return K.validate({token:s,secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:r,window:n})}toString(){const s=encodeURIComponent;return`otpauth://hotp/${this.issuer.length>0?this.issuerInLabel?`${s(this.issuer)}:${s(this.label)}?issuer=${s(this.issuer)}&`:`${s(this.label)}?issuer=${s(this.issuer)}&`:`${s(this.label)}?`}secret=${s(this.secret.base32)}&algorithm=${s(this.algorithm)}&digits=${s(this.digits)}&counter=${s(this.counter)}`}constructor({issuer:s=K.defaults.issuer,label:r=K.defaults.label,issuerInLabel:n=K.defaults.issuerInLabel,secret:c=new ce,algorithm:d=K.defaults.algorithm,digits:h=K.defaults.digits,counter:p=K.defaults.counter}={}){this.issuer=s,this.label=r,this.issuerInLabel=n,this.secret=typeof c=="string"?ce.fromBase32(c):c,this.algorithm=_s(d),this.digits=h,this.counter=p}}class V{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}static counter({period:s=V.defaults.period,timestamp:r=Date.now()}={}){return Math.floor(r/1e3/s)}counter({timestamp:s=Date.now()}={}){return V.counter({period:this.period,timestamp:s})}static remaining({period:s=V.defaults.period,timestamp:r=Date.now()}={}){return s*1e3-r%(s*1e3)}remaining({timestamp:s=Date.now()}={}){return V.remaining({period:this.period,timestamp:s})}static generate({secret:s,algorithm:r,digits:n,period:c=V.defaults.period,timestamp:d=Date.now()}){return K.generate({secret:s,algorithm:r,digits:n,counter:V.counter({period:c,timestamp:d})})}generate({timestamp:s=Date.now()}={}){return V.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:s})}static validate({token:s,secret:r,algorithm:n,digits:c,period:d=V.defaults.period,timestamp:h=Date.now(),window:p}){return K.validate({token:s,secret:r,algorithm:n,digits:c,counter:V.counter({period:d,timestamp:h}),window:p})}validate({token:s,timestamp:r,window:n}){return V.validate({token:s,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:r,window:n})}toString(){const s=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${s(this.issuer)}:${s(this.label)}?issuer=${s(this.issuer)}&`:`${s(this.label)}?issuer=${s(this.issuer)}&`:`${s(this.label)}?`}secret=${s(this.secret.base32)}&algorithm=${s(this.algorithm)}&digits=${s(this.digits)}&period=${s(this.period)}`}constructor({issuer:s=V.defaults.issuer,label:r=V.defaults.label,issuerInLabel:n=V.defaults.issuerInLabel,secret:c=new ce,algorithm:d=V.defaults.algorithm,digits:h=V.defaults.digits,period:p=V.defaults.period}={}){this.issuer=s,this.label=r,this.issuerInLabel=n,this.secret=typeof c=="string"?ce.fromBase32(c):c,this.algorithm=_s(d),this.digits=h,this.period=p}}var Co=Object.defineProperty,Gt=Object.getOwnPropertySymbols,ya=Object.prototype.hasOwnProperty,wa=Object.prototype.propertyIsEnumerable,Zr=(t,s,r)=>s in t?Co(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r,Ds=(t,s)=>{for(var r in s||(s={}))ya.call(s,r)&&Zr(t,r,s[r]);if(Gt)for(var r of Gt(s))wa.call(s,r)&&Zr(t,r,s[r]);return t},Fs=(t,s)=>{var r={};for(var n in t)ya.call(t,n)&&s.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Gt)for(var n of Gt(t))s.indexOf(n)<0&&wa.call(t,n)&&(r[n]=t[n]);return r};var Be;(t=>{const s=class I{constructor(i,o,l,m){if(this.version=i,this.errorCorrectionLevel=o,this.modules=[],this.isFunction=[],i<I.MIN_VERSION||i>I.MAX_VERSION)throw new RangeError("Version value out of range");if(m<-1||m>7)throw new RangeError("Mask value out of range");this.size=i*4+17;let u=[];for(let g=0;g<this.size;g++)u.push(!1);for(let g=0;g<this.size;g++)this.modules.push(u.slice()),this.isFunction.push(u.slice());this.drawFunctionPatterns();const y=this.addEccAndInterleave(l);
1if(this.drawCodewords(y),m==-1){let g=1e9;for(let x=0;x<8;x++){this.applyMask(x),this.drawFormatBits(x);const j=this.getPenaltyScore();j<g&&(m=x,g=j),this.applyMask(x)}}c(0<=m&&m<=7),this.mask=m,this.applyMask(m),this.drawFormatBits(m),this.isFunction=[]}static encodeText(i,o){const l=t.QrSegment.makeSegments(i);return I.encodeSegments(l,o)}static encodeBinary(i,o){const l=t.QrSegment.makeBytes(i);return I.encodeSegments([l],o)}static encodeSegments(i,o,l=1,m=40,u=-1,y=!0){if(!(I.MIN_VERSION<=l&&l<=m&&m<=I.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");let g,x;for(g=l;;g++){const w=I.getNumDataCodewords(g,o)*8,N=h.getTotalBits(i,g);if(N<=w){x=N;break}if(g>=m)throw new RangeError("Data too long")}for(const w of[I.Ecc.MEDIUM,I.Ecc.QUARTILE,I.Ecc.HIGH])y&&x<=I.getNumDataCodewords(g,w)*8&&(o=w);let j=[];for(const w of i){r(w.mode.modeBits,4,j),r(w.numChars,w.mode.numCharCountBits(g),j);for(const N of w.getData())j.push(N)}c(j.length==x);const L=I.getNumDataCodewords(g,o)*8;c(j.length<=L),r(0,Math.min(4,L-j.length),j),r(0,(8-j.length%8)%8,j),c(j.length%8==0);for(let w=236;j.length<L;w^=253)r(w,8,j);let k=[];for(;k.length*8<j.length;)k.push(0);return j.forEach((w,N)=>k[N>>>3]|=w<<7-(N&7)),new I(g,o,k,u)}getModule(i,o){return 0<=i&&i<this.size&&0<=o&&o<this.size&&this.modules[o][i]}getModules(){return this.modules}drawFunctionPatterns(){for(let l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const i=this.getAlignmentPatternPositions(),o=i.length;for(let l=0;l<o;l++)for(let m=0;m<o;m++)l==0&&m==0||l==0&&m==o-1||l==o-1&&m==0||this.drawAlignmentPattern(i[l],i[m]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(i){const o=this.errorCorrectionLevel.formatBits<<3|i;let l=o;for(let u=0;u<10;u++)l=l<<1^(l>>>9)*1335;const m=(o<<10|l)^21522;c(m>>>15==0);for(let u=0;u<=5;u++)this.setFunctionModule(8,u,n(m,u));this.setFunctionModule(8,7,n(m,6)),this.setFunctionModule(8,8,n(m,7)),this.setFunctionModule(7,8,n(m,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,n(m,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,n(m,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,n(m,u));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let i=this.version;for(let l=0;l<12;l++)i=i<<1^(i>>>11)*7973;const o=this.version<<12|i;c(o>>>18==0);for(let l=0;l<18;l++){const m=n(o,l),u=this.size-11+l%3,y=Math.floor(l/3);this.setFunctionModule(u,y,m),this.setFunctionModule(y,u,m)}}drawFinderPattern(i,o){for(let l=-4;l<=4;l++)for(let m=-4;m<=4;m++){const u=Math.max(Math.abs(m),Math.abs(l)),y=i+m,g=o+l;0<=y&&y<this.size&&0<=g&&g<this.size&&this.setFunctionModule(y,g,u!=2&&u!=4)}}drawAlignmentPattern(i,o){for(let l=-2;l<=2;l++)for(let m=-2;m<=2;m++)this.setFunctionModule(i+m,o+l,Math.max(Math.abs(m),Math.abs(l))!=1)}setFunctionModule(i,o,l){this.modules[o][i]=l,this.isFunction[o][i]=!0}addEccAndInterleave(i){const o=this.version,l=this.errorCorrectionLevel;if(i.length!=I.getNumDataCodewords(o,l))throw new RangeError("Invalid argument");const m=I.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][o],u=I.ECC_CODEWORDS_PER_BLOCK[l.ordinal][o],y=Math.floor(I.getNumRawDataModules(o)/8),g=m-y%m,x=Math.floor(y/m);let j=[];const L=I.reedSolomonComputeDivisor(u);for(let w=0,N=0;w<m;w++){let U=i.slice(N,N+x-u+(w<g?0:1));N+=U.length;const A=I.reedSolomonComputeRemainder(U,L);w<g&&U.push(0),j.push(U.concat(A))}let k=[];for(let w=0;w<j[0].length;w++)j.forEach((N,U)=>{(w!=x-u||U>=g)&&k.push(N[w])});return c(k.length==y),k}drawCodewords(i){if(i.length!=Math.floor(I.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let o=0;for(let l=this.size-1;l>=1;l-=2){l==6&&(l=5);for(let m=0;m<this.size;m++)for(let u=0;u<2;u++){const y=l-u,x=(l+1&2)==0?this.size-1-m:m;!this.isFunction[x][y]&&o<i.length*8&&(this.modules[x][y]=n(i[o>>>3],7-(o&7)),o++)}}c(o==i.length*8)}applyMask(i){if(i<0||i>7)throw new RangeError("Mask value out of range");for(let o=0;o<this.size;o++)for(let l=0;l<this.size;l++){let m;switch(i){case 0:m=(l+o)%2==0;break;case 1:m=o%2==0;break;case 2:m=l%3==0;break;case 3:m=(l+o)%3==0;break;case 4:m=(Math.floor(l/3)+Math.floor(o/2))%2==0;break;case 5:m=l*o%2+l*o%3==0;break;case 6:m=(l*o%2+l*o%3)%2==0;break;case 7:m=((l+o)%2+l*o%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[o][l]&&m&&(this.modules[o][l]=!this.modules[o][l])}}getPenaltyScore(){let i=0;for(let u=0;u<this.size;u++){let y=!1,g=0,x=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[u][j]==y?(g++,g==5?i+=I.PENALTY_N1:g>5&&i++):(this.finderPenaltyAddHistory(g,x),y||(i+=this.finderPenaltyCountPatterns(x)*I.PENALTY_N3),y=this.modules[u][j],g=1);i+=this.finderPenaltyTerminateAndCount(y,g,x)*I.PENALTY_N3}for(let u=0;u<this.size;u++){let y=!1,g=0,x=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[j][u]==y?(g++,g==5?i+=I.PENALTY_N1:g>5&&i++):(this.finderPenaltyAddHistory(g,x),y||(i+=this.finderPenaltyCountPatterns(x)*I.PENALTY_N3),y=this.modules[j][u],g=1);i+=this.finderPenaltyTerminateAndCount(y,g,x)*I.PENALTY_N3}for(let u=0;u<this.size-1;u++)for(let y=0;y<this.size-1;y++){const g=this.modules[u][y];g==this.modules[u][y+1]&&g==this.modules[u+1][y]&&g==this.modules[u+1][y+1]&&(i+=I.PENALTY_N2)}let o=0;for(const u of this.modules)o=u.reduce((y,g)=>y+(g?1:0),o);const l=this.size*this.size,m=Math.ceil(Math.abs(o*20-l*10)/l)-1;return c(0<=m&&m<=9),i+=m*I.PENALTY_N4,c(0<=i&&i<=2568888),i}getAlignmentPatternPositions(){if(this.version==1)return[];{const i=Math.floor(this.version/7)+2,o=this.version==32?26:Math.ceil((this.version*4+4)/(i*2-2))*2;let l=[6];for(let m=this.size-7;l.length<i;m-=o)l.splice(1,0,m);return l}}static getNumRawDataModules(i){if(i<I.MIN_VERSION||i>I.MAX_VERSION)throw new RangeError("Version number out of range");let o=(16*i+128)*i+64;if(i>=2){const l=Math.floor(i/7)+2;o-=(25*l-10)*l-55,i>=7&&(o-=36)}return c(208<=o&&o<=29648),o}static getNumDataCodewords(i,o){return Math.floor(I.getNumRawDataModules(i)/8)-I.ECC_CODEWORDS_PER_BLOCK[o.ordinal][i]*I.NUM_ERROR_CORRECTION_BLOCKS[o.ordinal][i]}static reedSolomonComputeDivisor(i){if(i<1||i>
1255)throw new RangeError("Degree out of range");let o=[];for(let m=0;m<i-1;m++)o.push(0);o.push(1);let l=1;for(let m=0;m<i;m++){for(let u=0;u<o.length;u++)o[u]=I.reedSolomonMultiply(o[u],l),u+1<o.length&&(o[u]^=o[u+1]);l=I.reedSolomonMultiply(l,2)}return o}static reedSolomonComputeRemainder(i,o){let l=o.map(m=>0);for(const m of i){const u=m^l.shift();l.push(0),o.forEach((y,g)=>l[g]^=I.reedSolomonMultiply(y,u))}return l}static reedSolomonMultiply(i,o){if(i>>>8||o>>>8)throw new RangeError("Byte out of range");let l=0;for(let m=7;m>=0;m--)l=l<<1^(l>>>7)*285,l^=(o>>>m&1)*i;return c(l>>>8==0),l}finderPenaltyCountPatterns(i){const o=i[1];c(o<=this.size*3);const l=o>0&&i[2]==o&&i[3]==o*3&&i[4]==o&&i[5]==o;return(l&&i[0]>=o*4&&i[6]>=o?1:0)+(l&&i[6]>=o*4&&i[0]>=o?1:0)}finderPenaltyTerminateAndCount(i,o,l){return i&&(this.finderPenaltyAddHistory(o,l),o=0),o+=this.size,this.finderPenaltyAddHistory(o,l),this.finderPenaltyCountPatterns(l)}finderPenaltyAddHistory(i,o){o[0]==0&&(i+=this.size),o.pop(),o.unshift(i)}};s.MIN_VERSION=1,s.MAX_VERSION=40,s.PENALTY_N1=3,s.PENALTY_N2=3,s.PENALTY_N3=40,s.PENALTY_N4=10,s.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],s.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],t.QrCode=s;function r(p,i,o){if(i<0||i>31||p>>>i)throw new RangeError("Value out of range");for(let l=i-1;l>=0;l--)o.push(p>>>l&1)}function n(p,i){return(p>>>i&1)!=0}function c(p){if(!p)throw new Error("Assertion error")}const d=class T{constructor(i,o,l){if(this.mode=i,this.numChars=o,this.bitData=l,o<0)throw new RangeError("Invalid argument");this.bitData=l.slice()}static makeBytes(i){let o=[];for(const l of i)r(l,8,o);return new T(T.Mode.BYTE,i.length,o)}static makeNumeric(i){if(!T.isNumeric(i))throw new RangeError("String contains non-numeric characters");let o=[];for(let l=0;l<i.length;){const m=Math.min(i.length-l,3);r(parseInt(i.substring(l,l+m),10),m*3+1,o),l+=m}return new T(T.Mode.NUMERIC,i.length,o)}static makeAlphanumeric(i){if(!T.isAlphanumeric(i))throw new RangeError("String contains unencodable characters in alphanumeric mode");let o=[],l;for(l=0;l+2<=i.length;l+=2){let m=T.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l))*45;m+=T.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l+1)),r(m,11,o)}return l<i.length&&r(T.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l)),6,o),new T(T.Mode.ALPHANUMERIC,i.length,o)}static makeSegments(i){return i==""?[]:T.isNumeric(i)?[T.makeNumeric(i)]:T.isAlphanumeric(i)?[T.makeAlphanumeric(i)]:[T.makeBytes(T.toUtf8ByteArray(i))]}static makeEci(i){let o=[];if(i<0)throw new RangeError("ECI assignment value out of range");if(i<128)r(i,8,o);else if(i<16384)r(2,2,o),r(i,14,o);else if(i<1e6)r(6,3,o),r(i,21,o);else throw new RangeError("ECI assignment value out of range");return new T(T.Mode.ECI,0,o)}static isNumeric(i){return T.NUMERIC_REGEX.test(i)}static isAlphanumeric(i){return T.ALPHANUMERIC_REGEX.test(i)}getData(){return this.bitData.slice()}static getTotalBits(i,o){let l=0;for(const m of i){const u=m.mode.numCharCountBits(o);if(m.numChars>=1<<u)return 1/0;l+=4+u+m.bitData.length}return l}static toUtf8ByteArray(i){i=encodeURI(i);let o=[];for(let l=0;l<i.length;l++)i.charAt(l)!="%"?o.push(i.charCodeAt(l)):(o.push(parseInt(i.substring(l+1,l+3),16)),l+=2);return o}};d.NUMERIC_REGEX=/^[0-9]*$/,d.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,d.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let h=d;t.QrSegment=d})(Be||(Be={}));(t=>{(s=>{const r=class{constructor(c,d){this.ordinal=c,this.formatBits=d}};r.LOW=new r(0,1),r.MEDIUM=new r(1,0),r.QUARTILE=new r(2,3),r.HIGH=new r(3,2),s.Ecc=r})(t.QrCode||(t.QrCode={}))})(Be||(Be={}));(t=>{(s=>{const r=class{constructor(c,d){this.modeBits=c,this.numBitsCharCount=d}numCharCountBits(c){return this.numBitsCharCount[Math.floor((c+7)/17)]}};r.NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]),s.Mode=r})(t.QrSegment||(t.QrSegment={}))})(Be||(Be={}));var et=Be;var So={L:et.QrCode.Ecc.LOW,M:et.QrCode.Ecc.MEDIUM,Q:et.QrCode.Ecc.QUARTILE,H:et.QrCode.Ecc.HIGH},ja=128,va="L",Na="#FFFFFF",Ca="#000000",Sa=!1,Ea=1,Eo=4,Ao=0,Io=.1;function Aa(t,s=0){const r=[];return t.forEach(function(n,c){let d=null;
1n.forEach(function(h,p){if(!h&&d!==null){r.push(`M${d+s} ${c+s}h${p-d}v1H${d+s}z`),d=null;return}if(p===n.length-1){if(!h)return;d===null?r.push(`M${p+s},${c+s} h1v1H${p+s}z`):r.push(`M${d+s},${c+s} h${p+1-d}v1H${d+s}z`);return}h&&d===null&&(d=p)})}),r.join("")}function Ia(t,s){return t.slice().map((r,n)=>n<s.y||n>=s.y+s.h?r:r.map((c,d)=>d<s.x||d>=s.x+s.w?c:!1))}function ko(t,s,r,n){if(n==null)return null;const c=t.length+r*2,d=Math.floor(s*Io),h=c/s,p=(n.width||d)*h,i=(n.height||d)*h,o=n.x==null?t.length/2-p/2:n.x*h,l=n.y==null?t.length/2-i/2:n.y*h,m=n.opacity==null?1:n.opacity;let u=null;if(n.excavate){let g=Math.floor(o),x=Math.floor(l),j=Math.ceil(p+o-g),L=Math.ceil(i+l-x);u={x:g,y:x,w:j,h:L}}const y=n.crossOrigin;return{x:o,y:l,h:i,w:p,excavation:u,opacity:m,crossOrigin:y}}function Po(t,s){return s!=null?Math.max(Math.floor(s),0):t?Eo:Ao}function ka({value:t,level:s,minVersion:r,includeMargin:n,marginSize:c,imageSettings:d,size:h,boostLevel:p}){let i=E.useMemo(()=>{const g=(Array.isArray(t)?t:[t]).reduce((x,j)=>(x.push(...et.QrSegment.makeSegments(j)),x),[]);return et.QrCode.encodeSegments(g,So[s],r,void 0,void 0,p)},[t,s,r,p]);const{cells:o,margin:l,numCells:m,calculatedImageSettings:u}=E.useMemo(()=>{let y=i.getModules();const g=Po(n,c),x=y.length+g*2,j=ko(y,h,g,d);return{cells:y,margin:g,numCells:x,calculatedImageSettings:j}},[i,h,d,n,c]);return{qrcode:i,margin:l,cells:o,numCells:m,calculatedImageSettings:u}}var Lo=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Mo=E.forwardRef(function(s,r){const n=s,{value:c,size:d=ja,level:h=va,bgColor:p=Na,fgColor:i=Ca,includeMargin:o=Sa,minVersion:l=Ea,boostLevel:m,marginSize:u,imageSettings:y}=n,x=Fs(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:j}=x,L=Fs(x,["style"]),k=y?.src,w=E.useRef(null),N=E.useRef(null),U=E.useCallback(P=>{w.current=P,typeof r=="function"?r(P):r&&(r.current=P)},[r]),[A,z]=E.useState(!1),{margin:W,cells:X,numCells:ne,calculatedImageSettings:$}=ka({value:c,level:h,minVersion:l,boostLevel:m,includeMargin:o,marginSize:u,imageSettings:y,size:d});E.useEffect(()=>{if(w.current!=null){const P=w.current,D=P.getContext("2d");if(!D)return;let Ie=X;const C=N.current,F=$!=null&&C!==null&&C.complete&&C.naturalHeight!==0&&C.naturalWidth!==0;F&&$.excavation!=null&&(Ie=Ia(X,$.excavation));const ke=window.devicePixelRatio||1;P.height=P.width=d*ke;const J=d/ne*ke;D.scale(J,J),D.fillStyle=p,D.fillRect(0,0,ne,ne),D.fillStyle=i,Lo?D.fill(new Path2D(Aa(Ie,W))):X.forEach(function(Pe,ge){Pe.forEach(function($e,O){$e&&D.fillRect(O+W,ge+W,1,1)})}),$&&(D.globalAlpha=$.opacity),F&&D.drawImage(C,$.x+W,$.y+W,$.w,$.h)}}),E.useEffect(()=>{z(!1)},[k]);const G=Ds({height:d,width:d},j);let ae=null;return k!=null&&(ae=E.createElement("img",{src:k,key:k,style:{display:"none"},onLoad:()=>{z(!0)},ref:N,crossOrigin:$?.crossOrigin})),E.createElement(E.Fragment,null,E.createElement("canvas",Ds({style:G,height:d,width:d,ref:U,role:"img"},L)),ae)});Mo.displayName="QRCodeCanvas";var Pa=E.forwardRef(function(s,r){const n=s,{value:c,size:d=ja,level:h=va,bgColor:p=Na,fgColor:i=Ca,includeMargin:o=Sa,minVersion:l=Ea,boostLevel:m,title:u,marginSize:y,imageSettings:g}=n,x=Fs(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:j,cells:L,numCells:k,calculatedImageSettings:w}=ka({value:c,level:h,minVersion:l,boostLevel:m,includeMargin:o,marginSize:y,imageSettings:g,size:d});let N=L,U=null;g!=null&&w!=null&&(w.excavation!=null&&(N=Ia(L,w.excavation)),U=E.createElement("image",{href:g.src,height:w.h,width:w.w,x:w.x+j,y:w.y+j,preserveAspectRatio:"none",opacity:w.opacity,crossOrigin:w.crossOrigin}));const A=Aa(N,j);return E.createElement("svg",Ds({height:d,width:d,viewBox:`0 0 ${k} ${k}`,ref:r,role:"img"},x),!!u&&E.createElement("title",null,u),E.createElement("path",{fill:p,d:`M0,0 h${k}v${k}H0z`,shapeRendering:"crispEdges"}),E.createElement("path",{fill:i,d:A,shapeRendering:"crispEdges"}),U)});Pa.displayName="QRCodeSVG";function ea(t,s){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);
vendor: 4,453 bytes, lines 1-2
1s&&(n=n.filter(function(c){return Object.getOwnPropertyDescriptor(t,c).enumerable})),r.push.apply(r,n)}return r}function ta(t){for(var s=1;s<arguments.length;s++){var r=arguments[s]!=null?arguments[s]:{};s%2?ea(Object(r),!0).forEach(function(n){La(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ea(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function zt(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zt=function(s){return typeof s}:zt=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},zt(t)}function La(t,s,r){return s in t?Object.defineProperty(t,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[s]=r,t}function Ro(t,s){if(t==null)return{};var r={},n=Object.keys(t),c,d;for(d=0;d<n.length;d++)c=n[d],!(s.indexOf(c)>=0)&&(r[c]=t[c]);return r}function Do(t,s){if(t==null)return{};var r=Ro(t,s),n,c;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(t);for(c=0;c<d.length;c++)n=d[c],!(s.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Ma(t,s){return Fo(t)||Uo(t,s)||Oo(t,s)||Ho()}function Fo(t){if(Array.isArray(t))return t}function Uo(t,s){var r=t&&(typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"]);if(r!=null){var n=[],c=!0,d=!1,h,p;try{for(r=r.call(t);!(c=(h=r.next()).done)&&(n.push(h.value),!(s&&n.length===s));c=!0);}catch(i){d=!0,p=i}finally{try{!c&&r.return!=null&&r.return()}finally{if(d)throw p}}return n}}function Oo(t,s){if(t){if(typeof t=="string")return sa(t,s);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sa(t,s)}}function sa(t,s){(s==null||s>t.length)&&(s=t.length);for(var r=0,n=new Array(s);r<s;r++)n[r]=t[r];return n}function Ho(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var te=function(s,r,n){var c=!!n,d=E.useRef(n);E.useEffect(function(){d.current=n},[n]),E.useEffect(function(){if(!c||!s)return function(){};var h=function(){d.current&&d.current.apply(d,arguments)};return s.on(r,h),function(){s.off(r,h)}},[c,r,s,d])},Us=function(s){var r=E.useRef(s);return E.useEffect(function(){r.current=s},[s]),r.current},at=function(s){return s!==null&&zt(s)==="object"},To=function(s){return at(s)&&typeof s.then=="function"},Bo=function(s){return at(s)&&typeof s.elements=="function"&&typeof s.createToken=="function"&&typeof s.createPaymentMethod=="function"&&typeof s.confirmCardPayment=="function"},ra="[object Object]",$o=function t(s,r){if(!at(s)||!at(r))return s===r;var n=Array.isArray(s),c=Array.isArray(r);if(n!==c)return!1;var d=Object.prototype.toString.call(s)===ra,h=Object.prototype.toString.call(r)===ra;if(d!==h)return!1;if(!d&&!n)return s===r;var p=Object.keys(s),i=Object.keys(r);if(p.length!==i.length)return!1;for(var o={},l=0;l<p.length;l+=1)o[p[l]]=!0;for(var m=0;m<i.length;m+=1)o[i[m]]=!0;var u=Object.keys(o);if(u.length!==p.length)return!1;var y=s,g=r,x=function(L){return t(y[L],g[L])};return u.every(x)},Ra=function(s,r,n){return at(s)?Object.keys(s).reduce(function(c,d){var h=!at(r)||!$o(s[d],r[d]);return n.includes(d)?(h&&console.warn("Unsupported prop change: options.".concat(d," is not a mutable property.")),c):h?ta(ta({},c||{}),{},La({},d,s[d])):c},null):null},Da="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",aa=function(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Da;if(s===null||Bo(s))return s;throw new Error(r)},_o=function(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Da;if(To(s))return{tag:"async",stripePromise:Promise.resolve(s).then(function(c){return aa(c,r)})};var n=aa(s,r);return n===null?{tag:"empty"}:{tag:"sync",stripe:n}},zo=function(s){!s||!s._registerWrapper||!s.registerAppInfo||(s._registerWrapper({name:"react-stripe-js",version:"5.4.1"}),s.registerAppInfo({name:"react-stripe-js",version:"5.4.1",url:"https://stripe.com/docs/stripe-js/react"}))},Yt=E.createContext(null);
2Yt.displayName="ElementsContext";var Fa=function(s,r){if(!s)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(r," in an <Elements> provider."));return s},Ua=function(s){var r=s.stripe,n=s.options,c=s.children,d=E.useMemo(function(){return _o(r)},[r]),h=E.useState(function(){return{stripe:d.tag==="sync"?d.stripe:null,elements:d.tag==="sync"?d.stripe.elements(n):null}}),p=Ma(h,2),i=p[0],o=p[1];E.useEffect(function(){var u=!0,y=function(x){o(function(j){return j.stripe?j:{stripe:x,elements:x.elements(n)}})};return d.tag==="async"&&!i.stripe?d.stripePromise.then(function(g){g&&u&&y(g)}):d.tag==="sync"&&!i.stripe&&y(d.stripe),function(){u=!1}},[d,i,n]);var l=Us(r);E.useEffect(function(){l!==null&&l!==r&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[l,r]);var m=Us(n);return E.useEffect(function(){if(i.elements){var u=Ra(n,m,["clientSecret","fonts"]);u&&i.elements.update(u)}},[n,m,i.elements]),E.useEffect(function(){zo(i.stripe)},[i.stripe]),E.createElement(Yt.Provider,{value:i},c)};Ua.propTypes={stripe:R.any,options:R.object};var Wo=function(s){var r=E.useContext(Yt);return Fa(r,s)},Go=function(){var s=Wo("calls useElements()"),r=s.elements;return r};R.func.isRequired;var Oa=E.createContext(null);Oa.displayName="CheckoutContext";R.any,R.shape({clientSecret:R.oneOfType([R.string,R.instanceOf(Promise)]).isRequired,elementsOptions:R.object}).isRequired;var Os=function(s){var r=E.useContext(Oa),n=E.useContext(Yt);if(r){if(n)throw new Error("You cannot wrap the part of your app that ".concat(s," in both <CheckoutProvider> and <Elements> providers."));return r}else return Fa(n,s)},Vo=["mode"],Qo=function(s){return s.charAt(0).toUpperCase()+s.slice(1)},se=function(s,r){var n="".concat(Qo(s),"Element"),c=function(i){var o=i.id,l=i.className,m=i.options,u=m===void 0?{}:m,y=i.onBlur,g=i.onFocus,x=i.onReady,j=i.onChange,L=i.onEscape,k=i.onClick,w=i.onLoadError,N=i.onLoaderStart,U=i.onNetworksChange,A=i.onConfirm,z=i.onCancel,W=i.onShippingAddressChange,X=i.onShippingRateChange,ne=i.onSavedPaymentMethodRemove,$=i.onSavedPaymentMethodUpdate,G=Os("mounts <".concat(n,">")),ae="elements"in G?G.elements:null,P="checkoutState"in G?G.checkoutState:null,D=P?.type==="success"||P?.type==="loading"?P.sdk:null,Ie=E.useState(null),C=Ma(Ie,2),F=C[0],ke=C[1],J=E.useRef(null),Pe=E.useRef(null);te(F,"blur",y),te(F,"focus",g),te(F,"escape",L),te(F,"click",k),te(F,"loaderror",w),te(F,"loaderstart",N),te(F,"networkschange",U),te(F,"confirm",A),te(F,"cancel",z),te(F,"shippingaddresschange",W),te(F,"shippingratechange",X),te(F,"savedpaymentmethodremove",ne),te(F,"savedpaymentmethodupdate",$),te(F,"change",j);var ge;x&&(s==="expressCheckout"?ge=x:ge=function(){x(F)}),te(F,"ready",ge),E.useLayoutEffect(function(){if(J.current===null&&Pe.current!==null&&(ae||D)){var O=null;if(D)switch(s){case"paymentForm":O=D.createPaymentFormElement();break;case"payment":O=D.createPaymentElement(u);break;case"address":if("mode"in u){var bt=u.mode,yt=Do(u,Vo);if(bt==="shipping")O=D.createShippingAddressElement(yt);else if(bt==="billing")O=D.createBillingAddressElement(yt);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":O=D.createExpressCheckoutElement(u);break;case"currencySelector":O=D.createCurrencySelectorElement();break;case"taxId":O=D.createTaxIdElement(u);break;default:throw new Error("Invalid Element type ".concat(n,". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."))}else ae&&(O=ae.create(s,u));J.current=O,ke(O),O&&O.mount(Pe.current)}},[ae,D,u]);var $e=Us(u);return E.useEffect(function(){if(J.current){var O=Ra(u,$e,["paymentRequest"]);O&&"update"in J.current&&J.current.update(O)}},[u,$e]),E.useLayoutEffect(function(){return function(){if(J.current&&typeof J.current.destroy=="function")try{J.current.destroy(),J.current=null}catch{}}},[]),E.createElement("div",{id:o,className:l,ref:Pe})},d=function(i){Os("mounts <".concat(n,">"));var o=i.id,l=i.className;return E.createElement("div",{id:o,className:l})},h=r?d:c;return h.propTypes={id:R.string,className:R.string,onChange:R.func,onBlur:R.func,onFocus:R.func,onReady:R.func,onEscape:R.func,onClick:R.func,onLoadError:R.func,onLoaderStart:R.func,onNetworksChange:R.func,onConfirm:R.func,onCancel:R.func,onShippingAddressChange:R.func,onShippingRateChange:R.func,onSavedPaymentMethodRemove:R.func,onSavedPaymentMethodUpdate:R.func,options:R.object},h.displayName=n,h.__elementType=s,h},re=typeof window>"u",Yo=E.createContext(null);Yo.displayName="EmbeddedCheckoutProviderContext";var Ko=function(){var s=Os("calls useStripe()"),r=s.stripe;return r};se("auBankAccount",re);var na=se("card",re);se("cardNumber",re);se("cardExpiry",re);se("cardCvc",re);se("iban",re);se("payment",re);se("expressCheckout",re);se("paymentRequestButton",re);se("linkAuthentication",re);se("address",re);se("shippingAddress",re);se("paymentMethodMessaging",re);se("taxId",re);const Xo="AIzaSyA1j0A2LNhwNa1HImdsHsKLCiG9dx656JE";let _t=null;async function qo(){return _t||(_t=(async()=>
2{if(!window.google?.maps?.places){if(window.google?.maps?.importLibrary){await window.google.maps.importLibrary("places");return}return new Promise((t,s)=>{const r="_gmapsCallback"+Date.now();window[r]=()=>{t(),delete window[r]};const n=document.createElement("script");n.src=`https://maps.googleapis.com/maps/api/js?key=${Xo}&libraries=places&callback=${r}`,n.async=!0,n.onerror=s,document.head.appendChild(n)})}})(),_t)}function Jo({onSuccess:t,onCancel:s,clientSecret:r}){const{t:n}=ia(),c=Ko(),d=Go(),[h,p]=b.useState(!1),[i,o]=b.useState(null),l=async u=>{if(u.preventDefault(),!(!c||!d)){p(!0),o(null);try{const y=d.getElement(na),{setupIntent:g,error:x}=await c.confirmCardSetup(r,{payment_method:{card:y}});if(x){o(x.message);return}const j=await ni(g.payment_method);t(j.paymentMethod)}catch(y){o(y.message||n("parametres.abo.genericError"))}finally{p(!1)}}},m={style:{base:{fontSize:"16px",color:"#1f2937","::placeholder":{color:"#9ca3af"}},invalid:{color:"#ef4444"}}};return e.jsxs("form",{onSubmit:l,className:"p-5",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:n("parametres.abo.newCard")}),e.jsx("div",{className:"p-4 border border-gray-200 rounded-xl",children:e.jsx(na,{options:m})})]}),i&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-xl text-red-600 text-sm",children:i}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:s,className:"px-4 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-xl transition-colors",children:n("parametres.cancel")}),e.jsx("button",{type:"submit",disabled:!c||h,className:"flex items-center gap-2 px-4 py-2.5 bg-amber-500 hover:bg-amber-600 disabled:bg-amber-400 text-white text-sm font-medium rounded-xl transition-colors",children:h?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{children:n("parametres.saving")})]}):e.jsx("span",{children:n("parametres.abo.saveCard")})})]})]})}function vl(){const{t,i18n:s}=ia(),r=s.language==="en"?"en-US":"fr-FR",n=$r(vs(s.language)).timezoneOptions,c=a=>{try{const f=new Intl.DateTimeFormat("en-US",{timeZone:a,timeZoneName:"shortOffset"}).formatToParts(new Date).find(v=>v.type==="timeZoneName")?.value;return f?` (${f})`:""}catch{return""}},{user:d,company:h,updateProfile:p,updatePassword:i,getToken:o,sessionToken:l,hasPasswordProvider:m,isImpersonating:u,impersonatedUser:y,impersonation:g}=Un(),{config:x,updateConfig:j,refresh:L,listenersReady:k,trackApiUsage:w}=On(),N=u&&y?y:d,{sidebarWidth:U,isMobile:A}=Hn(),z=Tn(),W=Bn(),[X,ne]=$n(),$=["profile","company","notifications","subscription","security"],G=X.get("tab"),ae=$.includes(G)?G:"profile",[P,D]=b.useState(ae);b.useEffect(()=>{G&&$.includes(G)&&G!==P&&D(G)},[G]);const Ie=a=>{D(a),ne({tab:a})},[C,F]=b.useState(null),[ke,J]=b.useState([]),[Pe,ge]=b.useState(!0),[$e,O]=b.useState(!1),[bt,yt]=b.useState(0),[ie,Kt]=b.useState(null),[Ha,wt]=b.useState(!1),[Ta,jt]=b.useState(!1),[Ba,Xt]=b.useState(!1),[Le,qt]=b.useState(!1),[Me,Jt]=b.useState(!1),[Re,zs]=b.useState(!1),[Zo,el]=b.useState(!1),[Ws,Gs]=b.useState(!1),[Vs,Qs]=b.useState(!1),[oe,_e]=b.useState(null),[Ys,Ks]=b.useState(!1),[Xs,vt]=b.useState(null),[q,de]=b.useState({name:"",email:"",phone:"",line1:"",line2:"",city:"",postalCode:"",country:s.language==="en"?"US":"FR",taxId:""}),qs=[{id:"profile",label:t("parametres.tabs.profil"),icon:oi},{id:"company",label:t("parametres.tabs.entreprise"),icon:li},{id:"notifications",label:t("parametres.tabs.notifications"),icon:_r},{id:"subscription",label:t("parametres.tabs.abonnement"),icon:Fr},{id:"security",label:t("parametres.tabs.securite"),icon:_n}],[_,ze]=b.useState({firstName:"",lastName:"",email:"",phone:"",jobTitle:"",photoURL:""}),[ye,Js]=b.useState({}),[De,$a]=b.useState(!1),Zs=b.useRef(null),[Nt,er]=b.useState(!1),[tl,ue]=b.useState(null),[_a,Zt]=b.useState(!1),[it,Ct]=b.useState(!1),[Fe,ot]=b.useState(""),[tr,sr]=b.useState(!1),[za,es]=b.useState(!1),[we,lt]=b.useState({currentPassword:"",newPassword:"",confirmPassword:""}),[ts,Wa]=b.useState(!1),[ss,Ga]=b.useState(!1),[rr,ar]=b.useState(!1),[nr,ct]=b.useState(null),[Va,ir]=b.useState(!1),[or,lr]=b.useState(!1),[Ue,cr]=b.useState(null),[dr,ur]=b.useState(""),[rs,as]=b.useState(""),[We,je]=b.useState(!1),[Ge,me]=b.useState(null),[St,dt]=b.useState(1),[Ve,ns]=b.useState(!1),[Qa,is]=b.useState(!1),[Et,os]=b.useState([]),[ls,Ya]=b.useState([]),[Ka,cs]=b.useState(!0),[ds,us]=b.useState(!0),[mr,hr]=b.useState(null),[pr,fr]=b.useState(!1),[ms,xr]=b.useState(!1),[ut,Xa]=b.useState(1),[hs,qa]=b.useState(1),[Ja,Za]=b.useState(0),[en,ps]=b.useState(!1),[At,fs]=b.useState(""),[gr,br]=b.useState(!1),[yr,mt]=b.useState(null),[Q,It]=b.useState({companyName:"",address:"",city:"",postalCode:"",siret:"",website:"",latitude:null,longitude:null}),kt=b.useRef(null),Oe=b.useRef(null),[xs,wr]=b.useState({}),[Qe,tn]=b.useState(!1),[Pt,jr]=b.useState(!1),[sl,Lt]=b.useState(null),[sn,Mt]=b.useState(!1),[Ye,gs]=b.useState(!1),[He,bs]=b.useState(""),[Ke,vr]=b.useState({}),[rl,rn]=b.useState(!1),[Rt,Nr]=b.useState(!1),[Cr,he]=b.useState(null),[ht,Dt]=b.useState(!1),[Sr,Er]=b.useState(!1),[an,ys]=b.useState(!1),Ar=a=>zn(a);b.useEffect(()=>{if(x)if(x.timezone)ot(x.timezone);else try{ot(Intl.DateTimeFormat().resolvedOptions().timeZone||"")}catch{ot("")}},[x]);const nn=async a=>{const f=Fe;if(ot(a),!(!a||a===x?.timezone)){sr(!0);try{await j({timezone:a}),z.success(t("parametres.profil.timezoneSaved"))}catch(v){console.error("Erreur sauvegarde timezone:",v),z.error(t("parametres.profil.timezoneError")),ot(f)}finally{sr(!1)}}},on=async a=>{try{await j({locale:vs(a)})}catch(f){throw console.error("Erreur sauvegarde langue:",f),z.error(t("parametres.profil.languageError")),f}};b.useEffect(()=>{if(N){const a={firstName:N.firstName||"",lastName:N.lastName||"",email:N.email||"",phone:Ar(N.phone||""),jobTitle:N.jobTitle||"",photoURL:N.photoURL||""};ze(a),Js({firstName:a.firstName,lastName:a.lastName,phone:a.phone,jobTitle:a.jobTitle}),$a(!0)}},[N]),b.useEffect(()=>{(async()=>
2{if(N?.clientId)try{const f=await Yn(Ns(Cs,"clients",N.clientId));if(f.exists()){const v=f.data();ns(v.twoFactorEnabled||!1)}}catch(f){console.error("Erreur vérification 2FA:",f)}})()},[N]),b.useEffect(()=>{(async()=>{if(N)try{const f=await o();if(!f)return;cs(!0);const v=await Ht.getSessions(f,l);os(v.sessions||[]),cs(!1)}catch(f){console.error("Erreur chargement sessions:",f),cs(!1)}})()},[N,l]);const ws=async(a=1)=>{if(N)try{const f=await o();if(!f)return;us(!0);const v=await Ht.getLoginHistory(f,a);Ya(v.history||[]),v.pagination&&(Xa(v.pagination.page),qa(v.pagination.totalPages),Za(v.pagination.totalEntries)),us(!1)}catch(f){console.error("Erreur chargement historique:",f),us(!1)}};b.useEffect(()=>{ws(1)},[N]);const ln=async a=>{if(a){hr(a);try{const f=await o();await Ht.revokeSession(f,a),os(v=>v.filter(S=>S.sessionToken!==a))}catch(f){console.error("Erreur révocation session:",f)}finally{hr(null)}}},cn=async()=>{if(l){fr(!0);try{const a=await o();await Ht.revokeAllSessions(a,l),os(f=>f.filter(v=>v.isCurrentSession))}catch(a){console.error("Erreur révocation toutes sessions:",a)}finally{fr(!1)}}},dn=async()=>{xr(!0);try{const a={exportDate:new Date().toISOString(),profile:{email:N?.email||"",firstName:N?.firstName||"",lastName:N?.lastName||"",phone:N?.phone||"",jobTitle:N?.jobTitle||"",createdAt:N?.createdAt||null},company:{name:h?.companyName||h?.name||"",email:h?.email||"",phone:h?.phone||"",primaryColor:h?.primaryColor||"",secondaryColor:h?.secondaryColor||""},sessions:Et,loginHistory:ls},f=new Blob([JSON.stringify(a,null,2)],{type:"application/json"}),v=URL.createObjectURL(f),S=document.createElement("a");S.href=v,S.download=`export-donnees-${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(S),S.click(),document.body.removeChild(S),URL.revokeObjectURL(v)}catch(a){console.error("Erreur export données:",a)}finally{xr(!1)}},un=async()=>{if(At!==t("parametres.secu.deleteWord")){mt(t("parametres.secu.deleteWordRequired",{word:t("parametres.secu.deleteWord")}));return}br(!0),mt(null);try{const a=await o();await Tr.deleteAccount(a,At),await As.signOut(),window.location.href="/login"}catch(a){console.error("Erreur suppression compte:",a),mt(a.message||t("parametres.secu.deleteError")),br(!1)}},mn=a=>{if(!a)return"";const f=a._seconds?new Date(a._seconds*1e3):new Date(a),S=new Date-f,B=Math.floor(S/(1e3*60*60*24)),M={hour:s.language==="en"?"numeric":"2-digit",minute:"2-digit"};return B===0?t("parametres.secu.todayAt",{time:f.toLocaleTimeString(r,M)}):B===1?t("parametres.secu.yesterdayAt",{time:f.toLocaleTimeString(r,M)}):B<7?t("parametres.secu.daysAgo",{count:B}):f.toLocaleDateString(r,{day:"numeric",month:"short",year:"numeric",hour:s.language==="en"?"numeric":"2-digit",minute:"2-digit"})},hn=a=>a?(a._seconds?new Date(a._seconds*1e3):new Date(a)).toLocaleDateString(r,{day:"numeric",month:"short",year:"numeric",hour:s.language==="en"?"numeric":"2-digit",minute:"2-digit"}):"",pn=async()=>{je(!0),me(null),dt(1),as("");try{const a=As.currentUser;if(!a)throw new Error(t("parametres.secu.notLoggedIn"));const f=new ce({size:20}),v=f.base32;cr(v);const B=new V({issuer:"SolarSales Pro",label:a.email,algorithm:"SHA1",digits:6,period:30,secret:f}).toString();ur(B),lr(!0)}catch(a){console.error("Erreur 2FA:",a),me(a.message||t("parametres.secu.enroll2FAError"))}finally{je(!1)}},fn=async()=>{je(!0),me(null);try{if(!Ue)throw new Error(t("parametres.secu.totpUnavailable"));const a=rs.replace(/\s/g,"");if(a.length!==6){me(t("parametres.secu.codeMust6Digits")),je(!1);return}if(new V({issuer:"SolarSales Pro",label:As.currentUser?.email||"",algorithm:"SHA1",digits:6,period:30,secret:ce.fromBase32(Ue)}).validate({token:a,window:1})===null){me(t("parametres.secu.invalidCode")),je(!1);return}if(!N?.clientId)throw new Error(t("parametres.secu.clientIdUnavailable"));await Br(Ns(Cs,"clients",N.clientId),{twoFactorEnabled:!0,twoFactorSecret:Ue,twoFactorEnabledAt:new Date}),ns(!0),dt(3)}catch(a){console.error("Erreur vérification 2FA:",a),me(a.message||t("parametres.secu.verify2FAError"))}finally{je(!1)}},xn=async()=>{je(!0),me(null);try{if(!N?.clientId)throw new Error(t("parametres.secu.clientIdUnavailable"));await Br(Ns(Cs,"clients",N.clientId),{twoFactorEnabled:!1,twoFactorSecret:null,twoFactorDisabledAt:new Date}),ns(!1),is(!1)}catch(a){console.error("Erreur désactivation 2FA:",a),me(a.message||t("parametres.secu.disable2FAError"))}finally{je(!1)}},Ir=()=>{lr(!1),cr(null),ur(""),as(""),dt(1),me(null)},gn=()=>{Ue&&navigator.clipboard.writeText(Ue)},bn=async()=>{er(!0),ue(null);try{p&&await p({firstName:_.firstName,lastName:_.lastName,phone:_.phone,jobTitle:_.jobTitle}),Js({firstName:_.firstName,lastName:_.lastName,phone:_.phone,jobTitle:_.jobTitle}),Zt(!1),z.success(t("parametres.saved"))}catch(a){ue(a.message),z.error(t("parametres.saveError"))}finally{er(!1)}},yn=()=>{ze(a=>({...a,firstName:ye.firstName,lastName:ye.lastName,phone:ye.phone,jobTitle:ye.jobTitle})),Zt(!1),ue(null)},kr=a=>{const v=a.replace(/\D/g,"").slice(0,14);let S="";return v.length>0&&(S+=v.slice(0,3)),v.length>3&&(S+=" "+v.slice(3,6)),v.length>6&&(S+=" "+v.slice(6,9)),v.length>9&&(S+=" "+v.slice(9,14)),S},wn=a=>a.replace(/\D/g,"").slice(0,5),Pr=b.useRef(!0);b.useEffect(()=>{if(x&&Pr.current){const a={companyName:x.companyName||"",address:x.address||"",city:x.city||"",postalCode:x.postalCode||"",siret:kr(x.siret||""),website:x.website||"",latitude:x.latitude||null,longitude:x.longitude||null};It(a),wr(a),tn(!0),Pr.current=!1}},[x]),b.useEffect(()=>{if(!(!Qe||!kt.current||Oe.current))return qo().then(()=>
2{if(!(!kt.current||Oe.current)){if(!document.getElementById("pac-styles-enterprise")){const a=document.createElement("style");a.id="pac-styles-enterprise",a.textContent=`
3          .pac-container {
4            background: rgba(255, 255, 255, 0.98) !important;
5            backdrop-filter: blur(12px) !important;
6            border: 1px solid #e5e7eb !important;
7            border-radius: 12px !important;
8            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
9            margin-top: 4px !important;
10            font-family: Inter, system-ui, sans-serif !important;
11            z-index: 10000 !important;
12          }
13          .pac-item { padding: 10px 14px !important; border: none !important; cursor: pointer !important; font-size: 14px !important; }
14          .pac-item:hover { background: #fef3c7 !important; }
15          .pac-item-query { color: #1f2937 !important; font-weight: 500 !important; }
16          .pac-matched { color: #f59e0b !important; font-weight: 600 !important; }
17          .pac-icon { display: none !important; }
18          .pac-logo::after { display: none !important; }
19        `,document.head.appendChild(a)}Oe.current=new window.google.maps.places.Autocomplete(kt.current,{componentRestrictions:{country:$r(vs(s.language)).addressCountryCodes},fields:["geometry","formatted_address","address_components"]}),Oe.current.addListener("place_changed",()=>{const a=Oe.current.getPlace();if(!a.geometry)return;w&&w("googlePlacesAutocomplete",1);const f=a.geometry.location.lat(),v=a.geometry.location.lng(),S=a.formatted_address||"";let B="",M="";if(a.address_components)for(const pe of a.address_components)pe.types.includes("postal_code")&&(B=pe.long_name),pe.types.includes("locality")&&(M=pe.long_name);const Xe={...Q,address:S,postalCode:B,city:M,latitude:f,longitude:v};It(Xe),Mt(!0)})}}),()=>{Oe.current&&window.google?.maps?.event?.clearInstanceListeners(Oe.current)}},[Qe]);const jn=async()=>{jr(!0),Lt(null);try{await j({companyName:Q.companyName,address:Q.address,city:Q.city,postalCode:Q.postalCode,siret:Q.siret.replace(/\s/g,""),website:Q.website,latitude:Q.latitude,longitude:Q.longitude}),wr({...Q}),Mt(!1),z.success(t("parametres.saved"))}catch(a){Lt(a.message||t("parametres.entreprise.saveError")),z.error(t("parametres.saveError"))}finally{jr(!1)}},vn=()=>{It({...xs}),Mt(!1),Lt(null)},Lr=b.useRef(!0);b.useEffect(()=>{if(x&&Lr.current){const a={enabled:x.notificationsEnabled||!1,email:x.notificationEmail||""};gs(a.enabled),bs(a.email),vr(a),rn(!0),Lr.current=!1}},[x]);const Nn=async()=>{if(Ye&&He&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(He)){he(t("parametres.notif.emailInvalid")),z.error(t("parametres.notif.emailInvalid"));return}Nr(!0),he(null);try{await j({notificationsEnabled:Ye,notificationEmail:He.trim()}),vr({enabled:Ye,email:He.trim()}),Dt(!1),z.success(t("parametres.saved"))}catch(a){he(a.message||t("parametres.notif.saveError")),z.error(t("parametres.saveError"))}finally{Nr(!1)}},Cn=()=>{gs(Ke.enabled),bs(Ke.email),Dt(!1),he(null)},Sn=async()=>{const a=ht?He:x?.notificationEmail||"";if(!a){he(t("parametres.notif.noEmailConfigured"));return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a)){he(t("parametres.notif.emailInvalid"));return}Er(!0),he(null),ys(!1);try{const v=await o();await qn.sendTestNotification(v),ys(!0),setTimeout(()=>ys(!1),5e3)}catch(v){he(v.message||t("parametres.notif.testError"))}finally{Er(!1)}};b.useEffect(()=>{async function a(){try{if(ge(!0),O(!1),u&&g?.clientId){try{const B=await o(),M=await ii.getClientSubscription(B,g.clientId);F(M.subscription),J(M.invoices||[]),M.billingInfo&&(Kt(M.billingInfo),de({name:M.billingInfo.name||"",email:M.billingInfo.email||"",phone:M.billingInfo.phone||"",line1:M.billingInfo.address?.line1||"",line2:M.billingInfo.address?.line2||"",city:M.billingInfo.address?.city||"",postalCode:M.billingInfo.address?.postalCode||"",country:M.billingInfo.address?.country||"FR",taxId:M.billingInfo.taxId||""}))}catch(B){console.error("Erreur chargement abonnement client (impersonation):",B),x?.subscription&&F(x.subscription),J([])}ge(!1);return}const[f,v,S]=await Promise.all([Zn(),ei(),ti()]);F(f.subscription),J(v.invoices||[]),S.billingInfo&&(Kt(S.billingInfo),de({name:S.billingInfo.name||"",email:S.billingInfo.email||"",phone:S.billingInfo.phone||"",line1:S.billingInfo.address?.line1||"",line2:S.billingInfo.address?.line2||"",city:S.billingInfo.address?.city||"",postalCode:S.billingInfo.address?.postalCode||"",country:S.billingInfo.address?.country||(s.language==="en"?"US":"FR"),taxI
19d:S.billingInfo.taxId||""}))}catch(f){console.error("Erreur chargement abonnement:",f),O(!0)}finally{ge(!1)}}P==="subscription"&&a()},[P,u,g?.clientId,o,bt]);const En=async(a,f)=>{try{const v=await o(),S=await fetch(`/api/downloadInvoice?invoiceId=${a}`,{headers:{Authorization:`Bearer ${v}`}});if(!S.ok)throw new Error("Download failed");const B=S.headers.get("Content-Disposition");let M="facture.pdf";if(B){const qe=B.match(/filename="(.+)"/);qe&&(M=qe[1])}const Xe=await S.blob(),pe=window.URL.createObjectURL(Xe),le=document.createElement("a");le.href=pe,le.download=M,document.body.appendChild(le),le.click(),document.body.removeChild(le),window.URL.revokeObjectURL(pe)}catch(v){console.error("Erreur téléchargement facture:",v),window.open(f,"_blank")}},An=async()=>{const a=[];if(Le&&a.push("main"),Me&&a.push("whiteLabel"),Re&&a.push("aiCapture"),console.log("Annulation - subscriptionTypes:",a,"cancelMainSub:",Le,"cancelWhiteLabelSub:",Me,"cancelAICaptureSub:",Re),a.length===0){alert(t("parametres.billing.selectSubscriptionToCancel"));return}try{Qs(!0);const f=await ai(!1,a);console.log("Résultat annulation:",f),console.log("Results.whiteLabel:",f.results?.whiteLabel),console.log("Results.aiCapture:",f.results?.aiCapture),console.log("Results.main:",f.results?.main),f.results?.main&&F(v=>({...v,cancelAtPeriodEnd:f.results.main.cancelAtPeriodEnd})),(f.results?.whiteLabel||f.results?.aiCapture)&&(await new Promise(v=>setTimeout(v,2e3)),await L()),Xt(!1),qt(!1),Jt(!1)}catch(f){console.error("Erreur annulation:",f),alert(t("parametres.billing.cancelError")+f.message)}finally{Qs(!1)}},Mr=async()=>{try{_e("main"),await Is("main"),F(a=>({...a,cancelAtPeriodEnd:!1}))}catch(a){console.error("Erreur réactivation:",a),alert(t("parametres.billing.reactivateError")+a.message)}finally{_e(null)}},Rr=async()=>{try{_e("whiteLabel"),await Is("whiteLabel"),await L()}catch(a){console.error("Erreur réactivation White Label:",a),alert(t("parametres.billing.reactivateError")+a.message)}finally{_e(null)}},Dr=async()=>{try{_e("aiCapture"),await Is("aiCapture"),await L()}catch(a){console.error("Erreur réactivation Capture IA:",a),alert(t("parametres.billing.reactivateError")+a.message)}finally{_e(null)}},In=async()=>{try{Ks(!0);const a=await si();vt(a.clientSecret),jt(!0)}catch(a){console.error("Erreur création setup intent:",a),alert(t("parametres.billing.genericError")+a.message)}finally{Ks(!1)}},kn=async()=>{try{Gs(!0);const a=await ri({name:q.name,email:q.email,phone:q.phone,address:{line1:q.line1,line2:q.line2,city:q.city,postalCode:q.postalCode,country:q.country},taxId:q.taxId});Kt(a.billingInfo),wt(!1)}catch(a){console.error("Erreur mise à jour facturation:",a),alert(t("parametres.billing.genericError")+a.message)}finally{Gs(!1)}},js=(a,f)=>{let v=f;a==="siret"?v=kr(f):a==="postalCode"&&(v=wn(f));const S={...Q,[a]:v};It(S);const B=Object.keys(xs).some(M=>S[M]!==xs[M]);Mt(B),Lt(null)},Ft=(a,f)=>{let v=f;a==="phone"&&(v=Ar(f));const S={..._,[a]:v};if(ze(S),a!=="email"){const B=S.firstName!==ye.firstName||S.lastName!==ye.lastName||S.phone!==ye.phone||S.jobTitle!==ye.jobTitle;Zt(B)}ue(null)},Pn=a=>{gs(a);const f=a!==Ke.enabled||He!==Ke.email;Dt(f),he(null)},Ln=a=>{bs(a);const f=Ye!==Ke.enabled||a!==Ke.email;Dt(f),he(null)},Mn=async a=>{const f=a.target.files?.[0];if(!(!f||!N)){if(!f.type.startsWith("image/")){ue(t("parametres.profil.photoNotImage"));return}
19if(f.size>5*1024*1024){ue(t("parametres.profil.photoTooLarge"));return}Ct(!0),ue(null);try{const v=new FileReader;v.onload=le=>{ze(qe=>({...qe,photoURL:le.target.result}))},v.readAsDataURL(f);const S=Ss(Es,`users/${N.id}/profile`);try{const le=await Or(S);await Promise.all(le.items.map(qe=>Hr(qe)))}catch{}const M=`profile.${f.name.split(".").pop()}`,Xe=Ss(Es,`users/${N.id}/profile/${M}`);await Kn(Xe,f);const pe=await Xn(Xe);ze(le=>({...le,photoURL:pe})),p&&await p({photoURL:pe}),setProfileSuccess(!0),setTimeout(()=>setProfileSuccess(!1),2e3)}catch(v){console.error("Erreur upload photo:",v),ue(t("parametres.profil.photoUploadError"))}finally{Ct(!1)}}},Rn=async()=>{if(!(!N||!_.photoURL)){Ct(!0),ue(null);try{const a=Ss(Es,`users/${N.id}/profile`);try{const f=await Or(a);await Promise.all(f.items.map(v=>Hr(v)))}catch{}ze(f=>({...f,photoURL:""})),p&&await p({photoURL:""}),setProfileSuccess(!0),setTimeout(()=>setProfileSuccess(!1),2e3)}catch(a){console.error("Erreur suppression photo:",a),ue(t("parametres.profil.photoDeleteError"))}finally{Ct(!1)}}},Dn=async a=>{if(a.preventDefault(),we.newPassword!==we.confirmPassword){ct(t("parametres.profil.passwordMismatch"));return}if(we.newPassword.length<8){ct(t("parametres.profil.passwordTooShort"));return}ar(!0),ct(null);try{await i(we.currentPassword,we.newPassword);const f=await o();Tr.notifyPasswordChanged(f).catch(v=>{console.error("Failed to send password changed email:",v)}),ir(!0),lt({currentPassword:"",newPassword:"",confirmPassword:""}),setTimeout(()=>{ir(!1),es(!1)},2e3)}catch(f){ct(f.message)}finally{ar(!1)}},Y=({className:a})=>e.jsx("div",{className:`bg-gray-200 animate-pulse rounded ${a}`}),Fn=()=>e.jsx("div",{className:"relative inline-flex h-6 w-11 items-center rounded-full bg-gray-200 animate-pulse"});return e.jsxs("div",{className:`min-h-screen ${A?"-mx-4 -my-6 px-5 py-5":"-mx-8 -my-8 lg:-mx-12 px-8 lg:px-12 pt-5 pb-10"}`,style:{background:"linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%)"},children:[!A&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed top-20 right-20 w-96 h-96 bg-gradient-to-br from-green-100/20 to-emerald-100/20 rounded-full blur-3xl pointer-events-none"}),e.jsx("div",{className:"fixed bottom-20 left-20 w-80 h-80 bg-gradient-to-br from-blue-100/15 to-indigo-100/15 rounded-full blur-3xl pointer-events-none"})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"mb-4 md:mb-6",children:[e.jsx("h1",{className:`font-bold text-gray-900 ${A?"text-2xl":"text-[28px]"}`,children:t("parametres.title")}),e.jsx("p",{className:"text-sm text-gray-500",children:t("parametres.subtitle")})]}),u&&e.jsxs("div",{className:"mb-4 md:mb-6 p-4 bg-orange-50 border border-orange-200 rounded-xl flex items-center gap-3",children:[e.jsx(Ut,{className:"w-5 h-5 text-orange-500 flex-shrink-0"}),e.jsxs("p",{className:"text-sm text-orange-700",children:[e.jsx("span",{className:"font-medium",children:t("parametres.impersonationLabel")})," ",t("parametres.impersonationText")]})]}),A&&e.jsx("div",{className:"mb-4",children:e.jsx("div",{className:"grid grid-cols-2 gap-2",children:qs.filter(a=>a.id!=="security").map(a=>{const f=a.icon;return e.jsxs("button",{onClick:()=>Ie(a.id),className:`flex items-center justify-center gap-2 px-3 py-2.5 text-sm font-medium rounded-xl transition-all ${P===a.id?"bg-amber-500 text-white shadow-sm":"bg-white text-gray-600 border border-gray-200"}`,children:[e.jsx(f,{className:"w-4 h-4"}),a.label]},a.id)})})}),e.jsxs("div",{className:A?"":"flex gap-6",children:[!A&&e.jsx("div",{className:"w-52 flex-shrink-0",children:e.jsx("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-100 p-2",children:e.jsx("nav",{className:"space-y-1",children:qs.map(a=>{const f=a.icon;return e.jsxs("button",{onClick:()=>Ie(a.id),className:`w-full flex items-center gap-3 px-3 py-2.5 text-sm font-medium rounded-xl transition-all ${P===a.id?"bg-amber-50 text-amber-500 border border-amber-500":"text-gray-600 hover:bg-gray-50 border border-transparent"}`,children:[e.jsx(f,{className:"w-4 h-4"}),a.label]},a.id)})})})}),e.jsxs("div",{className:`bg-white rounded-2xl shadow-sm border border-gray-100 ${A?"p-4 overflow-hidden":"flex-1 p-6"}`,children:[P==="profile"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"mb-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:t("parametres.profil.title")}),e.jsx("p",{className:"text-sm text-gray-500",children:t("parametres.profil.subtitle")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-4",children:De?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative",children:[_.photoURL?e.jsx("img",{src:_.photoURL,alt:t("parametres.profil.photoAlt"),className:"w-20 h-20 rounded-xl object-cover border border-gray-200"}):e.jsx("div",{className:"w-20 h-20 rounded-xl bg-gray-100 border border-gray-200 flex items-center justify-center",children:e.jsxs("span",{className:"text-2xl font-semibold text-gray-400",children:[_.firstName?.charAt(0)||"",_.lastName?.charAt(0)||""]})}),e.jsx("button",{type:"button",onClick:()=>!it&&Zs.current?.click(),disabled:it||u,className:`absolute -bottom-1 -right-1 w-7 h-7 ${it?"bg-gray-400":"bg-amber-500 hover:bg-amber-600"} text-white rounded-lg flex items-center justify-center transition-colors shadow-sm`,children:it?e.jsx(H,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(wi,{className:"w-3.5 h-3.5"})}),e.jsx("input",{ref:Zs,type:"file",accept:"image/*",onChange:Mn,className:"hidden"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-700",children:t("parametres.profil.photoLabel")}),e.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:t("parametres.profil.photoFormats")}),_.photoURL&&e.jsxs("button",{type:"button",onClick:Rn,disabled:it||u,className:"mt-2 text-xs text-red-500 hover:text-red-600 flex items-center gap-1 transition-colors",children:[e.jsx(ks,{className:"w-3 h-3"}),t("parametres.profil.photoDelete")]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"w-20 h-20 rounded-xl"}),e.jsxs("div",{children:[e.jsx(Y,{className:"w-24 h-4 mb-1"}),e.jsx(Y,{className:"w-32 h-3"})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.profil.firstName")}
19),De?e.jsx("input",{type:"text",value:_.firstName,onChange:a=>!u&&Ft("firstName",a.target.value),readOnly:u,className:`w-full px-4 py-2.5 border border-gray-200 rounded-xl transition-colors ${u?"bg-gray-50 text-gray-500 cursor-not-allowed":"focus:outline-none focus:border-amber-500"}`,placeholder:t("parametres.profil.firstNamePlaceholder")}):e.jsx(Y,{className:"w-full h-[46px] rounded-xl"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.profil.lastName")}),De?e.jsx("input",{type:"text",value:_.lastName,onChange:a=>!u&&Ft("lastName",a.target.value),readOnly:u,className:`w-full px-4 py-2.5 border border-gray-200 rounded-xl transition-colors ${u?"bg-gray-50 text-gray-500 cursor-not-allowed":"focus:outline-none focus:border-amber-500"}`,placeholder:t("parametres.profil.lastNamePlaceholder")}):e.jsx(Y,{className:"w-full h-[46px] rounded-xl"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.profil.email")}),De?e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"email",value:_.email,readOnly:!0,className:"w-full px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl text-gray-500 cursor-not-allowed"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1.5",children:t("parametres.profil.emailReadonly")})]}):e.jsx(Y,{className:"w-full h-[46px] rounded-xl"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.profil.phone")}),De?e.jsx("input",{type:"tel",value:_.phone,onChange:a=>!u&&Ft("phone",a.target.value),readOnly:u,className:`w-full px-4 py-2.5 border border-gray-200 rounded-xl transition-colors ${u?"bg-gray-50 text-gray-500 cursor-not-allowed":"focus:outline-none focus:border-amber-500"}`,placeholder:t("parametres.profil.phonePlaceholder")}):e.jsx(Y,{className:"w-full h-[46px] rounded-xl"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.profil.jobTitle")}),De?e.jsx("input",{type:"text",value:_.jobTitle,onChange:a=>!u&&Ft("jobTitle",a.target.value),readOnly:u,className:`w-full px-4 py-2.5 border border-gray-200 rounded-xl transition-colors ${u?"bg-gray-50 text-gray-500 cursor-not-allowed":"focus:outline-none focus:border-amber-500"}`,placeholder:t("parametres.profil.jobTitlePlaceholder")}):e.jsx(Y,{className:"w-full h-[46px] rounded-xl"})]}),_a&&e.jsxs("div",{className:"mt-5 flex justify-end gap-3",children:[e.jsx("button",{onClick:yn,disabled:Nt||u,className:"px-4 py-2 rounded-xl text-sm font-medium transition-all bg-gray-100 hover:bg-gray-200 text-gray-700",children:t("parametres.cancel")}),e.jsxs("button",{onClick:bn,disabled:Nt||u,className:"px-4 py-2 rounded-xl text-sm font-medium transition-all flex items-center gap-2 bg-amber-500 hover:bg-amber-600 text-white shadow-sm hover:shadow-md",children:[Nt&&e.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),t(Nt?"parametres.saving":"parametres.save")]})]})]}),e.jsx("div",{className:"mt-6 pt-6 border-t border-gray-100",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900",children:t("parametres.profil.languageTitle")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1 mb-4",children:t("parametres.profil.languageDesc")}),e.jsx(Wn,{variant:"dropdown",onSelect:on,disabled:u})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900",children:t("parametres.profil.timezoneTitle")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1 mb-4",children:t("parametres.profil.timezoneDesc")}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:Fe,onChange:a=>nn(a.target.value),disabled:tr||u,"aria-label":t("parametres.profil.timezoneLabel"),className:"w-full appearance-none pl-4 pr-10 py-2.5 border border-gray-200 rounded-xl bg-white text-sm text-gray-900 focus:outline-none focus:border-amber-500 transition-colors disabled:bg-gray-50 disabled:text-gray-400",children:[Fe&&!n.some(a=>a.value===Fe)&&e.jsxs("option",{value:Fe,children:[Fe,c(Fe)]}),n.map(a=>e.jsxs("option",{value:a.value,children:[a.label,c(a.value)]},a.value))]}),e.jsx(Gn,{className:"w-4 h-4 text-gray-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]}),tr&&e.jsxs("div",{className:"text-xs text-gray-400 mt-2 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 border-2 border-amber-500 border-t-transparent roun
19ded-full animate-spin inline-block"}),t("parametres.profil.timezoneSaving")]})]})]})}),m&&e.jsx("div",{className:"mt-6 pt-6 border-t border-gray-100",children:De?za?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900",children:t("parametres.profil.changePasswordTitle")}),e.jsx("button",{onClick:()=>{es(!1),lt({currentPassword:"",newPassword:"",confirmPassword:""}),ct(null)},className:"text-sm text-gray-500 hover:text-gray-700",children:t("parametres.cancel")})]}),nr&&e.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded-xl text-red-600 text-sm",children:nr}),Va&&e.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-xl text-green-600 text-sm flex items-center gap-2",children:[e.jsx(pt,{className:"w-4 h-4"}),t("parametres.profil.passwordSuccess")]}),e.jsxs("form",{onSubmit:Dn,className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.profil.currentPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:ts?"text":"password",value:we.currentPassword,onChange:a=>lt(f=>({...f,currentPassword:a.target.value})),className:"w-full px-4 py-2.5 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500 transition-colors pr-10",required:!0}),e.jsx("button",{type:"button",onClick:()=>Wa(!ts),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:ts?e.jsx(Ur,{className:"w-4 h-4"}):e.jsx(Ut,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.profil.newPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:ss?"text":"password",value:we.newPassword,onChange:a=>lt(f=>({...f,newPassword:a.target.value})),className:"w-full px-4 py-2.5 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500 transition-colors pr-10",required:!0,minLength:8}),e.jsx("button",{type:"button",onClick:()=>Ga(!ss),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:ss?e.jsx(Ur,{className:"w-4 h-4"}):e.jsx(Ut,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:t("parametres.profil.minChars")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.profil.confirmPassword")}),e.jsx("input",{type:"password",value:we.confirmPassword,onChange:a=>lt(f=>({...f,confirmPassword:a.target.value})),className:"w-full px-4 py-2.5 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500 transition-colors",required:!0})]}),e.jsx("button",{type:"submit",disabled:rr||u,className:"px-4 py-2.5 bg-amber-500 hover:bg-amber-600 disabled:bg-amber-400 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:rr?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),t("parametres.profil.changingPassword")]}):t("parametres.profil.changePasswordButton")})]})]}):e.jsx("button",{onClick:()=>es(!0),className:"text-sm font-medium text-amber-600 hover:text-amber-700 transition-colors",children:t("parametres.profil.changePassword")}):e.jsx(Y,{className:"w-48 h-5 rounded"})})]}),P==="company"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"mb-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:t("parametres.entreprise.title")}),e.jsx("p",{className:"text-sm text-gray-500",children:t("parametres.entreprise.subtitle")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.entreprise.companyName")}),Qe?e.jsx("input",{type:"text",value:Q.companyName,onChange:a=>!u&&js("companyName",a.target.value),readOnly:u,className:`w-full px-4 py-2.5 border border-gray-200 rounded-xl transition-colors ${u?"bg-gray-50 text-gray-500 cursor-not-allowed":"focus:outline-none focus:border-amber-500"}`,placeholder:t("parametres.entreprise.companyNamePlaceholder")}):e.jsx(Y,{className:"w-full h-[46px] rounded-xl"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.entreprise.taxId")}),Qe?e.jsx("input",{type:"text",value:Q.siret,onChange:a=>!u&&js("siret",a.target.value),readOnly:u,className:`w-full px-4 py-2.5 border border-gray-200 rounded-xl transition-colors ${u?"bg-gray-50 text-gray-500 cursor-not-allowed":"focus:outline-none focus:border-amber-500"}`,placeholder:t("parametres.entreprise.taxIdPlaceholder")}):e.jsx(Y,{className:"w-full h-[46px] rounded-xl"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.entreprise.address")}),Qe?e.jsx("input",{ref:kt,type:"text",defaultValue:Q.address,readOnly:u,className:`w-full px-4 py-2.5 border border-gray-200 rounded-xl transition-colors ${u?"bg-gray-50 text-gray-500 cursor-not-allowed":"focus:outline-none focus:border-amber-500"}`,placeholder:t("parametres.entreprise.addressPlaceholder")}):e.jsx(Y,{className:"w-full h-[46px] rounded-xl"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.entreprise.website")}),Qe?e.jsxs("div",{className:"flex min-w-0",children:[e.jsx("span",{className:"inline-flex items-center px-3 bg-gray-100 border border-r-0 border-gray-200 rounded-l-xl text-gray-500 flex-shrink-0",children:"https://"}),e.jsx("input",{type:"text",value:Q.website.replace(/^https?:\/\//,""),onChange:a=>!u&&js("website",a.target.value.replace(/^https?:\/\//,"")),readOnly:u,className:`flex-1 min-w-0 px-4 py-2.5 border border-gray-200 transition-colors ${u?"bg-gray-50 text-gray-500 cursor-not-allowed":"focus:outline-none focus:border-amber-500"} ${Q.website?"rounded-none":"rounded-r-xl"}`,placeholder:t("parametres.entreprise.websitePlaceholder")}),Q.website&&e.jsx("button",{type:"button",onClick:()=>window.open(`https://${Q.website.replace(/^https?:\/\//,"")}`,"_blank"),className:"inline-flex items-center px-3 bg-gray-100 border border-l-0 border-gray-200 rounded-r-xl text-gray-500 hover:text-amber-600 hover:bg-amber-50 transition-colors",title:t("parametres.entreprise.openSite"),children:e.jsx(di,{className:"w-4 h-4"})})]}):e.jsx(Y,{className:"w-full h-[46px] rounded-xl"})]}),sn&&e.jsxs("div",{className:"mt-5 flex justify-end gap-3",children:[e.jsx("button",{onClick:vn,disabled:Pt||u,className:"px-4 py-2 rounded-xl text-sm font-medium transition-all bg-gray-100 hover:bg-gray-200 text-gray-700",children:t("parametres.cancel")}),e.jsxs("button",{onClick:jn,disabled:Pt||u,className:"px-4 py-2 rounded-xl text-sm font-medium transition-all flex items-center gap-2 bg-amber-500 hover:bg-amber-600 text-white shadow-sm hover:shadow-md",children:[Pt&&e.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent roun
19ded-full animate-spin"}),t(Pt?"parametres.saving":"parametres.save")]})]})]})]}),P==="subscription"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"mb-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:t("parametres.abo.title")}),e.jsx("p",{className:"text-sm text-gray-500",children:t("parametres.abo.subtitle")})]}),Pe?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(H,{className:"w-8 h-8 text-amber-500 animate-spin"})}):$e?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(ft,{className:"w-12 h-12 text-amber-400 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:t("parametres.abo.loadError")}),e.jsx("p",{className:"text-sm text-gray-500 mb-6",children:t("parametres.abo.loadErrorHint")}),e.jsxs("button",{onClick:()=>yt(a=>a+1),className:"inline-flex items-center gap-2 px-6 py-3 bg-amber-500 hover:bg-amber-600 text-white font-medium rounded-xl transition-colors",children:[e.jsx(Te,{className:"w-4 h-4"}),e.jsx("span",{children:t("parametres.abo.retry")})]})]}):C?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center justify-between mb-3",children:e.jsx("h3",{className:"text-sm font-medium text-gray-900",children:x?.hasWhiteLabel?t("parametres.abo.yourSubscriptions"):t("parametres.abo.yourSubscription")})}),e.jsx("div",{className:"p-4 bg-gray-50 rounded-xl border border-gray-100",children:e.jsxs("div",{className:`flex ${A?"flex-col gap-3":"items-center justify-between min-h-[40px]"}`,children:[e.jsxs("div",{className:A?"flex items-center justify-between":"",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:C.plan?.name||t("parametres.abo.planProDefault")}),e.jsx("span",{className:`px-2 py-0.5 text-xs font-medium rounded-full ${C.cancelAtPeriodEnd?"bg-orange-100 text-orange-700":C.status==="active"?"bg-green-100 text-green-700":C.status==="trialing"?"bg-blue-100 text-blue-700":C.status==="past_due"?"bg-red-100 text-red-700":"bg-gray-100 text-gray-700"}`,children:C.cancelAtPeriodEnd?t("parametres.abo.statusCancelScheduled"):C.status==="active"?t("parametres.abo.statusActive"):C.status==="trialing"?t("parametres.abo.statusTrialing"):C.status==="past_due"?t("parametres.abo.statusPastDue"):C.status==="canceled"?t("parametres.abo.statusCanceled"):C.status})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:C.currentPeriodEnd?t(C.cancelAtPeriodEnd?"parametres.abo.expiresOn":"parametres.abo.renewsOn",{date:new Date(C.currentPeriodEnd).toLocaleDateString(r,{day:"numeric",month:"long",year:"numeric"})}):t("parametres.abo.fullAccess")})]}),A&&e.jsxs("p",{className:"text-sm font-medium text-gray-900 flex-shrink-0",children:[t("parametres.abo.price",{amount:C.plan?.amount||49}),e.jsxs("span",{className:"text-gray-500 font-normal",children:["/",t(C.plan?.interval==="year"?"parametres.abo.perYear":"parametres.abo.perMonth")]})]})]}),!A&&e.jsxs("div",{className:"flex items-center gap-3",children:[C.cancelAtPeriodEnd&&!u&&e.jsxs("button",{onClick:Mr,disabled:oe==="main",className:"flex items-center gap-2 px-3 py-1.5 bg-gray-900 hover:bg-gray-800 disabled:bg-gray-400 text-white text-xs font-medium rounded-lg transition-colors",children:[oe==="main"?e.jsx(H,{className:"w-3 h-3 animate-spin"}):e.jsx(Te,{className:"w-3 h-3"}),e.jsx("span",{children:t("parametres.abo.reactivate")})]}),e.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[t("parametres.abo.price",{amount:C.plan?.amount||49}),e.jsxs("span",{className:"text-gray-500 font-normal",children:[" / ",t(C.plan?.interval==="year"?"parametres.abo.perYear":"parametres.abo.perMonth")]})]})]}),A&&C.cancelAtPeriodEnd&&!u&&e.jsxs("button",{onClick:Mr,disabled:oe==="main",className:"flex items-center justify-center gap-2 px-3 py-2 bg-gray-900 hover:bg-gray-800 disabled:bg-gray-400 text-white text-xs font-medium rounded-lg transition-colors w-full",children:[oe==="main"?e.jsx(H,{className:"w-3 h-3 animate-spin"}):e.jsx(Te,{className:"w-3 h-3"}),e.jsx("span",{children:t("parametres.abo.reactivate")})]})]})}),x?.hasWhiteLabel&&e.jsx("div",{className:"p-4 bg-gray-50 rounded-xl border border-gray-100 mt-3",children:e.jsxs("div",{className:`flex ${A?"flex-col gap-3":"items-center justify-between min-h-[40px]"}`,children:[e.jsxs("div",{className:A?"flex items-center justify-between":"",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:t("parametres.abo.whiteLabelOption")}),e.jsx("span",{className:`px-2 py-0.5 text-xs font-medium rounded-full ${x?.whiteLabelSubscription?.cancelAtPeriodEnd?"bg-orange-100 text-orange-700":"bg-green-100 text-green-700"}`,children:x?.whiteLabelSubscription?.cancelAtPeriodEnd?t("parametres.abo.statusCancelScheduled"):t("parametres.abo.statusActive")}
19)]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("parametres.abo.whiteLabelDesc")})]}),A&&e.jsxs("p",{className:"text-sm font-medium text-gray-900 flex-shrink-0",children:[t("parametres.abo.price",{amount:x?.whiteLabelSubscription?.plan==="yearly"?149:19}),e.jsxs("span",{className:"text-gray-500 font-normal",children:["/",t(x?.whiteLabelSubscription?.plan==="yearly"?"parametres.abo.perYear":"parametres.abo.perMonth")]})]})]}),!A&&e.jsxs("div",{className:"flex items-center gap-3",children:[x?.whiteLabelSubscription?.cancelAtPeriodEnd&&!u&&e.jsxs("button",{onClick:Rr,disabled:oe==="whiteLabel",className:"flex items-center gap-2 px-3 py-1.5 bg-gray-900 hover:bg-gray-800 disabled:bg-gray-400 text-white text-xs font-medium rounded-lg transition-colors",children:[oe==="whiteLabel"?e.jsx(H,{className:"w-3 h-3 animate-spin"}):e.jsx(Te,{className:"w-3 h-3"}),e.jsx("span",{children:t("parametres.abo.reactivate")})]}),e.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[t("parametres.abo.price",{amount:x?.whiteLabelSubscription?.plan==="yearly"?149:19}),e.jsxs("span",{className:"text-gray-500 font-normal",children:[" / ",t(x?.whiteLabelSubscription?.plan==="yearly"?"parametres.abo.perYear":"parametres.abo.perMonth")]})]})]}),A&&x?.whiteLabelSubscription?.cancelAtPeriodEnd&&!u&&e.jsxs("button",{onClick:Rr,disabled:oe==="whiteLabel",className:"flex items-center justify-center gap-2 px-3 py-2 bg-gray-900 hover:bg-gray-800 disabled:bg-gray-400 text-white text-xs font-medium rounded-lg transition-colors w-full",children:[oe==="whiteLabel"?e.jsx(H,{className:"w-3 h-3 animate-spin"}):e.jsx(Te,{className:"w-3 h-3"}),e.jsx("span",{children:t("parametres.abo.reactivate")})]})]})}),x?.hasAICapture&&e.jsx("div",{className:"p-4 bg-gray-50 rounded-xl border border-gray-100 mt-3",children:e.jsxs("div",{className:`flex ${A?"flex-col gap-3":"items-center justify-between min-h-[40px]"}`,children:[e.jsxs("div",{className:A?"flex items-center justify-between":"",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:t("parametres.abo.aiCaptureOption")}),e.jsx("span",{className:`px-2 py-0.5 text-xs font-medium rounded-full ${x?.aiCaptureSubscription?.cancelAtPeriodEnd?"bg-orange-100 text-orange-700":"bg-green-100 text-green-700"}`,children:x?.aiCaptureSubscription?.cancelAtPeriodEnd?t("parametres.abo.statusCancelScheduled"):t("parametres.abo.statusActive")})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("parametres.abo.aiCaptureDesc")})]}),A&&e.jsxs("p",{className:"text-sm font-medium text-gray-900 flex-shrink-0",children:[t("parametres.abo.price",{amount:x?.aiCaptureSubscription?.plan==="yearly"?299:39}),e.jsxs("span",{className:"text-gray-500 font-normal",children:["/",t(x?.aiCaptureSubscription?.plan==="yearly"?"parametres.abo.perYear":"parametres.abo.perMonth")]})]})]}),!A&&e.jsxs("div",{className:"flex items-center gap-3",children:[x?.aiCaptureSubscription?.cancelAtPeriodEnd&&!u&&e.jsxs("button",{onClick:Dr,disabled:oe==="aiCapture",className:"flex items-center gap-2 px-3 py-1.5 bg-gray-900 hover:bg-gray-800 disabled:bg-gray-400 text-white text-xs font-medium rounded-lg transition-colors",children:[oe==="aiCapture"?e.jsx(H,{className:"w-3 h-3 animate-spin"}):e.jsx(Te,{className:"w-3 h-3"}),e.jsx("span",{children:t("parametres.abo.reactivate")})]}),e.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[t("parametres.abo.price",{amount:x?.aiCaptureSubscription?.plan==="yearly"?299:39}),e.jsxs("span",{className:"text-gray-500 font-normal",children:[" / ",t(x?.aiCaptureSubscription?.plan==="yearly"?"parametres.abo.perYear":"parametres.abo.perMonth")]})]})]}),A&&x?.aiCaptureSubscription?.cancelAtPeriodEnd&&!u&&e.jsxs("button",{onClick:Dr,disabled:oe==="aiCapture",className:"flex items-center justify-center gap-2 px-3 py-2 bg-gray-900 hover:bg-gray-800 disabled:bg-gray-400 text-white text-xs font-medium rounded-lg transition-colors w-full",children:[oe==="aiCapture"?e.jsx(H,{className:"w-3 h-3 animate-spin"}):e.jsx(Te,{className:"w-3 h-3"}),e.jsx("span",{children:t("parametres.abo.reactivate")})]})]})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900",children:t("parametres.abo.paymentMethod")}),!u&&e.jsxs("button",{onClick:In,disabled:Ys,className:"text-sm text-amber-600 hover:text-amber-700 font-medium flex items-center gap-1 transition-colors",children:[Ys?e.jsx(H,{className:"w-4 h-4 animate-spin"}):e.jsx(zr,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:t("parametres.abo.edit")})]})]}),e.jsx("div",{className:"p-4 bg-gray-50 rounded-xl border border-gray-100",children:e.jsx("div",{className:"flex items-center gap-3",children:C.paymentMethod?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`w-12 h-8 rounded-md flex items-center justify-center ${C.paymentMethod.brand==="visa"?"bg-gradient-to-br from-blue-600 to-blue-800":C.paymentMethod.brand==="mastercard"?"bg-gradient-to-br from-red-500 to-orange-500":C.paymentMethod.brand==="amex"?"bg-gradient-to-br from-blue-400 to-blue-600":"bg-gradient-to-br from-gray-600 to-gray-800"}`,children:e.jsx("span",{className:"text-white text-xs font-bold uppercase",children:C.paymentMethod.brand||"CARD"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium text-gray-900",children:["•••• •••• •••• ",C.paymentMethod.last4]}),e.jsx("p",{className:"text-xs text-gray-500",children:t("parametres.abo.expires",{date:`${C.paymentMethod.expMonth}/${C.paymentMethod.expYear}`})})]})]}):e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:t("parametres.abo.noPaymentMethod")}),e.jsx("p",{className:"text-xs text-gray-500",children:t("parametres.abo.addCard")})]})})})]}),!A&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900",children:t("parametres.abo.billingInfo")}),!u&&e.jsxs("button",{onClick:()=>wt(!0),className:"text-sm text-amber-600 hover:text-amber-700 font-medium flex items-center gap-1 transition-colors",children:[e.jsx(zr,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:t("parametres.abo.edit")})]})]}),e.jsx("div",{className:"p-4 bg-gray-50 rounded-xl border border-gray-100",children:ie?e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-0.5",children:t("parametres.abo.billingName")}
19),e.jsx("p",{className:"font-medium text-gray-900",children:ie.name||"-"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-0.5",children:t("parametres.abo.billingEmail")}),e.jsx("p",{className:"font-medium text-gray-900",children:ie.email||"-"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-0.5",children:t("parametres.abo.billingAddress")}),e.jsx("p",{className:"font-medium text-gray-900",children:ie.address?.line1?e.jsxs(e.Fragment,{children:[ie.address.line1,ie.address.line2&&e.jsxs(e.Fragment,{children:[", ",ie.address.line2]}),ie.address.postalCode&&e.jsxs(e.Fragment,{children:[", ",ie.address.postalCode]}),ie.address.city&&e.jsxs(e.Fragment,{children:[" ",ie.address.city]})]}):"-"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-0.5",children:t("parametres.abo.vatNumber")}),e.jsx("p",{className:"font-medium text-gray-900",children:ie.taxId||"-"})]})]}):e.jsx("p",{className:"text-sm text-gray-500",children:t("parametres.abo.noBillingInfo")})})]}),!A&&e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center justify-between mb-3",children:e.jsx("h3",{className:"text-sm font-medium text-gray-900",children:t("parametres.abo.billingHistory")})}),e.jsx("div",{className:"border border-gray-100 rounded-xl overflow-hidden",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:t("parametres.abo.tableDate")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:t("parametres.abo.tableDescription")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:t("parametres.abo.tableAmount")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:t("parametres.abo.tableStatus")}),e.jsx("th",{className:"px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:ke.length>0?ke.map(a=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-4 py-3 text-sm text-gray-900",children:new Date(a.date).toLocaleDateString(r,{day:"numeric",month:"short",year:"numeric"})}),e.jsx("td",{className:"px-4 py-3 text-sm text-gray-600",children:a.description||t("parametres.abo.invoiceDefaultDesc")}),e.jsx("td",{className:"px-4 py-3 text-sm font-medium text-gray-900",children:t("parametres.abo.invoiceAmount",{amount:s.language==="en"?a.amount?.toFixed(2):a.amount?.toFixed(2).replace(".",",")})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:`px-2 py-0.5 text-xs font-medium rounded-full ${a.status==="paid"?"bg-green-100 text-green-700":a.status==="open"?"bg-amber-100 text-amber-700":"bg-gray-100 text-gray-700"}`,children:a.status==="paid"?t("parametres.abo.invoicePaid"):a.status==="open"?t("parametres.abo.invoicePending"):a.status==="void"?t("parametres.abo.invoiceVoid"):a.status})}),e.jsx("td",{className:"px-4 py-3 text-right",children:a.pdfUrl&&e.jsx("button",{onClick:()=>En(a.id,a.pdfUrl),className:"text-gray-400 hover:text-gray-600 transition-colors",title:t("parametres.abo.downloadInvoice"),children:e.jsx(mi,{className:"w-4 h-4"})})})]},a.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:"5",className:"px-4 py-6 text-center text-sm text-gray-500",children:t("parametres.abo.noInvoices")})})})]})})]}),!A&&!u&&(!C.cancelAtPeriodEnd&&C.status!=="canceled"||x?.hasWhiteLabel&&!x?.whiteLabelSubscription?.cancelAtPeriodEnd||x?.hasAICapture&&!x?.aiCaptureSubscription?.cancelAtPeriodEnd)&&e.jsx("div",{className:"pt-4 border-t border-gray-100 flex justify-end",children:e.jsx("button",{onClick:()=>Xt(!0),className:"text-xs text-gray-400 hover:text-gray-600 transition-colors",children:t("parametres.abo.cancelSubscription")})})]}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Fr,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:t("parametres.abo.noActiveSubscription")}),e.jsx("p",{className:"text-sm text-gray-500 mb-6",children:t("parametres.abo.subscribePrompt")}),e.jsxs("button",{onClick:()=>W("/checkout"),className:"inline-flex items-center gap-2 px-6 py-3 bg-amber-500 hover:bg-amber-600 text-white font-medium rounded-xl transition-colors",children:[e.jsx("span",{children:t("parametres.abo.viewPlans")}),e.jsx(bi,{className:"w-4 h-4"})]})]})]}),Ha&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl w-full max-w-xl max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-gray-100",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t("parametres.abo.billingInfo")}),e.jsx("button",{onClick:()=>wt(!1),className:"p-1.5 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",children:e.jsx(Ot,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"p-5 space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.abo.billingName")}
19),e.jsx("input",{type:"text",value:q.name,onChange:a=>de(f=>({...f,name:a.target.value})),className:"w-full px-4 py-2.5 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500 transition-colors",placeholder:t("parametres.entreprise.companyNamePlaceholder")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.abo.billingEmail")}),e.jsx("input",{type:"email",value:q.email,onChange:a=>de(f=>({...f,email:a.target.value})),className:"w-full px-4 py-2.5 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500 transition-colors",placeholder:t("parametres.abo.billingEmailPlaceholder")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.profil.phone")}),e.jsx("input",{type:"tel",value:q.phone,onChange:a=>de(f=>({...f,phone:a.target.value})),className:"w-full px-4 py-2.5 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500 transition-colors",placeholder:t("parametres.abo.billingPhonePlaceholder")})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.abo.billingAddress")}),e.jsx("input",{type:"text",value:q.line1,onChange:a=>de(f=>({...f,line1:a.target.value})),className:"w-full px-4 py-2.5 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500 transition-colors",placeholder:t("parametres.abo.billingLine1Placeholder")})]}),e.jsx("div",{className:"col-span-2",children:e.jsx("input",{type:"text",value:q.line2,onChange:a=>de(f=>({...f,line2:a.target.value})),className:"w-full px-4 py-2.5 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500 transition-colors",placeholder:t("parametres.abo.billingLine2Placeholder")})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.abo.postalCode")}),e.jsx("input",{type:"text",value:q.postalCode,onChange:a=>de(f=>({...f,postalCode:a.target.value})),className:"w-full px-4 py-2.5 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500 transition-colors",placeholder:t("parametres.abo.postalCodePlaceholder")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.abo.city")}),e.jsx("input",{type:"text",value:q.city,onChange:a=>de(f=>({...f,city:a.target.value})),className:"w-full px-4 py-2.5 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500 transition-colors",placeholder:t("parametres.abo.cityPlaceholder")})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:t("parametres.abo.vatNumberFull")}),e.jsx("input",{type:"text",value:q.taxId,onChange:a=>de(f=>({...f,taxId:a.target.value})),className:"w-full px-4 py-2.5 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500 transition-colors",placeholder:t("parametres.abo.vatPlaceholder")}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:t("parametres.abo.vatFormat")})]})]})}),e.jsxs("div",{className:"flex items-center justify-end gap-3 p-5 border-t border-gray-100",children:[e.jsx("button",{onClick:()=>wt(!1),className:"px-4 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-xl transition-colors",children:t("parametres.cancel")}),e.jsx("button",{onClick:kn,disabled:Ws||u,className:"flex items-center gap-2 px-4 py-2.5 bg-amber-500 hover:bg-amber-600 disabled:bg-amber-400 text-white text-sm font-medium rounded-xl transition-colors",children:Ws?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{children:t("parametres.saving")})]}):e.jsx("span",{children:t("parametres.save")})})]})]})}),Ta&&Xs&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl w-full max-w-md",children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-gray-100",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t("parametres.abo.editPaymentMethod")}),e.jsx("button",{onClick:()=>{jt(!1),vt(null)},className:"p-1.5 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",children:e.jsx(Ot,{className:"w-5 h-5"})})]}),e.jsx(Ua,{stripe:Jn(),children:e.jsx(Jo,{clientSecret:Xs,onSuccess:a=>{F(f=>({...f,paymentMethod:a})),jt(!1),vt(null)},onCancel:()=>{jt(!1),vt(null)}})})]})}),Ba&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:e.jsx("div",{className:"bg-white rounded-2xl w-full max-w-md",children:e.jsxs("div",{className:"p-5",children:[e.jsx("div",{className:"flex items-center justify-center w-12 h-12 bg-red-100 rounded-full mx-auto mb-4",children:e.jsx(ft,{className:"w-6 h-6 text-red-600"})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 text-center mb-2",children:t("parametres.abo.cancelModalTitle")}),e.jsx("p",{className:"text-sm text-gray-600 text-center mb-4",children:t("parametres.abo.cancelModalText")}),e.jsxs("div",{className:"space-y-2 mb-6",children:[C&&!C.cancelAtPeriodEnd&&C.status!=="c
19anceled"&&e.jsxs("div",{onClick:()=>qt(!Le),className:`flex items-center justify-between p-3 rounded-xl cursor-pointer transition-all border ${Le?"bg-red-50 border-red-300":"bg-gray-50 border-gray-200 hover:bg-gray-100"}`,children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:C.plan?.name||t("parametres.abo.planLeadGenDefault")}),e.jsxs("p",{className:"text-xs text-gray-500",children:[t("parametres.abo.price",{amount:C.plan?.amount||49})," / ",t(C.plan?.interval==="year"?"parametres.abo.perYear":"parametres.abo.perMonth")]})]}),e.jsx("div",{className:`w-5 h-5 rounded-md flex items-center justify-center transition-all ${Le?"bg-red-500":"border border-gray-300 bg-white"}`,children:Le&&e.jsx(pt,{className:"w-3.5 h-3.5 text-white"})})]}),x?.hasWhiteLabel&&!x?.whiteLabelSubscription?.cancelAtPeriodEnd&&e.jsxs("div",{onClick:()=>Jt(!Me),className:`flex items-center justify-between p-3 rounded-xl cursor-pointer transition-all border ${Me?"bg-red-50 border-red-300":"bg-gray-50 border-gray-200 hover:bg-gray-100"}`,children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:t("parametres.abo.whiteLabelOption")}),e.jsxs("p",{className:"text-xs text-gray-500",children:[t("parametres.abo.price",{amount:x?.whiteLabelSubscription?.plan==="yearly"?149:19})," / ",t(x?.whiteLabelSubscription?.plan==="yearly"?"parametres.abo.perYear":"parametres.abo.perMonth")]})]}),e.jsx("div",{className:`w-5 h-5 rounded-md flex items-center justify-center transition-all ${Me?"bg-red-500":"border border-gray-300 bg-white"}`,children:Me&&e.jsx(pt,{className:"w-3.5 h-3.5 text-white"})})]}),x?.hasAICapture&&!x?.aiCaptureSubscription?.cancelAtPeriodEnd&&e.jsxs("div",{onClick:()=>zs(!Re),className:`flex items-center justify-between p-3 rounded-xl cursor-pointer transition-all border ${Re?"bg-red-50 border-red-300":"bg-gray-50 border-gray-200 hover:bg-gray-100"}`,children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:t("parametres.abo.aiCaptureOption")}),e.jsxs("p",{className:"text-xs text-gray-500",children:[t("parametres.abo.price",{amount:x?.aiCaptureSubscription?.plan==="yearly"?299:39})," / ",t(x?.aiCaptureSubscription?.plan==="yearly"?"parametres.abo.perYear":"parametres.abo.perMonth")]})]}),e.jsx("div",{className:`w-5 h-5 rounded-md flex items-center justify-center transition-all ${Re?"bg-red-500":"border border-gray-300 bg-white"}`,children:Re&&e.jsx(pt,{className:"w-3.5 h-3.5 text-white"})})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>{Xt(!1),qt(!1),Jt(!1),zs(!1)},className:"flex-1 px-4 py-2.5 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-xl transition-colors",children:t("parametres.cancel")}),e.jsx("button",{onClick:An,disabled:Vs||!Le&&!Me&&!Re,className:"flex-1 flex items-center justify-center gap-2 px-4 py-2.5 bg-red-500 hover:bg-red-600 disabled:bg-red-400 text-white text-sm font-medium rounded-xl transition-colors",children:Vs?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{children:t("parametres.abo.cancelling")})]}):e.jsx("span",{children:t("parametres.abo.confirmCancel")})})]})]})})}),P==="notifications"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"mb-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:t("parametres.notif.title")}),e.jsx("p",{className:"text-sm text-gray-500",children:t("parametres.notif.subtitle")})]}),(()=>{const a=ht?Ye:x?.notificationsEnabled||!1;return e.jsx("div",{className:"bg-white border border-gray-100 rounded-xl p-5",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"flex items-center gap-4",children:k?e.jsxs(e.Fragment,{children:[!A&&e.jsx("div",{className:`w-12 h-12 flex-shrink-0 rounded-xl flex items-center justify-center ${a?"bg-amber-100":"bg-gray-100"}`,children:e.jsx(_r,{className:`w-6 h-6 ${a?"text-amber-600":"text-gray-400"}`})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-medium text-gray-900",children:t("parametres.notif.emailNotif")}),e.jsx("p",{className:"text-sm text-gray-500",children:t(A?"parametres.notif.emailEachLeadMobile":"parametres.notif.emailEachLead")})]})]}):e.jsxs(e.Fragment,{children:[!A&&e.jsx(Y,{className:"w-12 h-12 rounded-xl"}),e.jsxs("div",{children:[e.jsx(Y,{className:"w-40 h-5 mb-1"}),e.jsx(Y,{className:"w-32 h-4"})]})]})}),k?e.jsx("button",{onClick:()=>!u&&Pn(!a),disabled:u,className:`relative flex-shrink-0 rounded-full transition-colors duration-200 ${A?"w-11 h-6":"w-14 h-8"} ${a?"bg-amber-500":"bg-gray-200"} ${u?"opacity-50 cursor-not-allowed":""}`,children:e.jsx("span",{className:`absolute bg-white rounded-full shadow-sm transition-transform duration-200 ${A?`top-0.5 left-0.5 w-
195 h-5 ${a?"translate-x-5":"translate-x-0"}`:`top-1 left-1 w-6 h-6 ${a?"translate-x-6":"translate-x-0"}`}`})}):e.jsx(Fn,{})]})})})(),(()=>{const a=ht?Ye:x?.notificationsEnabled||!1,f=ht?He:x?.notificationEmail||"";return e.jsxs("div",{className:`bg-white border border-gray-100 rounded-xl p-5 transition-opacity ${k&&!a?"opacity-50 pointer-events-none":"opacity-100"}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx(Vn,{className:"w-5 h-5 text-gray-400"}),e.jsx("h3",{className:"font-medium text-gray-900",children:t("parametres.notif.emailAddressTitle")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:t("parametres.notif.emailLabel")}),k?e.jsx("input",{type:"email",value:f,onChange:v=>!u&&Ln(v.target.value),readOnly:u,placeholder:t("parametres.notif.emailPlaceholder"),className:`w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl text-gray-900 placeholder-gray-400 transition-all ${u?"cursor-not-allowed opacity-70":"focus:outline-none focus:ring-2 focus:ring-amber-500/20 focus:border-amber-500"}`}):e.jsx(Y,{className:"w-full h-[50px] rounded-xl"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:t("parametres.notif.emailHelp")})]}),e.jsx("div",{className:"pt-2",children:k?e.jsx("button",{onClick:Sn,disabled:Sr||!f||u,className:"flex items-center gap-2 px-4 py-2.5 bg-gray-100 hover:bg-gray-200 disabled:bg-gray-50 disabled:text-gray-400 text-gray-700 font-medium rounded-xl transition-colors",children:Sr?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{children:t("parametres.notif.sendingTest")})]}):e.jsxs(e.Fragment,{children:[e.jsx(hi,{className:"w-4 h-4"}),e.jsx("span",{children:t("parametres.notif.sendTest")})]})}):e.jsx(Y,{className:"w-52 h-[42px] rounded-xl"})})]})]})})(),Cr&&e.jsxs("div",{className:"flex items-center gap-3 p-4 bg-red-50 border border-red-200 rounded-xl",children:[e.jsx(ft,{className:"w-5 h-5 text-red-500 flex-shrink-0"}),e.jsx("p",{className:"text-sm text-red-700",children:Cr})]}),an&&e.jsxs("div",{className:"flex items-center gap-3 p-4 bg-green-50 border border-green-200 rounded-xl",children:[e.jsx(pt,{className:"w-5 h-5 text-green-500 flex-shrink-0"}),e.jsx("p",{className:"text-sm text-green-700",children:t("parametres.notif.testSuccess")})]}),ht&&e.jsxs("div",{className:"mt-5 flex justify-end gap-3",children:[e.jsx("button",{onClick:Cn,disabled:Rt||u,className:"px-4 py-2 rounded-xl text-sm font-medium transition-all bg-gray-100 hover:bg-gray-200 text-gray-700",children:t("parametres.cancel")}),e.jsxs("button",{onClick:Nn,disabled:Rt||u,className:"px-4 py-2 rounded-xl text-sm font-medium transition-all flex items-center gap-2 bg-amber-500 hover:bg-amber-600 text-white shadow-sm hover:shadow-md",children:[Rt&&e.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),t(Rt?"parametres.saving":"parametres.save")]})]})]}),P==="security"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"mb-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:t("parametres.secu.title")}),e.jsx("p",{className:"text-sm text-gray-500",children:t("parametres.secu.subtitle")})]}),u&&e.jsxs("div",{className:"p-6 bg-orange-50 border border-orange-200 rounded-xl text-center",children:[e.jsx(Ut,{className:"w-10 h-10 text-orange-400 mx-auto mb-3"}),e.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:t("parametres.secu.tabUnavailable")}),e.jsxs("p",{className:"text-sm text-gray-600",children:[t("parametres.secu.tabUnavailableText"),e.jsx("br",{}),t("parametres.secu.tabUnavailableText2")]})]}),!u&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`p-4 rounded-xl border ${Ve?"bg-green-50 border-green-200":"bg-gray-50 border-gray-100"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${Ve?"bg-green-100":"bg-amber-100"}`,children:e.jsx("span",{className:`text-xs font-bold ${Ve?"text-green-600":"text-amber-600"}`,children:"2FA"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:t("parametres.secu.twoFA")}),Ve&&e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-green-100 text-green-700 rounded-full",children:t("parametres.secu.enabled")})]}),e.jsx("p",{className:"text-xs text-gray-500",children:t(Ve?"parametres.secu.twoFAEnabledDesc":"parametres.secu.twoFADisabledDesc")})]})]}),Ve?e.jsx("button",{onClick:()=>is(!0),className:"px-4 py-2 bg-white border border-gray-200 hover:border-red-300 hover:bg-red-50 text-sm font-medium text-gray-700 hover:text-red-600 rounded-xl transition-colors",children:t("parametres.secu.disable")}):e.jsx("button",{onClick:pn,disabled:We,className:"px-4 py-2 bg-amber-500 hover:bg-amber-600 disabled:bg-amber-400 text-white text-sm font-medium rounded-xl transition-colors flex items-center gap-2",children:We?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{children:t("parametres.secu.loading")})]}):t("parametres.secu.configure")})]}),Ge&&!or&&e.jsx("div",{className:"mt-3 p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-600",children:Ge})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900",children:t("parametres.secu.activeSessions")}),Et.length>1&&e.jsx("button",{onClick:cn,disabled:pr,className:"text-sm text-red-500 hover:text-red-600 font-medium transition-colors disabled:opacity-50",children:pr?e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(H,{className:"w-3 h-3 animate-spin"}),t("parametres.secu.disconnecting")]}):t("parametres.secu.disconnectAll")})]}),e.jsx("div",{className:"space-y-2",children:Ka?e.jsxs("div",{className:"p-4 bg-gray-50 border border-gray-100 rounded-xl flex items-center justify-center",children:[e.jsx(H,{className:"w-5 h-5 animate-spin text-gray-400"}),e.jsx("span",{className:"ml-2 text-sm text-gray-500",children:t("parametres.secu.loadingSessions")})]}):Et.length===0?e.jsx("div",{className:"p-4 bg-gray-50 border border-gray-100 rounded-xl text-center",children:e.jsx("p",{className:"text-sm text-gray-500",children:t("parametres.secu.noActiveSession")})}):Et.map((a,f)=>e.jsx("div",{className:`p-4 rounded-xl ${a.isCurrentSession?"bg-green-50 border border-green-200":"bg-white border border-gray-100"}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[a.deviceType==="mobile"?e.jsx(pi,{className:`w-5 h-5 ${a.isCurrentSession?"text-green-600":"text-gray-400"}`}):e.jsx(fi,{className:`w-5 h-5 ${a.isCurrentSession?"text-green-600":"text-gray-400"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[a.deviceName||t("parametres.secu.unknownDevice")," - ",a.browser||t("parametres.secu.browser")]}),a.isCurrentSession&&e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-green-100 text-green-700 rounded-full",children:t("parametres.secu.currentSession")})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[e.jsxs("span",{className:"text-xs text-gray-500 flex items-center gap-1",children:[e.jsx(xi,{className:"w-3 h-3"}),a.city&&a.country?`${a.city}, ${a.country}`:t("parametres.secu.unknownLocation")]}),e.jsx("span",{className:"text-xs text-gray-500",children:mn(a.lastActiveAt||a.createdAt)})]})]})]}),!a.isCurrentSession&&e.jsx("button",{onClick:()=>ln(a.sessionToken),disabled:mr===a.sessionToken,className:"p-2 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-lg transition-colors disabled:opacity-50",children:mr===a.sessionToken?e.jsx(H,{className:"w-4 h-4 animate-spin"}):e.jsx(Qn,{className:"w-4 h-4"})})]})},a.sessionToken||f))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:t("parametres.secu.loginHistory")}),e.jsx("div",{className:"border border-gray-100 rounded-xl overflow-hidden",children:ds?e.jsxs("div",{className:"p-4 flex items-center justify-center",children:[e.jsx(H,{className:"w-5 h-5 animate-spin text-gray-400"}),e.jsx("span",{className:"ml-2 text-sm text-gray-500",children:t("parametres.secu.loadingHistory")})]}):ls.length===0?e.jsx("div",{className:"p-4 text-center",children:e.jsx("p",{className:"text-sm text-gray-500",children:t("parametres.secu.noLoginHistory")})}):e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:t("parametres.secu.tableDate")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:t("parametres.secu.tableDevice")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:t("parametres.secu.tableLocation")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:t("parametres.secu.tableStatus")})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:ls.map((a,f)=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-4 py-3 text-sm text-gray-900",children:hn(a.timestamp)}),e.jsxs("td",{className:"px-4 py-3 text-sm text-gray-600",children:[a.deviceName||t("parametres.secu.deviceDefault")," - ",a.browser||t("parametres.secu.browser")]}),e.jsx("td",{className:"px-4 py-3 text-sm text-gray-600",children:a.city&&a.country?`${a.city}, ${a.country}`:t("parametres.secu.unknownLocation")}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:`px-2 py-0.5 text-xs font-medium rounded-full ${a.status==="success"?"bg-green-100 text-green-700":"bg-red-100 text-red-700"}`,children:a.status==="success"?t("parametres.secu.statusSuccess"):t("parametres.secu.statusFailed")})})]},a.id||f))})]})}),hs>1&&e.jsxs("div",{className:"flex items-center justify-between mt-4",children:[e.jsx("p",{className:"text-sm text-gray-500",children:t("parametres.secu.connectionsTotal",{count:Ja})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>ws(ut-1),disabled:ut<=1||ds,className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:t("common.pagination.previous")}),e.jsx("span",{className:"text-sm text-gray-600",children:t("parametres.secu.pageOf",{page:ut,total:hs})}),e.jsx("button",{onClick:()=>ws(ut+1),disabled:ut>=hs||ds,className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:t("common.pagination.next")})]})]})]}),e.jsxs("div",{className:"pt-6 border-t border-gray-200",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:t("parametres.secu.accountManagement")}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-xl border border-gray-100",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:t("parametres.secu.exportData")}),e.jsx("p",{className:"text-xs text-gray-500",children:t("parametres.secu.exportDataDesc")})]}),e.jsxs("button",{onClick:dn,disabled:ms,className:"flex items-center gap-2 px-4 py-2 bg-white border border-gray-200 hover:border-gray-300 text-sm font-medium text-gray-700 rounded-xl transition-colors disabled:opacity-50",children:[ms?e.jsx(H,{className:"w-4 h-4 animate-spin"}):e.jsx(vi,{className:"w-4 h-4"}),t(ms?"parametres.secu.exporting":"parametres.secu.export")]})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 bg-red-50 rounded-xl border border-red-200",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:t("parametres.secu.deleteAccount")}
19),e.jsx("p",{className:"text-xs text-red-600",children:t("parametres.secu.irreversible")})]}),e.jsxs("button",{onClick:()=>ps(!0),className:"flex items-center gap-2 px-4 py-2 bg-red-500 hover:bg-red-600 text-white text-sm font-medium rounded-xl transition-colors",children:[e.jsx(ks,{className:"w-4 h-4"}),t("parametres.secu.delete")]})]})]})]})]})]})]})]})]}),or&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl max-w-md w-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-gray-100",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t(St===3?"parametres.secu.configDone":"parametres.secu.configure2FA")}),e.jsx("button",{onClick:Ir,className:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",children:e.jsx(Ot,{className:"w-5 h-5"})})]}),e.jsxs("div",{className:"p-5",children:[St===1&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:t("parametres.secu.scanQR")}),e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded-xl",children:dr&&e.jsx(Pa,{value:dr,size:180,level:"M"})})}),Ue&&e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-xs text-gray-500 mb-2 text-center",children:t("parametres.secu.orEnterManually")}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-gray-50 rounded-lg",children:[e.jsx("code",{className:"flex-1 text-sm font-mono text-gray-800 break-all",children:Ue}),e.jsx("button",{onClick:gn,className:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-lg transition-colors",title:t("parametres.secu.copy"),children:e.jsx(ui,{className:"w-4 h-4"})})]})]}),e.jsx("button",{onClick:()=>dt(2),className:"w-full px-4 py-2.5 bg-amber-500 hover:bg-amber-600 text-white font-medium rounded-xl transition-colors",children:t("parametres.secu.scannedQR")})]}),St===2&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:t("parametres.secu.enterCode")}),e.jsx("div",{className:"mb-4",children:e.jsx("input",{type:"text",value:rs,onChange:a=>{const f=a.target.value.replace(/\D/g,"").slice(0,6);as(f)},placeholder:"000000",className:"w-full text-center text-2xl font-mono tracking-[0.5em] px-4 py-3 border border-gray-200 rounded-xl focus:outline-none focus:border-amber-500",autoFocus:!0})}),Ge&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-600",children:Ge}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>dt(1),className:"flex-1 px-4 py-2.5 border border-gray-200 text-gray-700 font-medium rounded-xl hover:bg-gray-50 transition-colors",children:t("common.back")}),e.jsx("button",{onClick:fn,disabled:We||rs.length!==6,className:"flex-1 px-4 py-2.5 bg-amber-500 hover:bg-amber-600 disabled:bg-amber-400 text-white font-medium rounded-xl transition-colors flex items-center justify-center gap-2",children:We?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{children:t("parametres.secu.verifying")})]}):t("parametres.secu.verify")})]})]}),St===3&&e.jsxs("div",{className:"text-center py-4",children:[e.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(ci,{className:"w-8 h-8 text-green-600"})}),e.jsx("h4",{className:"text-lg font-semibold text-gray-900 mb-2",children:t("parametres.secu.twoFASuccess")}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:t("parametres.secu.twoFASuccessDesc")}),e.jsx("button",{onClick:Ir,className:"w-full px-4 py-2.5 bg-green-600 hover:bg-green-700 text-white font-medium rounded-xl transition-colors",children:t("parametres.secu.done")})]})]})]})}),Qa&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl max-w-sm w-full p-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-red-100 rounded-full flex items-center justify-center",children:e.jsx(ft,{className:"w-5 h-5 text-red-600"})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t("parametres.secu.disable2FATitle")})]}),e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:t("parametres.secu.disable2FAConfirm")}),Ge&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-600",children:Ge}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>{is(!1),me(null)},className:"flex-1 px-4 py-2.5 border border-gray-200 text-gray-700 font-medium rounded-xl hover:bg-gray-50 transition-colors",children:t("parametres.cancel")}),e.jsx("button",{onClick:xn,disabled:We,className:"flex-1 px-4 py-2.5 bg-red-500 hover:bg-red-600 disabled:bg-red-400 text-white font-medium rounded-xl transition-colors flex items-center justify-center gap-2",children:We?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{children:t("parametres.secu.disabling")})]}):t("parametres.secu.disable")})]})]})}),en&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl max-w-[598px] w-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-gray-100",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t("parametres.secu.deleteAccount")}
19),e.jsx("button",{onClick:()=>{ps(!1),fs(""),mt(null)},className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:e.jsx(Ot,{className:"w-5 h-5 text-gray-500"})})]}),e.jsxs("div",{className:"p-5",children:[e.jsx("div",{className:"mb-4 p-4 bg-red-50 border border-red-200 rounded-xl",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ft,{className:"w-5 h-5 text-red-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:t("parametres.secu.deleteWarning")}),e.jsx("p",{className:"text-sm text-red-600 mt-1",children:t("parametres.secu.deleteWarningText")})]})]})}),e.jsxs("p",{className:"text-sm text-gray-600 mb-4",children:[t("parametres.secu.deleteConfirmBefore")," ",e.jsx("span",{className:"font-mono font-semibold bg-gray-100 px-2 py-0.5 rounded",children:t("parametres.secu.deleteWord")})," ",t("parametres.secu.deleteConfirmAfter")]}),e.jsx("input",{type:"text",value:At,onChange:a=>fs(a.target.value.toUpperCase()),placeholder:t("parametres.secu.deletePlaceholder",{word:t("parametres.secu.deleteWord")}),className:"w-full px-4 py-3 border border-gray-200 rounded-xl focus:ring-2 focus:ring-red-500 focus:border-red-500 text-center font-mono tracking-widest"}),yr&&e.jsx("div",{className:"mt-3 p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-600",children:yr})]}),e.jsxs("div",{className:"flex gap-3 p-5 border-t border-gray-100",children:[e.jsx("button",{onClick:()=>{ps(!1),fs(""),mt(null)},className:"flex-1 px-4 py-2.5 border border-gray-200 text-gray-700 rounded-xl font-medium hover:bg-gray-50 transition-colors",children:t("parametres.cancel")}),e.jsx("button",{onClick:un,disabled:At!==t("parametres.secu.deleteWord")||gr,className:"flex-1 flex items-center justify-center gap-2 px-4 py-2.5 bg-red-500 hover:bg-red-600 disabled:bg-gray-300 disabled:cursor-not-allowed text-white rounded-xl font-medium transition-colors",children:gr?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{children:t("parametres.secu.deleting")})]}):e.jsxs(e.Fragment,{children:[e.jsx(ks,{className:"w-4 h-4"}),e.jsx("span",{children:t("parametres.secu.deletePermanently")})]})})]})]})})]})}export{vl as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.