@arcblock/payment-service 1.29.7 → 1.29.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/cf.d.ts +31 -0
  2. package/dist/cf.js +79 -60
  3. package/dist/index.d.ts +17 -0
  4. package/dist/index.js +264 -73
  5. package/package.json +4 -4
  6. package/web/assets/{account-DETfFe4_.js → account-Clbqiiw3.js} +1 -1
  7. package/web/assets/{action-B_DQJlip.js → action-DENqSeOa.js} +1 -1
  8. package/web/assets/{actions-BtaoyTWt.js → actions-0iWP2mcx.js} +1 -1
  9. package/web/assets/{actions-QPa-8lfB.js → actions-BD9BAp3M.js} +1 -1
  10. package/web/assets/{actions-jxGAdGfb.js → actions-BJDN6Op2.js} +1 -1
  11. package/web/assets/{actions-DJyfN5OU.js → actions-BSNy5bOd.js} +1 -1
  12. package/web/assets/{actions-Bt_jST94.js → actions-CDsj5j8l.js} +1 -1
  13. package/web/assets/{actions-D9MHLBFH.js → actions-CSpJGOX7.js} +1 -1
  14. package/web/assets/{actions-BknL4OyZ.js → actions-CZL47E9r.js} +1 -1
  15. package/web/assets/{actions-EPYeS5p4.js → actions-D3tJgrUn.js} +1 -1
  16. package/web/assets/{actions-BaDh4xWX.js → actions-DGQs8fFF.js} +1 -1
  17. package/web/assets/{add-price-CD-utowo.js → add-price-BpnICuHO.js} +1 -1
  18. package/web/assets/{admin-_nEB-lHn.js → admin-CD8ViZ7D.js} +1 -1
  19. package/web/assets/{assign-CkV5Q2LP.js → assign-0vMUDW_C.js} +1 -1
  20. package/web/assets/{attempts-DySeqBYU.js → attempts-CKlxkJuE.js} +1 -1
  21. package/web/assets/browser-DDv4_sgY.js +1 -0
  22. package/web/assets/{change-payment-CPUCUEER.js → change-payment-gAlRmJpv.js} +1 -1
  23. package/web/assets/{change-plan-CxE-XfWc.js → change-plan-C47wfWH8.js} +1 -1
  24. package/web/assets/{click-boundary-y8dVA_tr.js → click-boundary-CafubiPp.js} +1 -1
  25. package/web/assets/{connect-CC_l_f6Q.js → connect-BHHzrwLA.js} +1 -1
  26. package/web/assets/{copyable-DpX04wZz.js → copyable-QrCyyiou.js} +1 -1
  27. package/web/assets/{create-3SsWCAOC.js → create-0PUtkJZY.js} +1 -1
  28. package/web/assets/{create-BkQAaSvD.js → create-BJ1asdcy.js} +1 -1
  29. package/web/assets/{create-kG09X9gl.js → create-Bgv5ux17.js} +1 -1
  30. package/web/assets/{create-BmcRybZ5.js → create-C7GOgZZM.js} +1 -1
  31. package/web/assets/{create-tYebjhr9.js → create-DNar5UQD.js} +1 -1
  32. package/web/assets/{create-Bs65p5Ne.js → create-ke4FrPx1.js} +1 -1
  33. package/web/assets/{credit-grant-item-list-Bk27jIc7.js → credit-grant-item-list-CeDAM3qV.js} +1 -1
  34. package/web/assets/{credit-overview-DmMSEs14.js → credit-overview-4zh0H02x.js} +2 -2
  35. package/web/assets/{currency-restrictions-DYLv4YyW.js → currency-restrictions-BcEm8W45.js} +1 -1
  36. package/web/assets/{currency-select-DGS-62-L.js → currency-select-B4ieQBvv.js} +1 -1
  37. package/web/assets/{dayjs-B9tvQIKg.js → dayjs-DUTDpcNU.js} +1 -1
  38. package/web/assets/{description-Ym17DL48.js → description-SnR5WxWT.js} +1 -1
  39. package/web/assets/detail-46aLUdJj.js +1 -0
  40. package/web/assets/{detail-Cr2wG4Th.js → detail-B-ceWfZr.js} +1 -1
  41. package/web/assets/detail-B0IHl4MI.js +1 -0
  42. package/web/assets/detail-B8eOBVSQ.js +15 -0
  43. package/web/assets/{detail-DE3OOC5M.js → detail-BO3zglCn.js} +1 -1
  44. package/web/assets/{detail-DG4l2CqN.js → detail-BQpDGZJQ.js} +1 -1
  45. package/web/assets/{detail-CxYQYu_l.js → detail-BXTsnQny.js} +1 -1
  46. package/web/assets/{detail-CT9Unyrf.js → detail-B_lpOomD.js} +1 -1
  47. package/web/assets/{detail-Do9QO5L2.js → detail-Bfnkg0A1.js} +1 -1
  48. package/web/assets/detail-BwH0DwAi.js +1 -0
  49. package/web/assets/{detail-OZeeKI69.js → detail-C1FupF1D.js} +2 -2
  50. package/web/assets/{detail-cwHZbY62.js → detail-CMBRd4Ct.js} +1 -1
  51. package/web/assets/detail-C_Zdfa0y.js +1 -0
  52. package/web/assets/{detail-Cb9HBSMw.js → detail-Cg505nKX.js} +1 -1
  53. package/web/assets/{detail-DB56SG-k.js → detail-CsGZMimg.js} +1 -1
  54. package/web/assets/{detail-K9EVY3r2.js → detail-Ct5QNBqu.js} +1 -1
  55. package/web/assets/{detail-DuO_Jn5X.js → detail-CyMhK5K_.js} +1 -1
  56. package/web/assets/{detail-DuWdZIyp.js → detail-DACnmls3.js} +1 -1
  57. package/web/assets/{detail-BJTcK7mx.js → detail-DCTb8R7F.js} +1 -1
  58. package/web/assets/{detail-DPCTQLOx.js → detail-DNcp_u5S.js} +1 -1
  59. package/web/assets/detail-DbU3p040.js +1 -0
  60. package/web/assets/{detail-D5KRrQDx.js → detail-Tn2R5C8i.js} +1 -1
  61. package/web/assets/{detail-15zxCbV9.js → detail-wU4wNf4s.js} +1 -1
  62. package/web/assets/{drawer-form-Cl0T1Yyt.js → drawer-form-DspWWj3x.js} +1 -1
  63. package/web/assets/{edit-3HUAnaXW.js → edit-Bkj-OTJh.js} +1 -1
  64. package/web/assets/{editor-BF5I0siU.js → editor-AmthipP2.js} +1 -1
  65. package/web/assets/{embed-CsNqeCd0.js → embed-rRKjDoHi.js} +1 -1
  66. package/web/assets/{filter-toolbar-BydfQ-79.js → filter-toolbar-DXGSTq57.js} +1 -1
  67. package/web/assets/{form-DSzMo9UD.js → form-B5WW-lS5.js} +1 -1
  68. package/web/assets/form-BmQlJZ84.js +9 -0
  69. package/web/assets/{form-BGm5NPDn.js → form-CAPjlw7l.js} +1 -1
  70. package/web/assets/{form-CKfKLGXP.js → form-DD-EiA7W.js} +3 -3
  71. package/web/assets/{form-P4luyUpY.js → form-cX026J4G.js} +1 -1
  72. package/web/assets/{gas-Qf0SSUfS.js → gas-nyR96dB0.js} +1 -1
  73. package/web/assets/{generateCategoricalChart-BaWwaXky.js → generateCategoricalChart-BadryV3H.js} +1 -1
  74. package/web/assets/{home-HbrLyxJL.js → home-_eX1aim8.js} +1 -1
  75. package/web/assets/index-BBHMsIxJ.js +1 -0
  76. package/web/assets/{index-Dr_MwbKt.js → index-BQjlhCSt.js} +1 -1
  77. package/web/assets/{index-DPodCQ9c.js → index-BRENdB5m.js} +1 -1
  78. package/web/assets/{index-9xBRL_33.js → index-BTfJ08JU.js} +1 -1
  79. package/web/assets/{index-DgSc1Qy8.js → index-BarN7DfU.js} +17 -17
  80. package/web/assets/index-BhcoukR2.js +1 -0
  81. package/web/assets/index-BturOfxo.js +1 -0
  82. package/web/assets/{index-SYTpMMMH.js → index-BzABukCz.js} +1 -1
  83. package/web/assets/{index-2l22EYw9.js → index-C-RT84yb.js} +1 -1
  84. package/web/assets/{index-C0JaS08f.js → index-C136x0O2.js} +1 -1
  85. package/web/assets/{index-Cw0ugaQL.js → index-CCVDDX0c.js} +1 -1
  86. package/web/assets/index-CDVogp6E.js +1 -0
  87. package/web/assets/{index-Br7_mvEw.js → index-CW8VfoJO.js} +1 -1
  88. package/web/assets/{index-BIoSdRvX.js → index-CbSXdD6E.js} +3 -3
  89. package/web/assets/{index-CdkYrABk.js → index-Cd_BD9TM.js} +1 -1
  90. package/web/assets/index-D-bx9Kam.js +1 -0
  91. package/web/assets/index-D0mynT6_.js +1 -0
  92. package/web/assets/index-DEiuhiEo.js +14 -0
  93. package/web/assets/{index-DE2KzqXl.js → index-DNGmCIRP.js} +1 -1
  94. package/web/assets/{index-CI_EY4YS.js → index-DSe7Dot_.js} +1 -1
  95. package/web/assets/{index-BFML4-2u.js → index-DcddP3R9.js} +1 -1
  96. package/web/assets/index-DcrGSDby.js +1 -0
  97. package/web/assets/{index-fByZjxLy.js → index-DeK5Pqjv.js} +1 -1
  98. package/web/assets/{index-Clbt8nRm.js → index-DoX0A-rP.js} +1 -1
  99. package/web/assets/index-Du0Ieh1F.js +49 -0
  100. package/web/assets/index-Dybqd298.js +1 -0
  101. package/web/assets/index-EXZPddtw.js +1 -0
  102. package/web/assets/{index-Drav4oDH.js → index-Kd_qCyRG.js} +2 -2
  103. package/web/assets/{index-Dc954mDP.js → index-SOzRg0yJ.js} +1 -1
  104. package/web/assets/{index-BMKZToMM.js → index-UYeD8rTJ.js} +2 -2
  105. package/web/assets/{index-DZpJPE1Z.js → index-W2uZUlFs.js} +1 -1
  106. package/web/assets/{index-1y9kjPIr.js → index-XaFn2ySq.js} +1 -1
  107. package/web/assets/{index-fswPX_qe.js → index-YG5oc8O3.js} +1 -1
  108. package/web/assets/{index-B1pTTyGZ.js → index-ajD9Iotk.js} +1 -1
  109. package/web/assets/index-brUCsnBA.js +1 -0
  110. package/web/assets/{index-BP53rZV9.js → index-mn5Zdrtn.js} +1 -1
  111. package/web/assets/index-qulrJQ4J.js +1 -0
  112. package/web/assets/{index.es-BWnfUzLb.js → index.es-C8dcCHdW.js} +1 -1
  113. package/web/assets/{info-card-C1yxhxJG.js → info-card-BvIMFQo5.js} +1 -1
  114. package/web/assets/{info-metric-CNse3r66.js → info-metric-Dl4ZDm0Z.js} +1 -1
  115. package/web/assets/{info-row-group-BeUhWnnY.js → info-row-group-CFuMWJf1.js} +1 -1
  116. package/web/assets/{info-row-DOK2whMn.js → info-row-jI0h_hv4.js} +1 -1
  117. package/web/assets/{libphonenumber-CyphiuxQ.js → libphonenumber-Qs8PCdM-.js} +1 -1
  118. package/web/assets/{link-3eeclTeS.js → link-CmPoIweR.js} +1 -1
  119. package/web/assets/{list-DnePqZ2K.js → list-BdSkPjIa.js} +1 -1
  120. package/web/assets/{list-jHj_5yy3.js → list-CWMEf-_C.js} +1 -1
  121. package/web/assets/{list-C521zE_7.js → list-CkHExntK.js} +1 -1
  122. package/web/assets/{list-CO0X4L3-.js → list-DLB_hd0Q.js} +1 -1
  123. package/web/assets/{list-D-I0msRW.js → list-DVFJwd_I.js} +2 -2
  124. package/web/assets/{list-D1aevUOI.js → list-DaK9287Y.js} +2 -2
  125. package/web/assets/{list-1OG83xc4.js → list-DghnUOc4.js} +1 -1
  126. package/web/assets/{list-CNmzJKIQ.js → list-eFkvVlp5.js} +1 -1
  127. package/web/assets/metadata-BmQTVFku.js +55 -0
  128. package/web/assets/{meter-event-lmNMgmIu.js → meter-event-B1JIhVpb.js} +1 -1
  129. package/web/assets/{metrics-C7U41HWk.js → metrics-UvxyQbUF.js} +1 -1
  130. package/web/assets/{overview-Cs3-8n4e.js → overview-Cxc6WKba.js} +1 -1
  131. package/web/assets/{overview-CH1HnSP-.js → overview-DrMaIptb.js} +1 -1
  132. package/web/assets/{past-due-CGGRZmXY.js → past-due-CUXkxns0.js} +1 -1
  133. package/web/assets/pay-omLYkqRA.js +4 -0
  134. package/web/assets/{payment-method-info-BsOBbA3m.js → payment-method-info-Bsf89VxV.js} +2 -2
  135. package/web/assets/{preview-DjYRpRA8.js → preview-BifsgUGT.js} +1 -1
  136. package/web/assets/{preview-CjYh9dTg.js → preview-C-H8pGVw.js} +1 -1
  137. package/web/assets/{pricing-table-C3Lkhq46.js → pricing-table-B3QOaAB5.js} +2 -2
  138. package/web/assets/{pricing-table-edE6TJGX.js → pricing-table-BUJdtkMq.js} +1 -1
  139. package/web/assets/{product-select-0ScZE2e8.js → product-select-ChEyoJqJ.js} +1 -1
  140. package/web/assets/{recharge-DcPtT8vt.js → recharge-BVT4USAO.js} +1 -1
  141. package/web/assets/{related-credit-grants-BygNGPfb.js → related-credit-grants-JV2ICsR5.js} +22 -22
  142. package/web/assets/{safe-did-address-B0fFbUph.js → safe-did-address-CiG_V6Gy.js} +1 -1
  143. package/web/assets/{source-data-viewer-By_Utay-.js → source-data-viewer-i1q9wNIG.js} +1 -1
  144. package/web/assets/{status-l6pD08fw.js → status-CUVYrUIG.js} +1 -1
  145. package/web/assets/subscription-BYz_k9dq.js +1 -0
  146. package/web/assets/{subscription-Dq22e3D1.js → subscription-DrnSPIfs.js} +1 -1
  147. package/web/assets/table-BrtHemkA.js +1 -0
  148. package/web/assets/{tax-code-select-CWhIIiXi.js → tax-code-select-TS07I0rB.js} +1 -1
  149. package/web/assets/{tax-utils-DqNX34-r.js → tax-utils-bPjALcVG.js} +1 -1
  150. package/web/assets/{uploader-DRXDz_r0.js → uploader-CsQNHG4I.js} +1 -1
  151. package/web/assets/{usage-records-jjJMZ6DI.js → usage-records-DAUQMJAW.js} +1 -1
  152. package/web/assets/{util-mDHAL0lx.js → util-DxXTXkeY.js} +1 -1
  153. package/web/assets/{vendor-arcblock-ChFCRdyx.js → vendor-arcblock-BTCAQSUK.js} +1 -1
  154. package/web/assets/{vendor-blocklet-D_i_QeSo.js → vendor-blocklet-DcLR2Cyf.js} +43 -43
  155. package/web/index.html +1 -1
  156. package/web/assets/browser-DSLTxXlL.js +0 -1
  157. package/web/assets/detail-ASPdMJoW.js +0 -1
  158. package/web/assets/detail-CIx9vkir.js +0 -1
  159. package/web/assets/detail-D5NbV29V.js +0 -1
  160. package/web/assets/detail-DVVzYhdV.js +0 -1
  161. package/web/assets/detail-Dqc0OfCQ.js +0 -1
  162. package/web/assets/detail-uhlID8jD.js +0 -15
  163. package/web/assets/form-BXAuSawq.js +0 -9
  164. package/web/assets/index-0HK7CYm4.js +0 -1
  165. package/web/assets/index-BJ_E6bEO.js +0 -1
  166. package/web/assets/index-Bnyh4rlV.js +0 -1
  167. package/web/assets/index-BoQ7wf3O.js +0 -1
  168. package/web/assets/index-C68x-aau.js +0 -1
  169. package/web/assets/index-C8s2QKoe.js +0 -1
  170. package/web/assets/index-Cn7O-OP7.js +0 -49
  171. package/web/assets/index-DU39aG5u.js +0 -1
  172. package/web/assets/index-DtbqgSK4.js +0 -1
  173. package/web/assets/index-DuRu9NWB.js +0 -14
  174. package/web/assets/index-WMKOiUez.js +0 -1
  175. package/web/assets/index-dmHgoplS.js +0 -1
  176. package/web/assets/index-txVTkoDD.js +0 -1
  177. package/web/assets/metadata-CMSHcSXi.js +0 -55
  178. package/web/assets/pay-CSpHBUh_.js +0 -4
  179. package/web/assets/subscription-DcwhSOpa.js +0 -1
  180. package/web/assets/table-BRU4Enia.js +0 -1
@@ -1,4 +1,4 @@
1
- import{am as Pb,ax as qb,g as ri,j as u,r as V,e as Ne,A as mr,a3 as ge,q as oe,x as pt,ai as cr,B as Se,bd as Lb,O as Un,be as i0,u as cs,p as jf,a2 as Yn,aZ as ls,ad as Hy,aT as Ib,aB as mf,v as lo,I as ei,D as uo,h as $b,ae as Gn,bf as Zn,bg as pf,N as pr,a$ as Vb,w as gr,bh as r0,bi as Hb,ah as Yb,a4 as Zl,bj as Gb,t as o0,Y as ti,b1 as Ol,b4 as hf,a1 as Ot,ag as zl,Q as s0,s as l0,a0 as Yy,bk as u0,a7 as Xl,$ as ss,bl as Gy,bm as Kb,aY as Qb,bn as c0,bo as Zb,bp as d0,z as Xb,bq as Wb,br as f0,o as m0,bs as Jb,bt as Dd,bu as ex,L as p0,i as h0,bv as Rf,c as tx,T as nx,C as ax,bw as ix,bx as rx,W as ox,by as y0,bz as sx,aF as lx,bA as Mf,bB as ux,bC as cx,bD as dx}from"./vendor-mui-BXZut9Pz.js";import{g as fx,k as mx,T as px,r as hx,b as yx,c as gx,d as Nf,f as Dx,h as vx,i as bx,j as xx,m as g0,n as Cx,o as Sx,p as _x,q as Ax,s as Ex,t as wx,u as Tx,v as kx,w as Fx,x as Wl,y as Ht,A as Sn,B as jx,C as Rx,I as Mx,D as Nx,E as Dt,F as ze,G as qt,H as D0,J as Bx,K as Kn,L as v0,M as Ux,N as Ox,O as Pi,P as zx,Q as Px,R as yf,S as qx,V as ft,U as b0,W as x0,X as ni,Y as rt,$ as C0,Z as S0,a0 as Bf,a1 as Lx,a2 as Fi,a3 as _0,a4 as Ix,a5 as vd,a6 as A0,a7 as Ky,a8 as Qy,a9 as Za,aa as Uf,ab as $x,ac as Vx,ad as Hx,ae as Yx,af as Gx,ag as Kx,ah as Qx,ai as Zx,aj as Xx,ak as Wx,al as Jx}from"./vendor-blocklet-D_i_QeSo.js";import{a as ds,b as eC,B as tC,R as nC,c as jt,d as Zy}from"./vendor-react-BPknnnEA.js";var bd={exports:{}},Jo={},xd={exports:{}},Cd={};var Xy;function aC(){return Xy||(Xy=1,(function(a){function r(P,D){var F=P.length;P.push(D);e:for(;0<F;){var ae=F-1>>>1,be=P[ae];if(0<f(be,D))P[ae]=D,P[F]=be,F=ae;else break e}}function o(P){return P.length===0?null:P[0]}function s(P){if(P.length===0)return null;var D=P[0],F=P.pop();if(F!==D){P[0]=F;e:for(var ae=0,be=P.length,Me=be>>>1;ae<Me;){var Fe=2*(ae+1)-1,Ae=P[Fe],ue=Fe+1,$e=P[ue];if(0>f(Ae,F))ue<be&&0>f($e,Ae)?(P[ae]=$e,P[ue]=F,ae=ue):(P[ae]=Ae,P[Fe]=F,ae=Fe);else if(ue<be&&0>f($e,F))P[ae]=$e,P[ue]=F,ae=ue;else break e}}return D}function f(P,D){var F=P.sortIndex-D.sortIndex;return F!==0?F:P.id-D.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;a.unstable_now=function(){return m.now()}}else{var c=Date,h=c.now();a.unstable_now=function(){return c.now()-h}}var g=[],y=[],S=1,x=null,A=3,v=!1,N=!1,B=!1,O=!1,k=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function w(P){for(var D=o(y);D!==null;){if(D.callback===null)s(y);else if(D.startTime<=P)s(y),D.sortIndex=D.expirationTime,r(g,D);else break;D=o(y)}}function G(P){if(B=!1,w(P),!N)if(o(g)!==null)N=!0,T||(T=!0,Q());else{var D=o(y);D!==null&&me(G,D.startTime-P)}}var T=!1,R=-1,q=5,z=-1;function $(){return O?!0:!(a.unstable_now()-z<q)}function re(){if(O=!1,T){var P=a.unstable_now();z=P;var D=!0;try{e:{N=!1,B&&(B=!1,K(R),R=-1),v=!0;var F=A;try{t:{for(w(P),x=o(g);x!==null&&!(x.expirationTime>P&&$());){var ae=x.callback;if(typeof ae=="function"){x.callback=null,A=x.priorityLevel;var be=ae(x.expirationTime<=P);if(P=a.unstable_now(),typeof be=="function"){x.callback=be,w(P),D=!0;break t}x===o(g)&&s(g),w(P)}else s(g);x=o(g)}if(x!==null)D=!0;else{var Me=o(y);Me!==null&&me(G,Me.startTime-P),D=!1}}break e}finally{x=null,A=F,v=!1}D=void 0}}finally{D?Q():T=!1}}}var Q;if(typeof j=="function")Q=function(){j(re)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ne=Z.port2;Z.port1.onmessage=re,Q=function(){ne.postMessage(null)}}else Q=function(){k(re,0)};function me(P,D){R=k(function(){P(a.unstable_now())},D)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(P){P.callback=null},a.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<P?Math.floor(1e3/P):5},a.unstable_getCurrentPriorityLevel=function(){return A},a.unstable_next=function(P){switch(A){case 1:case 2:case 3:var D=3;break;default:D=A}var F=A;A=D;try{return P()}finally{A=F}},a.unstable_requestPaint=function(){O=!0},a.unstable_runWithPriority=function(P,D){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var F=A;A=P;try{return D()}finally{A=F}},a.unstable_scheduleCallback=function(P,D,F){var ae=a.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?ae+F:ae):F=ae,P){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=F+be,P={id:S++,callback:D,priorityLevel:P,startTime:F,expirationTime:be,sortIndex:-1},F>ae?(P.sortIndex=F,r(y,P),o(g)===null&&P===o(y)&&(B?(K(R),R=-1):B=!0,me(G,F-ae))):(P.sortIndex=be,r(g,P),N||v||(N=!0,T||(T=!0,Q()))),P},a.unstable_shouldYield=$,a.unstable_wrapCallback=function(P){var D=A;return function(){var F=A;A=D;try{return P.apply(this,arguments)}finally{A=F}}}})(Cd)),Cd}var Wy;function iC(){return Wy||(Wy=1,xd.exports=aC()),xd.exports}var Jy;function rC(){if(Jy)return Jo;Jy=1;var a=iC(),r=Pb(),o=qb();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(m(e)!==e)throw Error(s(188))}function y(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(s(188));return t!==e?null:e}for(var n=e,i=t;;){var l=n.return;if(l===null)break;var d=l.alternate;if(d===null){if(i=l.return,i!==null){n=i;continue}break}if(l.child===d.child){for(d=l.child;d;){if(d===n)return g(l),e;if(d===i)return g(l),t;d=d.sibling}throw Error(s(188))}if(n.return!==i.return)n=l,i=d;else{for(var p=!1,C=l.child;C;){if(C===n){p=!0,n=l,i=d;break}if(C===i){p=!0,i=l,n=d;break}C=C.sibling}if(!p){for(C=d.child;C;){if(C===n){p=!0,n=d,i=l;break}if(C===i){p=!0,i=d,n=l;break}C=C.sibling}if(!p)throw Error(s(189))}}if(n.alternate!==i)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,A=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),j=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),re=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=re&&e[re]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function ne(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case B:return"Fragment";case k:return"Profiler";case O:return"StrictMode";case G:return"Suspense";case T:return"SuspenseList";case z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case j:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case w:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return t=e.displayName||null,t!==null?t:ne(e.type)||"Memo";case q:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var me=Array.isArray,P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},ae=[],be=-1;function Me(e){return{current:e}}function Fe(e){0>be||(e.current=ae[be],ae[be]=null,be--)}function Ae(e,t){be++,ae[be]=e.current,e.current=t}var ue=Me(null),$e=Me(null),Pe=Me(null),Xe=Me(null);function Ze(e,t){switch(Ae(Pe,t),Ae($e,e),Ae(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?py(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=py(t),e=hy(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Fe(ue),Ae(ue,e)}function Ue(){Fe(ue),Fe($e),Fe(Pe)}function b(e){e.memoizedState!==null&&Ae(Xe,e);var t=ue.current,n=hy(t,e.type);t!==n&&(Ae($e,e),Ae(ue,n))}function E(e){$e.current===e&&(Fe(ue),Fe($e)),Xe.current===e&&(Fe(Xe),Qo._currentValue=F)}var L,ie;function W(e){if(L===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);L=t&&t[1]||"",ie=-1<n.stack.indexOf(`
1
+ import{am as Pb,ax as qb,g as ri,j as u,r as V,e as Ne,A as mr,a3 as ge,q as oe,x as pt,ai as cr,B as Se,bd as Lb,O as Un,be as i0,u as cs,p as jf,a2 as Yn,aZ as ls,ad as Hy,aT as Ib,aB as mf,v as lo,I as ei,D as uo,h as $b,ae as Gn,bf as Zn,bg as pf,N as pr,a$ as Vb,w as gr,bh as r0,bi as Hb,ah as Yb,a4 as Zl,bj as Gb,t as o0,Y as ti,b1 as Ol,b4 as hf,a1 as Ot,ag as zl,Q as s0,s as l0,a0 as Yy,bk as u0,a7 as Xl,$ as ss,bl as Gy,bm as Kb,aY as Qb,bn as c0,bo as Zb,bp as d0,z as Xb,bq as Wb,br as f0,o as m0,bs as Jb,bt as Dd,bu as ex,L as p0,i as h0,bv as Rf,c as tx,T as nx,C as ax,bw as ix,bx as rx,W as ox,by as y0,bz as sx,aF as lx,bA as Mf,bB as ux,bC as cx,bD as dx}from"./vendor-mui-BXZut9Pz.js";import{b as fx,g as mx,k as px,T as hx,r as yx,c as gx,d as Dx,f as Nf,h as vx,i as bx,j as xx,m as Cx,n as g0,o as Sx,p as _x,q as Ax,s as Ex,t as wx,u as Tx,v as kx,w as Fx,x as jx,y as Wl,A as Ht,B as Sn,C as Rx,D as Mx,I as Nx,E as Bx,F as Dt,G as ze,H as qt,J as D0,K as Ux,L as Kn,M as v0,N as Ox,O as zx,P as Pi,Q as Px,R as qx,S as yf,U as Lx,V as ft,W as b0,X as x0,Y as ni,Z as rt,$ as C0,a0 as S0,a1 as Bf,a2 as Ix,a3 as Fi,a4 as _0,a5 as $x,a6 as vd,a7 as A0,a8 as Ky,a9 as Qy,aa as Za,ab as Uf,ac as Vx,ad as Hx,ae as Yx,af as Gx,ag as Kx,ah as Qx,ai as Zx,aj as Xx,ak as Wx,al as Jx,am as eC}from"./vendor-blocklet-DcLR2Cyf.js";import{a as ds,b as tC,B as nC,R as aC,c as jt,d as Zy}from"./vendor-react-BPknnnEA.js";typeof window<"u"&&!window.Buffer&&(window.Buffer=fx.Buffer);var bd={exports:{}},Jo={},xd={exports:{}},Cd={};var Xy;function iC(){return Xy||(Xy=1,(function(a){function r(P,D){var F=P.length;P.push(D);e:for(;0<F;){var ae=F-1>>>1,be=P[ae];if(0<f(be,D))P[ae]=D,P[F]=be,F=ae;else break e}}function o(P){return P.length===0?null:P[0]}function s(P){if(P.length===0)return null;var D=P[0],F=P.pop();if(F!==D){P[0]=F;e:for(var ae=0,be=P.length,Me=be>>>1;ae<Me;){var Fe=2*(ae+1)-1,Ae=P[Fe],ue=Fe+1,$e=P[ue];if(0>f(Ae,F))ue<be&&0>f($e,Ae)?(P[ae]=$e,P[ue]=F,ae=ue):(P[ae]=Ae,P[Fe]=F,ae=Fe);else if(ue<be&&0>f($e,F))P[ae]=$e,P[ue]=F,ae=ue;else break e}}return D}function f(P,D){var F=P.sortIndex-D.sortIndex;return F!==0?F:P.id-D.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;a.unstable_now=function(){return m.now()}}else{var c=Date,h=c.now();a.unstable_now=function(){return c.now()-h}}var g=[],y=[],S=1,x=null,A=3,v=!1,N=!1,B=!1,O=!1,k=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function w(P){for(var D=o(y);D!==null;){if(D.callback===null)s(y);else if(D.startTime<=P)s(y),D.sortIndex=D.expirationTime,r(g,D);else break;D=o(y)}}function G(P){if(B=!1,w(P),!N)if(o(g)!==null)N=!0,T||(T=!0,Q());else{var D=o(y);D!==null&&me(G,D.startTime-P)}}var T=!1,R=-1,q=5,z=-1;function $(){return O?!0:!(a.unstable_now()-z<q)}function re(){if(O=!1,T){var P=a.unstable_now();z=P;var D=!0;try{e:{N=!1,B&&(B=!1,K(R),R=-1),v=!0;var F=A;try{t:{for(w(P),x=o(g);x!==null&&!(x.expirationTime>P&&$());){var ae=x.callback;if(typeof ae=="function"){x.callback=null,A=x.priorityLevel;var be=ae(x.expirationTime<=P);if(P=a.unstable_now(),typeof be=="function"){x.callback=be,w(P),D=!0;break t}x===o(g)&&s(g),w(P)}else s(g);x=o(g)}if(x!==null)D=!0;else{var Me=o(y);Me!==null&&me(G,Me.startTime-P),D=!1}}break e}finally{x=null,A=F,v=!1}D=void 0}}finally{D?Q():T=!1}}}var Q;if(typeof j=="function")Q=function(){j(re)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ne=Z.port2;Z.port1.onmessage=re,Q=function(){ne.postMessage(null)}}else Q=function(){k(re,0)};function me(P,D){R=k(function(){P(a.unstable_now())},D)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(P){P.callback=null},a.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<P?Math.floor(1e3/P):5},a.unstable_getCurrentPriorityLevel=function(){return A},a.unstable_next=function(P){switch(A){case 1:case 2:case 3:var D=3;break;default:D=A}var F=A;A=D;try{return P()}finally{A=F}},a.unstable_requestPaint=function(){O=!0},a.unstable_runWithPriority=function(P,D){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var F=A;A=P;try{return D()}finally{A=F}},a.unstable_scheduleCallback=function(P,D,F){var ae=a.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?ae+F:ae):F=ae,P){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=F+be,P={id:S++,callback:D,priorityLevel:P,startTime:F,expirationTime:be,sortIndex:-1},F>ae?(P.sortIndex=F,r(y,P),o(g)===null&&P===o(y)&&(B?(K(R),R=-1):B=!0,me(G,F-ae))):(P.sortIndex=be,r(g,P),N||v||(N=!0,T||(T=!0,Q()))),P},a.unstable_shouldYield=$,a.unstable_wrapCallback=function(P){var D=A;return function(){var F=A;A=D;try{return P.apply(this,arguments)}finally{A=F}}}})(Cd)),Cd}var Wy;function rC(){return Wy||(Wy=1,xd.exports=iC()),xd.exports}var Jy;function oC(){if(Jy)return Jo;Jy=1;var a=rC(),r=Pb(),o=qb();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(m(e)!==e)throw Error(s(188))}function y(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(s(188));return t!==e?null:e}for(var n=e,i=t;;){var l=n.return;if(l===null)break;var d=l.alternate;if(d===null){if(i=l.return,i!==null){n=i;continue}break}if(l.child===d.child){for(d=l.child;d;){if(d===n)return g(l),e;if(d===i)return g(l),t;d=d.sibling}throw Error(s(188))}if(n.return!==i.return)n=l,i=d;else{for(var p=!1,C=l.child;C;){if(C===n){p=!0,n=l,i=d;break}if(C===i){p=!0,i=l,n=d;break}C=C.sibling}if(!p){for(C=d.child;C;){if(C===n){p=!0,n=d,i=l;break}if(C===i){p=!0,i=d,n=l;break}C=C.sibling}if(!p)throw Error(s(189))}}if(n.alternate!==i)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,A=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),j=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),re=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=re&&e[re]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function ne(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case B:return"Fragment";case k:return"Profiler";case O:return"StrictMode";case G:return"Suspense";case T:return"SuspenseList";case z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case j:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case w:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return t=e.displayName||null,t!==null?t:ne(e.type)||"Memo";case q:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var me=Array.isArray,P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},ae=[],be=-1;function Me(e){return{current:e}}function Fe(e){0>be||(e.current=ae[be],ae[be]=null,be--)}function Ae(e,t){be++,ae[be]=e.current,e.current=t}var ue=Me(null),$e=Me(null),Pe=Me(null),Xe=Me(null);function Ze(e,t){switch(Ae(Pe,t),Ae($e,e),Ae(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?py(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=py(t),e=hy(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Fe(ue),Ae(ue,e)}function Ue(){Fe(ue),Fe($e),Fe(Pe)}function b(e){e.memoizedState!==null&&Ae(Xe,e);var t=ue.current,n=hy(t,e.type);t!==n&&(Ae($e,e),Ae(ue,n))}function E(e){$e.current===e&&(Fe(ue),Fe($e)),Xe.current===e&&(Fe(Xe),Qo._currentValue=F)}var L,ie;function W(e){if(L===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);L=t&&t[1]||"",ie=-1<n.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
3
  `+L+e+ie}var te=!1;function ce(e,t){if(!e||te)return"";te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(ye){var he=ye}Reflect.construct(e,[],we)}else{try{we.call()}catch(ye){he=ye}e.call(we.prototype)}}else{try{throw Error()}catch(ye){he=ye}(we=e())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(ye){if(ye&&he&&typeof ye.stack=="string")return[ye.stack,he.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=i.DetermineComponentFrameRoot(),p=d[0],C=d[1];if(p&&C){var Y=p.split(`
4
4
  `),fe=C.split(`
@@ -6,7 +6,7 @@ import{am as Pb,ax as qb,g as ri,j as u,r as V,e as Ne,A as mr,a3 as ge,q as oe,
6
6
  `+Y[i].replace(" at new "," at ");return e.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",e.displayName)),xe}while(1<=i&&0<=l);break}}}finally{te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?W(n):""}function J(e,t){switch(e.tag){case 26:case 27:case 5:return W(e.type);case 16:return W("Lazy");case 13:return e.child!==t&&t!==null?W("Suspense Fallback"):W("Suspense");case 19:return W("SuspenseList");case 0:case 15:return ce(e.type,!1);case 11:return ce(e.type.render,!1);case 1:return ce(e.type,!0);case 31:return W("Activity");default:return""}}function H(e){try{var t="",n=null;do t+=J(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
7
7
  Error generating stack: `+i.message+`
8
8
  `+i.stack}}var M=Object.prototype.hasOwnProperty,U=a.unstable_scheduleCallback,se=a.unstable_cancelCallback,je=a.unstable_shouldYield,_=a.unstable_requestPaint,I=a.unstable_now,ee=a.unstable_getCurrentPriorityLevel,Ee=a.unstable_ImmediatePriority,De=a.unstable_UserBlockingPriority,Ce=a.unstable_NormalPriority,Te=a.unstable_LowPriority,Ye=a.unstable_IdlePriority,ve=a.log,qe=a.unstable_setDisableYieldValue,Oe=null,Ve=null;function Ge(e){if(typeof ve=="function"&&qe(e),Ve&&typeof Ve.setStrictMode=="function")try{Ve.setStrictMode(Oe,e)}catch{}}var Ke=Math.clz32?Math.clz32:It,et=Math.log,Lt=Math.LN2;function It(e){return e>>>=0,e===0?32:31-(et(e)/Lt|0)|0}var kt=256,zt=262144,Dn=4194304;function an(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function An(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var C=i&134217727;return C!==0?(i=C&~d,i!==0?l=an(i):(p&=C,p!==0?l=an(p):n||(n=C&~e,n!==0&&(l=an(n))))):(C=i&~d,C!==0?l=an(C):p!==0?l=an(p):n||(n=i&~e,n!==0&&(l=an(n)))),l===0?0:t!==0&&t!==l&&(t&d)===0&&(d=l&-l,n=t&-t,d>=n||d===32&&(n&4194048)!==0)?t:l}function Sa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function fa(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xn(){var e=Dn;return Dn<<=1,(Dn&62914560)===0&&(Dn=4194304),e}function Fa(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function _a(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Dr(e,t,n,i,l,d){var p=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var C=e.entanglements,Y=e.expirationTimes,fe=e.hiddenUpdates;for(n=p&~n;0<n;){var xe=31-Ke(n),we=1<<xe;C[xe]=0,Y[xe]=-1;var he=fe[xe];if(he!==null)for(fe[xe]=null,xe=0;xe<he.length;xe++){var ye=he[xe];ye!==null&&(ye.lane&=-536870913)}n&=~we}i!==0&&pe(e,i,0),d!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=d&~(p&~t))}function pe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Ke(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function ke(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Ke(n),l=1<<i;l&t|e[i]&t&&(e[i]|=t),n&=~l}}function Re(e,t){var n=t&-t;return n=(n&42)!==0?1:Je(n),(n&(e.suspendedLanes|t))!==0?0:n}function Je(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function tt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function it(){var e=D.p;return e!==0?e:(e=window.event,e===void 0?32:zy(e.type))}function Wn(e,t){var n=D.p;try{return D.p=e,t()}finally{D.p=n}}var Xt=Math.random().toString(36).slice(2),st="__reactFiber$"+Xt,Rt="__reactProps$"+Xt,Jn="__reactContainer$"+Xt,Li="__reactEvents$"+Xt,Ii="__reactListeners$"+Xt,vr="__reactHandles$"+Xt,co="__reactResources$"+Xt,ht="__reactMarker$"+Xt;function On(e){delete e[st],delete e[Rt],delete e[Li],delete e[Ii],delete e[vr]}function hn(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Jn]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cy(e);e!==null;){if(n=e[st])return n;e=Cy(e)}return t}e=n,n=e.parentNode}return null}function $i(e){if(e=e[st]||e[Jn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function oi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function ja(e){var t=e[co];return t||(t=e[co]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function on(e){e[ht]=!0}var nm=new Set,am={};function Vi(e,t){br(e,t),br(e+"Capture",t)}function br(e,t){for(am[e]=t,e=0;e<t.length;e++)nm.add(t[e])}var FD=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),im={},rm={};function jD(e){return M.call(rm,e)?!0:M.call(im,e)?!1:FD.test(e)?rm[e]=!0:(im[e]=!0,!1)}function ys(e,t,n){if(jD(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function gs(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Ra(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+i)}}function ea(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function om(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function RD(e,t,n){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var l=i.get,d=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(p){n=""+p,d.call(this,p)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(p){n=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function du(e){if(!e._valueTracker){var t=om(e)?"checked":"value";e._valueTracker=RD(e,t,""+e[t])}}function sm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=om(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Ds(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var MD=/[\n"\\]/g;function ta(e){return e.replace(MD,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function fu(e,t,n,i,l,d,p,C){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ea(t)):e.value!==""+ea(t)&&(e.value=""+ea(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?mu(e,p,ea(t)):n!=null?mu(e,p,ea(n)):i!=null&&e.removeAttribute("value"),l==null&&d!=null&&(e.defaultChecked=!!d),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.name=""+ea(C):e.removeAttribute("name")}function lm(e,t,n,i,l,d,p,C){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||n!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){du(e);return}n=n!=null?""+ea(n):"",t=t!=null?""+ea(t):n,C||t===e.value||(e.value=t),e.defaultValue=t}i=i??l,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=C?e.checked:!!i,e.defaultChecked=!!i,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),du(e)}function mu(e,t,n){t==="number"&&Ds(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function xr(e,t,n,i){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&i&&(e[n].defaultSelected=!0)}else{for(n=""+ea(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,i&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function um(e,t,n){if(t!=null&&(t=""+ea(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+ea(n):""}function cm(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(s(92));if(me(i)){if(1<i.length)throw Error(s(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=ea(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),du(e)}function Cr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ND=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dm(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||ND.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function fm(e,t,n){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var l in t)i=t[l],t.hasOwnProperty(l)&&n[l]!==i&&dm(e,l,i)}else for(var d in t)t.hasOwnProperty(d)&&dm(e,d,t[d])}function pu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var BD=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),UD=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function vs(e){return UD.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ma(){}var hu=null;function yu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sr=null,_r=null;function mm(e){var t=$i(e);if(t&&(e=t.stateNode)){var n=e[Rt]||null;e:switch(e=t.stateNode,t.type){case"input":if(fu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+ta(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var l=i[Rt]||null;if(!l)throw Error(s(90));fu(i,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&sm(i)}break e;case"textarea":um(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&xr(e,!!n.multiple,t,!1)}}}var gu=!1;function pm(e,t,n){if(gu)return e(t,n);gu=!0;try{var i=e(t);return i}finally{if(gu=!1,(Sr!==null||_r!==null)&&(ol(),Sr&&(t=Sr,e=_r,_r=Sr=null,mm(t),e)))for(t=0;t<e.length;t++)mm(e[t])}}function fo(e,t){var n=e.stateNode;if(n===null)return null;var i=n[Rt]||null;if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(s(231,t,typeof n));return n}var Na=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Du=!1;if(Na)try{var mo={};Object.defineProperty(mo,"passive",{get:function(){Du=!0}}),window.addEventListener("test",mo,mo),window.removeEventListener("test",mo,mo)}catch{Du=!1}var si=null,vu=null,bs=null;function hm(){if(bs)return bs;var e,t=vu,n=t.length,i,l="value"in si?si.value:si.textContent,d=l.length;for(e=0;e<n&&t[e]===l[e];e++);var p=n-e;for(i=1;i<=p&&t[n-i]===l[d-i];i++);return bs=l.slice(e,1<i?1-i:void 0)}function xs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Cs(){return!0}function ym(){return!1}function En(e){function t(n,i,l,d,p){this._reactName=n,this._targetInst=l,this.type=i,this.nativeEvent=d,this.target=p,this.currentTarget=null;for(var C in e)e.hasOwnProperty(C)&&(n=e[C],this[C]=n?n(d):d[C]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Cs:ym,this.isPropagationStopped=ym,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Cs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Cs)},persist:function(){},isPersistent:Cs}),t}var Hi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ss=En(Hi),po=x({},Hi,{view:0,detail:0}),OD=En(po),bu,xu,ho,_s=x({},po,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Su,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ho&&(ho&&e.type==="mousemove"?(bu=e.screenX-ho.screenX,xu=e.screenY-ho.screenY):xu=bu=0,ho=e),bu)},movementY:function(e){return"movementY"in e?e.movementY:xu}}),gm=En(_s),zD=x({},_s,{dataTransfer:0}),PD=En(zD),qD=x({},po,{relatedTarget:0}),Cu=En(qD),LD=x({},Hi,{animationName:0,elapsedTime:0,pseudoElement:0}),ID=En(LD),$D=x({},Hi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),VD=En($D),HD=x({},Hi,{data:0}),Dm=En(HD),YD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},GD={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},KD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=KD[e])?!!t[e]:!1}function Su(){return QD}var ZD=x({},po,{key:function(e){if(e.key){var t=YD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?GD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Su,charCode:function(e){return e.type==="keypress"?xs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),XD=En(ZD),WD=x({},_s,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vm=En(WD),JD=x({},po,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Su}),ev=En(JD),tv=x({},Hi,{propertyName:0,elapsedTime:0,pseudoElement:0}),nv=En(tv),av=x({},_s,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),iv=En(av),rv=x({},Hi,{newState:0,oldState:0}),ov=En(rv),sv=[9,13,27,32],_u=Na&&"CompositionEvent"in window,yo=null;Na&&"documentMode"in document&&(yo=document.documentMode);var lv=Na&&"TextEvent"in window&&!yo,bm=Na&&(!_u||yo&&8<yo&&11>=yo),xm=" ",Cm=!1;function Sm(e,t){switch(e){case"keyup":return sv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _m(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ar=!1;function uv(e,t){switch(e){case"compositionend":return _m(t);case"keypress":return t.which!==32?null:(Cm=!0,xm);case"textInput":return e=t.data,e===xm&&Cm?null:e;default:return null}}function cv(e,t){if(Ar)return e==="compositionend"||!_u&&Sm(e,t)?(e=hm(),bs=vu=si=null,Ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return bm&&t.locale!=="ko"?null:t.data;default:return null}}var dv={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Am(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dv[e.type]:t==="textarea"}function Em(e,t,n,i){Sr?_r?_r.push(i):_r=[i]:Sr=i,t=ml(t,"onChange"),0<t.length&&(n=new Ss("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var go=null,Do=null;function fv(e){ly(e,0)}function As(e){var t=oi(e);if(sm(t))return e}function wm(e,t){if(e==="change")return t}var Tm=!1;if(Na){var Au;if(Na){var Eu="oninput"in document;if(!Eu){var km=document.createElement("div");km.setAttribute("oninput","return;"),Eu=typeof km.oninput=="function"}Au=Eu}else Au=!1;Tm=Au&&(!document.documentMode||9<document.documentMode)}function Fm(){go&&(go.detachEvent("onpropertychange",jm),Do=go=null)}function jm(e){if(e.propertyName==="value"&&As(Do)){var t=[];Em(t,Do,e,yu(e)),pm(fv,t)}}function mv(e,t,n){e==="focusin"?(Fm(),go=t,Do=n,go.attachEvent("onpropertychange",jm)):e==="focusout"&&Fm()}function pv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return As(Do)}function hv(e,t){if(e==="click")return As(t)}function yv(e,t){if(e==="input"||e==="change")return As(t)}function gv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zn=typeof Object.is=="function"?Object.is:gv;function vo(e,t){if(zn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var l=n[i];if(!M.call(t,l)||!zn(e[l],t[l]))return!1}return!0}function Rm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mm(e,t){var n=Rm(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Rm(n)}}function Nm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ds(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ds(e.document)}return t}function wu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Dv=Na&&"documentMode"in document&&11>=document.documentMode,Er=null,Tu=null,bo=null,ku=!1;function Um(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ku||Er==null||Er!==Ds(i)||(i=Er,"selectionStart"in i&&wu(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),bo&&vo(bo,i)||(bo=i,i=ml(Tu,"onSelect"),0<i.length&&(t=new Ss("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Er)))}function Yi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var wr={animationend:Yi("Animation","AnimationEnd"),animationiteration:Yi("Animation","AnimationIteration"),animationstart:Yi("Animation","AnimationStart"),transitionrun:Yi("Transition","TransitionRun"),transitionstart:Yi("Transition","TransitionStart"),transitioncancel:Yi("Transition","TransitionCancel"),transitionend:Yi("Transition","TransitionEnd")},Fu={},Om={};Na&&(Om=document.createElement("div").style,"AnimationEvent"in window||(delete wr.animationend.animation,delete wr.animationiteration.animation,delete wr.animationstart.animation),"TransitionEvent"in window||delete wr.transitionend.transition);function Gi(e){if(Fu[e])return Fu[e];if(!wr[e])return e;var t=wr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Om)return Fu[e]=t[n];return e}var zm=Gi("animationend"),Pm=Gi("animationiteration"),qm=Gi("animationstart"),vv=Gi("transitionrun"),bv=Gi("transitionstart"),xv=Gi("transitioncancel"),Lm=Gi("transitionend"),Im=new Map,ju="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ju.push("scrollEnd");function ma(e,t){Im.set(e,t),Vi(t,[e])}var Es=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},na=[],Tr=0,Ru=0;function ws(){for(var e=Tr,t=Ru=Tr=0;t<e;){var n=na[t];na[t++]=null;var i=na[t];na[t++]=null;var l=na[t];na[t++]=null;var d=na[t];if(na[t++]=null,i!==null&&l!==null){var p=i.pending;p===null?l.next=l:(l.next=p.next,p.next=l),i.pending=l}d!==0&&$m(n,l,d)}}function Ts(e,t,n,i){na[Tr++]=e,na[Tr++]=t,na[Tr++]=n,na[Tr++]=i,Ru|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Mu(e,t,n,i){return Ts(e,t,n,i),ks(e)}function Ki(e,t){return Ts(e,null,null,t),ks(e)}function $m(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var l=!1,d=e.return;d!==null;)d.childLanes|=n,i=d.alternate,i!==null&&(i.childLanes|=n),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(l=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,l&&t!==null&&(l=31-Ke(n),e=d.hiddenUpdates,i=e[l],i===null?e[l]=[t]:i.push(t),t.lane=n|536870912),d):null}function ks(e){if(50<Io)throw Io=0,Ic=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var kr={};function Cv(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pn(e,t,n,i){return new Cv(e,t,n,i)}function Nu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ba(e,t){var n=e.alternate;return n===null?(n=Pn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Vm(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Fs(e,t,n,i,l,d){var p=0;if(i=e,typeof e=="function")Nu(e)&&(p=1);else if(typeof e=="string")p=wb(e,n,ue.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case z:return e=Pn(31,n,t,l),e.elementType=z,e.lanes=d,e;case B:return Qi(n.children,l,d,t);case O:p=8,l|=24;break;case k:return e=Pn(12,n,t,l|2),e.elementType=k,e.lanes=d,e;case G:return e=Pn(13,n,t,l),e.elementType=G,e.lanes=d,e;case T:return e=Pn(19,n,t,l),e.elementType=T,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case j:p=10;break e;case K:p=9;break e;case w:p=11;break e;case R:p=14;break e;case q:p=16,i=null;break e}p=29,n=Error(s(130,e===null?"null":typeof e,"")),i=null}return t=Pn(p,n,t,l),t.elementType=e,t.type=i,t.lanes=d,t}function Qi(e,t,n,i){return e=Pn(7,e,i,t),e.lanes=n,e}function Bu(e,t,n){return e=Pn(6,e,null,t),e.lanes=n,e}function Hm(e){var t=Pn(18,null,null,0);return t.stateNode=e,t}function Uu(e,t,n){return t=Pn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ym=new WeakMap;function aa(e,t){if(typeof e=="object"&&e!==null){var n=Ym.get(e);return n!==void 0?n:(t={value:e,source:t,stack:H(t)},Ym.set(e,t),t)}return{value:e,source:t,stack:H(t)}}var Fr=[],jr=0,js=null,xo=0,ia=[],ra=0,li=null,Aa=1,Ea="";function Ua(e,t){Fr[jr++]=xo,Fr[jr++]=js,js=e,xo=t}function Gm(e,t,n){ia[ra++]=Aa,ia[ra++]=Ea,ia[ra++]=li,li=e;var i=Aa;e=Ea;var l=32-Ke(i)-1;i&=~(1<<l),n+=1;var d=32-Ke(t)+l;if(30<d){var p=l-l%5;d=(i&(1<<p)-1).toString(32),i>>=p,l-=p,Aa=1<<32-Ke(t)+l|n<<l|i,Ea=d+e}else Aa=1<<d|n<<l|i,Ea=e}function Ou(e){e.return!==null&&(Ua(e,1),Gm(e,1,0))}function zu(e){for(;e===js;)js=Fr[--jr],Fr[jr]=null,xo=Fr[--jr],Fr[jr]=null;for(;e===li;)li=ia[--ra],ia[ra]=null,Ea=ia[--ra],ia[ra]=null,Aa=ia[--ra],ia[ra]=null}function Km(e,t){ia[ra++]=Aa,ia[ra++]=Ea,ia[ra++]=li,Aa=t.id,Ea=t.overflow,li=e}var cn=null,Nt=null,mt=!1,ui=null,oa=!1,Pu=Error(s(519));function ci(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(aa(t,e)),Pu}function Qm(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[st]=e,t[Rt]=i,n){case"dialog":ut("cancel",t),ut("close",t);break;case"iframe":case"object":case"embed":ut("load",t);break;case"video":case"audio":for(n=0;n<Vo.length;n++)ut(Vo[n],t);break;case"source":ut("error",t);break;case"img":case"image":case"link":ut("error",t),ut("load",t);break;case"details":ut("toggle",t);break;case"input":ut("invalid",t),lm(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":ut("invalid",t);break;case"textarea":ut("invalid",t),cm(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||fy(t.textContent,n)?(i.popover!=null&&(ut("beforetoggle",t),ut("toggle",t)),i.onScroll!=null&&ut("scroll",t),i.onScrollEnd!=null&&ut("scrollend",t),i.onClick!=null&&(t.onclick=Ma),t=!0):t=!1,t||ci(e,!0)}function Zm(e){for(cn=e.return;cn;)switch(cn.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:cn=cn.return}}function Rr(e){if(e!==cn)return!1;if(!mt)return Zm(e),mt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||ad(e.type,e.memoizedProps)),n=!n),n&&Nt&&ci(e),Zm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Nt=xy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Nt=xy(e)}else t===27?(t=Nt,_i(e.type)?(e=ld,ld=null,Nt=e):Nt=t):Nt=cn?la(e.stateNode.nextSibling):null;return!0}function Zi(){Nt=cn=null,mt=!1}function qu(){var e=ui;return e!==null&&(Fn===null?Fn=e:Fn.push.apply(Fn,e),ui=null),e}function Co(e){ui===null?ui=[e]:ui.push(e)}var Lu=Me(null),Xi=null,Oa=null;function di(e,t,n){Ae(Lu,t._currentValue),t._currentValue=n}function za(e){e._currentValue=Lu.current,Fe(Lu)}function Iu(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function $u(e,t,n,i){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var d=l.dependencies;if(d!==null){var p=l.child;d=d.firstContext;e:for(;d!==null;){var C=d;d=l;for(var Y=0;Y<t.length;Y++)if(C.context===t[Y]){d.lanes|=n,C=d.alternate,C!==null&&(C.lanes|=n),Iu(d.return,n,e),i||(p=null);break e}d=C.next}}else if(l.tag===18){if(p=l.return,p===null)throw Error(s(341));p.lanes|=n,d=p.alternate,d!==null&&(d.lanes|=n),Iu(p,n,e),p=null}else p=l.child;if(p!==null)p.return=l;else for(p=l;p!==null;){if(p===e){p=null;break}if(l=p.sibling,l!==null){l.return=p.return,p=l;break}p=p.return}l=p}}function Mr(e,t,n,i){e=null;for(var l=t,d=!1;l!==null;){if(!d){if((l.flags&524288)!==0)d=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var p=l.alternate;if(p===null)throw Error(s(387));if(p=p.memoizedProps,p!==null){var C=l.type;zn(l.pendingProps.value,p.value)||(e!==null?e.push(C):e=[C])}}else if(l===Xe.current){if(p=l.alternate,p===null)throw Error(s(387));p.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(Qo):e=[Qo])}l=l.return}e!==null&&$u(t,e,n,i),t.flags|=262144}function Rs(e){for(e=e.firstContext;e!==null;){if(!zn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wi(e){Xi=e,Oa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function dn(e){return Xm(Xi,e)}function Ms(e,t){return Xi===null&&Wi(e),Xm(e,t)}function Xm(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Oa===null){if(e===null)throw Error(s(308));Oa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Oa=Oa.next=t;return n}var Sv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},_v=a.unstable_scheduleCallback,Av=a.unstable_NormalPriority,Wt={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vu(){return{controller:new Sv,data:new Map,refCount:0}}function So(e){e.refCount--,e.refCount===0&&_v(Av,function(){e.controller.abort()})}var _o=null,Hu=0,Nr=0,Br=null;function Ev(e,t){if(_o===null){var n=_o=[];Hu=0,Nr=Kc(),Br={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Hu++,t.then(Wm,Wm),t}function Wm(){if(--Hu===0&&_o!==null){Br!==null&&(Br.status="fulfilled");var e=_o;_o=null,Nr=0,Br=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function wv(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(l){n.push(l)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var l=0;l<n.length;l++)(0,n[l])(t)},function(l){for(i.status="rejected",i.reason=l,l=0;l<n.length;l++)(0,n[l])(void 0)}),i}var Jm=P.S;P.S=function(e,t){Uh=I(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ev(e,t),Jm!==null&&Jm(e,t)};var Ji=Me(null);function Yu(){var e=Ji.current;return e!==null?e:Ft.pooledCache}function Ns(e,t){t===null?Ae(Ji,Ji.current):Ae(Ji,t.pool)}function ep(){var e=Yu();return e===null?null:{parent:Wt._currentValue,pool:e}}var Ur=Error(s(460)),Gu=Error(s(474)),Bs=Error(s(542)),Us={then:function(){}};function tp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function np(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ma,Ma),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ip(e),e;default:if(typeof t.status=="string")t.then(Ma,Ma);else{if(e=Ft,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=i}},function(i){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ip(e),e}throw tr=t,Ur}}function er(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(tr=n,Ur):n}}var tr=null;function ap(){if(tr===null)throw Error(s(459));var e=tr;return tr=null,e}function ip(e){if(e===Ur||e===Bs)throw Error(s(483))}var Or=null,Ao=0;function Os(e){var t=Ao;return Ao+=1,Or===null&&(Or=[]),np(Or,e,t)}function Eo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function zs(e,t){throw t.$$typeof===A?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function rp(e){function t(le,X){if(e){var de=le.deletions;de===null?(le.deletions=[X],le.flags|=16):de.push(X)}}function n(le,X){if(!e)return null;for(;X!==null;)t(le,X),X=X.sibling;return null}function i(le){for(var X=new Map;le!==null;)le.key!==null?X.set(le.key,le):X.set(le.index,le),le=le.sibling;return X}function l(le,X){return le=Ba(le,X),le.index=0,le.sibling=null,le}function d(le,X,de){return le.index=de,e?(de=le.alternate,de!==null?(de=de.index,de<X?(le.flags|=67108866,X):de):(le.flags|=67108866,X)):(le.flags|=1048576,X)}function p(le){return e&&le.alternate===null&&(le.flags|=67108866),le}function C(le,X,de,_e){return X===null||X.tag!==6?(X=Bu(de,le.mode,_e),X.return=le,X):(X=l(X,de),X.return=le,X)}function Y(le,X,de,_e){var Qe=de.type;return Qe===B?xe(le,X,de.props.children,_e,de.key):X!==null&&(X.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===q&&er(Qe)===X.type)?(X=l(X,de.props),Eo(X,de),X.return=le,X):(X=Fs(de.type,de.key,de.props,null,le.mode,_e),Eo(X,de),X.return=le,X)}function fe(le,X,de,_e){return X===null||X.tag!==4||X.stateNode.containerInfo!==de.containerInfo||X.stateNode.implementation!==de.implementation?(X=Uu(de,le.mode,_e),X.return=le,X):(X=l(X,de.children||[]),X.return=le,X)}function xe(le,X,de,_e,Qe){return X===null||X.tag!==7?(X=Qi(de,le.mode,_e,Qe),X.return=le,X):(X=l(X,de),X.return=le,X)}function we(le,X,de){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Bu(""+X,le.mode,de),X.return=le,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case v:return de=Fs(X.type,X.key,X.props,null,le.mode,de),Eo(de,X),de.return=le,de;case N:return X=Uu(X,le.mode,de),X.return=le,X;case q:return X=er(X),we(le,X,de)}if(me(X)||Q(X))return X=Qi(X,le.mode,de,null),X.return=le,X;if(typeof X.then=="function")return we(le,Os(X),de);if(X.$$typeof===j)return we(le,Ms(le,X),de);zs(le,X)}return null}function he(le,X,de,_e){var Qe=X!==null?X.key:null;if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return Qe!==null?null:C(le,X,""+de,_e);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case v:return de.key===Qe?Y(le,X,de,_e):null;case N:return de.key===Qe?fe(le,X,de,_e):null;case q:return de=er(de),he(le,X,de,_e)}if(me(de)||Q(de))return Qe!==null?null:xe(le,X,de,_e,null);if(typeof de.then=="function")return he(le,X,Os(de),_e);if(de.$$typeof===j)return he(le,X,Ms(le,de),_e);zs(le,de)}return null}function ye(le,X,de,_e,Qe){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return le=le.get(de)||null,C(X,le,""+_e,Qe);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case v:return le=le.get(_e.key===null?de:_e.key)||null,Y(X,le,_e,Qe);case N:return le=le.get(_e.key===null?de:_e.key)||null,fe(X,le,_e,Qe);case q:return _e=er(_e),ye(le,X,de,_e,Qe)}if(me(_e)||Q(_e))return le=le.get(de)||null,xe(X,le,_e,Qe,null);if(typeof _e.then=="function")return ye(le,X,de,Os(_e),Qe);if(_e.$$typeof===j)return ye(le,X,de,Ms(X,_e),Qe);zs(X,_e)}return null}function Le(le,X,de,_e){for(var Qe=null,yt=null,He=X,at=X=0,dt=null;He!==null&&at<de.length;at++){He.index>at?(dt=He,He=null):dt=He.sibling;var gt=he(le,He,de[at],_e);if(gt===null){He===null&&(He=dt);break}e&&He&&gt.alternate===null&&t(le,He),X=d(gt,X,at),yt===null?Qe=gt:yt.sibling=gt,yt=gt,He=dt}if(at===de.length)return n(le,He),mt&&Ua(le,at),Qe;if(He===null){for(;at<de.length;at++)He=we(le,de[at],_e),He!==null&&(X=d(He,X,at),yt===null?Qe=He:yt.sibling=He,yt=He);return mt&&Ua(le,at),Qe}for(He=i(He);at<de.length;at++)dt=ye(He,le,at,de[at],_e),dt!==null&&(e&&dt.alternate!==null&&He.delete(dt.key===null?at:dt.key),X=d(dt,X,at),yt===null?Qe=dt:yt.sibling=dt,yt=dt);return e&&He.forEach(function(ki){return t(le,ki)}),mt&&Ua(le,at),Qe}function We(le,X,de,_e){if(de==null)throw Error(s(151));for(var Qe=null,yt=null,He=X,at=X=0,dt=null,gt=de.next();He!==null&&!gt.done;at++,gt=de.next()){He.index>at?(dt=He,He=null):dt=He.sibling;var ki=he(le,He,gt.value,_e);if(ki===null){He===null&&(He=dt);break}e&&He&&ki.alternate===null&&t(le,He),X=d(ki,X,at),yt===null?Qe=ki:yt.sibling=ki,yt=ki,He=dt}if(gt.done)return n(le,He),mt&&Ua(le,at),Qe;if(He===null){for(;!gt.done;at++,gt=de.next())gt=we(le,gt.value,_e),gt!==null&&(X=d(gt,X,at),yt===null?Qe=gt:yt.sibling=gt,yt=gt);return mt&&Ua(le,at),Qe}for(He=i(He);!gt.done;at++,gt=de.next())gt=ye(He,le,at,gt.value,_e),gt!==null&&(e&&gt.alternate!==null&&He.delete(gt.key===null?at:gt.key),X=d(gt,X,at),yt===null?Qe=gt:yt.sibling=gt,yt=gt);return e&&He.forEach(function(zb){return t(le,zb)}),mt&&Ua(le,at),Qe}function wt(le,X,de,_e){if(typeof de=="object"&&de!==null&&de.type===B&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case v:e:{for(var Qe=de.key;X!==null;){if(X.key===Qe){if(Qe=de.type,Qe===B){if(X.tag===7){n(le,X.sibling),_e=l(X,de.props.children),_e.return=le,le=_e;break e}}else if(X.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===q&&er(Qe)===X.type){n(le,X.sibling),_e=l(X,de.props),Eo(_e,de),_e.return=le,le=_e;break e}n(le,X);break}else t(le,X);X=X.sibling}de.type===B?(_e=Qi(de.props.children,le.mode,_e,de.key),_e.return=le,le=_e):(_e=Fs(de.type,de.key,de.props,null,le.mode,_e),Eo(_e,de),_e.return=le,le=_e)}return p(le);case N:e:{for(Qe=de.key;X!==null;){if(X.key===Qe)if(X.tag===4&&X.stateNode.containerInfo===de.containerInfo&&X.stateNode.implementation===de.implementation){n(le,X.sibling),_e=l(X,de.children||[]),_e.return=le,le=_e;break e}else{n(le,X);break}else t(le,X);X=X.sibling}_e=Uu(de,le.mode,_e),_e.return=le,le=_e}return p(le);case q:return de=er(de),wt(le,X,de,_e)}if(me(de))return Le(le,X,de,_e);if(Q(de)){if(Qe=Q(de),typeof Qe!="function")throw Error(s(150));return de=Qe.call(de),We(le,X,de,_e)}if(typeof de.then=="function")return wt(le,X,Os(de),_e);if(de.$$typeof===j)return wt(le,X,Ms(le,de),_e);zs(le,de)}return typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint"?(de=""+de,X!==null&&X.tag===6?(n(le,X.sibling),_e=l(X,de),_e.return=le,le=_e):(n(le,X),_e=Bu(de,le.mode,_e),_e.return=le,le=_e),p(le)):n(le,X)}return function(le,X,de,_e){try{Ao=0;var Qe=wt(le,X,de,_e);return Or=null,Qe}catch(He){if(He===Ur||He===Bs)throw He;var yt=Pn(29,He,null,le.mode);return yt.lanes=_e,yt.return=le,yt}}}var nr=rp(!0),op=rp(!1),fi=!1;function Ku(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function mi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pi(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(vt&2)!==0){var l=i.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),i.pending=t,t=ks(e),$m(e,null,n),t}return Ts(e,i,t,n),ks(e)}function wo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,ke(e,n)}}function Zu(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var l=null,d=null;if(n=n.firstBaseUpdate,n!==null){do{var p={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};d===null?l=d=p:d=d.next=p,n=n.next}while(n!==null);d===null?l=d=t:d=d.next=t}else l=d=t;n={baseState:i.baseState,firstBaseUpdate:l,lastBaseUpdate:d,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xu=!1;function To(){if(Xu){var e=Br;if(e!==null)throw e}}function ko(e,t,n,i){Xu=!1;var l=e.updateQueue;fi=!1;var d=l.firstBaseUpdate,p=l.lastBaseUpdate,C=l.shared.pending;if(C!==null){l.shared.pending=null;var Y=C,fe=Y.next;Y.next=null,p===null?d=fe:p.next=fe,p=Y;var xe=e.alternate;xe!==null&&(xe=xe.updateQueue,C=xe.lastBaseUpdate,C!==p&&(C===null?xe.firstBaseUpdate=fe:C.next=fe,xe.lastBaseUpdate=Y))}if(d!==null){var we=l.baseState;p=0,xe=fe=Y=null,C=d;do{var he=C.lane&-536870913,ye=he!==C.lane;if(ye?(ct&he)===he:(i&he)===he){he!==0&&he===Nr&&(Xu=!0),xe!==null&&(xe=xe.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var Le=e,We=C;he=t;var wt=n;switch(We.tag){case 1:if(Le=We.payload,typeof Le=="function"){we=Le.call(wt,we,he);break e}we=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=We.payload,he=typeof Le=="function"?Le.call(wt,we,he):Le,he==null)break e;we=x({},we,he);break e;case 2:fi=!0}}he=C.callback,he!==null&&(e.flags|=64,ye&&(e.flags|=8192),ye=l.callbacks,ye===null?l.callbacks=[he]:ye.push(he))}else ye={lane:he,tag:C.tag,payload:C.payload,callback:C.callback,next:null},xe===null?(fe=xe=ye,Y=we):xe=xe.next=ye,p|=he;if(C=C.next,C===null){if(C=l.shared.pending,C===null)break;ye=C,C=ye.next,ye.next=null,l.lastBaseUpdate=ye,l.shared.pending=null}}while(!0);xe===null&&(Y=we),l.baseState=Y,l.firstBaseUpdate=fe,l.lastBaseUpdate=xe,d===null&&(l.shared.lanes=0),vi|=p,e.lanes=p,e.memoizedState=we}}function sp(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function lp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)sp(n[e],t)}var zr=Me(null),Ps=Me(0);function up(e,t){e=Ga,Ae(Ps,e),Ae(zr,t),Ga=e|t.baseLanes}function Wu(){Ae(Ps,Ga),Ae(zr,zr.current)}function Ju(){Ga=Ps.current,Fe(zr),Fe(Ps)}var qn=Me(null),sa=null;function hi(e){var t=e.alternate;Ae(Gt,Gt.current&1),Ae(qn,e),sa===null&&(t===null||zr.current!==null||t.memoizedState!==null)&&(sa=e)}function ec(e){Ae(Gt,Gt.current),Ae(qn,e),sa===null&&(sa=e)}function cp(e){e.tag===22?(Ae(Gt,Gt.current),Ae(qn,e),sa===null&&(sa=e)):yi()}function yi(){Ae(Gt,Gt.current),Ae(qn,qn.current)}function Ln(e){Fe(qn),sa===e&&(sa=null),Fe(Gt)}var Gt=Me(0);function qs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||od(n)||sd(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pa=0,nt=null,At=null,Jt=null,Ls=!1,Pr=!1,ar=!1,Is=0,Fo=0,qr=null,Tv=0;function $t(){throw Error(s(321))}function tc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!zn(e[n],t[n]))return!1;return!0}function nc(e,t,n,i,l,d){return Pa=d,nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Gp:gc,ar=!1,d=n(i,l),ar=!1,Pr&&(d=fp(t,n,i,l)),dp(e),d}function dp(e){P.H=Mo;var t=At!==null&&At.next!==null;if(Pa=0,Jt=At=nt=null,Ls=!1,Fo=0,qr=null,t)throw Error(s(300));e===null||en||(e=e.dependencies,e!==null&&Rs(e)&&(en=!0))}function fp(e,t,n,i){nt=e;var l=0;do{if(Pr&&(qr=null),Fo=0,Pr=!1,25<=l)throw Error(s(301));if(l+=1,Jt=At=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}P.H=Kp,d=t(n,i)}while(Pr);return d}function kv(){var e=P.H,t=e.useState()[0];return t=typeof t.then=="function"?jo(t):t,e=e.useState()[0],(At!==null?At.memoizedState:null)!==e&&(nt.flags|=1024),t}function ac(){var e=Is!==0;return Is=0,e}function ic(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function rc(e){if(Ls){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ls=!1}Pa=0,Jt=At=nt=null,Pr=!1,Fo=Is=0,qr=null}function vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jt===null?nt.memoizedState=Jt=e:Jt=Jt.next=e,Jt}function Kt(){if(At===null){var e=nt.alternate;e=e!==null?e.memoizedState:null}else e=At.next;var t=Jt===null?nt.memoizedState:Jt.next;if(t!==null)Jt=t,At=e;else{if(e===null)throw nt.alternate===null?Error(s(467)):Error(s(310));At=e,e={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},Jt===null?nt.memoizedState=Jt=e:Jt=Jt.next=e}return Jt}function $s(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(e){var t=Fo;return Fo+=1,qr===null&&(qr=[]),e=np(qr,e,t),t=nt,(Jt===null?t.memoizedState:Jt.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Gp:gc),e}function Vs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return jo(e);if(e.$$typeof===j)return dn(e)}throw Error(s(438,String(e)))}function oc(e){var t=null,n=nt.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=nt.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=$s(),nt.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=$;return t.index++,n}function qa(e,t){return typeof t=="function"?t(e):t}function Hs(e){var t=Kt();return sc(t,At,e)}function sc(e,t,n){var i=e.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=n;var l=e.baseQueue,d=i.pending;if(d!==null){if(l!==null){var p=l.next;l.next=d.next,d.next=p}t.baseQueue=l=d,i.pending=null}if(d=e.baseState,l===null)e.memoizedState=d;else{t=l.next;var C=p=null,Y=null,fe=t,xe=!1;do{var we=fe.lane&-536870913;if(we!==fe.lane?(ct&we)===we:(Pa&we)===we){var he=fe.revertLane;if(he===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),we===Nr&&(xe=!0);else if((Pa&he)===he){fe=fe.next,he===Nr&&(xe=!0);continue}else we={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},Y===null?(C=Y=we,p=d):Y=Y.next=we,nt.lanes|=he,vi|=he;we=fe.action,ar&&n(d,we),d=fe.hasEagerState?fe.eagerState:n(d,we)}else he={lane:we,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},Y===null?(C=Y=he,p=d):Y=Y.next=he,nt.lanes|=we,vi|=we;fe=fe.next}while(fe!==null&&fe!==t);if(Y===null?p=d:Y.next=C,!zn(d,e.memoizedState)&&(en=!0,xe&&(n=Br,n!==null)))throw n;e.memoizedState=d,e.baseState=p,e.baseQueue=Y,i.lastRenderedState=d}return l===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function lc(e){var t=Kt(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var i=n.dispatch,l=n.pending,d=t.memoizedState;if(l!==null){n.pending=null;var p=l=l.next;do d=e(d,p.action),p=p.next;while(p!==l);zn(d,t.memoizedState)||(en=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),n.lastRenderedState=d}return[d,i]}function mp(e,t,n){var i=nt,l=Kt(),d=mt;if(d){if(n===void 0)throw Error(s(407));n=n()}else n=t();var p=!zn((At||l).memoizedState,n);if(p&&(l.memoizedState=n,en=!0),l=l.queue,dc(yp.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Jt!==null&&Jt.memoizedState.tag&1){if(i.flags|=2048,Lr(9,{destroy:void 0},hp.bind(null,i,l,n,t),null),Ft===null)throw Error(s(349));d||(Pa&127)!==0||pp(i,t,n)}return n}function pp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=nt.updateQueue,t===null?(t=$s(),nt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hp(e,t,n,i){t.value=n,t.getSnapshot=i,gp(t)&&Dp(e)}function yp(e,t,n){return n(function(){gp(t)&&Dp(e)})}function gp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zn(e,n)}catch{return!0}}function Dp(e){var t=Ki(e,2);t!==null&&jn(t,e,2)}function uc(e){var t=vn();if(typeof e=="function"){var n=e;if(e=n(),ar){Ge(!0);try{n()}finally{Ge(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:e},t}function vp(e,t,n,i){return e.baseState=n,sc(e,At,typeof i=="function"?i:qa)}function Fv(e,t,n,i,l){if(Ks(e))throw Error(s(485));if(e=t.action,e!==null){var d={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){d.listeners.push(p)}};P.T!==null?n(!0):d.isTransition=!1,i(d),n=t.pending,n===null?(d.next=t.pending=d,bp(t,d)):(d.next=n.next,t.pending=n.next=d)}}function bp(e,t){var n=t.action,i=t.payload,l=e.state;if(t.isTransition){var d=P.T,p={};P.T=p;try{var C=n(l,i),Y=P.S;Y!==null&&Y(p,C),xp(e,t,C)}catch(fe){cc(e,t,fe)}finally{d!==null&&p.types!==null&&(d.types=p.types),P.T=d}}else try{d=n(l,i),xp(e,t,d)}catch(fe){cc(e,t,fe)}}function xp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Cp(e,t,i)},function(i){return cc(e,t,i)}):Cp(e,t,n)}function Cp(e,t,n){t.status="fulfilled",t.value=n,Sp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,bp(e,n)))}function cc(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,Sp(t),t=t.next;while(t!==i)}e.action=null}function Sp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function _p(e,t){return t}function Ap(e,t){if(mt){var n=Ft.formState;if(n!==null){e:{var i=nt;if(mt){if(Nt){t:{for(var l=Nt,d=oa;l.nodeType!==8;){if(!d){l=null;break t}if(l=la(l.nextSibling),l===null){l=null;break t}}d=l.data,l=d==="F!"||d==="F"?l:null}if(l){Nt=la(l.nextSibling),i=l.data==="F!";break e}}ci(i)}i=!1}i&&(t=n[0])}}return n=vn(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_p,lastRenderedState:t},n.queue=i,n=Vp.bind(null,nt,i),i.dispatch=n,i=uc(!1),d=yc.bind(null,nt,!1,i.queue),i=vn(),l={state:t,dispatch:null,action:e,pending:null},i.queue=l,n=Fv.bind(null,nt,l,d,n),l.dispatch=n,i.memoizedState=e,[t,n,!1]}function Ep(e){var t=Kt();return wp(t,At,e)}function wp(e,t,n){if(t=sc(e,t,_p)[0],e=Hs(qa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=jo(t)}catch(p){throw p===Ur?Bs:p}else i=t;t=Kt();var l=t.queue,d=l.dispatch;return n!==t.memoizedState&&(nt.flags|=2048,Lr(9,{destroy:void 0},jv.bind(null,l,n),null)),[i,d,e]}function jv(e,t){e.action=t}function Tp(e){var t=Kt(),n=At;if(n!==null)return wp(t,n,e);Kt(),t=t.memoizedState,n=Kt();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function Lr(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=nt.updateQueue,t===null&&(t=$s(),nt.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function kp(){return Kt().memoizedState}function Ys(e,t,n,i){var l=vn();nt.flags|=e,l.memoizedState=Lr(1|t,{destroy:void 0},n,i===void 0?null:i)}function Gs(e,t,n,i){var l=Kt();i=i===void 0?null:i;var d=l.memoizedState.inst;At!==null&&i!==null&&tc(i,At.memoizedState.deps)?l.memoizedState=Lr(t,d,n,i):(nt.flags|=e,l.memoizedState=Lr(1|t,d,n,i))}function Fp(e,t){Ys(8390656,8,e,t)}function dc(e,t){Gs(2048,8,e,t)}function Rv(e){nt.flags|=4;var t=nt.updateQueue;if(t===null)t=$s(),nt.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function jp(e){var t=Kt().memoizedState;return Rv({ref:t,nextImpl:e}),function(){if((vt&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function Rp(e,t){return Gs(4,2,e,t)}function Mp(e,t){return Gs(4,4,e,t)}function Np(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Bp(e,t,n){n=n!=null?n.concat([e]):null,Gs(4,4,Np.bind(null,t,e),n)}function fc(){}function Up(e,t){var n=Kt();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&tc(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Op(e,t){var n=Kt();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&tc(t,i[1]))return i[0];if(i=e(),ar){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[i,t],i}function mc(e,t,n){return n===void 0||(Pa&1073741824)!==0&&(ct&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=zh(),nt.lanes|=e,vi|=e,n)}function zp(e,t,n,i){return zn(n,t)?n:zr.current!==null?(e=mc(e,n,i),zn(e,t)||(en=!0),e):(Pa&42)===0||(Pa&1073741824)!==0&&(ct&261930)===0?(en=!0,e.memoizedState=n):(e=zh(),nt.lanes|=e,vi|=e,t)}function Pp(e,t,n,i,l){var d=D.p;D.p=d!==0&&8>d?d:8;var p=P.T,C={};P.T=C,yc(e,!1,t,n);try{var Y=l(),fe=P.S;if(fe!==null&&fe(C,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var xe=wv(Y,i);Ro(e,t,xe,Vn(e))}else Ro(e,t,i,Vn(e))}catch(we){Ro(e,t,{then:function(){},status:"rejected",reason:we},Vn())}finally{D.p=d,p!==null&&C.types!==null&&(p.types=C.types),P.T=p}}function Mv(){}function pc(e,t,n,i){if(e.tag!==5)throw Error(s(476));var l=qp(e).queue;Pp(e,l,t,F,n===null?Mv:function(){return Lp(e),n(i)})}function qp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Lp(e){var t=qp(e);t.next===null&&(t=e.alternate.memoizedState),Ro(e,t.next.queue,{},Vn())}function hc(){return dn(Qo)}function Ip(){return Kt().memoizedState}function $p(){return Kt().memoizedState}function Nv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Vn();e=mi(n);var i=pi(t,e,n);i!==null&&(jn(i,t,n),wo(i,t,n)),t={cache:Vu()},e.payload=t;return}t=t.return}}function Bv(e,t,n){var i=Vn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ks(e)?Hp(t,n):(n=Mu(e,t,n,i),n!==null&&(jn(n,e,i),Yp(n,t,i)))}function Vp(e,t,n){var i=Vn();Ro(e,t,n,i)}function Ro(e,t,n,i){var l={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ks(e))Hp(t,l);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var p=t.lastRenderedState,C=d(p,n);if(l.hasEagerState=!0,l.eagerState=C,zn(C,p))return Ts(e,t,l,0),Ft===null&&ws(),!1}catch{}if(n=Mu(e,t,l,i),n!==null)return jn(n,e,i),Yp(n,t,i),!0}return!1}function yc(e,t,n,i){if(i={lane:2,revertLane:Kc(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ks(e)){if(t)throw Error(s(479))}else t=Mu(e,n,i,2),t!==null&&jn(t,e,2)}function Ks(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function Hp(e,t){Pr=Ls=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yp(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,ke(e,n)}}var Mo={readContext:dn,use:Vs,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};Mo.useEffectEvent=$t;var Gp={readContext:dn,use:Vs,useCallback:function(e,t){return vn().memoizedState=[e,t===void 0?null:t],e},useContext:dn,useEffect:Fp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ys(4194308,4,Np.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ys(4194308,4,e,t)},useInsertionEffect:function(e,t){Ys(4,2,e,t)},useMemo:function(e,t){var n=vn();t=t===void 0?null:t;var i=e();if(ar){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=vn();if(n!==void 0){var l=n(t);if(ar){Ge(!0);try{n(t)}finally{Ge(!1)}}}else l=t;return i.memoizedState=i.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},i.queue=e,e=e.dispatch=Bv.bind(null,nt,e),[i.memoizedState,e]},useRef:function(e){var t=vn();return e={current:e},t.memoizedState=e},useState:function(e){e=uc(e);var t=e.queue,n=Vp.bind(null,nt,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:fc,useDeferredValue:function(e,t){var n=vn();return mc(n,e,t)},useTransition:function(){var e=uc(!1);return e=Pp.bind(null,nt,e.queue,!0,!1),vn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=nt,l=vn();if(mt){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),Ft===null)throw Error(s(349));(ct&127)!==0||pp(i,t,n)}l.memoizedState=n;var d={value:n,getSnapshot:t};return l.queue=d,Fp(yp.bind(null,i,d,e),[e]),i.flags|=2048,Lr(9,{destroy:void 0},hp.bind(null,i,d,n,t),null),n},useId:function(){var e=vn(),t=Ft.identifierPrefix;if(mt){var n=Ea,i=Aa;n=(i&~(1<<32-Ke(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Is++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Tv++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:hc,useFormState:Ap,useActionState:Ap,useOptimistic:function(e){var t=vn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=yc.bind(null,nt,!0,n),n.dispatch=t,[e,t]},useMemoCache:oc,useCacheRefresh:function(){return vn().memoizedState=Nv.bind(null,nt)},useEffectEvent:function(e){var t=vn(),n={impl:e};return t.memoizedState=n,function(){if((vt&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},gc={readContext:dn,use:Vs,useCallback:Up,useContext:dn,useEffect:dc,useImperativeHandle:Bp,useInsertionEffect:Rp,useLayoutEffect:Mp,useMemo:Op,useReducer:Hs,useRef:kp,useState:function(){return Hs(qa)},useDebugValue:fc,useDeferredValue:function(e,t){var n=Kt();return zp(n,At.memoizedState,e,t)},useTransition:function(){var e=Hs(qa)[0],t=Kt().memoizedState;return[typeof e=="boolean"?e:jo(e),t]},useSyncExternalStore:mp,useId:Ip,useHostTransitionStatus:hc,useFormState:Ep,useActionState:Ep,useOptimistic:function(e,t){var n=Kt();return vp(n,At,e,t)},useMemoCache:oc,useCacheRefresh:$p};gc.useEffectEvent=jp;var Kp={readContext:dn,use:Vs,useCallback:Up,useContext:dn,useEffect:dc,useImperativeHandle:Bp,useInsertionEffect:Rp,useLayoutEffect:Mp,useMemo:Op,useReducer:lc,useRef:kp,useState:function(){return lc(qa)},useDebugValue:fc,useDeferredValue:function(e,t){var n=Kt();return At===null?mc(n,e,t):zp(n,At.memoizedState,e,t)},useTransition:function(){var e=lc(qa)[0],t=Kt().memoizedState;return[typeof e=="boolean"?e:jo(e),t]},useSyncExternalStore:mp,useId:Ip,useHostTransitionStatus:hc,useFormState:Tp,useActionState:Tp,useOptimistic:function(e,t){var n=Kt();return At!==null?vp(n,At,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:oc,useCacheRefresh:$p};Kp.useEffectEvent=jp;function Dc(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:x({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vc={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=Vn(),l=mi(i);l.payload=t,n!=null&&(l.callback=n),t=pi(e,l,i),t!==null&&(jn(t,e,i),wo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=Vn(),l=mi(i);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=pi(e,l,i),t!==null&&(jn(t,e,i),wo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vn(),i=mi(n);i.tag=2,t!=null&&(i.callback=t),t=pi(e,i,n),t!==null&&(jn(t,e,n),wo(t,e,n))}};function Qp(e,t,n,i,l,d,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,d,p):t.prototype&&t.prototype.isPureReactComponent?!vo(n,i)||!vo(l,d):!0}function Zp(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&vc.enqueueReplaceState(t,t.state,null)}function ir(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=x({},n));for(var l in e)n[l]===void 0&&(n[l]=e[l])}return n}function Xp(e){Es(e)}function Wp(e){console.error(e)}function Jp(e){Es(e)}function Qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function eh(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function bc(e,t,n){return n=mi(n),n.tag=3,n.payload={element:null},n.callback=function(){Qs(e,t)},n}function th(e){return e=mi(e),e.tag=3,e}function nh(e,t,n,i){var l=n.type.getDerivedStateFromError;if(typeof l=="function"){var d=i.value;e.payload=function(){return l(d)},e.callback=function(){eh(t,n,i)}}var p=n.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){eh(t,n,i),typeof l!="function"&&(bi===null?bi=new Set([this]):bi.add(this));var C=i.stack;this.componentDidCatch(i.value,{componentStack:C!==null?C:""})})}function Uv(e,t,n,i,l){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&Mr(t,n,l,!0),n=qn.current,n!==null){switch(n.tag){case 31:case 13:return sa===null?sl():n.alternate===null&&Vt===0&&(Vt=3),n.flags&=-257,n.flags|=65536,n.lanes=l,i===Us?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),Hc(e,i,l)),!1;case 22:return n.flags|=65536,i===Us?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),Hc(e,i,l)),!1}throw Error(s(435,n.tag))}return Hc(e,i,l),sl(),!1}if(mt)return t=qn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,i!==Pu&&(e=Error(s(422),{cause:i}),Co(aa(e,n)))):(i!==Pu&&(t=Error(s(423),{cause:i}),Co(aa(t,n))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,i=aa(i,n),l=bc(e.stateNode,i,l),Zu(e,l),Vt!==4&&(Vt=2)),!1;var d=Error(s(520),{cause:i});if(d=aa(d,n),Lo===null?Lo=[d]:Lo.push(d),Vt!==4&&(Vt=2),t===null)return!0;i=aa(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=l&-l,n.lanes|=e,e=bc(n.stateNode,i,e),Zu(n,e),!1;case 1:if(t=n.type,d=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(bi===null||!bi.has(d))))return n.flags|=65536,l&=-l,n.lanes|=l,l=th(l),nh(l,e,n,i),Zu(n,l),!1}n=n.return}while(n!==null);return!1}var xc=Error(s(461)),en=!1;function fn(e,t,n,i){t.child=e===null?op(t,null,n,i):nr(t,e.child,n,i)}function ah(e,t,n,i,l){n=n.render;var d=t.ref;if("ref"in i){var p={};for(var C in i)C!=="ref"&&(p[C]=i[C])}else p=i;return Wi(t),i=nc(e,t,n,p,d,l),C=ac(),e!==null&&!en?(ic(e,t,l),La(e,t,l)):(mt&&C&&Ou(t),t.flags|=1,fn(e,t,i,l),t.child)}function ih(e,t,n,i,l){if(e===null){var d=n.type;return typeof d=="function"&&!Nu(d)&&d.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=d,rh(e,t,d,i,l)):(e=Fs(n.type,null,i,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!kc(e,l)){var p=d.memoizedProps;if(n=n.compare,n=n!==null?n:vo,n(p,i)&&e.ref===t.ref)return La(e,t,l)}return t.flags|=1,e=Ba(d,i),e.ref=t.ref,e.return=t,t.child=e}function rh(e,t,n,i,l){if(e!==null){var d=e.memoizedProps;if(vo(d,i)&&e.ref===t.ref)if(en=!1,t.pendingProps=i=d,kc(e,l))(e.flags&131072)!==0&&(en=!0);else return t.lanes=e.lanes,La(e,t,l)}return Cc(e,t,n,i,l)}function oh(e,t,n,i){var l=i.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|n:n,e!==null){for(i=t.child=e.child,l=0;i!==null;)l=l|i.lanes|i.childLanes,i=i.sibling;i=l&~d}else i=0,t.child=null;return sh(e,t,d,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ns(t,d!==null?d.cachePool:null),d!==null?up(t,d):Wu(),cp(t);else return i=t.lanes=536870912,sh(e,t,d!==null?d.baseLanes|n:n,n,i)}else d!==null?(Ns(t,d.cachePool),up(t,d),yi(),t.memoizedState=null):(e!==null&&Ns(t,null),Wu(),yi());return fn(e,t,l,n),t.child}function No(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sh(e,t,n,i,l){var d=Yu();return d=d===null?null:{parent:Wt._currentValue,pool:d},t.memoizedState={baseLanes:n,cachePool:d},e!==null&&Ns(t,null),Wu(),cp(t),e!==null&&Mr(e,t,i,!0),t.childLanes=l,null}function Zs(e,t){return t=Ws({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lh(e,t,n){return nr(t,e.child,null,n),e=Zs(t,t.pendingProps),e.flags|=2,Ln(t),t.memoizedState=null,e}function Ov(e,t,n){var i=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(mt){if(i.mode==="hidden")return e=Zs(t,i),t.lanes=536870912,No(null,e);if(ec(t),(e=Nt)?(e=by(e,oa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:li!==null?{id:Aa,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},n=Hm(e),n.return=t,t.child=n,cn=t,Nt=null)):e=null,e===null)throw ci(t);return t.lanes=536870912,null}return Zs(t,i)}var d=e.memoizedState;if(d!==null){var p=d.dehydrated;if(ec(t),l)if(t.flags&256)t.flags&=-257,t=lh(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(en||Mr(e,t,n,!1),l=(n&e.childLanes)!==0,en||l){if(i=Ft,i!==null&&(p=Re(i,n),p!==0&&p!==d.retryLane))throw d.retryLane=p,Ki(e,p),jn(i,e,p),xc;sl(),t=lh(e,t,n)}else e=d.treeContext,Nt=la(p.nextSibling),cn=t,mt=!0,ui=null,oa=!1,e!==null&&Km(t,e),t=Zs(t,i),t.flags|=4096;return t}return e=Ba(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Xs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(s(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Cc(e,t,n,i,l){return Wi(t),n=nc(e,t,n,i,void 0,l),i=ac(),e!==null&&!en?(ic(e,t,l),La(e,t,l)):(mt&&i&&Ou(t),t.flags|=1,fn(e,t,n,l),t.child)}function uh(e,t,n,i,l,d){return Wi(t),t.updateQueue=null,n=fp(t,i,n,l),dp(e),i=ac(),e!==null&&!en?(ic(e,t,d),La(e,t,d)):(mt&&i&&Ou(t),t.flags|=1,fn(e,t,n,d),t.child)}function ch(e,t,n,i,l){if(Wi(t),t.stateNode===null){var d=kr,p=n.contextType;typeof p=="object"&&p!==null&&(d=dn(p)),d=new n(i,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=vc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=i,d.state=t.memoizedState,d.refs={},Ku(t),p=n.contextType,d.context=typeof p=="object"&&p!==null?dn(p):kr,d.state=t.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(Dc(t,n,p,i),d.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(p=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),p!==d.state&&vc.enqueueReplaceState(d,d.state,null),ko(t,i,d,l),To(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){d=t.stateNode;var C=t.memoizedProps,Y=ir(n,C);d.props=Y;var fe=d.context,xe=n.contextType;p=kr,typeof xe=="object"&&xe!==null&&(p=dn(xe));var we=n.getDerivedStateFromProps;xe=typeof we=="function"||typeof d.getSnapshotBeforeUpdate=="function",C=t.pendingProps!==C,xe||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(C||fe!==p)&&Zp(t,d,i,p),fi=!1;var he=t.memoizedState;d.state=he,ko(t,i,d,l),To(),fe=t.memoizedState,C||he!==fe||fi?(typeof we=="function"&&(Dc(t,n,we,i),fe=t.memoizedState),(Y=fi||Qp(t,n,Y,i,he,fe,p))?(xe||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=fe),d.props=i,d.state=fe,d.context=p,i=Y):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{d=t.stateNode,Qu(e,t),p=t.memoizedProps,xe=ir(n,p),d.props=xe,we=t.pendingProps,he=d.context,fe=n.contextType,Y=kr,typeof fe=="object"&&fe!==null&&(Y=dn(fe)),C=n.getDerivedStateFromProps,(fe=typeof C=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(p!==we||he!==Y)&&Zp(t,d,i,Y),fi=!1,he=t.memoizedState,d.state=he,ko(t,i,d,l),To();var ye=t.memoizedState;p!==we||he!==ye||fi||e!==null&&e.dependencies!==null&&Rs(e.dependencies)?(typeof C=="function"&&(Dc(t,n,C,i),ye=t.memoizedState),(xe=fi||Qp(t,n,xe,i,he,ye,Y)||e!==null&&e.dependencies!==null&&Rs(e.dependencies))?(fe||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(i,ye,Y),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(i,ye,Y)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||p===e.memoizedProps&&he===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&he===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ye),d.props=i,d.state=ye,d.context=Y,i=xe):(typeof d.componentDidUpdate!="function"||p===e.memoizedProps&&he===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&he===e.memoizedState||(t.flags|=1024),i=!1)}return d=i,Xs(e,t),i=(t.flags&128)!==0,d||i?(d=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&i?(t.child=nr(t,e.child,null,l),t.child=nr(t,null,n,l)):fn(e,t,n,l),t.memoizedState=d.state,e=t.child):e=La(e,t,l),e}function dh(e,t,n,i){return Zi(),t.flags|=256,fn(e,t,n,i),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:ep()}}function Ac(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=$n),e}function fh(e,t,n){var i=t.pendingProps,l=!1,d=(t.flags&128)!==0,p;if((p=d)||(p=e!==null&&e.memoizedState===null?!1:(Gt.current&2)!==0),p&&(l=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(mt){if(l?hi(t):yi(),(e=Nt)?(e=by(e,oa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:li!==null?{id:Aa,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},n=Hm(e),n.return=t,t.child=n,cn=t,Nt=null)):e=null,e===null)throw ci(t);return sd(e)?t.lanes=32:t.lanes=536870912,null}var C=i.children;return i=i.fallback,l?(yi(),l=t.mode,C=Ws({mode:"hidden",children:C},l),i=Qi(i,l,n,null),C.return=t,i.return=t,C.sibling=i,t.child=C,i=t.child,i.memoizedState=_c(n),i.childLanes=Ac(e,p,n),t.memoizedState=Sc,No(null,i)):(hi(t),Ec(t,C))}var Y=e.memoizedState;if(Y!==null&&(C=Y.dehydrated,C!==null)){if(d)t.flags&256?(hi(t),t.flags&=-257,t=wc(e,t,n)):t.memoizedState!==null?(yi(),t.child=e.child,t.flags|=128,t=null):(yi(),C=i.fallback,l=t.mode,i=Ws({mode:"visible",children:i.children},l),C=Qi(C,l,n,null),C.flags|=2,i.return=t,C.return=t,i.sibling=C,t.child=i,nr(t,e.child,null,n),i=t.child,i.memoizedState=_c(n),i.childLanes=Ac(e,p,n),t.memoizedState=Sc,t=No(null,i));else if(hi(t),sd(C)){if(p=C.nextSibling&&C.nextSibling.dataset,p)var fe=p.dgst;p=fe,i=Error(s(419)),i.stack="",i.digest=p,Co({value:i,source:null,stack:null}),t=wc(e,t,n)}else if(en||Mr(e,t,n,!1),p=(n&e.childLanes)!==0,en||p){if(p=Ft,p!==null&&(i=Re(p,n),i!==0&&i!==Y.retryLane))throw Y.retryLane=i,Ki(e,i),jn(p,e,i),xc;od(C)||sl(),t=wc(e,t,n)}else od(C)?(t.flags|=192,t.child=e.child,t=null):(e=Y.treeContext,Nt=la(C.nextSibling),cn=t,mt=!0,ui=null,oa=!1,e!==null&&Km(t,e),t=Ec(t,i.children),t.flags|=4096);return t}return l?(yi(),C=i.fallback,l=t.mode,Y=e.child,fe=Y.sibling,i=Ba(Y,{mode:"hidden",children:i.children}),i.subtreeFlags=Y.subtreeFlags&65011712,fe!==null?C=Ba(fe,C):(C=Qi(C,l,n,null),C.flags|=2),C.return=t,i.return=t,i.sibling=C,t.child=i,No(null,i),i=t.child,C=e.child.memoizedState,C===null?C=_c(n):(l=C.cachePool,l!==null?(Y=Wt._currentValue,l=l.parent!==Y?{parent:Y,pool:Y}:l):l=ep(),C={baseLanes:C.baseLanes|n,cachePool:l}),i.memoizedState=C,i.childLanes=Ac(e,p,n),t.memoizedState=Sc,No(e.child,i)):(hi(t),n=e.child,e=n.sibling,n=Ba(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=n,t.memoizedState=null,n)}function Ec(e,t){return t=Ws({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ws(e,t){return e=Pn(22,e,null,t),e.lanes=0,e}function wc(e,t,n){return nr(t,e.child,null,n),e=Ec(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mh(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Iu(e.return,t,n)}function Tc(e,t,n,i,l,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:l,treeForkCount:d}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=n,p.tailMode=l,p.treeForkCount=d)}function ph(e,t,n){var i=t.pendingProps,l=i.revealOrder,d=i.tail;i=i.children;var p=Gt.current,C=(p&2)!==0;if(C?(p=p&1|2,t.flags|=128):p&=1,Ae(Gt,p),fn(e,t,i,n),i=mt?xo:0,!C&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mh(e,n,t);else if(e.tag===19)mh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&qs(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Tc(t,!1,l,n,d,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&qs(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Tc(t,!0,n,null,d,i);break;case"together":Tc(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function La(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vi|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Mr(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=Ba(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ba(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Rs(e)))}function zv(e,t,n){switch(t.tag){case 3:Ze(t,t.stateNode.containerInfo),di(t,Wt,e.memoizedState.cache),Zi();break;case 27:case 5:b(t);break;case 4:Ze(t,t.stateNode.containerInfo);break;case 10:di(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ec(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(hi(t),t.flags|=128,null):(n&t.child.childLanes)!==0?fh(e,t,n):(hi(t),e=La(e,t,n),e!==null?e.sibling:null);hi(t);break;case 19:var l=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(Mr(e,t,n,!1),i=(n&t.childLanes)!==0),l){if(i)return ph(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Ae(Gt,Gt.current),i)break;return null;case 22:return t.lanes=0,oh(e,t,n,t.pendingProps);case 24:di(t,Wt,e.memoizedState.cache)}return La(e,t,n)}function hh(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)en=!0;else{if(!kc(e,n)&&(t.flags&128)===0)return en=!1,zv(e,t,n);en=(e.flags&131072)!==0}else en=!1,mt&&(t.flags&1048576)!==0&&Gm(t,xo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=er(t.elementType),t.type=e,typeof e=="function")Nu(e)?(i=ir(e,i),t.tag=1,t=ch(null,t,e,i,n)):(t.tag=0,t=Cc(null,t,e,i,n));else{if(e!=null){var l=e.$$typeof;if(l===w){t.tag=11,t=ah(null,t,e,i,n);break e}else if(l===R){t.tag=14,t=ih(null,t,e,i,n);break e}}throw t=ne(e)||e,Error(s(306,t,""))}}return t;case 0:return Cc(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,l=ir(i,t.pendingProps),ch(e,t,i,l,n);case 3:e:{if(Ze(t,t.stateNode.containerInfo),e===null)throw Error(s(387));i=t.pendingProps;var d=t.memoizedState;l=d.element,Qu(e,t),ko(t,i,null,n);var p=t.memoizedState;if(i=p.cache,di(t,Wt,i),i!==d.cache&&$u(t,[Wt],n,!0),To(),i=p.element,d.isDehydrated)if(d={element:i,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=dh(e,t,i,n);break e}else if(i!==l){l=aa(Error(s(424)),t),Co(l),t=dh(e,t,i,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Nt=la(e.firstChild),cn=t,mt=!0,ui=null,oa=!0,n=op(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Zi(),i===l){t=La(e,t,n);break e}fn(e,t,i,n)}t=t.child}return t;case 26:return Xs(e,t),e===null?(n=Ey(t.type,null,t.pendingProps,null))?t.memoizedState=n:mt||(n=t.type,e=t.pendingProps,i=pl(Pe.current).createElement(n),i[st]=t,i[Rt]=e,mn(i,n,e),on(i),t.stateNode=i):t.memoizedState=Ey(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return b(t),e===null&&mt&&(i=t.stateNode=Sy(t.type,t.pendingProps,Pe.current),cn=t,oa=!0,l=Nt,_i(t.type)?(ld=l,Nt=la(i.firstChild)):Nt=l),fn(e,t,t.pendingProps.children,n),Xs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&mt&&((l=i=Nt)&&(i=pb(i,t.type,t.pendingProps,oa),i!==null?(t.stateNode=i,cn=t,Nt=la(i.firstChild),oa=!1,l=!0):l=!1),l||ci(t)),b(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,i=d.children,ad(l,d)?i=null:p!==null&&ad(l,p)&&(t.flags|=32),t.memoizedState!==null&&(l=nc(e,t,kv,null,null,n),Qo._currentValue=l),Xs(e,t),fn(e,t,i,n),t.child;case 6:return e===null&&mt&&((e=n=Nt)&&(n=hb(n,t.pendingProps,oa),n!==null?(t.stateNode=n,cn=t,Nt=null,e=!0):e=!1),e||ci(t)),null;case 13:return fh(e,t,n);case 4:return Ze(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=nr(t,null,i,n):fn(e,t,i,n),t.child;case 11:return ah(e,t,t.type,t.pendingProps,n);case 7:return fn(e,t,t.pendingProps,n),t.child;case 8:return fn(e,t,t.pendingProps.children,n),t.child;case 12:return fn(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,di(t,t.type,i.value),fn(e,t,i.children,n),t.child;case 9:return l=t.type._context,i=t.pendingProps.children,Wi(t),l=dn(l),i=i(l),t.flags|=1,fn(e,t,i,n),t.child;case 14:return ih(e,t,t.type,t.pendingProps,n);case 15:return rh(e,t,t.type,t.pendingProps,n);case 19:return ph(e,t,n);case 31:return Ov(e,t,n);case 22:return oh(e,t,n,t.pendingProps);case 24:return Wi(t),i=dn(Wt),e===null?(l=Yu(),l===null&&(l=Ft,d=Vu(),l.pooledCache=d,d.refCount++,d!==null&&(l.pooledCacheLanes|=n),l=d),t.memoizedState={parent:i,cache:l},Ku(t),di(t,Wt,l)):((e.lanes&n)!==0&&(Qu(e,t),ko(t,null,null,n),To()),l=e.memoizedState,d=t.memoizedState,l.parent!==i?(l={parent:i,cache:i},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),di(t,Wt,i)):(i=d.cache,di(t,Wt,i),i!==l.cache&&$u(t,[Wt],n,!0))),fn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function Ia(e){e.flags|=4}function Fc(e,t,n,i,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(Ih())e.flags|=8192;else throw tr=Us,Gu}else e.flags&=-16777217}function yh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!jy(t))if(Ih())e.flags|=8192;else throw tr=Us,Gu}function Js(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Xn():536870912,e.lanes|=t,Hr|=t)}function Bo(e,t){if(!mt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Bt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,i|=l.subtreeFlags&65011712,i|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,i|=l.subtreeFlags,i|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function Pv(e,t,n){var i=t.pendingProps;switch(zu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bt(t),null;case 1:return Bt(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),za(Wt),Ue(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Rr(t)?Ia(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,qu())),Bt(t),null;case 26:var l=t.type,d=t.memoizedState;return e===null?(Ia(t),d!==null?(Bt(t),yh(t,d)):(Bt(t),Fc(t,l,null,i,n))):d?d!==e.memoizedState?(Ia(t),Bt(t),yh(t,d)):(Bt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Ia(t),Bt(t),Fc(t,l,e,i,n)),null;case 27:if(E(t),n=Pe.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Ia(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Bt(t),null}e=ue.current,Rr(t)?Qm(t):(e=Sy(l,i,n),t.stateNode=e,Ia(t))}return Bt(t),null;case 5:if(E(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Ia(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Bt(t),null}if(d=ue.current,Rr(t))Qm(t);else{var p=pl(Pe.current);switch(d){case 1:d=p.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:d=p.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":d=p.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":d=p.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":d=p.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof i.is=="string"?p.createElement("select",{is:i.is}):p.createElement("select"),i.multiple?d.multiple=!0:i.size&&(d.size=i.size);break;default:d=typeof i.is=="string"?p.createElement(l,{is:i.is}):p.createElement(l)}}d[st]=t,d[Rt]=i;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)d.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=d;e:switch(mn(d,l,i),l){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ia(t)}}return Bt(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Ia(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(e=Pe.current,Rr(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,l=cn,l!==null)switch(l.tag){case 27:case 5:i=l.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||fy(e.nodeValue,n)),e||ci(t,!0)}else e=pl(e).createTextNode(i),e[st]=t,t.stateNode=e}return Bt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Rr(t),n!==null){if(e===null){if(!i)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[st]=t}else Zi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Bt(t),e=!1}else n=qu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ln(t),t):(Ln(t),null);if((t.flags&128)!==0)throw Error(s(558))}return Bt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Rr(t),i!==null&&i.dehydrated!==null){if(e===null){if(!l)throw Error(s(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(s(317));l[st]=t}else Zi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Bt(t),l=!1}else l=qu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(Ln(t),t):(Ln(t),null)}return Ln(t),(t.flags&128)!==0?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,l=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(l=i.alternate.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Js(t,t.updateQueue),Bt(t),null);case 4:return Ue(),e===null&&Wc(t.stateNode.containerInfo),Bt(t),null;case 10:return za(t.type),Bt(t),null;case 19:if(Fe(Gt),i=t.memoizedState,i===null)return Bt(t),null;if(l=(t.flags&128)!==0,d=i.rendering,d===null)if(l)Bo(i,!1);else{if(Vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=qs(e),d!==null){for(t.flags|=128,Bo(i,!1),e=d.updateQueue,t.updateQueue=e,Js(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Vm(n,e),n=n.sibling;return Ae(Gt,Gt.current&1|2),mt&&Ua(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&I()>il&&(t.flags|=128,l=!0,Bo(i,!1),t.lanes=4194304)}else{if(!l)if(e=qs(d),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Js(t,e),Bo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!d.alternate&&!mt)return Bt(t),null}else 2*I()-i.renderingStartTime>il&&n!==536870912&&(t.flags|=128,l=!0,Bo(i,!1),t.lanes=4194304);i.isBackwards?(d.sibling=t.child,t.child=d):(e=i.last,e!==null?e.sibling=d:t.child=d,i.last=d)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=I(),e.sibling=null,n=Gt.current,Ae(Gt,l?n&1|2:n&1),mt&&Ua(t,i.treeForkCount),e):(Bt(t),null);case 22:case 23:return Ln(t),Ju(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(n&536870912)!==0&&(t.flags&128)===0&&(Bt(t),t.subtreeFlags&6&&(t.flags|=8192)):Bt(t),n=t.updateQueue,n!==null&&Js(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Fe(Ji),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),za(Wt),Bt(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function qv(e,t){switch(zu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return za(Wt),Ue(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return E(t),null;case 31:if(t.memoizedState!==null){if(Ln(t),t.alternate===null)throw Error(s(340));Zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ln(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fe(Gt),null;case 4:return Ue(),null;case 10:return za(t.type),null;case 22:case 23:return Ln(t),Ju(),e!==null&&Fe(Ji),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return za(Wt),null;case 25:return null;default:return null}}function gh(e,t){switch(zu(t),t.tag){case 3:za(Wt),Ue();break;case 26:case 27:case 5:E(t);break;case 4:Ue();break;case 31:t.memoizedState!==null&&Ln(t);break;case 13:Ln(t);break;case 19:Fe(Gt);break;case 10:za(t.type);break;case 22:case 23:Ln(t),Ju(),e!==null&&Fe(Ji);break;case 24:za(Wt)}}function Uo(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var l=i.next;n=l;do{if((n.tag&e)===e){i=void 0;var d=n.create,p=n.inst;i=d(),p.destroy=i}n=n.next}while(n!==l)}}catch(C){St(t,t.return,C)}}function gi(e,t,n){try{var i=t.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var d=l.next;i=d;do{if((i.tag&e)===e){var p=i.inst,C=p.destroy;if(C!==void 0){p.destroy=void 0,l=t;var Y=n,fe=C;try{fe()}catch(xe){St(l,Y,xe)}}}i=i.next}while(i!==d)}}catch(xe){St(t,t.return,xe)}}function Dh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{lp(t,n)}catch(i){St(e,e.return,i)}}}function vh(e,t,n){n.props=ir(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){St(e,t,i)}}function Oo(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(l){St(e,t,l)}}function wa(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(l){St(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(l){St(e,t,l)}else n.current=null}function bh(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(l){St(e,e.return,l)}}function jc(e,t,n){try{var i=e.stateNode;lb(i,e.type,n,t),i[Rt]=t}catch(l){St(e,e.return,l)}}function xh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&_i(e.type)||e.tag===4}function Rc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&_i(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mc(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ma));else if(i!==4&&(i===27&&_i(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Mc(e,t,n),e=e.sibling;e!==null;)Mc(e,t,n),e=e.sibling}function el(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&_i(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function Ch(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);mn(t,i,n),t[st]=e,t[Rt]=n}catch(d){St(e,e.return,d)}}var $a=!1,tn=!1,Nc=!1,Sh=typeof WeakSet=="function"?WeakSet:Set,sn=null;function Lv(e,t){if(e=e.containerInfo,td=xl,e=Bm(e),wu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var l=i.anchorOffset,d=i.focusNode;i=i.focusOffset;try{n.nodeType,d.nodeType}catch{n=null;break e}var p=0,C=-1,Y=-1,fe=0,xe=0,we=e,he=null;t:for(;;){for(var ye;we!==n||l!==0&&we.nodeType!==3||(C=p+l),we!==d||i!==0&&we.nodeType!==3||(Y=p+i),we.nodeType===3&&(p+=we.nodeValue.length),(ye=we.firstChild)!==null;)he=we,we=ye;for(;;){if(we===e)break t;if(he===n&&++fe===l&&(C=p),he===d&&++xe===i&&(Y=p),(ye=we.nextSibling)!==null)break;we=he,he=we.parentNode}we=ye}n=C===-1||Y===-1?null:{start:C,end:Y}}else n=null}n=n||{start:0,end:0}}else n=null;for(nd={focusedElem:e,selectionRange:n},xl=!1,sn=t;sn!==null;)if(t=sn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,sn=e;else for(;sn!==null;){switch(t=sn,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)l=e[n],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,n=t,l=d.memoizedProps,d=d.memoizedState,i=n.stateNode;try{var Le=ir(n.type,l);e=i.getSnapshotBeforeUpdate(Le,d),i.__reactInternalSnapshotBeforeUpdate=e}catch(We){St(n,n.return,We)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)rd(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":rd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,sn=e;break}sn=t.return}}function _h(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Ha(e,n),i&4&&Uo(5,n);break;case 1:if(Ha(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(p){St(n,n.return,p)}else{var l=ir(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){St(n,n.return,p)}}i&64&&Dh(n),i&512&&Oo(n,n.return);break;case 3:if(Ha(e,n),i&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{lp(e,t)}catch(p){St(n,n.return,p)}}break;case 27:t===null&&i&4&&Ch(n);case 26:case 5:Ha(e,n),t===null&&i&4&&bh(n),i&512&&Oo(n,n.return);break;case 12:Ha(e,n);break;case 31:Ha(e,n),i&4&&wh(e,n);break;case 13:Ha(e,n),i&4&&Th(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zv.bind(null,n),yb(e,n))));break;case 22:if(i=n.memoizedState!==null||$a,!i){t=t!==null&&t.memoizedState!==null||tn,l=$a;var d=tn;$a=i,(tn=t)&&!d?Ya(e,n,(n.subtreeFlags&8772)!==0):Ha(e,n),$a=l,tn=d}break;case 30:break;default:Ha(e,n)}}function Ah(e){var t=e.alternate;t!==null&&(e.alternate=null,Ah(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&On(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ut=null,wn=!1;function Va(e,t,n){for(n=n.child;n!==null;)Eh(e,t,n),n=n.sibling}function Eh(e,t,n){if(Ve&&typeof Ve.onCommitFiberUnmount=="function")try{Ve.onCommitFiberUnmount(Oe,n)}catch{}switch(n.tag){case 26:tn||wa(n,t),Va(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tn||wa(n,t);var i=Ut,l=wn;_i(n.type)&&(Ut=n.stateNode,wn=!1),Va(e,t,n),Yo(n.stateNode),Ut=i,wn=l;break;case 5:tn||wa(n,t);case 6:if(i=Ut,l=wn,Ut=null,Va(e,t,n),Ut=i,wn=l,Ut!==null)if(wn)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(n.stateNode)}catch(d){St(n,t,d)}else try{Ut.removeChild(n.stateNode)}catch(d){St(n,t,d)}break;case 18:Ut!==null&&(wn?(e=Ut,Dy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Jr(e)):Dy(Ut,n.stateNode));break;case 4:i=Ut,l=wn,Ut=n.stateNode.containerInfo,wn=!0,Va(e,t,n),Ut=i,wn=l;break;case 0:case 11:case 14:case 15:gi(2,n,t),tn||gi(4,n,t),Va(e,t,n);break;case 1:tn||(wa(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&vh(n,t,i)),Va(e,t,n);break;case 21:Va(e,t,n);break;case 22:tn=(i=tn)||n.memoizedState!==null,Va(e,t,n),tn=i;break;default:Va(e,t,n)}}function wh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jr(e)}catch(n){St(t,t.return,n)}}}function Th(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jr(e)}catch(n){St(t,t.return,n)}}function Iv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sh),t;default:throw Error(s(435,e.tag))}}function tl(e,t){var n=Iv(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var l=Xv.bind(null,e,i);i.then(l,l)}})}function Tn(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var l=n[i],d=e,p=t,C=p;e:for(;C!==null;){switch(C.tag){case 27:if(_i(C.type)){Ut=C.stateNode,wn=!1;break e}break;case 5:Ut=C.stateNode,wn=!1;break e;case 3:case 4:Ut=C.stateNode.containerInfo,wn=!0;break e}C=C.return}if(Ut===null)throw Error(s(160));Eh(d,p,l),Ut=null,wn=!1,d=l.alternate,d!==null&&(d.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kh(t,e),t=t.sibling}var pa=null;function kh(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Tn(t,e),kn(e),i&4&&(gi(3,e,e.return),Uo(3,e),gi(5,e,e.return));break;case 1:Tn(t,e),kn(e),i&512&&(tn||n===null||wa(n,n.return)),i&64&&$a&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var l=pa;if(Tn(t,e),kn(e),i&512&&(tn||n===null||wa(n,n.return)),i&4){var d=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,l=l.ownerDocument||l;t:switch(i){case"title":d=l.getElementsByTagName("title")[0],(!d||d[ht]||d[st]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=l.createElement(i),l.head.insertBefore(d,l.querySelector("head > title"))),mn(d,i,n),d[st]=e,on(d),i=d;break e;case"link":var p=ky("link","href",l).get(i+(n.href||""));if(p){for(var C=0;C<p.length;C++)if(d=p[C],d.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&d.getAttribute("rel")===(n.rel==null?null:n.rel)&&d.getAttribute("title")===(n.title==null?null:n.title)&&d.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){p.splice(C,1);break t}}d=l.createElement(i),mn(d,i,n),l.head.appendChild(d);break;case"meta":if(p=ky("meta","content",l).get(i+(n.content||""))){for(C=0;C<p.length;C++)if(d=p[C],d.getAttribute("content")===(n.content==null?null:""+n.content)&&d.getAttribute("name")===(n.name==null?null:n.name)&&d.getAttribute("property")===(n.property==null?null:n.property)&&d.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&d.getAttribute("charset")===(n.charSet==null?null:n.charSet)){p.splice(C,1);break t}}d=l.createElement(i),mn(d,i,n),l.head.appendChild(d);break;default:throw Error(s(468,i))}d[st]=e,on(d),i=d}e.stateNode=i}else Fy(l,e.type,e.stateNode);else e.stateNode=Ty(l,i,e.memoizedProps);else d!==i?(d===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):d.count--,i===null?Fy(l,e.type,e.stateNode):Ty(l,i,e.memoizedProps)):i===null&&e.stateNode!==null&&jc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Tn(t,e),kn(e),i&512&&(tn||n===null||wa(n,n.return)),n!==null&&i&4&&jc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Tn(t,e),kn(e),i&512&&(tn||n===null||wa(n,n.return)),e.flags&32){l=e.stateNode;try{Cr(l,"")}catch(Le){St(e,e.return,Le)}}i&4&&e.stateNode!=null&&(l=e.memoizedProps,jc(e,l,n!==null?n.memoizedProps:l)),i&1024&&(Nc=!0);break;case 6:if(Tn(t,e),kn(e),i&4){if(e.stateNode===null)throw Error(s(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(Le){St(e,e.return,Le)}}break;case 3:if(gl=null,l=pa,pa=hl(t.containerInfo),Tn(t,e),pa=l,kn(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Jr(t.containerInfo)}catch(Le){St(e,e.return,Le)}Nc&&(Nc=!1,Fh(e));break;case 4:i=pa,pa=hl(e.stateNode.containerInfo),Tn(t,e),kn(e),pa=i;break;case 12:Tn(t,e),kn(e);break;case 31:Tn(t,e),kn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,tl(e,i)));break;case 13:Tn(t,e),kn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(al=I()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,tl(e,i)));break;case 22:l=e.memoizedState!==null;var Y=n!==null&&n.memoizedState!==null,fe=$a,xe=tn;if($a=fe||l,tn=xe||Y,Tn(t,e),tn=xe,$a=fe,kn(e),i&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(n===null||Y||$a||tn||rr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){Y=n=t;try{if(d=Y.stateNode,l)p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{C=Y.stateNode;var we=Y.memoizedProps.style,he=we!=null&&we.hasOwnProperty("display")?we.display:null;C.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(Le){St(Y,Y.return,Le)}}}else if(t.tag===6){if(n===null){Y=t;try{Y.stateNode.nodeValue=l?"":Y.memoizedProps}catch(Le){St(Y,Y.return,Le)}}}else if(t.tag===18){if(n===null){Y=t;try{var ye=Y.stateNode;l?vy(ye,!0):vy(Y.stateNode,!1)}catch(Le){St(Y,Y.return,Le)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,tl(e,n))));break;case 19:Tn(t,e),kn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,tl(e,i)));break;case 30:break;case 21:break;default:Tn(t,e),kn(e)}}function kn(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(xh(i)){n=i;break}i=i.return}if(n==null)throw Error(s(160));switch(n.tag){case 27:var l=n.stateNode,d=Rc(e);el(e,d,l);break;case 5:var p=n.stateNode;n.flags&32&&(Cr(p,""),n.flags&=-33);var C=Rc(e);el(e,C,p);break;case 3:case 4:var Y=n.stateNode.containerInfo,fe=Rc(e);Mc(e,fe,Y);break;default:throw Error(s(161))}}catch(xe){St(e,e.return,xe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ha(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_h(e,t.alternate,t),t=t.sibling}function rr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:gi(4,t,t.return),rr(t);break;case 1:wa(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&vh(t,t.return,n),rr(t);break;case 27:Yo(t.stateNode);case 26:case 5:wa(t,t.return),rr(t);break;case 22:t.memoizedState===null&&rr(t);break;case 30:rr(t);break;default:rr(t)}e=e.sibling}}function Ya(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,l=e,d=t,p=d.flags;switch(d.tag){case 0:case 11:case 15:Ya(l,d,n),Uo(4,d);break;case 1:if(Ya(l,d,n),i=d,l=i.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(fe){St(i,i.return,fe)}if(i=d,l=i.updateQueue,l!==null){var C=i.stateNode;try{var Y=l.shared.hiddenCallbacks;if(Y!==null)for(l.shared.hiddenCallbacks=null,l=0;l<Y.length;l++)sp(Y[l],C)}catch(fe){St(i,i.return,fe)}}n&&p&64&&Dh(d),Oo(d,d.return);break;case 27:Ch(d);case 26:case 5:Ya(l,d,n),n&&i===null&&p&4&&bh(d),Oo(d,d.return);break;case 12:Ya(l,d,n);break;case 31:Ya(l,d,n),n&&p&4&&wh(l,d);break;case 13:Ya(l,d,n),n&&p&4&&Th(l,d);break;case 22:d.memoizedState===null&&Ya(l,d,n),Oo(d,d.return);break;case 30:break;default:Ya(l,d,n)}t=t.sibling}}function Bc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&So(n))}function Uc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&So(e))}function ha(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jh(e,t,n,i),t=t.sibling}function jh(e,t,n,i){var l=t.flags;switch(t.tag){case 0:case 11:case 15:ha(e,t,n,i),l&2048&&Uo(9,t);break;case 1:ha(e,t,n,i);break;case 3:ha(e,t,n,i),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&So(e)));break;case 12:if(l&2048){ha(e,t,n,i),e=t.stateNode;try{var d=t.memoizedProps,p=d.id,C=d.onPostCommit;typeof C=="function"&&C(p,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Y){St(t,t.return,Y)}}else ha(e,t,n,i);break;case 31:ha(e,t,n,i);break;case 13:ha(e,t,n,i);break;case 23:break;case 22:d=t.stateNode,p=t.alternate,t.memoizedState!==null?d._visibility&2?ha(e,t,n,i):zo(e,t):d._visibility&2?ha(e,t,n,i):(d._visibility|=2,Ir(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),l&2048&&Bc(p,t);break;case 24:ha(e,t,n,i),l&2048&&Uc(t.alternate,t);break;default:ha(e,t,n,i)}}function Ir(e,t,n,i,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,p=t,C=n,Y=i,fe=p.flags;switch(p.tag){case 0:case 11:case 15:Ir(d,p,C,Y,l),Uo(8,p);break;case 23:break;case 22:var xe=p.stateNode;p.memoizedState!==null?xe._visibility&2?Ir(d,p,C,Y,l):zo(d,p):(xe._visibility|=2,Ir(d,p,C,Y,l)),l&&fe&2048&&Bc(p.alternate,p);break;case 24:Ir(d,p,C,Y,l),l&&fe&2048&&Uc(p.alternate,p);break;default:Ir(d,p,C,Y,l)}t=t.sibling}}function zo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,l=i.flags;switch(i.tag){case 22:zo(n,i),l&2048&&Bc(i.alternate,i);break;case 24:zo(n,i),l&2048&&Uc(i.alternate,i);break;default:zo(n,i)}t=t.sibling}}var Po=8192;function $r(e,t,n){if(e.subtreeFlags&Po)for(e=e.child;e!==null;)Rh(e,t,n),e=e.sibling}function Rh(e,t,n){switch(e.tag){case 26:$r(e,t,n),e.flags&Po&&e.memoizedState!==null&&Tb(n,pa,e.memoizedState,e.memoizedProps);break;case 5:$r(e,t,n);break;case 3:case 4:var i=pa;pa=hl(e.stateNode.containerInfo),$r(e,t,n),pa=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Po,Po=16777216,$r(e,t,n),Po=i):$r(e,t,n));break;default:$r(e,t,n)}}function Mh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function qo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];sn=i,Bh(i,e)}Mh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nh(e),e=e.sibling}function Nh(e){switch(e.tag){case 0:case 11:case 15:qo(e),e.flags&2048&&gi(9,e,e.return);break;case 3:qo(e);break;case 12:qo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,nl(e)):qo(e);break;default:qo(e)}}function nl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];sn=i,Bh(i,e)}Mh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gi(8,t,t.return),nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,nl(t));break;default:nl(t)}e=e.sibling}}function Bh(e,t){for(;sn!==null;){var n=sn;switch(n.tag){case 0:case 11:case 15:gi(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:So(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,sn=i;else e:for(n=e;sn!==null;){i=sn;var l=i.sibling,d=i.return;if(Ah(i),i===n){sn=null;break e}if(l!==null){l.return=d,sn=l;break e}sn=d}}}var $v={getCacheForType:function(e){var t=dn(Wt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return dn(Wt).controller.signal}},Vv=typeof WeakMap=="function"?WeakMap:Map,vt=0,Ft=null,lt=null,ct=0,Ct=0,In=null,Di=!1,Vr=!1,Oc=!1,Ga=0,Vt=0,vi=0,or=0,zc=0,$n=0,Hr=0,Lo=null,Fn=null,Pc=!1,al=0,Uh=0,il=1/0,rl=null,bi=null,rn=0,xi=null,Yr=null,Ka=0,qc=0,Lc=null,Oh=null,Io=0,Ic=null;function Vn(){return(vt&2)!==0&&ct!==0?ct&-ct:P.T!==null?Kc():it()}function zh(){if($n===0)if((ct&536870912)===0||mt){var e=zt;zt<<=1,(zt&3932160)===0&&(zt=262144),$n=e}else $n=536870912;return e=qn.current,e!==null&&(e.flags|=32),$n}function jn(e,t,n){(e===Ft&&(Ct===2||Ct===9)||e.cancelPendingCommit!==null)&&(Gr(e,0),Ci(e,ct,$n,!1)),_a(e,n),((vt&2)===0||e!==Ft)&&(e===Ft&&((vt&2)===0&&(or|=n),Vt===4&&Ci(e,ct,$n,!1)),Ta(e))}function Ph(e,t,n){if((vt&6)!==0)throw Error(s(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Sa(e,t),l=i?Gv(e,t):Vc(e,t,!0),d=i;do{if(l===0){Vr&&!i&&Ci(e,t,0,!1);break}else{if(n=e.current.alternate,d&&!Hv(n)){l=Vc(e,t,!1),d=!1;continue}if(l===2){if(d=t,e.errorRecoveryDisabledLanes&d)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var C=e;l=Lo;var Y=C.current.memoizedState.isDehydrated;if(Y&&(Gr(C,p).flags|=256),p=Vc(C,p,!1),p!==2){if(Oc&&!Y){C.errorRecoveryDisabledLanes|=d,or|=d,l=4;break e}d=Fn,Fn=l,d!==null&&(Fn===null?Fn=d:Fn.push.apply(Fn,d))}l=p}if(d=!1,l!==2)continue}}if(l===1){Gr(e,0),Ci(e,t,0,!0);break}e:{switch(i=e,d=l,d){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:Ci(i,t,$n,!Di);break e;case 2:Fn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(l=al+300-I(),10<l)){if(Ci(i,t,$n,!Di),An(i,0,!0)!==0)break e;Ka=t,i.timeoutHandle=yy(qh.bind(null,i,n,Fn,rl,Pc,t,$n,or,Hr,Di,d,"Throttled",-0,0),l);break e}qh(i,n,Fn,rl,Pc,t,$n,or,Hr,Di,d,null,-0,0)}}break}while(!0);Ta(e)}function qh(e,t,n,i,l,d,p,C,Y,fe,xe,we,he,ye){if(e.timeoutHandle=-1,we=t.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ma},Rh(t,d,we);var Le=(d&62914560)===d?al-I():(d&4194048)===d?Uh-I():0;if(Le=kb(we,Le),Le!==null){Ka=d,e.cancelPendingCommit=Le(Kh.bind(null,e,t,d,n,i,l,p,C,Y,xe,we,null,he,ye)),Ci(e,d,p,!fe);return}}Kh(e,t,d,n,i,l,p,C,Y)}function Hv(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var l=n[i],d=l.getSnapshot;l=l.value;try{if(!zn(d(),l))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ci(e,t,n,i){t&=~zc,t&=~or,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var l=t;0<l;){var d=31-Ke(l),p=1<<d;i[d]=-1,l&=~p}n!==0&&pe(e,n,t)}function ol(){return(vt&6)===0?($o(0),!1):!0}function $c(){if(lt!==null){if(Ct===0)var e=lt.return;else e=lt,Oa=Xi=null,rc(e),Or=null,Ao=0,e=lt;for(;e!==null;)gh(e.alternate,e),e=e.return;lt=null}}function Gr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,db(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ka=0,$c(),Ft=e,lt=n=Ba(e.current,null),ct=t,Ct=0,In=null,Di=!1,Vr=Sa(e,t),Oc=!1,Hr=$n=zc=or=vi=Vt=0,Fn=Lo=null,Pc=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var l=31-Ke(i),d=1<<l;t|=e[l],i&=~d}return Ga=t,ws(),n}function Lh(e,t){nt=null,P.H=Mo,t===Ur||t===Bs?(t=ap(),Ct=3):t===Gu?(t=ap(),Ct=4):Ct=t===xc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,In=t,lt===null&&(Vt=1,Qs(e,aa(t,e.current)))}function Ih(){var e=qn.current;return e===null?!0:(ct&4194048)===ct?sa===null:(ct&62914560)===ct||(ct&536870912)!==0?e===sa:!1}function $h(){var e=P.H;return P.H=Mo,e===null?Mo:e}function Vh(){var e=P.A;return P.A=$v,e}function sl(){Vt=4,Di||(ct&4194048)!==ct&&qn.current!==null||(Vr=!0),(vi&134217727)===0&&(or&134217727)===0||Ft===null||Ci(Ft,ct,$n,!1)}function Vc(e,t,n){var i=vt;vt|=2;var l=$h(),d=Vh();(Ft!==e||ct!==t)&&(rl=null,Gr(e,t)),t=!1;var p=Vt;e:do try{if(Ct!==0&&lt!==null){var C=lt,Y=In;switch(Ct){case 8:$c(),p=6;break e;case 3:case 2:case 9:case 6:qn.current===null&&(t=!0);var fe=Ct;if(Ct=0,In=null,Kr(e,C,Y,fe),n&&Vr){p=0;break e}break;default:fe=Ct,Ct=0,In=null,Kr(e,C,Y,fe)}}Yv(),p=Vt;break}catch(xe){Lh(e,xe)}while(!0);return t&&e.shellSuspendCounter++,Oa=Xi=null,vt=i,P.H=l,P.A=d,lt===null&&(Ft=null,ct=0,ws()),p}function Yv(){for(;lt!==null;)Hh(lt)}function Gv(e,t){var n=vt;vt|=2;var i=$h(),l=Vh();Ft!==e||ct!==t?(rl=null,il=I()+500,Gr(e,t)):Vr=Sa(e,t);e:do try{if(Ct!==0&&lt!==null){t=lt;var d=In;t:switch(Ct){case 1:Ct=0,In=null,Kr(e,t,d,1);break;case 2:case 9:if(tp(d)){Ct=0,In=null,Yh(t);break}t=function(){Ct!==2&&Ct!==9||Ft!==e||(Ct=7),Ta(e)},d.then(t,t);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:tp(d)?(Ct=0,In=null,Yh(t)):(Ct=0,In=null,Kr(e,t,d,7));break;case 5:var p=null;switch(lt.tag){case 26:p=lt.memoizedState;case 5:case 27:var C=lt;if(p?jy(p):C.stateNode.complete){Ct=0,In=null;var Y=C.sibling;if(Y!==null)lt=Y;else{var fe=C.return;fe!==null?(lt=fe,ll(fe)):lt=null}break t}}Ct=0,In=null,Kr(e,t,d,5);break;case 6:Ct=0,In=null,Kr(e,t,d,6);break;case 8:$c(),Vt=6;break e;default:throw Error(s(462))}}Kv();break}catch(xe){Lh(e,xe)}while(!0);return Oa=Xi=null,P.H=i,P.A=l,vt=n,lt!==null?0:(Ft=null,ct=0,ws(),Vt)}function Kv(){for(;lt!==null&&!je();)Hh(lt)}function Hh(e){var t=hh(e.alternate,e,Ga);e.memoizedProps=e.pendingProps,t===null?ll(e):lt=t}function Yh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=uh(n,t,t.pendingProps,t.type,void 0,ct);break;case 11:t=uh(n,t,t.pendingProps,t.type.render,t.ref,ct);break;case 5:rc(t);default:gh(n,t),t=lt=Vm(t,Ga),t=hh(n,t,Ga)}e.memoizedProps=e.pendingProps,t===null?ll(e):lt=t}function Kr(e,t,n,i){Oa=Xi=null,rc(t),Or=null,Ao=0;var l=t.return;try{if(Uv(e,l,t,n,ct)){Vt=1,Qs(e,aa(n,e.current)),lt=null;return}}catch(d){if(l!==null)throw lt=l,d;Vt=1,Qs(e,aa(n,e.current)),lt=null;return}t.flags&32768?(mt||i===1?e=!0:Vr||(ct&536870912)!==0?e=!1:(Di=e=!0,(i===2||i===9||i===3||i===6)&&(i=qn.current,i!==null&&i.tag===13&&(i.flags|=16384))),Gh(t,e)):ll(t)}function ll(e){var t=e;do{if((t.flags&32768)!==0){Gh(t,Di);return}e=t.return;var n=Pv(t.alternate,t,Ga);if(n!==null){lt=n;return}if(t=t.sibling,t!==null){lt=t;return}lt=t=e}while(t!==null);Vt===0&&(Vt=5)}function Gh(e,t){do{var n=qv(e.alternate,e);if(n!==null){n.flags&=32767,lt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){lt=e;return}lt=e=n}while(e!==null);Vt=6,lt=null}function Kh(e,t,n,i,l,d,p,C,Y){e.cancelPendingCommit=null;do ul();while(rn!==0);if((vt&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(d=t.lanes|t.childLanes,d|=Ru,Dr(e,n,d,p,C,Y),e===Ft&&(lt=Ft=null,ct=0),Yr=t,xi=e,Ka=n,qc=d,Lc=l,Oh=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Wv(Ce,function(){return Jh(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=P.T,P.T=null,l=D.p,D.p=2,p=vt,vt|=4;try{Lv(e,t,n)}finally{vt=p,D.p=l,P.T=i}}rn=1,Qh(),Zh(),Xh()}}function Qh(){if(rn===1){rn=0;var e=xi,t=Yr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=P.T,P.T=null;var i=D.p;D.p=2;var l=vt;vt|=4;try{kh(t,e);var d=nd,p=Bm(e.containerInfo),C=d.focusedElem,Y=d.selectionRange;if(p!==C&&C&&C.ownerDocument&&Nm(C.ownerDocument.documentElement,C)){if(Y!==null&&wu(C)){var fe=Y.start,xe=Y.end;if(xe===void 0&&(xe=fe),"selectionStart"in C)C.selectionStart=fe,C.selectionEnd=Math.min(xe,C.value.length);else{var we=C.ownerDocument||document,he=we&&we.defaultView||window;if(he.getSelection){var ye=he.getSelection(),Le=C.textContent.length,We=Math.min(Y.start,Le),wt=Y.end===void 0?We:Math.min(Y.end,Le);!ye.extend&&We>wt&&(p=wt,wt=We,We=p);var le=Mm(C,We),X=Mm(C,wt);if(le&&X&&(ye.rangeCount!==1||ye.anchorNode!==le.node||ye.anchorOffset!==le.offset||ye.focusNode!==X.node||ye.focusOffset!==X.offset)){var de=we.createRange();de.setStart(le.node,le.offset),ye.removeAllRanges(),We>wt?(ye.addRange(de),ye.extend(X.node,X.offset)):(de.setEnd(X.node,X.offset),ye.addRange(de))}}}}for(we=[],ye=C;ye=ye.parentNode;)ye.nodeType===1&&we.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<we.length;C++){var _e=we[C];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}xl=!!td,nd=td=null}finally{vt=l,D.p=i,P.T=n}}e.current=t,rn=2}}function Zh(){if(rn===2){rn=0;var e=xi,t=Yr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=P.T,P.T=null;var i=D.p;D.p=2;var l=vt;vt|=4;try{_h(e,t.alternate,t)}finally{vt=l,D.p=i,P.T=n}}rn=3}}function Xh(){if(rn===4||rn===3){rn=0,_();var e=xi,t=Yr,n=Ka,i=Oh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?rn=5:(rn=0,Yr=xi=null,Wh(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(bi=null),tt(n),t=t.stateNode,Ve&&typeof Ve.onCommitFiberRoot=="function")try{Ve.onCommitFiberRoot(Oe,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=P.T,l=D.p,D.p=2,P.T=null;try{for(var d=e.onRecoverableError,p=0;p<i.length;p++){var C=i[p];d(C.value,{componentStack:C.stack})}}finally{P.T=t,D.p=l}}(Ka&3)!==0&&ul(),Ta(e),l=e.pendingLanes,(n&261930)!==0&&(l&42)!==0?e===Ic?Io++:(Io=0,Ic=e):Io=0,$o(0)}}function Wh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,So(t)))}function ul(){return Qh(),Zh(),Xh(),Jh()}function Jh(){if(rn!==5)return!1;var e=xi,t=qc;qc=0;var n=tt(Ka),i=P.T,l=D.p;try{D.p=32>n?32:n,P.T=null,n=Lc,Lc=null;var d=xi,p=Ka;if(rn=0,Yr=xi=null,Ka=0,(vt&6)!==0)throw Error(s(331));var C=vt;if(vt|=4,Nh(d.current),jh(d,d.current,p,n),vt=C,$o(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot=="function")try{Ve.onPostCommitFiberRoot(Oe,d)}catch{}return!0}finally{D.p=l,P.T=i,Wh(e,t)}}function ey(e,t,n){t=aa(n,t),t=bc(e.stateNode,t,2),e=pi(e,t,2),e!==null&&(_a(e,2),Ta(e))}function St(e,t,n){if(e.tag===3)ey(e,e,n);else for(;t!==null;){if(t.tag===3){ey(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(bi===null||!bi.has(i))){e=aa(n,e),n=th(2),i=pi(t,n,2),i!==null&&(nh(n,i,t,e),_a(i,2),Ta(i));break}}t=t.return}}function Hc(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Vv;var l=new Set;i.set(t,l)}else l=i.get(t),l===void 0&&(l=new Set,i.set(t,l));l.has(n)||(Oc=!0,l.add(n),e=Qv.bind(null,e,t,n),t.then(e,e))}function Qv(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ft===e&&(ct&n)===n&&(Vt===4||Vt===3&&(ct&62914560)===ct&&300>I()-al?(vt&2)===0&&Gr(e,0):zc|=n,Hr===ct&&(Hr=0)),Ta(e)}function ty(e,t){t===0&&(t=Xn()),e=Ki(e,t),e!==null&&(_a(e,t),Ta(e))}function Zv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ty(e,n)}function Xv(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(t),ty(e,n)}function Wv(e,t){return U(e,t)}var cl=null,Qr=null,Yc=!1,dl=!1,Gc=!1,Si=0;function Ta(e){e!==Qr&&e.next===null&&(Qr===null?cl=Qr=e:Qr=Qr.next=e),dl=!0,Yc||(Yc=!0,eb())}function $o(e,t){if(!Gc&&dl){Gc=!0;do for(var n=!1,i=cl;i!==null;){if(e!==0){var l=i.pendingLanes;if(l===0)var d=0;else{var p=i.suspendedLanes,C=i.pingedLanes;d=(1<<31-Ke(42|e)+1)-1,d&=l&~(p&~C),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(n=!0,ry(i,d))}else d=ct,d=An(i,i===Ft?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(d&3)===0||Sa(i,d)||(n=!0,ry(i,d));i=i.next}while(n);Gc=!1}}function Jv(){ny()}function ny(){dl=Yc=!1;var e=0;Si!==0&&cb()&&(e=Si);for(var t=I(),n=null,i=cl;i!==null;){var l=i.next,d=ay(i,t);d===0?(i.next=null,n===null?cl=l:n.next=l,l===null&&(Qr=n)):(n=i,(e!==0||(d&3)!==0)&&(dl=!0)),i=l}rn!==0&&rn!==5||$o(e),Si!==0&&(Si=0)}function ay(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,l=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var p=31-Ke(d),C=1<<p,Y=l[p];Y===-1?((C&n)===0||(C&i)!==0)&&(l[p]=fa(C,t)):Y<=t&&(e.expiredLanes|=C),d&=~C}if(t=Ft,n=ct,n=An(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(Ct===2||Ct===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&se(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Sa(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&se(i),tt(n)){case 2:case 8:n=De;break;case 32:n=Ce;break;case 268435456:n=Ye;break;default:n=Ce}return i=iy.bind(null,e),n=U(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&se(i),e.callbackPriority=2,e.callbackNode=null,2}function iy(e,t){if(rn!==0&&rn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ul()&&e.callbackNode!==n)return null;var i=ct;return i=An(e,e===Ft?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Ph(e,i,t),ay(e,I()),e.callbackNode!=null&&e.callbackNode===n?iy.bind(null,e):null)}function ry(e,t){if(ul())return null;Ph(e,t,!0)}function eb(){fb(function(){(vt&6)!==0?U(Ee,Jv):ny()})}function Kc(){if(Si===0){var e=Nr;e===0&&(e=kt,kt<<=1,(kt&261888)===0&&(kt=256)),Si=e}return Si}function oy(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:vs(""+e)}function sy(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function tb(e,t,n,i,l){if(t==="submit"&&n&&n.stateNode===l){var d=oy((l[Rt]||null).action),p=i.submitter;p&&(t=(t=p[Rt]||null)?oy(t.formAction):p.getAttribute("formAction"),t!==null&&(d=t,p=null));var C=new Ss("action","action",null,i,l);e.push({event:C,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Si!==0){var Y=p?sy(l,p):new FormData(l);pc(n,{pending:!0,data:Y,method:l.method,action:d},null,Y)}}else typeof d=="function"&&(C.preventDefault(),Y=p?sy(l,p):new FormData(l),pc(n,{pending:!0,data:Y,method:l.method,action:d},d,Y))},currentTarget:l}]})}}for(var Qc=0;Qc<ju.length;Qc++){var Zc=ju[Qc],nb=Zc.toLowerCase(),ab=Zc[0].toUpperCase()+Zc.slice(1);ma(nb,"on"+ab)}ma(zm,"onAnimationEnd"),ma(Pm,"onAnimationIteration"),ma(qm,"onAnimationStart"),ma("dblclick","onDoubleClick"),ma("focusin","onFocus"),ma("focusout","onBlur"),ma(vv,"onTransitionRun"),ma(bv,"onTransitionStart"),ma(xv,"onTransitionCancel"),ma(Lm,"onTransitionEnd"),br("onMouseEnter",["mouseout","mouseover"]),br("onMouseLeave",["mouseout","mouseover"]),br("onPointerEnter",["pointerout","pointerover"]),br("onPointerLeave",["pointerout","pointerover"]),Vi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ib=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vo));function ly(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],l=i.event;i=i.listeners;e:{var d=void 0;if(t)for(var p=i.length-1;0<=p;p--){var C=i[p],Y=C.instance,fe=C.currentTarget;if(C=C.listener,Y!==d&&l.isPropagationStopped())break e;d=C,l.currentTarget=fe;try{d(l)}catch(xe){Es(xe)}l.currentTarget=null,d=Y}else for(p=0;p<i.length;p++){if(C=i[p],Y=C.instance,fe=C.currentTarget,C=C.listener,Y!==d&&l.isPropagationStopped())break e;d=C,l.currentTarget=fe;try{d(l)}catch(xe){Es(xe)}l.currentTarget=null,d=Y}}}}function ut(e,t){var n=t[Li];n===void 0&&(n=t[Li]=new Set);var i=e+"__bubble";n.has(i)||(uy(t,e,2,!1),n.add(i))}function Xc(e,t,n){var i=0;t&&(i|=4),uy(n,e,i,t)}var fl="_reactListening"+Math.random().toString(36).slice(2);function Wc(e){if(!e[fl]){e[fl]=!0,nm.forEach(function(n){n!=="selectionchange"&&(ib.has(n)||Xc(n,!1,e),Xc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fl]||(t[fl]=!0,Xc("selectionchange",!1,t))}}function uy(e,t,n,i){switch(zy(t)){case 2:var l=Rb;break;case 8:l=Mb;break;default:l=md}n=l.bind(null,t,n,e),l=void 0,!Du||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),i?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Jc(e,t,n,i,l){var d=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var p=i.tag;if(p===3||p===4){var C=i.stateNode.containerInfo;if(C===l)break;if(p===4)for(p=i.return;p!==null;){var Y=p.tag;if((Y===3||Y===4)&&p.stateNode.containerInfo===l)return;p=p.return}for(;C!==null;){if(p=hn(C),p===null)return;if(Y=p.tag,Y===5||Y===6||Y===26||Y===27){i=d=p;continue e}C=C.parentNode}}i=i.return}pm(function(){var fe=d,xe=yu(n),we=[];e:{var he=Im.get(e);if(he!==void 0){var ye=Ss,Le=e;switch(e){case"keypress":if(xs(n)===0)break e;case"keydown":case"keyup":ye=XD;break;case"focusin":Le="focus",ye=Cu;break;case"focusout":Le="blur",ye=Cu;break;case"beforeblur":case"afterblur":ye=Cu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=gm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=PD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=ev;break;case zm:case Pm:case qm:ye=ID;break;case Lm:ye=nv;break;case"scroll":case"scrollend":ye=OD;break;case"wheel":ye=iv;break;case"copy":case"cut":case"paste":ye=VD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=vm;break;case"toggle":case"beforetoggle":ye=ov}var We=(t&4)!==0,wt=!We&&(e==="scroll"||e==="scrollend"),le=We?he!==null?he+"Capture":null:he;We=[];for(var X=fe,de;X!==null;){var _e=X;if(de=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||de===null||le===null||(_e=fo(X,le),_e!=null&&We.push(Ho(X,_e,de))),wt)break;X=X.return}0<We.length&&(he=new ye(he,Le,null,n,xe),we.push({event:he,listeners:We}))}}if((t&7)===0){e:{if(he=e==="mouseover"||e==="pointerover",ye=e==="mouseout"||e==="pointerout",he&&n!==hu&&(Le=n.relatedTarget||n.fromElement)&&(hn(Le)||Le[Jn]))break e;if((ye||he)&&(he=xe.window===xe?xe:(he=xe.ownerDocument)?he.defaultView||he.parentWindow:window,ye?(Le=n.relatedTarget||n.toElement,ye=fe,Le=Le?hn(Le):null,Le!==null&&(wt=m(Le),We=Le.tag,Le!==wt||We!==5&&We!==27&&We!==6)&&(Le=null)):(ye=null,Le=fe),ye!==Le)){if(We=gm,_e="onMouseLeave",le="onMouseEnter",X="mouse",(e==="pointerout"||e==="pointerover")&&(We=vm,_e="onPointerLeave",le="onPointerEnter",X="pointer"),wt=ye==null?he:oi(ye),de=Le==null?he:oi(Le),he=new We(_e,X+"leave",ye,n,xe),he.target=wt,he.relatedTarget=de,_e=null,hn(xe)===fe&&(We=new We(le,X+"enter",Le,n,xe),We.target=de,We.relatedTarget=wt,_e=We),wt=_e,ye&&Le)t:{for(We=rb,le=ye,X=Le,de=0,_e=le;_e;_e=We(_e))de++;_e=0;for(var Qe=X;Qe;Qe=We(Qe))_e++;for(;0<de-_e;)le=We(le),de--;for(;0<_e-de;)X=We(X),_e--;for(;de--;){if(le===X||X!==null&&le===X.alternate){We=le;break t}le=We(le),X=We(X)}We=null}else We=null;ye!==null&&cy(we,he,ye,We,!1),Le!==null&&wt!==null&&cy(we,wt,Le,We,!0)}}e:{if(he=fe?oi(fe):window,ye=he.nodeName&&he.nodeName.toLowerCase(),ye==="select"||ye==="input"&&he.type==="file")var yt=wm;else if(Am(he))if(Tm)yt=yv;else{yt=pv;var He=mv}else ye=he.nodeName,!ye||ye.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?fe&&pu(fe.elementType)&&(yt=wm):yt=hv;if(yt&&(yt=yt(e,fe))){Em(we,yt,n,xe);break e}He&&He(e,he,fe),e==="focusout"&&fe&&he.type==="number"&&fe.memoizedProps.value!=null&&mu(he,"number",he.value)}switch(He=fe?oi(fe):window,e){case"focusin":(Am(He)||He.contentEditable==="true")&&(Er=He,Tu=fe,bo=null);break;case"focusout":bo=Tu=Er=null;break;case"mousedown":ku=!0;break;case"contextmenu":case"mouseup":case"dragend":ku=!1,Um(we,n,xe);break;case"selectionchange":if(Dv)break;case"keydown":case"keyup":Um(we,n,xe)}var at;if(_u)e:{switch(e){case"compositionstart":var dt="onCompositionStart";break e;case"compositionend":dt="onCompositionEnd";break e;case"compositionupdate":dt="onCompositionUpdate";break e}dt=void 0}else Ar?Sm(e,n)&&(dt="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(dt="onCompositionStart");dt&&(bm&&n.locale!=="ko"&&(Ar||dt!=="onCompositionStart"?dt==="onCompositionEnd"&&Ar&&(at=hm()):(si=xe,vu="value"in si?si.value:si.textContent,Ar=!0)),He=ml(fe,dt),0<He.length&&(dt=new Dm(dt,e,null,n,xe),we.push({event:dt,listeners:He}),at?dt.data=at:(at=_m(n),at!==null&&(dt.data=at)))),(at=lv?uv(e,n):cv(e,n))&&(dt=ml(fe,"onBeforeInput"),0<dt.length&&(He=new Dm("onBeforeInput","beforeinput",null,n,xe),we.push({event:He,listeners:dt}),He.data=at)),tb(we,e,fe,n,xe)}ly(we,t)})}function Ho(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ml(e,t){for(var n=t+"Capture",i=[];e!==null;){var l=e,d=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||d===null||(l=fo(e,n),l!=null&&i.unshift(Ho(e,l,d)),l=fo(e,t),l!=null&&i.push(Ho(e,l,d))),e.tag===3)return i;e=e.return}return[]}function rb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function cy(e,t,n,i,l){for(var d=t._reactName,p=[];n!==null&&n!==i;){var C=n,Y=C.alternate,fe=C.stateNode;if(C=C.tag,Y!==null&&Y===i)break;C!==5&&C!==26&&C!==27||fe===null||(Y=fe,l?(fe=fo(n,d),fe!=null&&p.unshift(Ho(n,fe,Y))):l||(fe=fo(n,d),fe!=null&&p.push(Ho(n,fe,Y)))),n=n.return}p.length!==0&&e.push({event:t,listeners:p})}var ob=/\r\n?/g,sb=/\u0000|\uFFFD/g;function dy(e){return(typeof e=="string"?e:""+e).replace(ob,`
9
- `).replace(sb,"")}function fy(e,t){return t=dy(t),dy(e)===t}function Et(e,t,n,i,l,d){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Cr(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Cr(e,""+i);break;case"className":gs(e,"class",i);break;case"tabIndex":gs(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":gs(e,n,i);break;case"style":fm(e,i,d);break;case"data":if(t!=="object"){gs(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=vs(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(n==="formAction"?(t!=="input"&&Et(e,t,"name",l.name,l,null),Et(e,t,"formEncType",l.formEncType,l,null),Et(e,t,"formMethod",l.formMethod,l,null),Et(e,t,"formTarget",l.formTarget,l,null)):(Et(e,t,"encType",l.encType,l,null),Et(e,t,"method",l.method,l,null),Et(e,t,"target",l.target,l,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=vs(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=Ma);break;case"onScroll":i!=null&&ut("scroll",e);break;case"onScrollEnd":i!=null&&ut("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(n=i.__html,n!=null){if(l.children!=null)throw Error(s(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=vs(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":ut("beforetoggle",e),ut("toggle",e),ys(e,"popover",i);break;case"xlinkActuate":Ra(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ra(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ra(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ra(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ra(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ra(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ra(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ra(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ra(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":ys(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=BD.get(n)||n,ys(e,n,i))}}function ed(e,t,n,i,l,d){switch(n){case"style":fm(e,i,d);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(n=i.__html,n!=null){if(l.children!=null)throw Error(s(60));e.innerHTML=n}}break;case"children":typeof i=="string"?Cr(e,i):(typeof i=="number"||typeof i=="bigint")&&Cr(e,""+i);break;case"onScroll":i!=null&&ut("scroll",e);break;case"onScrollEnd":i!=null&&ut("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Ma);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!am.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(l=n.endsWith("Capture"),t=n.slice(2,l?n.length-7:void 0),d=e[Rt]||null,d=d!=null?d[n]:null,typeof d=="function"&&e.removeEventListener(t,d,l),typeof i=="function")){typeof d!="function"&&d!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,l);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):ys(e,n,i)}}}function mn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ut("error",e),ut("load",e);var i=!1,l=!1,d;for(d in n)if(n.hasOwnProperty(d)){var p=n[d];if(p!=null)switch(d){case"src":i=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Et(e,t,d,p,n,null)}}l&&Et(e,t,"srcSet",n.srcSet,n,null),i&&Et(e,t,"src",n.src,n,null);return;case"input":ut("invalid",e);var C=d=p=l=null,Y=null,fe=null;for(i in n)if(n.hasOwnProperty(i)){var xe=n[i];if(xe!=null)switch(i){case"name":l=xe;break;case"type":p=xe;break;case"checked":Y=xe;break;case"defaultChecked":fe=xe;break;case"value":d=xe;break;case"defaultValue":C=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(s(137,t));break;default:Et(e,t,i,xe,n,null)}}lm(e,d,C,Y,fe,p,l,!1);return;case"select":ut("invalid",e),i=p=d=null;for(l in n)if(n.hasOwnProperty(l)&&(C=n[l],C!=null))switch(l){case"value":d=C;break;case"defaultValue":p=C;break;case"multiple":i=C;default:Et(e,t,l,C,n,null)}t=d,n=p,e.multiple=!!i,t!=null?xr(e,!!i,t,!1):n!=null&&xr(e,!!i,n,!0);return;case"textarea":ut("invalid",e),d=l=i=null;for(p in n)if(n.hasOwnProperty(p)&&(C=n[p],C!=null))switch(p){case"value":i=C;break;case"defaultValue":l=C;break;case"children":d=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:Et(e,t,p,C,n,null)}cm(e,i,l,d);return;case"option":for(Y in n)n.hasOwnProperty(Y)&&(i=n[Y],i!=null)&&(Y==="selected"?e.selected=i&&typeof i!="function"&&typeof i!="symbol":Et(e,t,Y,i,n,null));return;case"dialog":ut("beforetoggle",e),ut("toggle",e),ut("cancel",e),ut("close",e);break;case"iframe":case"object":ut("load",e);break;case"video":case"audio":for(i=0;i<Vo.length;i++)ut(Vo[i],e);break;case"image":ut("error",e),ut("load",e);break;case"details":ut("toggle",e);break;case"embed":case"source":case"link":ut("error",e),ut("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in n)if(n.hasOwnProperty(fe)&&(i=n[fe],i!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Et(e,t,fe,i,n,null)}return;default:if(pu(t)){for(xe in n)n.hasOwnProperty(xe)&&(i=n[xe],i!==void 0&&ed(e,t,xe,i,n,void 0));return}}for(C in n)n.hasOwnProperty(C)&&(i=n[C],i!=null&&Et(e,t,C,i,n,null))}function lb(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,d=null,p=null,C=null,Y=null,fe=null,xe=null;for(ye in n){var we=n[ye];if(n.hasOwnProperty(ye)&&we!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":Y=we;default:i.hasOwnProperty(ye)||Et(e,t,ye,null,i,we)}}for(var he in i){var ye=i[he];if(we=n[he],i.hasOwnProperty(he)&&(ye!=null||we!=null))switch(he){case"type":d=ye;break;case"name":l=ye;break;case"checked":fe=ye;break;case"defaultChecked":xe=ye;break;case"value":p=ye;break;case"defaultValue":C=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,t));break;default:ye!==we&&Et(e,t,he,ye,i,we)}}fu(e,p,C,Y,fe,xe,d,l);return;case"select":ye=p=C=he=null;for(d in n)if(Y=n[d],n.hasOwnProperty(d)&&Y!=null)switch(d){case"value":break;case"multiple":ye=Y;default:i.hasOwnProperty(d)||Et(e,t,d,null,i,Y)}for(l in i)if(d=i[l],Y=n[l],i.hasOwnProperty(l)&&(d!=null||Y!=null))switch(l){case"value":he=d;break;case"defaultValue":C=d;break;case"multiple":p=d;default:d!==Y&&Et(e,t,l,d,i,Y)}t=C,n=p,i=ye,he!=null?xr(e,!!n,he,!1):!!i!=!!n&&(t!=null?xr(e,!!n,t,!0):xr(e,!!n,n?[]:"",!1));return;case"textarea":ye=he=null;for(C in n)if(l=n[C],n.hasOwnProperty(C)&&l!=null&&!i.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:Et(e,t,C,null,i,l)}for(p in i)if(l=i[p],d=n[p],i.hasOwnProperty(p)&&(l!=null||d!=null))switch(p){case"value":he=l;break;case"defaultValue":ye=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(s(91));break;default:l!==d&&Et(e,t,p,l,i,d)}um(e,he,ye);return;case"option":for(var Le in n)he=n[Le],n.hasOwnProperty(Le)&&he!=null&&!i.hasOwnProperty(Le)&&(Le==="selected"?e.selected=!1:Et(e,t,Le,null,i,he));for(Y in i)he=i[Y],ye=n[Y],i.hasOwnProperty(Y)&&he!==ye&&(he!=null||ye!=null)&&(Y==="selected"?e.selected=he&&typeof he!="function"&&typeof he!="symbol":Et(e,t,Y,he,i,ye));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var We in n)he=n[We],n.hasOwnProperty(We)&&he!=null&&!i.hasOwnProperty(We)&&Et(e,t,We,null,i,he);for(fe in i)if(he=i[fe],ye=n[fe],i.hasOwnProperty(fe)&&he!==ye&&(he!=null||ye!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,t));break;default:Et(e,t,fe,he,i,ye)}return;default:if(pu(t)){for(var wt in n)he=n[wt],n.hasOwnProperty(wt)&&he!==void 0&&!i.hasOwnProperty(wt)&&ed(e,t,wt,void 0,i,he);for(xe in i)he=i[xe],ye=n[xe],!i.hasOwnProperty(xe)||he===ye||he===void 0&&ye===void 0||ed(e,t,xe,he,i,ye);return}}for(var le in n)he=n[le],n.hasOwnProperty(le)&&he!=null&&!i.hasOwnProperty(le)&&Et(e,t,le,null,i,he);for(we in i)he=i[we],ye=n[we],!i.hasOwnProperty(we)||he===ye||he==null&&ye==null||Et(e,t,we,he,i,ye)}function my(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ub(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var l=n[i],d=l.transferSize,p=l.initiatorType,C=l.duration;if(d&&C&&my(p)){for(p=0,C=l.responseEnd,i+=1;i<n.length;i++){var Y=n[i],fe=Y.startTime;if(fe>C)break;var xe=Y.transferSize,we=Y.initiatorType;xe&&my(we)&&(Y=Y.responseEnd,p+=xe*(Y<C?1:(C-fe)/(Y-fe)))}if(--i,t+=8*(d+p)/(l.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var td=null,nd=null;function pl(e){return e.nodeType===9?e:e.ownerDocument}function py(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hy(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function ad(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var id=null;function cb(){var e=window.event;return e&&e.type==="popstate"?e===id?!1:(id=e,!0):(id=null,!1)}var yy=typeof setTimeout=="function"?setTimeout:void 0,db=typeof clearTimeout=="function"?clearTimeout:void 0,gy=typeof Promise=="function"?Promise:void 0,fb=typeof queueMicrotask=="function"?queueMicrotask:typeof gy<"u"?function(e){return gy.resolve(null).then(e).catch(mb)}:yy;function mb(e){setTimeout(function(){throw e})}function _i(e){return e==="head"}function Dy(e,t){var n=t,i=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(l),Jr(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Yo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Yo(n);for(var d=n.firstChild;d;){var p=d.nextSibling,C=d.nodeName;d[ht]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&d.rel.toLowerCase()==="stylesheet"||n.removeChild(d),d=p}}else n==="body"&&Yo(e.ownerDocument.body);n=l}while(n);Jr(t)}function vy(e,t){var n=e;e=0;do{var i=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function rd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":rd(n),On(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function pb(e,t,n,i){for(;e.nodeType===1;){var l=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ht])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=la(e.nextSibling),e===null)break}return null}function hb(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=la(e.nextSibling),e===null))return null;return e}function by(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=la(e.nextSibling),e===null))return null;return e}function od(e){return e.data==="$?"||e.data==="$~"}function sd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function yb(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function la(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ld=null;function xy(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return la(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Cy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Sy(e,t,n){switch(t=pl(n),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Yo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);On(e)}var ua=new Map,_y=new Set;function hl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Qa=D.d;D.d={f:gb,r:Db,D:vb,C:bb,L:xb,m:Cb,X:_b,S:Sb,M:Ab};function gb(){var e=Qa.f(),t=ol();return e||t}function Db(e){var t=$i(e);t!==null&&t.tag===5&&t.type==="form"?Lp(t):Qa.r(e)}var Zr=typeof document>"u"?null:document;function Ay(e,t,n){var i=Zr;if(i&&typeof t=="string"&&t){var l=ta(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),_y.has(l)||(_y.add(l),e={rel:e,crossOrigin:n,href:t},i.querySelector(l)===null&&(t=i.createElement("link"),mn(t,"link",e),on(t),i.head.appendChild(t)))}}function vb(e){Qa.D(e),Ay("dns-prefetch",e,null)}function bb(e,t){Qa.C(e,t),Ay("preconnect",e,t)}function xb(e,t,n){Qa.L(e,t,n);var i=Zr;if(i&&e&&t){var l='link[rel="preload"][as="'+ta(t)+'"]';t==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+ta(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+ta(n.imageSizes)+'"]')):l+='[href="'+ta(e)+'"]';var d=l;switch(t){case"style":d=Xr(e);break;case"script":d=Wr(e)}ua.has(d)||(e=x({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ua.set(d,e),i.querySelector(l)!==null||t==="style"&&i.querySelector(Go(d))||t==="script"&&i.querySelector(Ko(d))||(t=i.createElement("link"),mn(t,"link",e),on(t),i.head.appendChild(t)))}}function Cb(e,t){Qa.m(e,t);var n=Zr;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+ta(i)+'"][href="'+ta(e)+'"]',d=l;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Wr(e)}if(!ua.has(d)&&(e=x({rel:"modulepreload",href:e},t),ua.set(d,e),n.querySelector(l)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ko(d)))return}i=n.createElement("link"),mn(i,"link",e),on(i),n.head.appendChild(i)}}}function Sb(e,t,n){Qa.S(e,t,n);var i=Zr;if(i&&e){var l=ja(i).hoistableStyles,d=Xr(e);t=t||"default";var p=l.get(d);if(!p){var C={loading:0,preload:null};if(p=i.querySelector(Go(d)))C.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ua.get(d))&&ud(e,n);var Y=p=i.createElement("link");on(Y),mn(Y,"link",e),Y._p=new Promise(function(fe,xe){Y.onload=fe,Y.onerror=xe}),Y.addEventListener("load",function(){C.loading|=1}),Y.addEventListener("error",function(){C.loading|=2}),C.loading|=4,yl(p,t,i)}p={type:"stylesheet",instance:p,count:1,state:C},l.set(d,p)}}}function _b(e,t){Qa.X(e,t);var n=Zr;if(n&&e){var i=ja(n).hoistableScripts,l=Wr(e),d=i.get(l);d||(d=n.querySelector(Ko(l)),d||(e=x({src:e,async:!0},t),(t=ua.get(l))&&cd(e,t),d=n.createElement("script"),on(d),mn(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(l,d))}}function Ab(e,t){Qa.M(e,t);var n=Zr;if(n&&e){var i=ja(n).hoistableScripts,l=Wr(e),d=i.get(l);d||(d=n.querySelector(Ko(l)),d||(e=x({src:e,async:!0,type:"module"},t),(t=ua.get(l))&&cd(e,t),d=n.createElement("script"),on(d),mn(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(l,d))}}function Ey(e,t,n,i){var l=(l=Pe.current)?hl(l):null;if(!l)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Xr(n.href),n=ja(l).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Xr(n.href);var d=ja(l).hoistableStyles,p=d.get(e);if(p||(l=l.ownerDocument||l,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,p),(d=l.querySelector(Go(e)))&&!d._p&&(p.instance=d,p.state.loading=5),ua.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ua.set(e,n),d||Eb(l,e,n,p.state))),t&&i===null)throw Error(s(528,""));return p}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wr(n),n=ja(l).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Xr(e){return'href="'+ta(e)+'"'}function Go(e){return'link[rel="stylesheet"]['+e+"]"}function wy(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function Eb(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),mn(t,"link",n),on(t),e.head.appendChild(t))}function Wr(e){return'[src="'+ta(e)+'"]'}function Ko(e){return"script[async]"+e}function Ty(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+ta(n.href)+'"]');if(i)return t.instance=i,on(i),i;var l=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),on(i),mn(i,"style",l),yl(i,n.precedence,e),t.instance=i;case"stylesheet":l=Xr(n.href);var d=e.querySelector(Go(l));if(d)return t.state.loading|=4,t.instance=d,on(d),d;i=wy(n),(l=ua.get(l))&&ud(i,l),d=(e.ownerDocument||e).createElement("link"),on(d);var p=d;return p._p=new Promise(function(C,Y){p.onload=C,p.onerror=Y}),mn(d,"link",i),t.state.loading|=4,yl(d,n.precedence,e),t.instance=d;case"script":return d=Wr(n.src),(l=e.querySelector(Ko(d)))?(t.instance=l,on(l),l):(i=n,(l=ua.get(d))&&(i=x({},n),cd(i,l)),e=e.ownerDocument||e,l=e.createElement("script"),on(l),mn(l,"link",i),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,yl(i,n.precedence,e));return t.instance}function yl(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=i.length?i[i.length-1]:null,d=l,p=0;p<i.length;p++){var C=i[p];if(C.dataset.precedence===t)d=C;else if(d!==l)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function cd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var gl=null;function ky(e,t,n){if(gl===null){var i=new Map,l=gl=new Map;l.set(n,i)}else l=gl,i=l.get(n),i||(i=new Map,l.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),l=0;l<n.length;l++){var d=n[l];if(!(d[ht]||d[st]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var p=d.getAttribute(t)||"";p=e+p;var C=i.get(p);C?C.push(d):i.set(p,[d])}}return i}function Fy(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function wb(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function jy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Tb(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=Xr(i.href),d=t.querySelector(Go(l));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Dl.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=d,on(d);return}d=t.ownerDocument||t,i=wy(i),(l=ua.get(l))&&ud(i,l),d=d.createElement("link"),on(d);var p=d;p._p=new Promise(function(C,Y){p.onload=C,p.onerror=Y}),mn(d,"link",i),n.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Dl.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var dd=0;function kb(e,t){return e.stylesheets&&e.count===0&&bl(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&bl(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&dd===0&&(dd=62500*ub());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&bl(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>dd?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(l)}}:null}function Dl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vl=null;function bl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vl=new Map,t.forEach(Fb,e),vl=null,Dl.call(e))}function Fb(e,t){if(!(t.state.loading&4)){var n=vl.get(e);if(n)var i=n.get(null);else{n=new Map,vl.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<l.length;d++){var p=l[d];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(n.set(p.dataset.precedence,p),i=p)}i&&n.set(null,i)}l=t.instance,p=l.getAttribute("data-precedence"),d=n.get(p)||i,d===i&&n.set(null,l),n.set(p,l),this.count++,i=Dl.bind(this),l.addEventListener("load",i),l.addEventListener("error",i),d?d.parentNode.insertBefore(l,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var Qo={$$typeof:j,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function jb(e,t,n,i,l,d,p,C,Y){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fa(0),this.hiddenUpdates=Fa(null),this.identifierPrefix=i,this.onUncaughtError=l,this.onCaughtError=d,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function Ry(e,t,n,i,l,d,p,C,Y,fe,xe,we){return e=new jb(e,t,n,p,Y,fe,xe,we,C),t=1,d===!0&&(t|=24),d=Pn(3,null,null,t),e.current=d,d.stateNode=e,t=Vu(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:i,isDehydrated:n,cache:t},Ku(d),e}function My(e){return e?(e=kr,e):kr}function Ny(e,t,n,i,l,d){l=My(l),i.context===null?i.context=l:i.pendingContext=l,i=mi(t),i.payload={element:n},d=d===void 0?null:d,d!==null&&(i.callback=d),n=pi(e,i,t),n!==null&&(jn(n,e,t),wo(n,e,t))}function By(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fd(e,t){By(e,t),(e=e.alternate)&&By(e,t)}function Uy(e){if(e.tag===13||e.tag===31){var t=Ki(e,67108864);t!==null&&jn(t,e,67108864),fd(e,67108864)}}function Oy(e){if(e.tag===13||e.tag===31){var t=Vn();t=Je(t);var n=Ki(e,t);n!==null&&jn(n,e,t),fd(e,t)}}var xl=!0;function Rb(e,t,n,i){var l=P.T;P.T=null;var d=D.p;try{D.p=2,md(e,t,n,i)}finally{D.p=d,P.T=l}}function Mb(e,t,n,i){var l=P.T;P.T=null;var d=D.p;try{D.p=8,md(e,t,n,i)}finally{D.p=d,P.T=l}}function md(e,t,n,i){if(xl){var l=pd(i);if(l===null)Jc(e,t,i,Cl,n),Py(e,i);else if(Bb(l,e,t,n,i))i.stopPropagation();else if(Py(e,i),t&4&&-1<Nb.indexOf(e)){for(;l!==null;){var d=$i(l);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var p=an(d.pendingLanes);if(p!==0){var C=d;for(C.pendingLanes|=2,C.entangledLanes|=2;p;){var Y=1<<31-Ke(p);C.entanglements[1]|=Y,p&=~Y}Ta(d),(vt&6)===0&&(il=I()+500,$o(0))}}break;case 31:case 13:C=Ki(d,2),C!==null&&jn(C,d,2),ol(),fd(d,2)}if(d=pd(i),d===null&&Jc(e,t,i,Cl,n),d===l)break;l=d}l!==null&&i.stopPropagation()}else Jc(e,t,i,null,n)}}function pd(e){return e=yu(e),hd(e)}var Cl=null;function hd(e){if(Cl=null,e=hn(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=h(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Cl=e,null}function zy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ee()){case Ee:return 2;case De:return 8;case Ce:case Te:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var yd=!1,Ai=null,Ei=null,wi=null,Zo=new Map,Xo=new Map,Ti=[],Nb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Py(e,t){switch(e){case"focusin":case"focusout":Ai=null;break;case"dragenter":case"dragleave":Ei=null;break;case"mouseover":case"mouseout":wi=null;break;case"pointerover":case"pointerout":Zo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xo.delete(t.pointerId)}}function Wo(e,t,n,i,l,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:d,targetContainers:[l]},t!==null&&(t=$i(t),t!==null&&Uy(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Bb(e,t,n,i,l){switch(t){case"focusin":return Ai=Wo(Ai,e,t,n,i,l),!0;case"dragenter":return Ei=Wo(Ei,e,t,n,i,l),!0;case"mouseover":return wi=Wo(wi,e,t,n,i,l),!0;case"pointerover":var d=l.pointerId;return Zo.set(d,Wo(Zo.get(d)||null,e,t,n,i,l)),!0;case"gotpointercapture":return d=l.pointerId,Xo.set(d,Wo(Xo.get(d)||null,e,t,n,i,l)),!0}return!1}function qy(e){var t=hn(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,Wn(e.priority,function(){Oy(n)});return}}else if(t===31){if(t=h(n),t!==null){e.blockedOn=t,Wn(e.priority,function(){Oy(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Sl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pd(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);hu=i,n.target.dispatchEvent(i),hu=null}else return t=$i(n),t!==null&&Uy(t),e.blockedOn=n,!1;t.shift()}return!0}function Ly(e,t,n){Sl(e)&&n.delete(t)}function Ub(){yd=!1,Ai!==null&&Sl(Ai)&&(Ai=null),Ei!==null&&Sl(Ei)&&(Ei=null),wi!==null&&Sl(wi)&&(wi=null),Zo.forEach(Ly),Xo.forEach(Ly)}function _l(e,t){e.blockedOn===t&&(e.blockedOn=null,yd||(yd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Ub)))}var Al=null;function Iy(e){Al!==e&&(Al=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Al===e&&(Al=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],l=e[t+2];if(typeof i!="function"){if(hd(i||n)===null)continue;break}var d=$i(n);d!==null&&(e.splice(t,3),t-=3,pc(d,{pending:!0,data:l,method:n.method,action:i},i,l))}}))}function Jr(e){function t(Y){return _l(Y,e)}Ai!==null&&_l(Ai,e),Ei!==null&&_l(Ei,e),wi!==null&&_l(wi,e),Zo.forEach(t),Xo.forEach(t);for(var n=0;n<Ti.length;n++){var i=Ti[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ti.length&&(n=Ti[0],n.blockedOn===null);)qy(n),n.blockedOn===null&&Ti.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var l=n[i],d=n[i+1],p=l[Rt]||null;if(typeof d=="function")p||Iy(n);else if(p){var C=null;if(d&&d.hasAttribute("formAction")){if(l=d,p=d[Rt]||null)C=p.formAction;else if(hd(l)!==null)continue}else C=p.action;typeof C=="function"?n[i+1]=C:(n.splice(i,3),i-=3),Iy(n)}}}function $y(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(p){return l=p})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function gd(e){this._internalRoot=e}El.prototype.render=gd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current,i=Vn();Ny(n,i,e,t,null,null)},El.prototype.unmount=gd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ny(e.current,2,null,e,null,null),ol(),t[Jn]=null}};function El(e){this._internalRoot=e}El.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ti.length&&t!==0&&t<Ti[n].priority;n++);Ti.splice(n,0,e),n===0&&qy(e)}};var Vy=r.version;if(Vy!=="19.2.5")throw Error(s(527,Vy,"19.2.5"));D.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=y(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var Ob={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wl.isDisabled&&wl.supportsFiber)try{Oe=wl.inject(Ob),Ve=wl}catch{}}return Jo.createRoot=function(e,t){if(!f(e))throw Error(s(299));var n=!1,i="",l=Xp,d=Wp,p=Jp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=Ry(e,1,!1,null,null,n,i,null,l,d,p,$y),e[Jn]=t.current,Wc(e),new gd(t)},Jo.hydrateRoot=function(e,t,n){if(!f(e))throw Error(s(299));var i=!1,l="",d=Xp,p=Wp,C=Jp,Y=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(C=n.onRecoverableError),n.formState!==void 0&&(Y=n.formState)),t=Ry(e,1,!0,t,n??null,i,l,Y,d,p,C,$y),t.context=My(null),n=t.current,i=Vn(),i=Je(i),l=mi(i),l.callback=null,pi(n,l,i),n=i,t.current.lanes=n,_a(t,n),Ta(t),e[Jn]=t.current,Wc(e),new El(t)},Jo.version="19.2.5",Jo}var eg;function oC(){if(eg)return bd.exports;eg=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(r){console.error(r)}}return a(),bd.exports=rC(),bd.exports}var sC=oC();const lC=ri(sC),gf=fx(),uC=gf.user.getUserPublicInfo.bind(gf.user),Sd=new Map;gf.user.getUserPublicInfo=a=>{const r=`${a?.did||""}|${a?.name||""}`,o=Sd.get(r);if(o)return o;const s=uC(a).finally(()=>Sd.delete(r));return Sd.set(r,s),s};function cC({children:a,theme:r,injectFirst:o,darkSchemeClass:s,prefer:f,disableBlockletTheme:m=!1,enableColorScheme:c,disableStyleCache:h,locale:g,fallbackLocale:y,translations:S={},languages:x,onLoadingTranslation:A}){return u.jsx(mx,{theme:r,injectFirst:o,darkSchemeClass:s,prefer:f,disableBlockletTheme:m,enableColorScheme:c,disableStyleCache:h,children:u.jsx(px,{locale:g,fallbackLocale:y,translations:S,onLoadingTranslation:A,languages:x,children:a})})}const dC=V.createContext(null),_d={didCatch:!1,error:null};class fC extends V.Component{constructor(r){super(r),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=_d}static getDerivedStateFromError(r){return{didCatch:!0,error:r}}resetErrorBoundary(){const{error:r}=this.state;if(r!==null){for(var o,s,f=arguments.length,m=new Array(f),c=0;c<f;c++)m[c]=arguments[c];(o=(s=this.props).onReset)===null||o===void 0||o.call(s,{args:m,reason:"imperative-api"}),this.setState(_d)}}componentDidCatch(r,o){var s,f;(s=(f=this.props).onError)===null||s===void 0||s.call(f,r,o)}componentDidUpdate(r,o){const{didCatch:s}=this.state,{resetKeys:f}=this.props;if(s&&o.error!==null&&mC(r.resetKeys,f)){var m,c;(m=(c=this.props).onReset)===null||m===void 0||m.call(c,{next:f,prev:r.resetKeys,reason:"keys"}),this.setState(_d)}}render(){const{children:r,fallbackRender:o,FallbackComponent:s,fallback:f}=this.props,{didCatch:m,error:c}=this.state;let h=r;if(m){const g={error:c,resetErrorBoundary:this.resetErrorBoundary};if(typeof o=="function")h=o(g);else if(s)h=V.createElement(s,g);else if(f!==void 0)h=f;else throw c}return V.createElement(dC.Provider,{value:{didCatch:m,error:c,resetErrorBoundary:this.resetErrorBoundary}},h)}}function mC(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return a.length!==r.length||a.some((o,s)=>!Object.is(o,r[s]))}var Ad,tg;function pC(){if(tg)return Ad;tg=1;function a(r){return r===null}return Ad=a,Ad}var hC=pC();const E0=ri(hC);var Ed,ng;function yC(){if(ng)return Ed;ng=1;var a=hx(),r=yx(),o=gx(),s=vx(),f=Nf(),m=Dx();function c(h,g,y){if(h=f(h),h&&(y||g===void 0))return h.slice(0,m(h)+1);if(!h||!(g=a(g)))return h;var S=s(h),x=o(S,s(g))+1;return r(S,0,x).join("")}return Ed=c,Ed}var gC=yC();const DC=ri(gC);var vC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function bC(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var wd,ag;function xC(){return ag||(ag=1,wd={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(a){let r=a%10;return~~(a%100/10)===1?"th":r===1?"st":r===2?"nd":r===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),wd}var Td,ig;function w0(){if(ig)return Td;ig=1;const a=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function r(g){return g.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function o(g,y,S,x,A,v,N){if(!isNaN(+g))return+g;let B="",O=g.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(O!==g)return-1*o(O,y,S,x,A,v);for(let T=0;T<a.length;T++){let R=a[T];if(B=g.replace(RegExp(`([0-9 ])(${R.key})$`),"$1"),B!==g)return o(B,y,S,x,A,v)*R.factor}if(B=g.replace("%",""),B!==g)return o(B,y,S,x,A,v)/100;let k=parseFloat(g);if(isNaN(k))return;let K=x(k);if(K&&K!=="."&&(B=g.replace(new RegExp(`${r(K)}$`),""),B!==g))return o(B,y,S,x,A,v);let j={};Object.keys(v).forEach(T=>{j[v[T]]=T});let w=Object.keys(j).sort().reverse(),G=w.length;for(let T=0;T<G;T++){let R=w[T],q=j[R];if(B=g.replace(R,""),B!==g){let z;switch(q){case"thousand":z=Math.pow(10,3);break;case"million":z=Math.pow(10,6);break;case"billion":z=Math.pow(10,9);break;case"trillion":z=Math.pow(10,12);break}return o(B,y,S,x,A,v)*z}}}function s(g,y,S){let x=g.replace(S,"");return x=x.replace(new RegExp(`([0-9])${r(y.thousands)}([0-9])`,"g"),"$1$2"),x=x.replace(y.decimal,"."),x}function f(g,y,S="",x,A,v,N){if(g==="")return;if(g===A)return 0;let B=s(g,y,S);return o(B,y,S,x,A,v)}function m(g,y){if(!(g.indexOf(":")&&y.thousands!==":"))return!1;let x=g.split(":");if(x.length!==3)return!1;let A=+x[0],v=+x[1],N=+x[2];return!isNaN(A)&&!isNaN(v)&&!isNaN(N)}function c(g){let y=g.split(":"),S=+y[0],x=+y[1];return+y[2]+60*x+3600*S}function h(g,y){const S=Pf();let x=S.currentDelimiters(),A=S.currentCurrency().symbol,v=S.currentOrdinal(),N=S.getZeroFormat(),B=S.currentAbbreviations(),O;if(typeof g=="string")m(g,x)?O=c(g):O=f(g,x,A,v,N,B);else if(typeof g=="number")O=g;else return;if(O!==void 0)return O}return Td={unformat:h},Td}var kd,rg;function Of(){if(rg)return kd;rg=1;let a=w0();const r=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,o=["currency","percent","byte","time","ordinal","number"],s=["trillion","billion","million","thousand"],f=["prefix","infix","postfix"],m=["sign","parenthesis"],c={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},y={output:{type:"string",validValues:o},base:{type:"string",validValues:["decimal","binary","general"],restriction:(O,k)=>k.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:O=>O.output==="byte"},characteristic:{type:"number",restriction:O=>O>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:s},average:"boolean",lowPrecision:{type:"boolean",restriction:(O,k)=>k.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:f},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:O=>O>=0,message:"value must be positive"},{restriction:(O,k)=>!k.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:O=>O>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:m},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(O,k)=>k.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},S={languageTag:{type:"string",mandatory:!0,restriction:O=>O.match(r),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:c,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function x(O,k){let K=A(O),j=N(k);return K&&j}function A(O){return a.unformat(O)!==void 0}function v(O,k,K,j=!1){let w=Object.keys(O).map(G=>{if(!k[G])return console.error(`${K} Invalid key: ${G}`),!1;let T=O[G],R=k[G];if(typeof R=="string"&&(R={type:R}),R.type==="format"){if(!v(T,y,`[Validate ${G}]`,!0))return!1}else if(typeof T!==R.type)return console.error(`${K} ${G} type mismatched: "${R.type}" expected, "${typeof T}" provided`),!1;if(R.restrictions&&R.restrictions.length){let q=R.restrictions.length;for(let z=0;z<q;z++){let{restriction:$,message:re}=R.restrictions[z];if(!$(T,O))return console.error(`${K} ${G} invalid value: ${re}`),!1}}return R.restriction&&!R.restriction(T,O)?(console.error(`${K} ${G} invalid value: ${R.message}`),!1):R.validValues&&R.validValues.indexOf(T)===-1?(console.error(`${K} ${G} invalid value: must be among ${JSON.stringify(R.validValues)}, "${T}" provided`),!1):!(R.children&&!v(T,R.children,`[Validate ${G}]`))});return j||w.push(...Object.keys(k).map(G=>{let T=k[G];if(typeof T=="string"&&(T={type:T}),T.mandatory){let R=T.mandatory;if(typeof R=="function"&&(R=R(O)),R&&O[G]===void 0)return console.error(`${K} Missing mandatory key "${G}"`),!1}return!0})),w.reduce((G,T)=>G&&T,!0)}function N(O){return v(O,y,"[Validate format]")}function B(O){return v(O,S,"[Validate language]")}return kd={validate:x,validateFormat:N,validateInput:A,validateLanguage:B},kd}function CC(a,r){let o=a.match(/^{([^}]*)}/);return o?(r.prefix=o[1],a.slice(o[0].length)):a}function SC(a,r){let o=a.match(/{([^}]*)}$/);return o?(r.postfix=o[1],a.slice(0,-o[0].length)):a}function _C(a,r){if(a.indexOf("$")!==-1){r.output="currency";return}if(a.indexOf("%")!==-1){r.output="percent";return}if(a.indexOf("bd")!==-1){r.output="byte",r.base="general";return}if(a.indexOf("b")!==-1){r.output="byte",r.base="binary";return}if(a.indexOf("d")!==-1){r.output="byte",r.base="decimal";return}if(a.indexOf(":")!==-1){r.output="time";return}a.indexOf("o")!==-1&&(r.output="ordinal")}function AC(a,r){a.indexOf(",")!==-1&&(r.thousandSeparated=!0)}function EC(a,r){a.indexOf(" ")!==-1&&(r.spaceSeparated=!0,r.spaceSeparatedCurrency=!0,(r.average||r.forceAverage)&&(r.spaceSeparatedAbbreviation=!0))}function wC(a,r){let o=a.match(/[1-9]+[0-9]*/);o&&(r.totalLength=+o[0])}function TC(a,r){let s=a.split(".")[0].match(/0+/);s&&(r.characteristic=s[0].length)}function kC(a,r){let o=a.split(".")[1];if(o){let s=o.match(/0+/);s&&(r.mantissa=s[0].length)}}function FC(a,r){const o=a.split(".")[1];o&&(r.trimMantissa=o.indexOf("[")!==-1)}function jC(a,r){a.indexOf("a")!==-1&&(r.average=!0)}function RC(a,r){a.indexOf("K")!==-1?r.forceAverage="thousand":a.indexOf("M")!==-1?r.forceAverage="million":a.indexOf("B")!==-1?r.forceAverage="billion":a.indexOf("T")!==-1&&(r.forceAverage="trillion")}function MC(a,r){a.match(/\[\.]/)?r.optionalMantissa=!0:a.match(/\./)&&(r.optionalMantissa=!1)}function NC(a,r){if(a.indexOf(".")!==-1){let o=a.split(".")[0];r.optionalCharacteristic=o.indexOf("0")===-1}}function BC(a,r){a.match(/^\+?\([^)]*\)$/)&&(r.negative="parenthesis"),a.match(/^\+?-/)&&(r.negative="sign")}function UC(a,r){a.match(/^\+/)&&(r.forceSign=!0)}function OC(a,r={}){return typeof a!="string"?a:(a=CC(a,r),a=SC(a,r),_C(a,r),wC(a,r),TC(a,r),NC(a,r),jC(a,r),RC(a,r),kC(a,r),MC(a,r),FC(a,r),AC(a,r),EC(a,r),BC(a,r),UC(a,r),r)}var zf={parseFormat:OC};var Fd,og;function Pf(){if(og)return Fd;og=1;const a=xC(),r=Of(),o=zf;let s={},f,m={},c=null,h={};function g(S){f=S}function y(){return m[f]}return s.languages=()=>Object.assign({},m),s.currentLanguage=()=>f,s.currentBytes=()=>y().bytes||{},s.currentCurrency=()=>y().currency,s.currentAbbreviations=()=>y().abbreviations,s.currentDelimiters=()=>y().delimiters,s.currentOrdinal=()=>y().ordinal,s.currentDefaults=()=>Object.assign({},y().defaults,h),s.currentOrdinalDefaultFormat=()=>Object.assign({},s.currentDefaults(),y().ordinalFormat),s.currentByteDefaultFormat=()=>Object.assign({},s.currentDefaults(),y().byteFormat),s.currentPercentageDefaultFormat=()=>Object.assign({},s.currentDefaults(),y().percentageFormat),s.currentCurrencyDefaultFormat=()=>Object.assign({},s.currentDefaults(),y().currencyFormat),s.currentTimeDefaultFormat=()=>Object.assign({},s.currentDefaults(),y().timeFormat),s.setDefaults=S=>{S=o.parseFormat(S),r.validateFormat(S)&&(h=S)},s.getZeroFormat=()=>c,s.setZeroFormat=S=>c=typeof S=="string"?S:null,s.hasZeroFormat=()=>c!==null,s.languageData=S=>{if(S){if(m[S])return m[S];throw new Error(`Unknown tag "${S}"`)}return y()},s.registerLanguage=(S,x=!1)=>{if(!r.validateLanguage(S))throw new Error("Invalid language data");m[S.languageTag]=S,x&&g(S.languageTag)},s.setLanguage=(S,x=a.languageTag)=>{if(!m[S]){let A=S.split("-")[0],v=Object.keys(m).find(N=>N.split("-")[0]===A);if(!m[v]){g(x);return}g(v);return}g(S)},s.registerLanguage(a),f=a.languageTag,Fd=s,Fd}function zC(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function PC(a,r){a.forEach(o=>{let s;try{s=zC(`../languages/${o}`)}catch{console.error(`Unable to load "${o}". No matching language file found.`)}s&&r.registerLanguage(s)})}var qC=a=>({loadLanguagesInNode:r=>PC(r,a)}),T0={exports:{}};(function(a){(function(r){var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,f=Math.ceil,m=Math.floor,c="[BigNumber Error] ",h=c+"Number primitive has more than 15 significant digits: ",g=1e14,y=14,S=9007199254740991,x=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],A=1e7,v=1e9;function N(T){var R,q,z,$=ue.prototype={constructor:ue,toString:null,valueOf:null},re=new ue(1),Q=20,Z=4,ne=-7,me=21,P=-1e7,D=1e7,F=!1,ae=1,be=0,Me={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Fe="0123456789abcdefghijklmnopqrstuvwxyz",Ae=!0;function ue(b,E){var L,ie,W,te,ce,J,H,M,U=this;if(!(U instanceof ue))return new ue(b,E);if(E==null){if(b&&b._isBigNumber===!0){U.s=b.s,!b.c||b.e>D?U.c=U.e=null:b.e<P?U.c=[U.e=0]:(U.e=b.e,U.c=b.c.slice());return}if((J=typeof b=="number")&&b*0==0){if(U.s=1/b<0?(b=-b,-1):1,b===~~b){for(te=0,ce=b;ce>=10;ce/=10,te++);te>D?U.c=U.e=null:(U.e=te,U.c=[b]);return}M=String(b)}else{if(!s.test(M=String(b)))return z(U,M,J);U.s=M.charCodeAt(0)==45?(M=M.slice(1),-1):1}(te=M.indexOf("."))>-1&&(M=M.replace(".","")),(ce=M.search(/e/i))>0?(te<0&&(te=ce),te+=+M.slice(ce+1),M=M.substring(0,ce)):te<0&&(te=M.length)}else{if(K(E,2,Fe.length,"Base"),E==10&&Ae)return U=new ue(b),Ze(U,Q+U.e+1,Z);if(M=String(b),J=typeof b=="number"){if(b*0!=0)return z(U,M,J,E);if(U.s=1/b<0?(M=M.slice(1),-1):1,ue.DEBUG&&M.replace(/^0\.0*|\./,"").length>15)throw Error(h+b)}else U.s=M.charCodeAt(0)===45?(M=M.slice(1),-1):1;for(L=Fe.slice(0,E),te=ce=0,H=M.length;ce<H;ce++)if(L.indexOf(ie=M.charAt(ce))<0){if(ie=="."){if(ce>te){te=H;continue}}else if(!W&&(M==M.toUpperCase()&&(M=M.toLowerCase())||M==M.toLowerCase()&&(M=M.toUpperCase()))){W=!0,ce=-1,te=0;continue}return z(U,String(b),J,E)}J=!1,M=q(M,E,10,U.s),(te=M.indexOf("."))>-1?M=M.replace(".",""):te=M.length}for(ce=0;M.charCodeAt(ce)===48;ce++);for(H=M.length;M.charCodeAt(--H)===48;);if(M=M.slice(ce,++H)){if(H-=ce,J&&ue.DEBUG&&H>15&&(b>S||b!==m(b)))throw Error(h+U.s*b);if((te=te-ce-1)>D)U.c=U.e=null;else if(te<P)U.c=[U.e=0];else{if(U.e=te,U.c=[],ce=(te+1)%y,te<0&&(ce+=y),ce<H){for(ce&&U.c.push(+M.slice(0,ce)),H-=y;ce<H;)U.c.push(+M.slice(ce,ce+=y));ce=y-(M=M.slice(ce)).length}else ce-=H;for(;ce--;M+="0");U.c.push(+M)}}else U.c=[U.e=0]}ue.clone=N,ue.ROUND_UP=0,ue.ROUND_DOWN=1,ue.ROUND_CEIL=2,ue.ROUND_FLOOR=3,ue.ROUND_HALF_UP=4,ue.ROUND_HALF_DOWN=5,ue.ROUND_HALF_EVEN=6,ue.ROUND_HALF_CEIL=7,ue.ROUND_HALF_FLOOR=8,ue.EUCLID=9,ue.config=ue.set=function(b){var E,L;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(E="DECIMAL_PLACES")&&(L=b[E],K(L,0,v,E),Q=L),b.hasOwnProperty(E="ROUNDING_MODE")&&(L=b[E],K(L,0,8,E),Z=L),b.hasOwnProperty(E="EXPONENTIAL_AT")&&(L=b[E],L&&L.pop?(K(L[0],-v,0,E),K(L[1],0,v,E),ne=L[0],me=L[1]):(K(L,-v,v,E),ne=-(me=L<0?-L:L))),b.hasOwnProperty(E="RANGE"))if(L=b[E],L&&L.pop)K(L[0],-v,-1,E),K(L[1],1,v,E),P=L[0],D=L[1];else if(K(L,-v,v,E),L)P=-(D=L<0?-L:L);else throw Error(c+E+" cannot be zero: "+L);if(b.hasOwnProperty(E="CRYPTO"))if(L=b[E],L===!!L)if(L)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))F=L;else throw F=!L,Error(c+"crypto unavailable");else F=L;else throw Error(c+E+" not true or false: "+L);if(b.hasOwnProperty(E="MODULO_MODE")&&(L=b[E],K(L,0,9,E),ae=L),b.hasOwnProperty(E="POW_PRECISION")&&(L=b[E],K(L,0,v,E),be=L),b.hasOwnProperty(E="FORMAT"))if(L=b[E],typeof L=="object")Me=L;else throw Error(c+E+" not an object: "+L);if(b.hasOwnProperty(E="ALPHABET"))if(L=b[E],typeof L=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(L))Ae=L.slice(0,10)=="0123456789",Fe=L;else throw Error(c+E+" invalid: "+L)}else throw Error(c+"Object expected: "+b);return{DECIMAL_PLACES:Q,ROUNDING_MODE:Z,EXPONENTIAL_AT:[ne,me],RANGE:[P,D],CRYPTO:F,MODULO_MODE:ae,POW_PRECISION:be,FORMAT:Me,ALPHABET:Fe}},ue.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!ue.DEBUG)return!0;var E,L,ie=b.c,W=b.e,te=b.s;e:if({}.toString.call(ie)=="[object Array]"){if((te===1||te===-1)&&W>=-v&&W<=v&&W===m(W)){if(ie[0]===0){if(W===0&&ie.length===1)return!0;break e}if(E=(W+1)%y,E<1&&(E+=y),String(ie[0]).length==E){for(E=0;E<ie.length;E++)if(L=ie[E],L<0||L>=g||L!==m(L))break e;if(L!==0)return!0}}}else if(ie===null&&W===null&&(te===null||te===1||te===-1))return!0;throw Error(c+"Invalid BigNumber: "+b)},ue.maximum=ue.max=function(){return Pe(arguments,-1)},ue.minimum=ue.min=function(){return Pe(arguments,1)},ue.random=(function(){var b=9007199254740992,E=Math.random()*b&2097151?function(){return m(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(L){var ie,W,te,ce,J,H=0,M=[],U=new ue(re);if(L==null?L=Q:K(L,0,v),ce=f(L/y),F)if(crypto.getRandomValues){for(ie=crypto.getRandomValues(new Uint32Array(ce*=2));H<ce;)J=ie[H]*131072+(ie[H+1]>>>11),J>=9e15?(W=crypto.getRandomValues(new Uint32Array(2)),ie[H]=W[0],ie[H+1]=W[1]):(M.push(J%1e14),H+=2);H=ce/2}else if(crypto.randomBytes){for(ie=crypto.randomBytes(ce*=7);H<ce;)J=(ie[H]&31)*281474976710656+ie[H+1]*1099511627776+ie[H+2]*4294967296+ie[H+3]*16777216+(ie[H+4]<<16)+(ie[H+5]<<8)+ie[H+6],J>=9e15?crypto.randomBytes(7).copy(ie,H):(M.push(J%1e14),H+=7);H=ce/7}else throw F=!1,Error(c+"crypto unavailable");if(!F)for(;H<ce;)J=E(),J<9e15&&(M[H++]=J%1e14);for(ce=M[--H],L%=y,ce&&L&&(J=x[y-L],M[H]=m(ce/J)*J);M[H]===0;M.pop(),H--);if(H<0)M=[te=0];else{for(te=-1;M[0]===0;M.splice(0,1),te-=y);for(H=1,J=M[0];J>=10;J/=10,H++);H<y&&(te-=y-H)}return U.e=te,U.c=M,U}})(),ue.sum=function(){for(var b=1,E=arguments,L=new ue(E[0]);b<E.length;)L=L.plus(E[b++]);return L},q=(function(){var b="0123456789";function E(L,ie,W,te){for(var ce,J=[0],H,M=0,U=L.length;M<U;){for(H=J.length;H--;J[H]*=ie);for(J[0]+=te.indexOf(L.charAt(M++)),ce=0;ce<J.length;ce++)J[ce]>W-1&&(J[ce+1]==null&&(J[ce+1]=0),J[ce+1]+=J[ce]/W|0,J[ce]%=W)}return J.reverse()}return function(L,ie,W,te,ce){var J,H,M,U,se,je,_,I,ee=L.indexOf("."),Ee=Q,De=Z;for(ee>=0&&(U=be,be=0,L=L.replace(".",""),I=new ue(ie),je=I.pow(L.length-ee),be=U,I.c=E(G(O(je.c),je.e,"0"),10,W,b),I.e=I.c.length),_=E(L,ie,W,ce?(J=Fe,b):(J=b,Fe)),M=U=_.length;_[--U]==0;_.pop());if(!_[0])return J.charAt(0);if(ee<0?--M:(je.c=_,je.e=M,je.s=te,je=R(je,I,Ee,De,W),_=je.c,se=je.r,M=je.e),H=M+Ee+1,ee=_[H],U=W/2,se=se||H<0||_[H+1]!=null,se=De<4?(ee!=null||se)&&(De==0||De==(je.s<0?3:2)):ee>U||ee==U&&(De==4||se||De==6&&_[H-1]&1||De==(je.s<0?8:7)),H<1||!_[0])L=se?G(J.charAt(1),-Ee,J.charAt(0)):J.charAt(0);else{if(_.length=H,se)for(--W;++_[--H]>W;)_[H]=0,H||(++M,_=[1].concat(_));for(U=_.length;!_[--U];);for(ee=0,L="";ee<=U;L+=J.charAt(_[ee++]));L=G(L,M,J.charAt(0))}return L}})(),R=(function(){function b(ie,W,te){var ce,J,H,M,U=0,se=ie.length,je=W%A,_=W/A|0;for(ie=ie.slice();se--;)H=ie[se]%A,M=ie[se]/A|0,ce=_*H+M*je,J=je*H+ce%A*A+U,U=(J/te|0)+(ce/A|0)+_*M,ie[se]=J%te;return U&&(ie=[U].concat(ie)),ie}function E(ie,W,te,ce){var J,H;if(te!=ce)H=te>ce?1:-1;else for(J=H=0;J<te;J++)if(ie[J]!=W[J]){H=ie[J]>W[J]?1:-1;break}return H}function L(ie,W,te,ce){for(var J=0;te--;)ie[te]-=J,J=ie[te]<W[te]?1:0,ie[te]=J*ce+ie[te]-W[te];for(;!ie[0]&&ie.length>1;ie.splice(0,1));}return function(ie,W,te,ce,J){var H,M,U,se,je,_,I,ee,Ee,De,Ce,Te,Ye,ve,qe,Oe,Ve,Ge=ie.s==W.s?1:-1,Ke=ie.c,et=W.c;if(!Ke||!Ke[0]||!et||!et[0])return new ue(!ie.s||!W.s||(Ke?et&&Ke[0]==et[0]:!et)?NaN:Ke&&Ke[0]==0||!et?Ge*0:Ge/0);for(ee=new ue(Ge),Ee=ee.c=[],M=ie.e-W.e,Ge=te+M+1,J||(J=g,M=B(ie.e/y)-B(W.e/y),Ge=Ge/y|0),U=0;et[U]==(Ke[U]||0);U++);if(et[U]>(Ke[U]||0)&&M--,Ge<0)Ee.push(1),se=!0;else{for(ve=Ke.length,Oe=et.length,U=0,Ge+=2,je=m(J/(et[0]+1)),je>1&&(et=b(et,je,J),Ke=b(Ke,je,J),Oe=et.length,ve=Ke.length),Ye=Oe,De=Ke.slice(0,Oe),Ce=De.length;Ce<Oe;De[Ce++]=0);Ve=et.slice(),Ve=[0].concat(Ve),qe=et[0],et[1]>=J/2&&qe++;do{if(je=0,H=E(et,De,Oe,Ce),H<0){if(Te=De[0],Oe!=Ce&&(Te=Te*J+(De[1]||0)),je=m(Te/qe),je>1)for(je>=J&&(je=J-1),_=b(et,je,J),I=_.length,Ce=De.length;E(_,De,I,Ce)==1;)je--,L(_,Oe<I?Ve:et,I,J),I=_.length,H=1;else je==0&&(H=je=1),_=et.slice(),I=_.length;if(I<Ce&&(_=[0].concat(_)),L(De,_,Ce,J),Ce=De.length,H==-1)for(;E(et,De,Oe,Ce)<1;)je++,L(De,Oe<Ce?Ve:et,Ce,J),Ce=De.length}else H===0&&(je++,De=[0]);Ee[U++]=je,De[0]?De[Ce++]=Ke[Ye]||0:(De=[Ke[Ye]],Ce=1)}while((Ye++<ve||De[0]!=null)&&Ge--);se=De[0]!=null,Ee[0]||Ee.splice(0,1)}if(J==g){for(U=1,Ge=Ee[0];Ge>=10;Ge/=10,U++);Ze(ee,te+(ee.e=U+M*y-1)+1,ce,se)}else ee.e=M,ee.r=+se;return ee}})();function $e(b,E,L,ie){var W,te,ce,J,H;if(L==null?L=Z:K(L,0,8),!b.c)return b.toString();if(W=b.c[0],ce=b.e,E==null)H=O(b.c),H=ie==1||ie==2&&(ce<=ne||ce>=me)?w(H,ce):G(H,ce,"0");else if(b=Ze(new ue(b),E,L),te=b.e,H=O(b.c),J=H.length,ie==1||ie==2&&(E<=te||te<=ne)){for(;J<E;H+="0",J++);H=w(H,te)}else if(E-=ce,H=G(H,te,"0"),te+1>J){if(--E>0)for(H+=".";E--;H+="0");}else if(E+=te-J,E>0)for(te+1==J&&(H+=".");E--;H+="0");return b.s<0&&W?"-"+H:H}function Pe(b,E){for(var L,ie,W=1,te=new ue(b[0]);W<b.length;W++)ie=new ue(b[W]),(!ie.s||(L=k(te,ie))===E||L===0&&te.s===E)&&(te=ie);return te}function Xe(b,E,L){for(var ie=1,W=E.length;!E[--W];E.pop());for(W=E[0];W>=10;W/=10,ie++);return(L=ie+L*y-1)>D?b.c=b.e=null:L<P?b.c=[b.e=0]:(b.e=L,b.c=E),b}z=(function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,L=/^\.([^.]+)$/,ie=/^-?(Infinity|NaN)$/,W=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(te,ce,J,H){var M,U=J?ce:ce.replace(W,"");if(ie.test(U))te.s=isNaN(U)?null:U<0?-1:1;else{if(!J&&(U=U.replace(b,function(se,je,_){return M=(_=_.toLowerCase())=="x"?16:_=="b"?2:8,!H||H==M?je:se}),H&&(M=H,U=U.replace(E,"$1").replace(L,"0.$1")),ce!=U))return new ue(U,M);if(ue.DEBUG)throw Error(c+"Not a"+(H?" base "+H:"")+" number: "+ce);te.s=null}te.c=te.e=null}})();function Ze(b,E,L,ie){var W,te,ce,J,H,M,U,se=b.c,je=x;if(se){e:{for(W=1,J=se[0];J>=10;J/=10,W++);if(te=E-W,te<0)te+=y,ce=E,H=se[M=0],U=m(H/je[W-ce-1]%10);else if(M=f((te+1)/y),M>=se.length)if(ie){for(;se.length<=M;se.push(0));H=U=0,W=1,te%=y,ce=te-y+1}else break e;else{for(H=J=se[M],W=1;J>=10;J/=10,W++);te%=y,ce=te-y+W,U=ce<0?0:m(H/je[W-ce-1]%10)}if(ie=ie||E<0||se[M+1]!=null||(ce<0?H:H%je[W-ce-1]),ie=L<4?(U||ie)&&(L==0||L==(b.s<0?3:2)):U>5||U==5&&(L==4||ie||L==6&&(te>0?ce>0?H/je[W-ce]:0:se[M-1])%10&1||L==(b.s<0?8:7)),E<1||!se[0])return se.length=0,ie?(E-=b.e+1,se[0]=je[(y-E%y)%y],b.e=-E||0):se[0]=b.e=0,b;if(te==0?(se.length=M,J=1,M--):(se.length=M+1,J=je[y-te],se[M]=ce>0?m(H/je[W-ce]%je[ce])*J:0),ie)for(;;)if(M==0){for(te=1,ce=se[0];ce>=10;ce/=10,te++);for(ce=se[0]+=J,J=1;ce>=10;ce/=10,J++);te!=J&&(b.e++,se[0]==g&&(se[0]=1));break}else{if(se[M]+=J,se[M]!=g)break;se[M--]=0,J=1}for(te=se.length;se[--te]===0;se.pop());}b.e>D?b.c=b.e=null:b.e<P&&(b.c=[b.e=0])}return b}function Ue(b){var E,L=b.e;return L===null?b.toString():(E=O(b.c),E=L<=ne||L>=me?w(E,L):G(E,L,"0"),b.s<0?"-"+E:E)}return $.absoluteValue=$.abs=function(){var b=new ue(this);return b.s<0&&(b.s=1),b},$.comparedTo=function(b,E){return k(this,new ue(b,E))},$.decimalPlaces=$.dp=function(b,E){var L,ie,W,te=this;if(b!=null)return K(b,0,v),E==null?E=Z:K(E,0,8),Ze(new ue(te),b+te.e+1,E);if(!(L=te.c))return null;if(ie=((W=L.length-1)-B(this.e/y))*y,W=L[W])for(;W%10==0;W/=10,ie--);return ie<0&&(ie=0),ie},$.dividedBy=$.div=function(b,E){return R(this,new ue(b,E),Q,Z)},$.dividedToIntegerBy=$.idiv=function(b,E){return R(this,new ue(b,E),0,1)},$.exponentiatedBy=$.pow=function(b,E){var L,ie,W,te,ce,J,H,M,U,se=this;if(b=new ue(b),b.c&&!b.isInteger())throw Error(c+"Exponent not an integer: "+Ue(b));if(E!=null&&(E=new ue(E)),J=b.e>14,!se.c||!se.c[0]||se.c[0]==1&&!se.e&&se.c.length==1||!b.c||!b.c[0])return U=new ue(Math.pow(+Ue(se),J?b.s*(2-j(b)):+Ue(b))),E?U.mod(E):U;if(H=b.s<0,E){if(E.c?!E.c[0]:!E.s)return new ue(NaN);ie=!H&&se.isInteger()&&E.isInteger(),ie&&(se=se.mod(E))}else{if(b.e>9&&(se.e>0||se.e<-1||(se.e==0?se.c[0]>1||J&&se.c[1]>=24e7:se.c[0]<8e13||J&&se.c[0]<=9999975e7)))return te=se.s<0&&j(b)?-0:0,se.e>-1&&(te=1/te),new ue(H?1/te:te);be&&(te=f(be/y+2))}for(J?(L=new ue(.5),H&&(b.s=1),M=j(b)):(W=Math.abs(+Ue(b)),M=W%2),U=new ue(re);;){if(M){if(U=U.times(se),!U.c)break;te?U.c.length>te&&(U.c.length=te):ie&&(U=U.mod(E))}if(W){if(W=m(W/2),W===0)break;M=W%2}else if(b=b.times(L),Ze(b,b.e+1,1),b.e>14)M=j(b);else{if(W=+Ue(b),W===0)break;M=W%2}se=se.times(se),te?se.c&&se.c.length>te&&(se.c.length=te):ie&&(se=se.mod(E))}return ie?U:(H&&(U=re.div(U)),E?U.mod(E):te?Ze(U,be,Z,ce):U)},$.integerValue=function(b){var E=new ue(this);return b==null?b=Z:K(b,0,8),Ze(E,E.e+1,b)},$.isEqualTo=$.eq=function(b,E){return k(this,new ue(b,E))===0},$.isFinite=function(){return!!this.c},$.isGreaterThan=$.gt=function(b,E){return k(this,new ue(b,E))>0},$.isGreaterThanOrEqualTo=$.gte=function(b,E){return(E=k(this,new ue(b,E)))===1||E===0},$.isInteger=function(){return!!this.c&&B(this.e/y)>this.c.length-2},$.isLessThan=$.lt=function(b,E){return k(this,new ue(b,E))<0},$.isLessThanOrEqualTo=$.lte=function(b,E){return(E=k(this,new ue(b,E)))===-1||E===0},$.isNaN=function(){return!this.s},$.isNegative=function(){return this.s<0},$.isPositive=function(){return this.s>0},$.isZero=function(){return!!this.c&&this.c[0]==0},$.minus=function(b,E){var L,ie,W,te,ce=this,J=ce.s;if(b=new ue(b,E),E=b.s,!J||!E)return new ue(NaN);if(J!=E)return b.s=-E,ce.plus(b);var H=ce.e/y,M=b.e/y,U=ce.c,se=b.c;if(!H||!M){if(!U||!se)return U?(b.s=-E,b):new ue(se?ce:NaN);if(!U[0]||!se[0])return se[0]?(b.s=-E,b):new ue(U[0]?ce:Z==3?-0:0)}if(H=B(H),M=B(M),U=U.slice(),J=H-M){for((te=J<0)?(J=-J,W=U):(M=H,W=se),W.reverse(),E=J;E--;W.push(0));W.reverse()}else for(ie=(te=(J=U.length)<(E=se.length))?J:E,J=E=0;E<ie;E++)if(U[E]!=se[E]){te=U[E]<se[E];break}if(te&&(W=U,U=se,se=W,b.s=-b.s),E=(ie=se.length)-(L=U.length),E>0)for(;E--;U[L++]=0);for(E=g-1;ie>J;){if(U[--ie]<se[ie]){for(L=ie;L&&!U[--L];U[L]=E);--U[L],U[ie]+=g}U[ie]-=se[ie]}for(;U[0]==0;U.splice(0,1),--M);return U[0]?Xe(b,U,M):(b.s=Z==3?-1:1,b.c=[b.e=0],b)},$.modulo=$.mod=function(b,E){var L,ie,W=this;return b=new ue(b,E),!W.c||!b.s||b.c&&!b.c[0]?new ue(NaN):!b.c||W.c&&!W.c[0]?new ue(W):(ae==9?(ie=b.s,b.s=1,L=R(W,b,0,3),b.s=ie,L.s*=ie):L=R(W,b,0,ae),b=W.minus(L.times(b)),!b.c[0]&&ae==1&&(b.s=W.s),b)},$.multipliedBy=$.times=function(b,E){var L,ie,W,te,ce,J,H,M,U,se,je,_,I,ee,Ee,De=this,Ce=De.c,Te=(b=new ue(b,E)).c;if(!Ce||!Te||!Ce[0]||!Te[0])return!De.s||!b.s||Ce&&!Ce[0]&&!Te||Te&&!Te[0]&&!Ce?b.c=b.e=b.s=null:(b.s*=De.s,!Ce||!Te?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(ie=B(De.e/y)+B(b.e/y),b.s*=De.s,H=Ce.length,se=Te.length,H<se&&(I=Ce,Ce=Te,Te=I,W=H,H=se,se=W),W=H+se,I=[];W--;I.push(0));for(ee=g,Ee=A,W=se;--W>=0;){for(L=0,je=Te[W]%Ee,_=Te[W]/Ee|0,ce=H,te=W+ce;te>W;)M=Ce[--ce]%Ee,U=Ce[ce]/Ee|0,J=_*M+U*je,M=je*M+J%Ee*Ee+I[te]+L,L=(M/ee|0)+(J/Ee|0)+_*U,I[te--]=M%ee;I[te]=L}return L?++ie:I.splice(0,1),Xe(b,I,ie)},$.negated=function(){var b=new ue(this);return b.s=-b.s||null,b},$.plus=function(b,E){var L,ie=this,W=ie.s;if(b=new ue(b,E),E=b.s,!W||!E)return new ue(NaN);if(W!=E)return b.s=-E,ie.minus(b);var te=ie.e/y,ce=b.e/y,J=ie.c,H=b.c;if(!te||!ce){if(!J||!H)return new ue(W/0);if(!J[0]||!H[0])return H[0]?b:new ue(J[0]?ie:W*0)}if(te=B(te),ce=B(ce),J=J.slice(),W=te-ce){for(W>0?(ce=te,L=H):(W=-W,L=J),L.reverse();W--;L.push(0));L.reverse()}for(W=J.length,E=H.length,W-E<0&&(L=H,H=J,J=L,E=W),W=0;E;)W=(J[--E]=J[E]+H[E]+W)/g|0,J[E]=g===J[E]?0:J[E]%g;return W&&(J=[W].concat(J),++ce),Xe(b,J,ce)},$.precision=$.sd=function(b,E){var L,ie,W,te=this;if(b!=null&&b!==!!b)return K(b,1,v),E==null?E=Z:K(E,0,8),Ze(new ue(te),b,E);if(!(L=te.c))return null;if(W=L.length-1,ie=W*y+1,W=L[W]){for(;W%10==0;W/=10,ie--);for(W=L[0];W>=10;W/=10,ie++);}return b&&te.e+1>ie&&(ie=te.e+1),ie},$.shiftedBy=function(b){return K(b,-S,S),this.times("1e"+b)},$.squareRoot=$.sqrt=function(){var b,E,L,ie,W,te=this,ce=te.c,J=te.s,H=te.e,M=Q+4,U=new ue("0.5");if(J!==1||!ce||!ce[0])return new ue(!J||J<0&&(!ce||ce[0])?NaN:ce?te:1/0);if(J=Math.sqrt(+Ue(te)),J==0||J==1/0?(E=O(ce),(E.length+H)%2==0&&(E+="0"),J=Math.sqrt(+E),H=B((H+1)/2)-(H<0||H%2),J==1/0?E="5e"+H:(E=J.toExponential(),E=E.slice(0,E.indexOf("e")+1)+H),L=new ue(E)):L=new ue(J+""),L.c[0]){for(H=L.e,J=H+M,J<3&&(J=0);;)if(W=L,L=U.times(W.plus(R(te,W,M,1))),O(W.c).slice(0,J)===(E=O(L.c)).slice(0,J))if(L.e<H&&--J,E=E.slice(J-3,J+1),E=="9999"||!ie&&E=="4999"){if(!ie&&(Ze(W,W.e+Q+2,0),W.times(W).eq(te))){L=W;break}M+=4,J+=4,ie=1}else{(!+E||!+E.slice(1)&&E.charAt(0)=="5")&&(Ze(L,L.e+Q+2,1),b=!L.times(L).eq(te));break}}return Ze(L,L.e+Q+1,Z,b)},$.toExponential=function(b,E){return b!=null&&(K(b,0,v),b++),$e(this,b,E,1)},$.toFixed=function(b,E){return b!=null&&(K(b,0,v),b=b+this.e+1),$e(this,b,E)},$.toFormat=function(b,E,L){var ie,W=this;if(L==null)b!=null&&E&&typeof E=="object"?(L=E,E=null):b&&typeof b=="object"?(L=b,b=E=null):L=Me;else if(typeof L!="object")throw Error(c+"Argument not an object: "+L);if(ie=W.toFixed(b,E),W.c){var te,ce=ie.split("."),J=+L.groupSize,H=+L.secondaryGroupSize,M=L.groupSeparator||"",U=ce[0],se=ce[1],je=W.s<0,_=je?U.slice(1):U,I=_.length;if(H&&(te=J,J=H,H=te,I-=te),J>0&&I>0){for(te=I%J||J,U=_.substr(0,te);te<I;te+=J)U+=M+_.substr(te,J);H>0&&(U+=M+_.slice(te)),je&&(U="-"+U)}ie=se?U+(L.decimalSeparator||"")+((H=+L.fractionGroupSize)?se.replace(new RegExp("\\d{"+H+"}\\B","g"),"$&"+(L.fractionGroupSeparator||"")):se):U}return(L.prefix||"")+ie+(L.suffix||"")},$.toFraction=function(b){var E,L,ie,W,te,ce,J,H,M,U,se,je,_=this,I=_.c;if(b!=null&&(J=new ue(b),!J.isInteger()&&(J.c||J.s!==1)||J.lt(re)))throw Error(c+"Argument "+(J.isInteger()?"out of range: ":"not an integer: ")+Ue(J));if(!I)return new ue(_);for(E=new ue(re),M=L=new ue(re),ie=H=new ue(re),je=O(I),te=E.e=je.length-_.e-1,E.c[0]=x[(ce=te%y)<0?y+ce:ce],b=!b||J.comparedTo(E)>0?te>0?E:M:J,ce=D,D=1/0,J=new ue(je),H.c[0]=0;U=R(J,E,0,1),W=L.plus(U.times(ie)),W.comparedTo(b)!=1;)L=ie,ie=W,M=H.plus(U.times(W=M)),H=W,E=J.minus(U.times(W=E)),J=W;return W=R(b.minus(L),ie,0,1),H=H.plus(W.times(M)),L=L.plus(W.times(ie)),H.s=M.s=_.s,te=te*2,se=R(M,ie,te,Z).minus(_).abs().comparedTo(R(H,L,te,Z).minus(_).abs())<1?[M,ie]:[H,L],D=ce,se},$.toNumber=function(){return+Ue(this)},$.toPrecision=function(b,E){return b!=null&&K(b,1,v),$e(this,b,E,2)},$.toString=function(b){var E,L=this,ie=L.s,W=L.e;return W===null?ie?(E="Infinity",ie<0&&(E="-"+E)):E="NaN":(b==null?E=W<=ne||W>=me?w(O(L.c),W):G(O(L.c),W,"0"):b===10&&Ae?(L=Ze(new ue(L),Q+W+1,Z),E=G(O(L.c),L.e,"0")):(K(b,2,Fe.length,"Base"),E=q(G(O(L.c),W,"0"),10,b,ie,!0)),ie<0&&L.c[0]&&(E="-"+E)),E},$.valueOf=$.toJSON=function(){return Ue(this)},$._isBigNumber=!0,T!=null&&ue.set(T),ue}function B(T){var R=T|0;return T>0||T===R?R:R-1}function O(T){for(var R,q,z=1,$=T.length,re=T[0]+"";z<$;){for(R=T[z++]+"",q=y-R.length;q--;R="0"+R);re+=R}for($=re.length;re.charCodeAt(--$)===48;);return re.slice(0,$+1||1)}function k(T,R){var q,z,$=T.c,re=R.c,Q=T.s,Z=R.s,ne=T.e,me=R.e;if(!Q||!Z)return null;if(q=$&&!$[0],z=re&&!re[0],q||z)return q?z?0:-Z:Q;if(Q!=Z)return Q;if(q=Q<0,z=ne==me,!$||!re)return z?0:!$^q?1:-1;if(!z)return ne>me^q?1:-1;for(Z=(ne=$.length)<(me=re.length)?ne:me,Q=0;Q<Z;Q++)if($[Q]!=re[Q])return $[Q]>re[Q]^q?1:-1;return ne==me?0:ne>me^q?1:-1}function K(T,R,q,z){if(T<R||T>q||T!==m(T))throw Error(c+(z||"Argument")+(typeof T=="number"?T<R||T>q?" out of range: ":" not an integer: ":" not a primitive number: ")+String(T))}function j(T){var R=T.c.length-1;return B(T.e/y)==R&&T.c[R]%2!=0}function w(T,R){return(T.length>1?T.charAt(0)+"."+T.slice(1):T)+(R<0?"e":"e+")+R}function G(T,R,q){var z,$;if(R<0){for($=q+".";++R;$+=q);T=$+T}else if(z=T.length,++R>z){for($=q,R-=z;--R;$+=q);T+=$}else R<z&&(T=T.slice(0,R)+"."+T.slice(R));return T}o=N(),o.default=o.BigNumber=o,a.exports?a.exports=o:(r||(r=typeof self<"u"&&self?self:window),r.BigNumber=o)})(vC)})(T0);var k0=T0.exports;const Da=Pf(),LC=Of(),IC=zf,$C=k0,pn={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},fs={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:F0,decimalSuffixes:Pl}=Da.currentBytes(),qf={general:{scale:1024,suffixes:Pl},binary:{scale:1024,suffixes:F0},decimal:{scale:1e3,suffixes:Pl}};function VC(a,r={},o){if(typeof r=="string"&&(r=IC.parseFormat(r)),!LC.validateFormat(r))return"ERROR: invalid format";let f=r.prefix||"",m=r.postfix||"",c=HC(a,r,o);return c=c1(c,f),c=d1(c,m),c}function HC(a,r,o){switch(r.output){case"currency":return r=ao(r,Da.currentCurrencyDefaultFormat()),JC(a,r,Da);case"percent":return r=ao(r,Da.currentPercentageDefaultFormat()),WC(a,r,Da,o);case"byte":return r=ao(r,Da.currentByteDefaultFormat()),QC(a,r,Da,o);case"time":return r=ao(r,Da.currentTimeDefaultFormat()),XC(a);case"ordinal":return r=ao(r,Da.currentOrdinalDefaultFormat()),ZC(a,r,Da);default:return ms({instance:a,providedFormat:r})}}function YC(a){let r=qf.decimal;return Jl(a._value,r.suffixes,r.scale).suffix}function GC(a){let r=qf.binary;return Jl(a._value,r.suffixes,r.scale).suffix}function KC(a){let r=qf.general;return Jl(a._value,r.suffixes,r.scale).suffix}function Jl(a,r,o){let s=r[0],f=Math.abs(a);if(f>=o){for(let m=1;m<r.length;++m){let c=Math.pow(o,m),h=Math.pow(o,m+1);if(f>=c&&f<h){s=r[m],a=a/c;break}}s===r[0]&&(a=a/Math.pow(o,r.length-1),s=r[r.length-1])}return{value:a,suffix:s}}function QC(a,r,o,s){let f=r.base||"binary",m=Object.assign({},fs,r);const{binarySuffixes:c,decimalSuffixes:h}=o.currentBytes();let y={general:{scale:1024,suffixes:h||Pl,marker:"bd"},binary:{scale:1024,suffixes:c||F0,marker:"b"},decimal:{scale:1e3,suffixes:h||Pl,marker:"d"}}[f],{value:S,suffix:x}=Jl(a._value,y.suffixes,y.scale);return`${ms({instance:s(S),providedFormat:r,state:o,defaults:o.currentByteDefaultFormat()})}${m.spaceSeparated?" ":""}${x}`}function ZC(a,r,o){let s=o.currentOrdinal(),f=Object.assign({},fs,r),m=ms({instance:a,providedFormat:r,state:o}),c=s(a._value);return`${m}${f.spaceSeparated?" ":""}${c}`}function XC(a){let r=Math.floor(a._value/60/60),o=Math.floor((a._value-r*60*60)/60),s=Math.round(a._value-r*60*60-o*60);return`${r}:${o<10?"0":""}${o}:${s<10?"0":""}${s}`}function WC(a,r,o,s){let f=r.prefixSymbol,m=ms({instance:s(a._value*100),providedFormat:r,state:o}),c=Object.assign({},fs,r);return f?`%${c.spaceSeparated?" ":""}${m}`:`${m}${c.spaceSeparated?" ":""}%`}function JC(a,r,o){const s=o.currentCurrency();let f=Object.assign({},r),m=Object.assign({},fs,f),c,h="",g=!!m.totalLength||!!m.forceAverage||m.average,y=f.currencyPosition||s.position,S=f.currencySymbol||s.symbol;const x=m.spaceSeparatedCurrency!==void 0?m.spaceSeparatedCurrency:m.spaceSeparated;f.lowPrecision===void 0&&(f.lowPrecision=!1),x&&(h=" "),y==="infix"&&(c=h+S+h);let A=ms({instance:a,providedFormat:f,state:o,decimalSeparator:c});return y==="prefix"&&(a._value<0&&m.negative==="sign"?A=`-${h}${S}${A.slice(1)}`:a._value>0&&m.forceSign?A=`+${h}${S}${A.slice(1)}`:A=S+h+A),(!y||y==="postfix")&&(h=!m.spaceSeparatedAbbreviation&&g?"":h,A=A+h+S),A}function e1({value:a,forceAverage:r,lowPrecision:o=!0,abbreviations:s,spaceSeparated:f=!1,totalLength:m=0,roundingFunction:c=Math.round}){let h="",g=Math.abs(a),y=-1;if(r&&s[r]&&pn[r]?(h=s[r],a=a/pn[r]):g>=pn.trillion||o&&c(g/pn.trillion)===1?(h=s.trillion,a=a/pn.trillion):g<pn.trillion&&g>=pn.billion||o&&c(g/pn.billion)===1?(h=s.billion,a=a/pn.billion):g<pn.billion&&g>=pn.million||o&&c(g/pn.million)===1?(h=s.million,a=a/pn.million):(g<pn.million&&g>=pn.thousand||o&&c(g/pn.thousand)===1)&&(h=s.thousand,a=a/pn.thousand),h&&(h=(f?" ":"")+h),m){let x=a<0,A=a.toString().split(".")[0],v=x?A.length-1:A.length;y=Math.max(m-v,0)}return{value:a,abbreviation:h,mantissaPrecision:y}}function t1({value:a,characteristicPrecision:r}){let[o,s]=a.toExponential().split("e"),f=+o;if(!r)return{value:f,abbreviation:`e${s}`};let m=1;return m<r&&(f=f*Math.pow(10,r-m),s=+s-(r-m),s=s>=0?`+${s}`:s),{value:f,abbreviation:`e${s}`}}function Tl(a){let r="";for(let o=0;o<a;o++)r+="0";return r}function n1(a,r){let o=a.toString(),[s,f]=o.split("e"),[m,c=""]=s.split(".");if(+f>0)o=m+c+Tl(f-c.length);else{let h=".";+m<0?h=`-0${h}`:h=`0${h}`;let g=(Tl(-f-1)+Math.abs(m)+c).substr(0,r);g.length<r&&(g+=Tl(r-g.length)),o=h+g}return+f>0&&r>0&&(o+=`.${Tl(r)}`),o}function a1(a,r,o=Math.round){return a.toString().indexOf("e")!==-1?n1(a,r):new $C(o(+`${a}e+${r}`)/Math.pow(10,r)).toFixed(r)}function i1(a,r,o,s,f,m){if(s===-1)return a;let c=a1(r,s,m),[h,g=""]=c.toString().split(".");if(g.match(/^0+$/)&&(o||f))return h;let y=g.match(/0+$/);return f&&y?`${h}.${g.toString().slice(0,y.index)}`:c.toString()}function r1(a,r,o,s){let f=a,[m,c]=f.toString().split(".");if(m.match(/^-?0$/)&&o)return c?`${m.replace("0","")}.${c}`:m.replace("0","");const h=r<0&&m.indexOf("-")===0;if(h&&(m=m.slice(1),f=f.slice(1)),m.length<s){let g=s-m.length;for(let y=0;y<g;y++)f=`0${f}`}return h&&(f=`-${f}`),f.toString()}function o1(a,r){let o=[],s=0;for(let f=a;f>0;f--)s===r&&(o.unshift(f),s=0),s++;return o}function s1(a,r,o,s,f){let m=s.currentDelimiters(),c=m.thousands;f=f||m.decimal;let h=m.thousandsSize||3,g=a.toString(),y=g.split(".")[0],S=g.split(".")[1];const x=r<0&&y.indexOf("-")===0;return o&&(x&&(y=y.slice(1)),o1(y.length,h).forEach((v,N)=>{y=y.slice(0,v+N)+c+y.slice(v+N)}),x&&(y=`-${y}`)),S?g=y+f+S:g=y,g}function l1(a,r){return a+r}function u1(a,r,o){return r===0?a:+a==0?a.replace("-",""):r>0?`+${a}`:o==="sign"?a:`(${a.replace("-","")})`}function c1(a,r){return r+a}function d1(a,r){return a+r}function ms({instance:a,providedFormat:r,state:o=Da,decimalSeparator:s,defaults:f=o.currentDefaults()}){let m=a._value;if(m===0&&o.hasZeroFormat())return o.getZeroFormat();if(!isFinite(m))return m.toString();let c=Object.assign({},fs,f,r),h=c.totalLength,g=h?0:c.characteristic,y=c.optionalCharacteristic,S=c.forceAverage,x=c.lowPrecision,A=!!h||!!S||c.average,v=h?-1:A&&r.mantissa===void 0?0:c.mantissa,N=h?!1:r.optionalMantissa===void 0?v===-1:c.optionalMantissa,B=c.trimMantissa,O=c.thousandSeparated,k=c.spaceSeparated,K=c.negative,j=c.forceSign,w=c.exponential,G=c.roundingFunction,T="";if(A){let q=e1({value:m,forceAverage:S,lowPrecision:x,abbreviations:o.currentAbbreviations(),spaceSeparated:k,roundingFunction:G,totalLength:h});m=q.value,T+=q.abbreviation,h&&(v=q.mantissaPrecision)}if(w){let q=t1({value:m,characteristicPrecision:g});m=q.value,T=q.abbreviation+T}let R=i1(m.toString(),m,N,v,B,G);return R=r1(R,m,y,g),R=s1(R,m,O,o,s),(A||w)&&(R=l1(R,T)),(j||m<0)&&(R=u1(R,m,K)),R}function ao(a,r){if(!a)return r;let o=Object.keys(a);return o.length===1&&o[0]==="output"?r:a}var f1=a=>({format:(...r)=>VC(...r,a),getByteUnit:(...r)=>KC(...r,a),getBinaryByteUnit:(...r)=>GC(...r,a),getDecimalByteUnit:(...r)=>YC(...r,a),formatOrDefault:ao});const ai=k0;function m1(a,r,o){let s=new ai(a._value),f=r;return o.isNumbro(r)&&(f=r._value),f=new ai(f),a._value=s.plus(f).toNumber(),a}function j0(a,r,o){let s=new ai(a._value),f=r;return o.isNumbro(r)&&(f=r._value),f=new ai(f),a._value=s.minus(f).toNumber(),a}function p1(a,r,o){let s=new ai(a._value),f=r;return o.isNumbro(r)&&(f=r._value),f=new ai(f),a._value=s.times(f).toNumber(),a}function h1(a,r,o){let s=new ai(a._value),f=r;return o.isNumbro(r)&&(f=r._value),f=new ai(f),a._value=s.dividedBy(f).toNumber(),a}function y1(a,r,o){let s=r;return o.isNumbro(r)&&(s=r._value),a._value=s,a}function g1(a,r,o){let s=o(a._value);return j0(s,r,o),Math.abs(s._value)}var D1=a=>({add:(r,o)=>m1(r,o,a),subtract:(r,o)=>j0(r,o,a),multiply:(r,o)=>p1(r,o,a),divide:(r,o)=>h1(r,o,a),set:(r,o)=>y1(r,o,a),difference:(r,o)=>g1(r,o,a),BigNumber:ai});const v1="2.5.0",ka=Pf(),b1=Of(),x1=qC(Yt),C1=w0();let sr=f1(Yt),lr=D1(Yt);const S1=zf;class R0{constructor(r){this._value=r}clone(){return Yt(this._value)}format(r={}){return sr.format(this,r)}formatCurrency(r){return typeof r=="string"&&(r=S1.parseFormat(r)),r=sr.formatOrDefault(r,ka.currentCurrencyDefaultFormat()),r.output="currency",sr.format(this,r)}formatTime(r={}){return r.output="time",sr.format(this,r)}binaryByteUnits(){return sr.getBinaryByteUnit(this)}decimalByteUnits(){return sr.getDecimalByteUnit(this)}byteUnits(){return sr.getByteUnit(this)}difference(r){return lr.difference(this,r)}add(r){return lr.add(this,r)}subtract(r){return lr.subtract(this,r)}multiply(r){return lr.multiply(this,r)}divide(r){return lr.divide(this,r)}set(r){return lr.set(this,M0(r))}value(){return this._value}valueOf(){return this._value}}function M0(a){let r=a;return Yt.isNumbro(a)?r=a._value:typeof a=="string"?r=Yt.unformat(a):isNaN(a)&&(r=NaN),r}function Yt(a){return new R0(M0(a))}Yt.version=v1;Yt.isNumbro=function(a){return a instanceof R0};Yt.language=ka.currentLanguage;Yt.registerLanguage=ka.registerLanguage;Yt.setLanguage=ka.setLanguage;Yt.languages=ka.languages;Yt.languageData=ka.languageData;Yt.zeroFormat=ka.setZeroFormat;Yt.defaultFormat=ka.currentDefaults;Yt.setDefaults=ka.setDefaults;Yt.defaultCurrencyFormat=ka.currentCurrencyDefaultFormat;Yt.validate=b1.validate;Yt.loadLanguagesInNode=x1.loadLanguagesInNode;Yt.unformat=C1.unformat;Yt.BigNumber=lr.BigNumber;var _1=Yt,A1=bC(_1);function E1({onlyFirst:a=!1}={}){const f="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(f,a?void 0:"g")}const w1=E1();function T1(a){if(typeof a!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof a}\``);return!a.includes("\x1B")&&!a.includes("›")?a:a.replace(w1,"")}var jd={exports:{}},sg;function k1(){return sg||(sg=1,(function(a){var r={};a.exports=r,r.eastAsianWidth=function(s){var f=s.charCodeAt(0),m=s.length==2?s.charCodeAt(1):0,c=f;return 55296<=f&&f<=56319&&56320<=m&&m<=57343&&(f&=1023,m&=1023,c=f<<10|m,c+=65536),c==12288||65281<=c&&c<=65376||65504<=c&&c<=65510?"F":c==8361||65377<=c&&c<=65470||65474<=c&&c<=65479||65482<=c&&c<=65487||65490<=c&&c<=65495||65498<=c&&c<=65500||65512<=c&&c<=65518?"H":4352<=c&&c<=4447||4515<=c&&c<=4519||4602<=c&&c<=4607||9001<=c&&c<=9002||11904<=c&&c<=11929||11931<=c&&c<=12019||12032<=c&&c<=12245||12272<=c&&c<=12283||12289<=c&&c<=12350||12353<=c&&c<=12438||12441<=c&&c<=12543||12549<=c&&c<=12589||12593<=c&&c<=12686||12688<=c&&c<=12730||12736<=c&&c<=12771||12784<=c&&c<=12830||12832<=c&&c<=12871||12880<=c&&c<=13054||13056<=c&&c<=19903||19968<=c&&c<=42124||42128<=c&&c<=42182||43360<=c&&c<=43388||44032<=c&&c<=55203||55216<=c&&c<=55238||55243<=c&&c<=55291||63744<=c&&c<=64255||65040<=c&&c<=65049||65072<=c&&c<=65106||65108<=c&&c<=65126||65128<=c&&c<=65131||110592<=c&&c<=110593||127488<=c&&c<=127490||127504<=c&&c<=127546||127552<=c&&c<=127560||127568<=c&&c<=127569||131072<=c&&c<=194367||177984<=c&&c<=196605||196608<=c&&c<=262141?"W":32<=c&&c<=126||162<=c&&c<=163||165<=c&&c<=166||c==172||c==175||10214<=c&&c<=10221||10629<=c&&c<=10630?"Na":c==161||c==164||167<=c&&c<=168||c==170||173<=c&&c<=174||176<=c&&c<=180||182<=c&&c<=186||188<=c&&c<=191||c==198||c==208||215<=c&&c<=216||222<=c&&c<=225||c==230||232<=c&&c<=234||236<=c&&c<=237||c==240||242<=c&&c<=243||247<=c&&c<=250||c==252||c==254||c==257||c==273||c==275||c==283||294<=c&&c<=295||c==299||305<=c&&c<=307||c==312||319<=c&&c<=322||c==324||328<=c&&c<=331||c==333||338<=c&&c<=339||358<=c&&c<=359||c==363||c==462||c==464||c==466||c==468||c==470||c==472||c==474||c==476||c==593||c==609||c==708||c==711||713<=c&&c<=715||c==717||c==720||728<=c&&c<=731||c==733||c==735||768<=c&&c<=879||913<=c&&c<=929||931<=c&&c<=937||945<=c&&c<=961||963<=c&&c<=969||c==1025||1040<=c&&c<=1103||c==1105||c==8208||8211<=c&&c<=8214||8216<=c&&c<=8217||8220<=c&&c<=8221||8224<=c&&c<=8226||8228<=c&&c<=8231||c==8240||8242<=c&&c<=8243||c==8245||c==8251||c==8254||c==8308||c==8319||8321<=c&&c<=8324||c==8364||c==8451||c==8453||c==8457||c==8467||c==8470||8481<=c&&c<=8482||c==8486||c==8491||8531<=c&&c<=8532||8539<=c&&c<=8542||8544<=c&&c<=8555||8560<=c&&c<=8569||c==8585||8592<=c&&c<=8601||8632<=c&&c<=8633||c==8658||c==8660||c==8679||c==8704||8706<=c&&c<=8707||8711<=c&&c<=8712||c==8715||c==8719||c==8721||c==8725||c==8730||8733<=c&&c<=8736||c==8739||c==8741||8743<=c&&c<=8748||c==8750||8756<=c&&c<=8759||8764<=c&&c<=8765||c==8776||c==8780||c==8786||8800<=c&&c<=8801||8804<=c&&c<=8807||8810<=c&&c<=8811||8814<=c&&c<=8815||8834<=c&&c<=8835||8838<=c&&c<=8839||c==8853||c==8857||c==8869||c==8895||c==8978||9312<=c&&c<=9449||9451<=c&&c<=9547||9552<=c&&c<=9587||9600<=c&&c<=9615||9618<=c&&c<=9621||9632<=c&&c<=9633||9635<=c&&c<=9641||9650<=c&&c<=9651||9654<=c&&c<=9655||9660<=c&&c<=9661||9664<=c&&c<=9665||9670<=c&&c<=9672||c==9675||9678<=c&&c<=9681||9698<=c&&c<=9701||c==9711||9733<=c&&c<=9734||c==9737||9742<=c&&c<=9743||9748<=c&&c<=9749||c==9756||c==9758||c==9792||c==9794||9824<=c&&c<=9825||9827<=c&&c<=9829||9831<=c&&c<=9834||9836<=c&&c<=9837||c==9839||9886<=c&&c<=9887||9918<=c&&c<=9919||9924<=c&&c<=9933||9935<=c&&c<=9953||c==9955||9960<=c&&c<=9983||c==10045||c==10071||10102<=c&&c<=10111||11093<=c&&c<=11097||12872<=c&&c<=12879||57344<=c&&c<=63743||65024<=c&&c<=65039||c==65533||127232<=c&&c<=127242||127248<=c&&c<=127277||127280<=c&&c<=127337||127344<=c&&c<=127386||917760<=c&&c<=917999||983040<=c&&c<=1048573||1048576<=c&&c<=1114109?"A":"N"},r.characterLength=function(s){var f=this.eastAsianWidth(s);return f=="F"||f=="W"||f=="A"?2:1};function o(s){return s.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}r.length=function(s){for(var f=o(s),m=0,c=0;c<f.length;c++)m=m+this.characterLength(f[c]);return m},r.slice=function(s,f,m){textLen=r.length(s),f=f||0,m=m||1,f<0&&(f=textLen+f),m<0&&(m=textLen+m);for(var c="",h=0,g=o(s),y=0;y<g.length;y++){var S=g[y],x=r.length(S);if(h>=f-(x==2?1:0))if(h+x<=m)c+=S;else break;h+=x}return c}})(jd)),jd.exports}var F1=k1();const j1=ri(F1);var Rd,lg;function R1(){return lg||(lg=1,Rd=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}),Rd}var M1=R1();const N1=ri(M1);function B1(a,r={}){if(typeof a!="string"||a.length===0||(r={ambiguousIsNarrow:!0,...r},a=T1(a),a.length===0))return 0;a=a.replace(N1()," ");const o=r.ambiguousIsNarrow?1:2;let s=0;for(const f of a){const m=f.codePointAt(0);if(m<=31||m>=127&&m<=159||m>=768&&m<=879)continue;switch(j1.eastAsianWidth(f)){case"F":case"W":s+=2;break;case"A":s+=o;break;default:s+=1}}return s}var Bi=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["Andorra","ad","376"],["Angola","ao","244"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54","(..) ........",0],["Armenia","am","374",".. ......"],["Aruba","aw","297"],["Australia","au","61",". .... ....",0],["Austria","at","43"],["Azerbaijan","az","994","(..) ... .. .."],["Bahamas","bs","1242"],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1246"],["Belarus","by","375","(..) ... .. .."],["Belgium","be","32","... .. .. .."],["Belize","bz","501"],["Benin","bj","229"],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55","(..) ........."],["British Indian Ocean Territory","io","246"],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599","",1],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86","... .... ...."],["Colombia","co","57","... ... ...."],["Comoros","km","269"],["Congo","cd","243"],["Congo","cg","242"],["Costa Rica","cr","506","....-...."],["Côte d'Ivoire","ci","225",".. .. .. .. .."],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599","",0],["Cyprus","cy","357",".. ......"],["Czech Republic","cz","420","... ... ..."],["Denmark","dk","45",".. .. .. .."],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic","do","1","",2],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503","....-...."],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372",".... ......"],["Ethiopia","et","251"],["Fiji","fj","679"],["Finland","fi","358",".. ... .. .."],["France","fr","33",". .. .. .. .."],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49",".... ........"],["Ghana","gh","233"],["Greece","gr","30"],["Grenada","gd","1473"],["Guadeloupe","gp","590","",0],["Guam","gu","1671"],["Guatemala","gt","502","....-...."],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509","....-...."],["Honduras","hn","504"],["Hong Kong","hk","852",".... ...."],["Hungary","hu","36"],["Iceland","is","354","... ...."],["India","in","91",".....-....."],["Indonesia","id","62"],["Iran","ir","98","... ... ...."],["Iraq","iq","964"],["Ireland","ie","353",".. ......."],["Israel","il","972","... ... ...."],["Italy","it","39","... .......",0],["Jamaica","jm","1876"],["Japan","jp","81",".. .... ...."],["Jordan","jo","962"],["Kazakhstan","kz","7","... ...-..-..",0],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996","... ... ..."],["Laos","la","856"],["Latvia","lv","371",".. ... ..."],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Macedonia","mk","389"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60","..-....-...."],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mexico","mx","52","... ... ....",0],["Micronesia","fm","691"],["Moldova","md","373","(..) ..-..-.."],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Morocco","ma","212"],["Mozambique","mz","258"],["Myanmar","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31",".. ........"],["New Caledonia","nc","687"],["New Zealand","nz","64","...-...-...."],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["North Korea","kp","850"],["Norway","no","47","... .. ..."],["Oman","om","968"],["Pakistan","pk","92","...-......."],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63",".... ......."],["Poland","pl","48","...-...-..."],["Portugal","pt","351"],["Puerto Rico","pr","1","",3],["Qatar","qa","974"],["Réunion","re","262"],["Romania","ro","40"],["Russia","ru","7","(...) ...-..-..",1],["Rwanda","rw","250"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65","....-...."],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82","... .... ...."],["South Sudan","ss","211"],["Spain","es","34","... ... ..."],["Sri Lanka","lk","94"],["Sudan","sd","249"],["Suriname","sr","597"],["Swaziland","sz","268"],["Sweden","se","46","(...) ...-..."],["Switzerland","ch","41",".. ... .. .."],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia","tn","216"],["Turkey","tr","90","... ... .. .."],["Turkmenistan","tm","993"],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380","(..) ... .. .."],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",".... ......"],["United States","us","1","(...) ...-....",0],["Uruguay","uy","598"],["Uzbekistan","uz","998",".. ... .. .."],["Vanuatu","vu","678"],["Vatican City","va","39",".. .... ....",1],["Venezuela","ve","58"],["Vietnam","vn","84"],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"]],U1="react-international-phone-",N0=(...a)=>a.filter(r=>!!r).join(" ").trim(),O1=(...a)=>N0(...a).split(" ").map(r=>`${U1}${r}`).join(" "),ug=({addPrefix:a,rawClassNames:r})=>N0(O1(...a),...r),z1=({value:a,mask:r,maskSymbol:o,offset:s=0,trimNonMaskCharsLeftover:f=!1})=>{if(a.length<s)return a;let m=a.slice(0,s),c=a.slice(s),h=m,g=0;for(let y of r.split("")){if(g>=c.length){if(!f&&y!==o){h+=y;continue}break}y===o?(h+=c[g],g+=1):h+=y}return h},ql=a=>a.replace(/\D/g,""),Wa=a=>{let[r,o,s,f,m,c]=a;return{name:r,iso2:o,dialCode:s,format:f,priority:m,areaCodes:c}},P1=a=>`Field "${a}" is not supported`,Ml=({field:a,value:r,countries:o=Bi})=>{if(["priority"].includes(a))throw new Error(P1(a));let s=o.find(f=>{let m=Wa(f);return r===m[a]});if(s)return Wa(s)},cg=({phone:a,countries:r=Bi,currentCountryIso2:o})=>{let s={country:void 0,fullDialCodeMatch:!1};if(!a)return s;let f=ql(a);if(!f)return s;let m=s,c=({country:h,fullDialCodeMatch:g})=>{let y=h.dialCode===m.country?.dialCode,S=(h.priority??0)<(m.country?.priority??0);(!y||S)&&(m={country:h,fullDialCodeMatch:g})};for(let h of r){let g=Wa(h),{dialCode:y,areaCodes:S}=g;if(f.startsWith(y)){let x=m.country?Number(y)>=Number(m.country.dialCode):!0;if(S){let A=f.substring(y.length);for(let v of S)if(A.startsWith(v))return{country:g,fullDialCodeMatch:!0}}(x||y===f||!m.fullDialCodeMatch)&&c({country:g,fullDialCodeMatch:!0})}m.fullDialCodeMatch||f.length<y.length&&y.startsWith(f)&&(!m.country||Number(y)<=Number(m.country.dialCode))&&c({country:g,fullDialCodeMatch:!1})}if(o){let h=Ml({value:o,field:"iso2",countries:r});if(!h)return m;let g=h?(y=>{if(!y?.areaCodes)return!1;let S=f.substring(y.dialCode.length);return y.areaCodes.some(x=>x.startsWith(S))})(h):!1;m&&m.country?.dialCode===h.dialCode&&m.country!==h&&m.fullDialCodeMatch&&(!h.areaCodes||g)&&(m={country:h,fullDialCodeMatch:!0})}return m},q1=({phone:a,dialCode:r,prefix:o="+",charAfterDialCode:s=" "})=>{if(!a||!r)return a;let f=a;return f.startsWith(o)&&(f=f.replace(o,"")),f.startsWith(r)?(f=f.replace(r,""),f.startsWith(s)&&(f=f.replace(s,"")),f):a},L1=({phone:a,dialCode:r,prefix:o="+",charAfterDialCode:s=" "})=>`${o}${r}${s}${q1({phone:a,dialCode:r,charAfterDialCode:s,prefix:o})}`,I1=(a,r)=>{let o=r.disableDialCodeAndPrefix?!1:r.forceDialCode,s=r.disableDialCodeAndPrefix?!1:r.insertDialCodeOnEmpty,f=a,m=y=>r.trimNonDigitsEnd?y.trim():y;if(!f)return s&&!f.length||o?m(`${r.prefix}${r.dialCode}${r.charAfterDialCode}`):m(f);if(f=ql(f),f===r.dialCode&&!r.disableDialCodeAndPrefix)return m(`${r.prefix}${r.dialCode}${r.charAfterDialCode}`);if(r.dialCode.startsWith(f)&&!r.disableDialCodeAndPrefix)return m(o?`${r.prefix}${r.dialCode}${r.charAfterDialCode}`:`${r.prefix}${f}`);if(!f.startsWith(r.dialCode)&&!r.disableDialCodeAndPrefix){if(o)return m(`${r.prefix}${r.dialCode}${r.charAfterDialCode}`);if(f.length<r.dialCode.length)return m(`${r.prefix}${f}`)}let c=()=>{let y=r.dialCode.length;r.disableDialCodeAndPrefix&&(y=0);let S=f.slice(0,y),x=f.slice(y);return{phoneLeftSide:S,phoneRightSide:x}},{phoneLeftSide:h,phoneRightSide:g}=c();return h=`${r.prefix}${h}${r.charAfterDialCode}`,g=z1({value:g,mask:r.mask,maskSymbol:r.maskChar,trimNonMaskCharsLeftover:r.trimNonDigitsEnd}),r.disableDialCodeAndPrefix&&(h=""),m(`${h}${g}`)},es=a=>/\d/.test(a),$1=({phoneBeforeInput:a,phoneAfterInput:r,phoneAfterFormatted:o,cursorPositionAfterInput:s,leftOffset:f=0,deletion:m})=>{if(s<f)return f;if(!a)return o.length;let c=m==="backward";if(s===0&&r.length>0&&o.length>0){if(c)return 0;for(let x=0;x<o.length;x+=1)if(es(o[x]))return x;return o.length}if(r.length<a.length&&r.length===1)return o.length;let h=null;for(let x=s-1;x>=0;x-=1)if(es(r[x])){h=x;break}if(h===null)return s!==0?s:o.length;let g=0;for(let x=0;x<h;x+=1)es(r[x])&&(g+=1);c&&(g-=1);let y=0,S=0;for(let x=0;x<o.length&&(y+=1,es(o[x])&&(S+=1),S!==g+1);x+=1);for(;!es(o[y])&&y<o.length;)y+=1;return c&&(y+=1),y},V1=(a,r)=>{let o=parseInt(a,16);return Number(o+r).toString(16)},H1="abcdefghijklmnopqrstuvwxyz",Y1="1f1e6",dg=H1.split("").reduce((a,r,o)=>({...a,[r]:V1(Y1,o)}),{}),G1=a=>[dg[a[0]],dg[a[1]]].join("-"),Nl=({iso2:a,size:r,src:o,protocol:s="https",disableLazyLoading:f,className:m,style:c,...h})=>{if(!a)return Ne.createElement("img",{className:ug({addPrefix:["flag-emoji"],rawClassNames:[m]}),width:r,height:r,...h});let g=()=>{if(o)return o;let y=G1(a);return`${s}://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${y}.svg`};return Ne.createElement("img",{className:ug({addPrefix:["flag-emoji"],rawClassNames:[m]}),src:g(),width:r,height:r,draggable:!1,"data-country":a,loading:f?void 0:"lazy",style:{width:r,height:r,...c},alt:"",...h})},K1=()=>{let a=V.useRef(),r=V.useRef(Date.now());return{check:()=>{let o=Date.now(),s=a.current?o-r.current:void 0;return a.current=r.current,r.current=o,s}}},Q1={size:20,overrideLastItemDebounceMS:-1};function Z1(a,r){let{size:o,overrideLastItemDebounceMS:s,onChange:f}={...Q1,...r},[m,c]=V.useState(a),[h,g]=V.useState([m]),[y,S]=V.useState(0),x=K1();return[m,(A,v)=>{if(typeof A=="object"&&Object.entries(A).toString()===Object.entries(m).toString()||A===m)return;let N=s>0,B=x.check(),O=N&&B!==void 0?B>s:!0;if(v?.overrideLastItem!==void 0?v.overrideLastItem:!O)g(k=>[...k.slice(0,y),A]);else{let k=h.length>=o;g(K=>[...K.slice(k?1:0,y+1),A]),k||S(K=>K+1)}c(A),f?.(A)},()=>{if(y<=0)return{success:!1};let A=h[y-1];return c(A),S(v=>v-1),f?.(A),{success:!0,value:A}},()=>{if(y+1>=h.length)return{success:!1};let A=h[y+1];return c(A),S(v=>v+1),f?.(A),{success:!0,value:A}}]}var X1=".",ya={defaultCountry:"us",value:"",prefix:"+",defaultMask:"............",charAfterDialCode:" ",historySaveDebounceMS:200,disableCountryGuess:!1,disableDialCodePrefill:!1,forceDialCode:!1,disableDialCodeAndPrefix:!1,countries:Bi},W1=({defaultCountry:a=ya.defaultCountry,value:r=ya.value,countries:o=ya.countries,prefix:s=ya.prefix,defaultMask:f=ya.defaultMask,charAfterDialCode:m=ya.charAfterDialCode,historySaveDebounceMS:c=ya.historySaveDebounceMS,disableCountryGuess:h=ya.disableCountryGuess,disableDialCodePrefill:g=ya.disableDialCodePrefill,forceDialCode:y=ya.forceDialCode,disableDialCodeAndPrefix:S=ya.disableDialCodeAndPrefix,onChange:x})=>{let A=S?!1:!h,v=V.useRef(null),N=({value:re,country:Q,trimNonDigitsEnd:Z,insertDialCodeOnEmpty:ne,forceDisableCountryGuess:me})=>{let P=!me&&A?cg({phone:re,countries:o,currentCountryIso2:Q.iso2}):void 0,D=P?.country??Q;return{phone:D?I1(re,{prefix:s,mask:D.format||f,maskChar:X1,dialCode:D.dialCode,trimNonDigitsEnd:Z,charAfterDialCode:m,forceDialCode:y,insertDialCodeOnEmpty:ne,disableDialCodeAndPrefix:S}):re,countryGuessResult:P,formatCountry:D}},B=re=>{Promise.resolve().then(()=>{v.current?.setSelectionRange(re,re)})},[{phone:O,country:k},K,j,w]=Z1(()=>{let re=(S?null:cg({phone:r,countries:o,currentCountryIso2:a}))?.country||Ml({value:a,field:"iso2",countries:o});re||console.error(`[react-international-phone]: can not find a country with "${a}" iso2 code`);let Q=re||Wa(o.find(ne=>Wa(ne).iso2==="us")),Z=N({value:r,country:Q,insertDialCodeOnEmpty:!g}).phone;return B(Z.length),{phone:Z,country:Q.iso2}},{overrideLastItemDebounceMS:c,onChange:x}),G=V.useMemo(()=>Ml({value:k,field:"iso2",countries:o}),[o,k]),T=(re,{deletion:Q,cursorPosition:Z,insertDialCodeOnEmpty:ne,inserted:me}={})=>{let P=re,D=Z;y&&!S&&G&&!ql(re).startsWith(G.dialCode)&&re&&(me&&re.startsWith(s)&&re.length-(Z??0)===0?P=re:(P=O,D=0));let{phone:F,countryGuessResult:ae}=N({value:P,country:G,trimNonDigitsEnd:Q==="backward",insertDialCodeOnEmpty:ne,forceDisableCountryGuess:y&&!!Q&&ql(P).length<G.dialCode.length}),be=G;A&&ae?.country&&ae.country.name!==k&&ae.fullDialCodeMatch&&(be=ae.country);let Me=$1({cursorPositionAfterInput:D??0,phoneBeforeInput:O,phoneAfterInput:re,phoneAfterFormatted:F,leftOffset:y?s.length+(G?.dialCode?.length??0)+m.length:0,deletion:Q});return K({phone:F,country:be.iso2}),B(Me),F};V.useEffect(()=>{let re=v.current;if(!re)return;let Q=Z=>{if(!Z.key)return;let ne=Z.ctrlKey,me=Z.shiftKey,P=Z.key.toLowerCase()==="z";!ne||!P||(me?w():j())};return re.addEventListener("keydown",Q),()=>{re.removeEventListener("keydown",Q)}},[v,j,w]);let R=re=>{re.preventDefault();let Q=re.nativeEvent.inputType,Z=()=>{if(Q?.toLocaleLowerCase().includes("delete")??!1)return Q?.toLocaleLowerCase().includes("forward")?"forward":"backward"},ne=Q?.startsWith("insertFrom"),me=T(re.target.value,{deletion:Z(),inserted:ne,cursorPosition:re.target.selectionStart??0});return S&&G?L1({phone:me,dialCode:G.dialCode,charAfterDialCode:m,prefix:s}):me},q=re=>{let Q=Ml({value:re,field:"iso2",countries:o});if(!Q)return;let Z=S?"":`${s}${Q.dialCode}${m}`;K({phone:Z,country:Q.iso2}),Promise.resolve().then(()=>{v.current?.focus()})},[z,$]=V.useState(!1);return V.useEffect(()=>{if(!z){$(!0),r!==O&&x?.({phone:O,country:k});return}r!==O&&T(r)},[r]),{phone:O,country:k,setCountry:q,handlePhoneValueChange:R,inputRef:v}},Md,fg;function J1(){if(fg)return Md;fg=1;var a=bx(),r=xx(),o=g0(),s=r(function(f,m,c,h){a(m,o(m),f,h)});return Md=s,Md}var Nd,mg;function B0(){if(mg)return Nd;mg=1;var a=Cx(),r=Sx(),o=_x(),s="[object DOMException]",f="[object Error]";function m(c){if(!r(c))return!1;var h=a(c);return h==f||h==s||typeof c.message=="string"&&typeof c.name=="string"&&!o(c)}return Nd=m,Nd}var Bd,pg;function eS(){if(pg)return Bd;pg=1;var a=Ax(),r=Ex(),o=B0(),s=r(function(f,m){try{return a(f,void 0,m)}catch(c){return o(c)?c:new Error(c)}});return Bd=s,Bd}var Ud,hg;function tS(){if(hg)return Ud;hg=1;var a=wx();function r(o,s){return a(s,function(f){return o[f]})}return Ud=r,Ud}var Od,yg;function nS(){if(yg)return Od;yg=1;var a=Tx(),r=Object.prototype,o=r.hasOwnProperty;function s(f,m,c,h){return f===void 0||a(f,r[c])&&!o.call(h,c)?m:f}return Od=s,Od}var zd,gg;function aS(){if(gg)return zd;gg=1;var a={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function r(o){return"\\"+a[o]}return zd=r,zd}var Pd,Dg;function U0(){if(Dg)return Pd;Dg=1;var a=/<%=([\s\S]+?)%>/g;return Pd=a,Pd}var qd,vg;function iS(){if(vg)return qd;vg=1;function a(r){return function(o){return r?.[o]}}return qd=a,qd}var Ld,bg;function rS(){if(bg)return Ld;bg=1;var a=iS(),r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},o=a(r);return Ld=o,Ld}var Id,xg;function oS(){if(xg)return Id;xg=1;var a=rS(),r=Nf(),o=/[&<>"']/g,s=RegExp(o.source);function f(m){return m=r(m),m&&s.test(m)?m.replace(o,a):m}return Id=f,Id}var $d,Cg;function sS(){if(Cg)return $d;Cg=1;var a=/<%-([\s\S]+?)%>/g;return $d=a,$d}var Vd,Sg;function lS(){if(Sg)return Vd;Sg=1;var a=/<%([\s\S]+?)%>/g;return Vd=a,Vd}var Hd,_g;function uS(){if(_g)return Hd;_g=1;var a=oS(),r=sS(),o=lS(),s=U0(),f={escape:r,evaluate:o,interpolate:s,variable:"",imports:{_:{escape:a}}};return Hd=f,Hd}var Yd,Ag;function cS(){if(Ag)return Yd;Ag=1;var a=kx(),r=J1(),o=eS(),s=tS(),f=nS(),m=aS(),c=B0(),h=Fx(),g=g0(),y=U0(),S=uS(),x=Nf(),A="Invalid `variable` option passed into `_.template`",v="Invalid `imports` option passed into `_.template`",N=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,k=/[()=,{}\[\]\/\s]/,K=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,j=/($^)/,w=/['\n\r\u2028\u2029\\]/g,G=Object.prototype,T=G.hasOwnProperty;function R(q,z,$){var re=S.imports._.templateSettings||S;$&&h(q,z,$)&&(z=void 0),q=x(q),z=r({},z,re,f);var Q=r({},z.imports,re.imports,f),Z=g(Q),ne=s(Q,Z);a(Z,function(ue){if(k.test(ue))throw new Error(v)});var me,P,D=0,F=z.interpolate||j,ae="__p += '",be=RegExp((z.escape||j).source+"|"+F.source+"|"+(F===y?K:j).source+"|"+(z.evaluate||j).source+"|$","g"),Me=T.call(z,"sourceURL")?"//# sourceURL="+(z.sourceURL+"").replace(/\s/g," ")+`
9
+ `).replace(sb,"")}function fy(e,t){return t=dy(t),dy(e)===t}function Et(e,t,n,i,l,d){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Cr(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Cr(e,""+i);break;case"className":gs(e,"class",i);break;case"tabIndex":gs(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":gs(e,n,i);break;case"style":fm(e,i,d);break;case"data":if(t!=="object"){gs(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=vs(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(n==="formAction"?(t!=="input"&&Et(e,t,"name",l.name,l,null),Et(e,t,"formEncType",l.formEncType,l,null),Et(e,t,"formMethod",l.formMethod,l,null),Et(e,t,"formTarget",l.formTarget,l,null)):(Et(e,t,"encType",l.encType,l,null),Et(e,t,"method",l.method,l,null),Et(e,t,"target",l.target,l,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=vs(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=Ma);break;case"onScroll":i!=null&&ut("scroll",e);break;case"onScrollEnd":i!=null&&ut("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(n=i.__html,n!=null){if(l.children!=null)throw Error(s(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=vs(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":ut("beforetoggle",e),ut("toggle",e),ys(e,"popover",i);break;case"xlinkActuate":Ra(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ra(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ra(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ra(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ra(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ra(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ra(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ra(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ra(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":ys(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=BD.get(n)||n,ys(e,n,i))}}function ed(e,t,n,i,l,d){switch(n){case"style":fm(e,i,d);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(n=i.__html,n!=null){if(l.children!=null)throw Error(s(60));e.innerHTML=n}}break;case"children":typeof i=="string"?Cr(e,i):(typeof i=="number"||typeof i=="bigint")&&Cr(e,""+i);break;case"onScroll":i!=null&&ut("scroll",e);break;case"onScrollEnd":i!=null&&ut("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Ma);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!am.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(l=n.endsWith("Capture"),t=n.slice(2,l?n.length-7:void 0),d=e[Rt]||null,d=d!=null?d[n]:null,typeof d=="function"&&e.removeEventListener(t,d,l),typeof i=="function")){typeof d!="function"&&d!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,l);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):ys(e,n,i)}}}function mn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ut("error",e),ut("load",e);var i=!1,l=!1,d;for(d in n)if(n.hasOwnProperty(d)){var p=n[d];if(p!=null)switch(d){case"src":i=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Et(e,t,d,p,n,null)}}l&&Et(e,t,"srcSet",n.srcSet,n,null),i&&Et(e,t,"src",n.src,n,null);return;case"input":ut("invalid",e);var C=d=p=l=null,Y=null,fe=null;for(i in n)if(n.hasOwnProperty(i)){var xe=n[i];if(xe!=null)switch(i){case"name":l=xe;break;case"type":p=xe;break;case"checked":Y=xe;break;case"defaultChecked":fe=xe;break;case"value":d=xe;break;case"defaultValue":C=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(s(137,t));break;default:Et(e,t,i,xe,n,null)}}lm(e,d,C,Y,fe,p,l,!1);return;case"select":ut("invalid",e),i=p=d=null;for(l in n)if(n.hasOwnProperty(l)&&(C=n[l],C!=null))switch(l){case"value":d=C;break;case"defaultValue":p=C;break;case"multiple":i=C;default:Et(e,t,l,C,n,null)}t=d,n=p,e.multiple=!!i,t!=null?xr(e,!!i,t,!1):n!=null&&xr(e,!!i,n,!0);return;case"textarea":ut("invalid",e),d=l=i=null;for(p in n)if(n.hasOwnProperty(p)&&(C=n[p],C!=null))switch(p){case"value":i=C;break;case"defaultValue":l=C;break;case"children":d=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:Et(e,t,p,C,n,null)}cm(e,i,l,d);return;case"option":for(Y in n)n.hasOwnProperty(Y)&&(i=n[Y],i!=null)&&(Y==="selected"?e.selected=i&&typeof i!="function"&&typeof i!="symbol":Et(e,t,Y,i,n,null));return;case"dialog":ut("beforetoggle",e),ut("toggle",e),ut("cancel",e),ut("close",e);break;case"iframe":case"object":ut("load",e);break;case"video":case"audio":for(i=0;i<Vo.length;i++)ut(Vo[i],e);break;case"image":ut("error",e),ut("load",e);break;case"details":ut("toggle",e);break;case"embed":case"source":case"link":ut("error",e),ut("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in n)if(n.hasOwnProperty(fe)&&(i=n[fe],i!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Et(e,t,fe,i,n,null)}return;default:if(pu(t)){for(xe in n)n.hasOwnProperty(xe)&&(i=n[xe],i!==void 0&&ed(e,t,xe,i,n,void 0));return}}for(C in n)n.hasOwnProperty(C)&&(i=n[C],i!=null&&Et(e,t,C,i,n,null))}function lb(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,d=null,p=null,C=null,Y=null,fe=null,xe=null;for(ye in n){var we=n[ye];if(n.hasOwnProperty(ye)&&we!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":Y=we;default:i.hasOwnProperty(ye)||Et(e,t,ye,null,i,we)}}for(var he in i){var ye=i[he];if(we=n[he],i.hasOwnProperty(he)&&(ye!=null||we!=null))switch(he){case"type":d=ye;break;case"name":l=ye;break;case"checked":fe=ye;break;case"defaultChecked":xe=ye;break;case"value":p=ye;break;case"defaultValue":C=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,t));break;default:ye!==we&&Et(e,t,he,ye,i,we)}}fu(e,p,C,Y,fe,xe,d,l);return;case"select":ye=p=C=he=null;for(d in n)if(Y=n[d],n.hasOwnProperty(d)&&Y!=null)switch(d){case"value":break;case"multiple":ye=Y;default:i.hasOwnProperty(d)||Et(e,t,d,null,i,Y)}for(l in i)if(d=i[l],Y=n[l],i.hasOwnProperty(l)&&(d!=null||Y!=null))switch(l){case"value":he=d;break;case"defaultValue":C=d;break;case"multiple":p=d;default:d!==Y&&Et(e,t,l,d,i,Y)}t=C,n=p,i=ye,he!=null?xr(e,!!n,he,!1):!!i!=!!n&&(t!=null?xr(e,!!n,t,!0):xr(e,!!n,n?[]:"",!1));return;case"textarea":ye=he=null;for(C in n)if(l=n[C],n.hasOwnProperty(C)&&l!=null&&!i.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:Et(e,t,C,null,i,l)}for(p in i)if(l=i[p],d=n[p],i.hasOwnProperty(p)&&(l!=null||d!=null))switch(p){case"value":he=l;break;case"defaultValue":ye=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(s(91));break;default:l!==d&&Et(e,t,p,l,i,d)}um(e,he,ye);return;case"option":for(var Le in n)he=n[Le],n.hasOwnProperty(Le)&&he!=null&&!i.hasOwnProperty(Le)&&(Le==="selected"?e.selected=!1:Et(e,t,Le,null,i,he));for(Y in i)he=i[Y],ye=n[Y],i.hasOwnProperty(Y)&&he!==ye&&(he!=null||ye!=null)&&(Y==="selected"?e.selected=he&&typeof he!="function"&&typeof he!="symbol":Et(e,t,Y,he,i,ye));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var We in n)he=n[We],n.hasOwnProperty(We)&&he!=null&&!i.hasOwnProperty(We)&&Et(e,t,We,null,i,he);for(fe in i)if(he=i[fe],ye=n[fe],i.hasOwnProperty(fe)&&he!==ye&&(he!=null||ye!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,t));break;default:Et(e,t,fe,he,i,ye)}return;default:if(pu(t)){for(var wt in n)he=n[wt],n.hasOwnProperty(wt)&&he!==void 0&&!i.hasOwnProperty(wt)&&ed(e,t,wt,void 0,i,he);for(xe in i)he=i[xe],ye=n[xe],!i.hasOwnProperty(xe)||he===ye||he===void 0&&ye===void 0||ed(e,t,xe,he,i,ye);return}}for(var le in n)he=n[le],n.hasOwnProperty(le)&&he!=null&&!i.hasOwnProperty(le)&&Et(e,t,le,null,i,he);for(we in i)he=i[we],ye=n[we],!i.hasOwnProperty(we)||he===ye||he==null&&ye==null||Et(e,t,we,he,i,ye)}function my(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ub(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var l=n[i],d=l.transferSize,p=l.initiatorType,C=l.duration;if(d&&C&&my(p)){for(p=0,C=l.responseEnd,i+=1;i<n.length;i++){var Y=n[i],fe=Y.startTime;if(fe>C)break;var xe=Y.transferSize,we=Y.initiatorType;xe&&my(we)&&(Y=Y.responseEnd,p+=xe*(Y<C?1:(C-fe)/(Y-fe)))}if(--i,t+=8*(d+p)/(l.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var td=null,nd=null;function pl(e){return e.nodeType===9?e:e.ownerDocument}function py(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hy(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function ad(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var id=null;function cb(){var e=window.event;return e&&e.type==="popstate"?e===id?!1:(id=e,!0):(id=null,!1)}var yy=typeof setTimeout=="function"?setTimeout:void 0,db=typeof clearTimeout=="function"?clearTimeout:void 0,gy=typeof Promise=="function"?Promise:void 0,fb=typeof queueMicrotask=="function"?queueMicrotask:typeof gy<"u"?function(e){return gy.resolve(null).then(e).catch(mb)}:yy;function mb(e){setTimeout(function(){throw e})}function _i(e){return e==="head"}function Dy(e,t){var n=t,i=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(l),Jr(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Yo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Yo(n);for(var d=n.firstChild;d;){var p=d.nextSibling,C=d.nodeName;d[ht]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&d.rel.toLowerCase()==="stylesheet"||n.removeChild(d),d=p}}else n==="body"&&Yo(e.ownerDocument.body);n=l}while(n);Jr(t)}function vy(e,t){var n=e;e=0;do{var i=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function rd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":rd(n),On(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function pb(e,t,n,i){for(;e.nodeType===1;){var l=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ht])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=la(e.nextSibling),e===null)break}return null}function hb(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=la(e.nextSibling),e===null))return null;return e}function by(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=la(e.nextSibling),e===null))return null;return e}function od(e){return e.data==="$?"||e.data==="$~"}function sd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function yb(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function la(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ld=null;function xy(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return la(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Cy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Sy(e,t,n){switch(t=pl(n),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Yo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);On(e)}var ua=new Map,_y=new Set;function hl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Qa=D.d;D.d={f:gb,r:Db,D:vb,C:bb,L:xb,m:Cb,X:_b,S:Sb,M:Ab};function gb(){var e=Qa.f(),t=ol();return e||t}function Db(e){var t=$i(e);t!==null&&t.tag===5&&t.type==="form"?Lp(t):Qa.r(e)}var Zr=typeof document>"u"?null:document;function Ay(e,t,n){var i=Zr;if(i&&typeof t=="string"&&t){var l=ta(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),_y.has(l)||(_y.add(l),e={rel:e,crossOrigin:n,href:t},i.querySelector(l)===null&&(t=i.createElement("link"),mn(t,"link",e),on(t),i.head.appendChild(t)))}}function vb(e){Qa.D(e),Ay("dns-prefetch",e,null)}function bb(e,t){Qa.C(e,t),Ay("preconnect",e,t)}function xb(e,t,n){Qa.L(e,t,n);var i=Zr;if(i&&e&&t){var l='link[rel="preload"][as="'+ta(t)+'"]';t==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+ta(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+ta(n.imageSizes)+'"]')):l+='[href="'+ta(e)+'"]';var d=l;switch(t){case"style":d=Xr(e);break;case"script":d=Wr(e)}ua.has(d)||(e=x({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ua.set(d,e),i.querySelector(l)!==null||t==="style"&&i.querySelector(Go(d))||t==="script"&&i.querySelector(Ko(d))||(t=i.createElement("link"),mn(t,"link",e),on(t),i.head.appendChild(t)))}}function Cb(e,t){Qa.m(e,t);var n=Zr;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+ta(i)+'"][href="'+ta(e)+'"]',d=l;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Wr(e)}if(!ua.has(d)&&(e=x({rel:"modulepreload",href:e},t),ua.set(d,e),n.querySelector(l)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ko(d)))return}i=n.createElement("link"),mn(i,"link",e),on(i),n.head.appendChild(i)}}}function Sb(e,t,n){Qa.S(e,t,n);var i=Zr;if(i&&e){var l=ja(i).hoistableStyles,d=Xr(e);t=t||"default";var p=l.get(d);if(!p){var C={loading:0,preload:null};if(p=i.querySelector(Go(d)))C.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ua.get(d))&&ud(e,n);var Y=p=i.createElement("link");on(Y),mn(Y,"link",e),Y._p=new Promise(function(fe,xe){Y.onload=fe,Y.onerror=xe}),Y.addEventListener("load",function(){C.loading|=1}),Y.addEventListener("error",function(){C.loading|=2}),C.loading|=4,yl(p,t,i)}p={type:"stylesheet",instance:p,count:1,state:C},l.set(d,p)}}}function _b(e,t){Qa.X(e,t);var n=Zr;if(n&&e){var i=ja(n).hoistableScripts,l=Wr(e),d=i.get(l);d||(d=n.querySelector(Ko(l)),d||(e=x({src:e,async:!0},t),(t=ua.get(l))&&cd(e,t),d=n.createElement("script"),on(d),mn(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(l,d))}}function Ab(e,t){Qa.M(e,t);var n=Zr;if(n&&e){var i=ja(n).hoistableScripts,l=Wr(e),d=i.get(l);d||(d=n.querySelector(Ko(l)),d||(e=x({src:e,async:!0,type:"module"},t),(t=ua.get(l))&&cd(e,t),d=n.createElement("script"),on(d),mn(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(l,d))}}function Ey(e,t,n,i){var l=(l=Pe.current)?hl(l):null;if(!l)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Xr(n.href),n=ja(l).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Xr(n.href);var d=ja(l).hoistableStyles,p=d.get(e);if(p||(l=l.ownerDocument||l,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,p),(d=l.querySelector(Go(e)))&&!d._p&&(p.instance=d,p.state.loading=5),ua.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ua.set(e,n),d||Eb(l,e,n,p.state))),t&&i===null)throw Error(s(528,""));return p}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wr(n),n=ja(l).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Xr(e){return'href="'+ta(e)+'"'}function Go(e){return'link[rel="stylesheet"]['+e+"]"}function wy(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function Eb(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),mn(t,"link",n),on(t),e.head.appendChild(t))}function Wr(e){return'[src="'+ta(e)+'"]'}function Ko(e){return"script[async]"+e}function Ty(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+ta(n.href)+'"]');if(i)return t.instance=i,on(i),i;var l=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),on(i),mn(i,"style",l),yl(i,n.precedence,e),t.instance=i;case"stylesheet":l=Xr(n.href);var d=e.querySelector(Go(l));if(d)return t.state.loading|=4,t.instance=d,on(d),d;i=wy(n),(l=ua.get(l))&&ud(i,l),d=(e.ownerDocument||e).createElement("link"),on(d);var p=d;return p._p=new Promise(function(C,Y){p.onload=C,p.onerror=Y}),mn(d,"link",i),t.state.loading|=4,yl(d,n.precedence,e),t.instance=d;case"script":return d=Wr(n.src),(l=e.querySelector(Ko(d)))?(t.instance=l,on(l),l):(i=n,(l=ua.get(d))&&(i=x({},n),cd(i,l)),e=e.ownerDocument||e,l=e.createElement("script"),on(l),mn(l,"link",i),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,yl(i,n.precedence,e));return t.instance}function yl(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=i.length?i[i.length-1]:null,d=l,p=0;p<i.length;p++){var C=i[p];if(C.dataset.precedence===t)d=C;else if(d!==l)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function cd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var gl=null;function ky(e,t,n){if(gl===null){var i=new Map,l=gl=new Map;l.set(n,i)}else l=gl,i=l.get(n),i||(i=new Map,l.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),l=0;l<n.length;l++){var d=n[l];if(!(d[ht]||d[st]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var p=d.getAttribute(t)||"";p=e+p;var C=i.get(p);C?C.push(d):i.set(p,[d])}}return i}function Fy(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function wb(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function jy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Tb(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=Xr(i.href),d=t.querySelector(Go(l));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Dl.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=d,on(d);return}d=t.ownerDocument||t,i=wy(i),(l=ua.get(l))&&ud(i,l),d=d.createElement("link"),on(d);var p=d;p._p=new Promise(function(C,Y){p.onload=C,p.onerror=Y}),mn(d,"link",i),n.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Dl.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var dd=0;function kb(e,t){return e.stylesheets&&e.count===0&&bl(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&bl(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&dd===0&&(dd=62500*ub());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&bl(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>dd?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(l)}}:null}function Dl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vl=null;function bl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vl=new Map,t.forEach(Fb,e),vl=null,Dl.call(e))}function Fb(e,t){if(!(t.state.loading&4)){var n=vl.get(e);if(n)var i=n.get(null);else{n=new Map,vl.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<l.length;d++){var p=l[d];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(n.set(p.dataset.precedence,p),i=p)}i&&n.set(null,i)}l=t.instance,p=l.getAttribute("data-precedence"),d=n.get(p)||i,d===i&&n.set(null,l),n.set(p,l),this.count++,i=Dl.bind(this),l.addEventListener("load",i),l.addEventListener("error",i),d?d.parentNode.insertBefore(l,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var Qo={$$typeof:j,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function jb(e,t,n,i,l,d,p,C,Y){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fa(0),this.hiddenUpdates=Fa(null),this.identifierPrefix=i,this.onUncaughtError=l,this.onCaughtError=d,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function Ry(e,t,n,i,l,d,p,C,Y,fe,xe,we){return e=new jb(e,t,n,p,Y,fe,xe,we,C),t=1,d===!0&&(t|=24),d=Pn(3,null,null,t),e.current=d,d.stateNode=e,t=Vu(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:i,isDehydrated:n,cache:t},Ku(d),e}function My(e){return e?(e=kr,e):kr}function Ny(e,t,n,i,l,d){l=My(l),i.context===null?i.context=l:i.pendingContext=l,i=mi(t),i.payload={element:n},d=d===void 0?null:d,d!==null&&(i.callback=d),n=pi(e,i,t),n!==null&&(jn(n,e,t),wo(n,e,t))}function By(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fd(e,t){By(e,t),(e=e.alternate)&&By(e,t)}function Uy(e){if(e.tag===13||e.tag===31){var t=Ki(e,67108864);t!==null&&jn(t,e,67108864),fd(e,67108864)}}function Oy(e){if(e.tag===13||e.tag===31){var t=Vn();t=Je(t);var n=Ki(e,t);n!==null&&jn(n,e,t),fd(e,t)}}var xl=!0;function Rb(e,t,n,i){var l=P.T;P.T=null;var d=D.p;try{D.p=2,md(e,t,n,i)}finally{D.p=d,P.T=l}}function Mb(e,t,n,i){var l=P.T;P.T=null;var d=D.p;try{D.p=8,md(e,t,n,i)}finally{D.p=d,P.T=l}}function md(e,t,n,i){if(xl){var l=pd(i);if(l===null)Jc(e,t,i,Cl,n),Py(e,i);else if(Bb(l,e,t,n,i))i.stopPropagation();else if(Py(e,i),t&4&&-1<Nb.indexOf(e)){for(;l!==null;){var d=$i(l);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var p=an(d.pendingLanes);if(p!==0){var C=d;for(C.pendingLanes|=2,C.entangledLanes|=2;p;){var Y=1<<31-Ke(p);C.entanglements[1]|=Y,p&=~Y}Ta(d),(vt&6)===0&&(il=I()+500,$o(0))}}break;case 31:case 13:C=Ki(d,2),C!==null&&jn(C,d,2),ol(),fd(d,2)}if(d=pd(i),d===null&&Jc(e,t,i,Cl,n),d===l)break;l=d}l!==null&&i.stopPropagation()}else Jc(e,t,i,null,n)}}function pd(e){return e=yu(e),hd(e)}var Cl=null;function hd(e){if(Cl=null,e=hn(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=h(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Cl=e,null}function zy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ee()){case Ee:return 2;case De:return 8;case Ce:case Te:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var yd=!1,Ai=null,Ei=null,wi=null,Zo=new Map,Xo=new Map,Ti=[],Nb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Py(e,t){switch(e){case"focusin":case"focusout":Ai=null;break;case"dragenter":case"dragleave":Ei=null;break;case"mouseover":case"mouseout":wi=null;break;case"pointerover":case"pointerout":Zo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xo.delete(t.pointerId)}}function Wo(e,t,n,i,l,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:d,targetContainers:[l]},t!==null&&(t=$i(t),t!==null&&Uy(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Bb(e,t,n,i,l){switch(t){case"focusin":return Ai=Wo(Ai,e,t,n,i,l),!0;case"dragenter":return Ei=Wo(Ei,e,t,n,i,l),!0;case"mouseover":return wi=Wo(wi,e,t,n,i,l),!0;case"pointerover":var d=l.pointerId;return Zo.set(d,Wo(Zo.get(d)||null,e,t,n,i,l)),!0;case"gotpointercapture":return d=l.pointerId,Xo.set(d,Wo(Xo.get(d)||null,e,t,n,i,l)),!0}return!1}function qy(e){var t=hn(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,Wn(e.priority,function(){Oy(n)});return}}else if(t===31){if(t=h(n),t!==null){e.blockedOn=t,Wn(e.priority,function(){Oy(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Sl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pd(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);hu=i,n.target.dispatchEvent(i),hu=null}else return t=$i(n),t!==null&&Uy(t),e.blockedOn=n,!1;t.shift()}return!0}function Ly(e,t,n){Sl(e)&&n.delete(t)}function Ub(){yd=!1,Ai!==null&&Sl(Ai)&&(Ai=null),Ei!==null&&Sl(Ei)&&(Ei=null),wi!==null&&Sl(wi)&&(wi=null),Zo.forEach(Ly),Xo.forEach(Ly)}function _l(e,t){e.blockedOn===t&&(e.blockedOn=null,yd||(yd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Ub)))}var Al=null;function Iy(e){Al!==e&&(Al=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Al===e&&(Al=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],l=e[t+2];if(typeof i!="function"){if(hd(i||n)===null)continue;break}var d=$i(n);d!==null&&(e.splice(t,3),t-=3,pc(d,{pending:!0,data:l,method:n.method,action:i},i,l))}}))}function Jr(e){function t(Y){return _l(Y,e)}Ai!==null&&_l(Ai,e),Ei!==null&&_l(Ei,e),wi!==null&&_l(wi,e),Zo.forEach(t),Xo.forEach(t);for(var n=0;n<Ti.length;n++){var i=Ti[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ti.length&&(n=Ti[0],n.blockedOn===null);)qy(n),n.blockedOn===null&&Ti.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var l=n[i],d=n[i+1],p=l[Rt]||null;if(typeof d=="function")p||Iy(n);else if(p){var C=null;if(d&&d.hasAttribute("formAction")){if(l=d,p=d[Rt]||null)C=p.formAction;else if(hd(l)!==null)continue}else C=p.action;typeof C=="function"?n[i+1]=C:(n.splice(i,3),i-=3),Iy(n)}}}function $y(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(p){return l=p})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function gd(e){this._internalRoot=e}El.prototype.render=gd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current,i=Vn();Ny(n,i,e,t,null,null)},El.prototype.unmount=gd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ny(e.current,2,null,e,null,null),ol(),t[Jn]=null}};function El(e){this._internalRoot=e}El.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ti.length&&t!==0&&t<Ti[n].priority;n++);Ti.splice(n,0,e),n===0&&qy(e)}};var Vy=r.version;if(Vy!=="19.2.5")throw Error(s(527,Vy,"19.2.5"));D.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=y(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var Ob={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wl.isDisabled&&wl.supportsFiber)try{Oe=wl.inject(Ob),Ve=wl}catch{}}return Jo.createRoot=function(e,t){if(!f(e))throw Error(s(299));var n=!1,i="",l=Xp,d=Wp,p=Jp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=Ry(e,1,!1,null,null,n,i,null,l,d,p,$y),e[Jn]=t.current,Wc(e),new gd(t)},Jo.hydrateRoot=function(e,t,n){if(!f(e))throw Error(s(299));var i=!1,l="",d=Xp,p=Wp,C=Jp,Y=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(C=n.onRecoverableError),n.formState!==void 0&&(Y=n.formState)),t=Ry(e,1,!0,t,n??null,i,l,Y,d,p,C,$y),t.context=My(null),n=t.current,i=Vn(),i=Je(i),l=mi(i),l.callback=null,pi(n,l,i),n=i,t.current.lanes=n,_a(t,n),Ta(t),e[Jn]=t.current,Wc(e),new El(t)},Jo.version="19.2.5",Jo}var eg;function sC(){if(eg)return bd.exports;eg=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(r){console.error(r)}}return a(),bd.exports=oC(),bd.exports}var lC=sC();const uC=ri(lC),gf=mx(),cC=gf.user.getUserPublicInfo.bind(gf.user),Sd=new Map;gf.user.getUserPublicInfo=a=>{const r=`${a?.did||""}|${a?.name||""}`,o=Sd.get(r);if(o)return o;const s=cC(a).finally(()=>Sd.delete(r));return Sd.set(r,s),s};function dC({children:a,theme:r,injectFirst:o,darkSchemeClass:s,prefer:f,disableBlockletTheme:m=!1,enableColorScheme:c,disableStyleCache:h,locale:g,fallbackLocale:y,translations:S={},languages:x,onLoadingTranslation:A}){return u.jsx(px,{theme:r,injectFirst:o,darkSchemeClass:s,prefer:f,disableBlockletTheme:m,enableColorScheme:c,disableStyleCache:h,children:u.jsx(hx,{locale:g,fallbackLocale:y,translations:S,onLoadingTranslation:A,languages:x,children:a})})}const fC=V.createContext(null),_d={didCatch:!1,error:null};class mC extends V.Component{constructor(r){super(r),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=_d}static getDerivedStateFromError(r){return{didCatch:!0,error:r}}resetErrorBoundary(){const{error:r}=this.state;if(r!==null){for(var o,s,f=arguments.length,m=new Array(f),c=0;c<f;c++)m[c]=arguments[c];(o=(s=this.props).onReset)===null||o===void 0||o.call(s,{args:m,reason:"imperative-api"}),this.setState(_d)}}componentDidCatch(r,o){var s,f;(s=(f=this.props).onError)===null||s===void 0||s.call(f,r,o)}componentDidUpdate(r,o){const{didCatch:s}=this.state,{resetKeys:f}=this.props;if(s&&o.error!==null&&pC(r.resetKeys,f)){var m,c;(m=(c=this.props).onReset)===null||m===void 0||m.call(c,{next:f,prev:r.resetKeys,reason:"keys"}),this.setState(_d)}}render(){const{children:r,fallbackRender:o,FallbackComponent:s,fallback:f}=this.props,{didCatch:m,error:c}=this.state;let h=r;if(m){const g={error:c,resetErrorBoundary:this.resetErrorBoundary};if(typeof o=="function")h=o(g);else if(s)h=V.createElement(s,g);else if(f!==void 0)h=f;else throw c}return V.createElement(fC.Provider,{value:{didCatch:m,error:c,resetErrorBoundary:this.resetErrorBoundary}},h)}}function pC(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return a.length!==r.length||a.some((o,s)=>!Object.is(o,r[s]))}var Ad,tg;function hC(){if(tg)return Ad;tg=1;function a(r){return r===null}return Ad=a,Ad}var yC=hC();const E0=ri(yC);var Ed,ng;function gC(){if(ng)return Ed;ng=1;var a=yx(),r=gx(),o=Dx(),s=bx(),f=Nf(),m=vx();function c(h,g,y){if(h=f(h),h&&(y||g===void 0))return h.slice(0,m(h)+1);if(!h||!(g=a(g)))return h;var S=s(h),x=o(S,s(g))+1;return r(S,0,x).join("")}return Ed=c,Ed}var DC=gC();const vC=ri(DC);var bC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function xC(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var wd,ag;function CC(){return ag||(ag=1,wd={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(a){let r=a%10;return~~(a%100/10)===1?"th":r===1?"st":r===2?"nd":r===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),wd}var Td,ig;function w0(){if(ig)return Td;ig=1;const a=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function r(g){return g.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function o(g,y,S,x,A,v,N){if(!isNaN(+g))return+g;let B="",O=g.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(O!==g)return-1*o(O,y,S,x,A,v);for(let T=0;T<a.length;T++){let R=a[T];if(B=g.replace(RegExp(`([0-9 ])(${R.key})$`),"$1"),B!==g)return o(B,y,S,x,A,v)*R.factor}if(B=g.replace("%",""),B!==g)return o(B,y,S,x,A,v)/100;let k=parseFloat(g);if(isNaN(k))return;let K=x(k);if(K&&K!=="."&&(B=g.replace(new RegExp(`${r(K)}$`),""),B!==g))return o(B,y,S,x,A,v);let j={};Object.keys(v).forEach(T=>{j[v[T]]=T});let w=Object.keys(j).sort().reverse(),G=w.length;for(let T=0;T<G;T++){let R=w[T],q=j[R];if(B=g.replace(R,""),B!==g){let z;switch(q){case"thousand":z=Math.pow(10,3);break;case"million":z=Math.pow(10,6);break;case"billion":z=Math.pow(10,9);break;case"trillion":z=Math.pow(10,12);break}return o(B,y,S,x,A,v)*z}}}function s(g,y,S){let x=g.replace(S,"");return x=x.replace(new RegExp(`([0-9])${r(y.thousands)}([0-9])`,"g"),"$1$2"),x=x.replace(y.decimal,"."),x}function f(g,y,S="",x,A,v,N){if(g==="")return;if(g===A)return 0;let B=s(g,y,S);return o(B,y,S,x,A,v)}function m(g,y){if(!(g.indexOf(":")&&y.thousands!==":"))return!1;let x=g.split(":");if(x.length!==3)return!1;let A=+x[0],v=+x[1],N=+x[2];return!isNaN(A)&&!isNaN(v)&&!isNaN(N)}function c(g){let y=g.split(":"),S=+y[0],x=+y[1];return+y[2]+60*x+3600*S}function h(g,y){const S=Pf();let x=S.currentDelimiters(),A=S.currentCurrency().symbol,v=S.currentOrdinal(),N=S.getZeroFormat(),B=S.currentAbbreviations(),O;if(typeof g=="string")m(g,x)?O=c(g):O=f(g,x,A,v,N,B);else if(typeof g=="number")O=g;else return;if(O!==void 0)return O}return Td={unformat:h},Td}var kd,rg;function Of(){if(rg)return kd;rg=1;let a=w0();const r=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,o=["currency","percent","byte","time","ordinal","number"],s=["trillion","billion","million","thousand"],f=["prefix","infix","postfix"],m=["sign","parenthesis"],c={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},y={output:{type:"string",validValues:o},base:{type:"string",validValues:["decimal","binary","general"],restriction:(O,k)=>k.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:O=>O.output==="byte"},characteristic:{type:"number",restriction:O=>O>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:s},average:"boolean",lowPrecision:{type:"boolean",restriction:(O,k)=>k.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:f},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:O=>O>=0,message:"value must be positive"},{restriction:(O,k)=>!k.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:O=>O>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:m},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(O,k)=>k.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},S={languageTag:{type:"string",mandatory:!0,restriction:O=>O.match(r),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:c,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function x(O,k){let K=A(O),j=N(k);return K&&j}function A(O){return a.unformat(O)!==void 0}function v(O,k,K,j=!1){let w=Object.keys(O).map(G=>{if(!k[G])return console.error(`${K} Invalid key: ${G}`),!1;let T=O[G],R=k[G];if(typeof R=="string"&&(R={type:R}),R.type==="format"){if(!v(T,y,`[Validate ${G}]`,!0))return!1}else if(typeof T!==R.type)return console.error(`${K} ${G} type mismatched: "${R.type}" expected, "${typeof T}" provided`),!1;if(R.restrictions&&R.restrictions.length){let q=R.restrictions.length;for(let z=0;z<q;z++){let{restriction:$,message:re}=R.restrictions[z];if(!$(T,O))return console.error(`${K} ${G} invalid value: ${re}`),!1}}return R.restriction&&!R.restriction(T,O)?(console.error(`${K} ${G} invalid value: ${R.message}`),!1):R.validValues&&R.validValues.indexOf(T)===-1?(console.error(`${K} ${G} invalid value: must be among ${JSON.stringify(R.validValues)}, "${T}" provided`),!1):!(R.children&&!v(T,R.children,`[Validate ${G}]`))});return j||w.push(...Object.keys(k).map(G=>{let T=k[G];if(typeof T=="string"&&(T={type:T}),T.mandatory){let R=T.mandatory;if(typeof R=="function"&&(R=R(O)),R&&O[G]===void 0)return console.error(`${K} Missing mandatory key "${G}"`),!1}return!0})),w.reduce((G,T)=>G&&T,!0)}function N(O){return v(O,y,"[Validate format]")}function B(O){return v(O,S,"[Validate language]")}return kd={validate:x,validateFormat:N,validateInput:A,validateLanguage:B},kd}function SC(a,r){let o=a.match(/^{([^}]*)}/);return o?(r.prefix=o[1],a.slice(o[0].length)):a}function _C(a,r){let o=a.match(/{([^}]*)}$/);return o?(r.postfix=o[1],a.slice(0,-o[0].length)):a}function AC(a,r){if(a.indexOf("$")!==-1){r.output="currency";return}if(a.indexOf("%")!==-1){r.output="percent";return}if(a.indexOf("bd")!==-1){r.output="byte",r.base="general";return}if(a.indexOf("b")!==-1){r.output="byte",r.base="binary";return}if(a.indexOf("d")!==-1){r.output="byte",r.base="decimal";return}if(a.indexOf(":")!==-1){r.output="time";return}a.indexOf("o")!==-1&&(r.output="ordinal")}function EC(a,r){a.indexOf(",")!==-1&&(r.thousandSeparated=!0)}function wC(a,r){a.indexOf(" ")!==-1&&(r.spaceSeparated=!0,r.spaceSeparatedCurrency=!0,(r.average||r.forceAverage)&&(r.spaceSeparatedAbbreviation=!0))}function TC(a,r){let o=a.match(/[1-9]+[0-9]*/);o&&(r.totalLength=+o[0])}function kC(a,r){let s=a.split(".")[0].match(/0+/);s&&(r.characteristic=s[0].length)}function FC(a,r){let o=a.split(".")[1];if(o){let s=o.match(/0+/);s&&(r.mantissa=s[0].length)}}function jC(a,r){const o=a.split(".")[1];o&&(r.trimMantissa=o.indexOf("[")!==-1)}function RC(a,r){a.indexOf("a")!==-1&&(r.average=!0)}function MC(a,r){a.indexOf("K")!==-1?r.forceAverage="thousand":a.indexOf("M")!==-1?r.forceAverage="million":a.indexOf("B")!==-1?r.forceAverage="billion":a.indexOf("T")!==-1&&(r.forceAverage="trillion")}function NC(a,r){a.match(/\[\.]/)?r.optionalMantissa=!0:a.match(/\./)&&(r.optionalMantissa=!1)}function BC(a,r){if(a.indexOf(".")!==-1){let o=a.split(".")[0];r.optionalCharacteristic=o.indexOf("0")===-1}}function UC(a,r){a.match(/^\+?\([^)]*\)$/)&&(r.negative="parenthesis"),a.match(/^\+?-/)&&(r.negative="sign")}function OC(a,r){a.match(/^\+/)&&(r.forceSign=!0)}function zC(a,r={}){return typeof a!="string"?a:(a=SC(a,r),a=_C(a,r),AC(a,r),TC(a,r),kC(a,r),BC(a,r),RC(a,r),MC(a,r),FC(a,r),NC(a,r),jC(a,r),EC(a,r),wC(a,r),UC(a,r),OC(a,r),r)}var zf={parseFormat:zC};var Fd,og;function Pf(){if(og)return Fd;og=1;const a=CC(),r=Of(),o=zf;let s={},f,m={},c=null,h={};function g(S){f=S}function y(){return m[f]}return s.languages=()=>Object.assign({},m),s.currentLanguage=()=>f,s.currentBytes=()=>y().bytes||{},s.currentCurrency=()=>y().currency,s.currentAbbreviations=()=>y().abbreviations,s.currentDelimiters=()=>y().delimiters,s.currentOrdinal=()=>y().ordinal,s.currentDefaults=()=>Object.assign({},y().defaults,h),s.currentOrdinalDefaultFormat=()=>Object.assign({},s.currentDefaults(),y().ordinalFormat),s.currentByteDefaultFormat=()=>Object.assign({},s.currentDefaults(),y().byteFormat),s.currentPercentageDefaultFormat=()=>Object.assign({},s.currentDefaults(),y().percentageFormat),s.currentCurrencyDefaultFormat=()=>Object.assign({},s.currentDefaults(),y().currencyFormat),s.currentTimeDefaultFormat=()=>Object.assign({},s.currentDefaults(),y().timeFormat),s.setDefaults=S=>{S=o.parseFormat(S),r.validateFormat(S)&&(h=S)},s.getZeroFormat=()=>c,s.setZeroFormat=S=>c=typeof S=="string"?S:null,s.hasZeroFormat=()=>c!==null,s.languageData=S=>{if(S){if(m[S])return m[S];throw new Error(`Unknown tag "${S}"`)}return y()},s.registerLanguage=(S,x=!1)=>{if(!r.validateLanguage(S))throw new Error("Invalid language data");m[S.languageTag]=S,x&&g(S.languageTag)},s.setLanguage=(S,x=a.languageTag)=>{if(!m[S]){let A=S.split("-")[0],v=Object.keys(m).find(N=>N.split("-")[0]===A);if(!m[v]){g(x);return}g(v);return}g(S)},s.registerLanguage(a),f=a.languageTag,Fd=s,Fd}function PC(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function qC(a,r){a.forEach(o=>{let s;try{s=PC(`../languages/${o}`)}catch{console.error(`Unable to load "${o}". No matching language file found.`)}s&&r.registerLanguage(s)})}var LC=a=>({loadLanguagesInNode:r=>qC(r,a)}),T0={exports:{}};(function(a){(function(r){var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,f=Math.ceil,m=Math.floor,c="[BigNumber Error] ",h=c+"Number primitive has more than 15 significant digits: ",g=1e14,y=14,S=9007199254740991,x=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],A=1e7,v=1e9;function N(T){var R,q,z,$=ue.prototype={constructor:ue,toString:null,valueOf:null},re=new ue(1),Q=20,Z=4,ne=-7,me=21,P=-1e7,D=1e7,F=!1,ae=1,be=0,Me={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Fe="0123456789abcdefghijklmnopqrstuvwxyz",Ae=!0;function ue(b,E){var L,ie,W,te,ce,J,H,M,U=this;if(!(U instanceof ue))return new ue(b,E);if(E==null){if(b&&b._isBigNumber===!0){U.s=b.s,!b.c||b.e>D?U.c=U.e=null:b.e<P?U.c=[U.e=0]:(U.e=b.e,U.c=b.c.slice());return}if((J=typeof b=="number")&&b*0==0){if(U.s=1/b<0?(b=-b,-1):1,b===~~b){for(te=0,ce=b;ce>=10;ce/=10,te++);te>D?U.c=U.e=null:(U.e=te,U.c=[b]);return}M=String(b)}else{if(!s.test(M=String(b)))return z(U,M,J);U.s=M.charCodeAt(0)==45?(M=M.slice(1),-1):1}(te=M.indexOf("."))>-1&&(M=M.replace(".","")),(ce=M.search(/e/i))>0?(te<0&&(te=ce),te+=+M.slice(ce+1),M=M.substring(0,ce)):te<0&&(te=M.length)}else{if(K(E,2,Fe.length,"Base"),E==10&&Ae)return U=new ue(b),Ze(U,Q+U.e+1,Z);if(M=String(b),J=typeof b=="number"){if(b*0!=0)return z(U,M,J,E);if(U.s=1/b<0?(M=M.slice(1),-1):1,ue.DEBUG&&M.replace(/^0\.0*|\./,"").length>15)throw Error(h+b)}else U.s=M.charCodeAt(0)===45?(M=M.slice(1),-1):1;for(L=Fe.slice(0,E),te=ce=0,H=M.length;ce<H;ce++)if(L.indexOf(ie=M.charAt(ce))<0){if(ie=="."){if(ce>te){te=H;continue}}else if(!W&&(M==M.toUpperCase()&&(M=M.toLowerCase())||M==M.toLowerCase()&&(M=M.toUpperCase()))){W=!0,ce=-1,te=0;continue}return z(U,String(b),J,E)}J=!1,M=q(M,E,10,U.s),(te=M.indexOf("."))>-1?M=M.replace(".",""):te=M.length}for(ce=0;M.charCodeAt(ce)===48;ce++);for(H=M.length;M.charCodeAt(--H)===48;);if(M=M.slice(ce,++H)){if(H-=ce,J&&ue.DEBUG&&H>15&&(b>S||b!==m(b)))throw Error(h+U.s*b);if((te=te-ce-1)>D)U.c=U.e=null;else if(te<P)U.c=[U.e=0];else{if(U.e=te,U.c=[],ce=(te+1)%y,te<0&&(ce+=y),ce<H){for(ce&&U.c.push(+M.slice(0,ce)),H-=y;ce<H;)U.c.push(+M.slice(ce,ce+=y));ce=y-(M=M.slice(ce)).length}else ce-=H;for(;ce--;M+="0");U.c.push(+M)}}else U.c=[U.e=0]}ue.clone=N,ue.ROUND_UP=0,ue.ROUND_DOWN=1,ue.ROUND_CEIL=2,ue.ROUND_FLOOR=3,ue.ROUND_HALF_UP=4,ue.ROUND_HALF_DOWN=5,ue.ROUND_HALF_EVEN=6,ue.ROUND_HALF_CEIL=7,ue.ROUND_HALF_FLOOR=8,ue.EUCLID=9,ue.config=ue.set=function(b){var E,L;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(E="DECIMAL_PLACES")&&(L=b[E],K(L,0,v,E),Q=L),b.hasOwnProperty(E="ROUNDING_MODE")&&(L=b[E],K(L,0,8,E),Z=L),b.hasOwnProperty(E="EXPONENTIAL_AT")&&(L=b[E],L&&L.pop?(K(L[0],-v,0,E),K(L[1],0,v,E),ne=L[0],me=L[1]):(K(L,-v,v,E),ne=-(me=L<0?-L:L))),b.hasOwnProperty(E="RANGE"))if(L=b[E],L&&L.pop)K(L[0],-v,-1,E),K(L[1],1,v,E),P=L[0],D=L[1];else if(K(L,-v,v,E),L)P=-(D=L<0?-L:L);else throw Error(c+E+" cannot be zero: "+L);if(b.hasOwnProperty(E="CRYPTO"))if(L=b[E],L===!!L)if(L)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))F=L;else throw F=!L,Error(c+"crypto unavailable");else F=L;else throw Error(c+E+" not true or false: "+L);if(b.hasOwnProperty(E="MODULO_MODE")&&(L=b[E],K(L,0,9,E),ae=L),b.hasOwnProperty(E="POW_PRECISION")&&(L=b[E],K(L,0,v,E),be=L),b.hasOwnProperty(E="FORMAT"))if(L=b[E],typeof L=="object")Me=L;else throw Error(c+E+" not an object: "+L);if(b.hasOwnProperty(E="ALPHABET"))if(L=b[E],typeof L=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(L))Ae=L.slice(0,10)=="0123456789",Fe=L;else throw Error(c+E+" invalid: "+L)}else throw Error(c+"Object expected: "+b);return{DECIMAL_PLACES:Q,ROUNDING_MODE:Z,EXPONENTIAL_AT:[ne,me],RANGE:[P,D],CRYPTO:F,MODULO_MODE:ae,POW_PRECISION:be,FORMAT:Me,ALPHABET:Fe}},ue.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!ue.DEBUG)return!0;var E,L,ie=b.c,W=b.e,te=b.s;e:if({}.toString.call(ie)=="[object Array]"){if((te===1||te===-1)&&W>=-v&&W<=v&&W===m(W)){if(ie[0]===0){if(W===0&&ie.length===1)return!0;break e}if(E=(W+1)%y,E<1&&(E+=y),String(ie[0]).length==E){for(E=0;E<ie.length;E++)if(L=ie[E],L<0||L>=g||L!==m(L))break e;if(L!==0)return!0}}}else if(ie===null&&W===null&&(te===null||te===1||te===-1))return!0;throw Error(c+"Invalid BigNumber: "+b)},ue.maximum=ue.max=function(){return Pe(arguments,-1)},ue.minimum=ue.min=function(){return Pe(arguments,1)},ue.random=(function(){var b=9007199254740992,E=Math.random()*b&2097151?function(){return m(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(L){var ie,W,te,ce,J,H=0,M=[],U=new ue(re);if(L==null?L=Q:K(L,0,v),ce=f(L/y),F)if(crypto.getRandomValues){for(ie=crypto.getRandomValues(new Uint32Array(ce*=2));H<ce;)J=ie[H]*131072+(ie[H+1]>>>11),J>=9e15?(W=crypto.getRandomValues(new Uint32Array(2)),ie[H]=W[0],ie[H+1]=W[1]):(M.push(J%1e14),H+=2);H=ce/2}else if(crypto.randomBytes){for(ie=crypto.randomBytes(ce*=7);H<ce;)J=(ie[H]&31)*281474976710656+ie[H+1]*1099511627776+ie[H+2]*4294967296+ie[H+3]*16777216+(ie[H+4]<<16)+(ie[H+5]<<8)+ie[H+6],J>=9e15?crypto.randomBytes(7).copy(ie,H):(M.push(J%1e14),H+=7);H=ce/7}else throw F=!1,Error(c+"crypto unavailable");if(!F)for(;H<ce;)J=E(),J<9e15&&(M[H++]=J%1e14);for(ce=M[--H],L%=y,ce&&L&&(J=x[y-L],M[H]=m(ce/J)*J);M[H]===0;M.pop(),H--);if(H<0)M=[te=0];else{for(te=-1;M[0]===0;M.splice(0,1),te-=y);for(H=1,J=M[0];J>=10;J/=10,H++);H<y&&(te-=y-H)}return U.e=te,U.c=M,U}})(),ue.sum=function(){for(var b=1,E=arguments,L=new ue(E[0]);b<E.length;)L=L.plus(E[b++]);return L},q=(function(){var b="0123456789";function E(L,ie,W,te){for(var ce,J=[0],H,M=0,U=L.length;M<U;){for(H=J.length;H--;J[H]*=ie);for(J[0]+=te.indexOf(L.charAt(M++)),ce=0;ce<J.length;ce++)J[ce]>W-1&&(J[ce+1]==null&&(J[ce+1]=0),J[ce+1]+=J[ce]/W|0,J[ce]%=W)}return J.reverse()}return function(L,ie,W,te,ce){var J,H,M,U,se,je,_,I,ee=L.indexOf("."),Ee=Q,De=Z;for(ee>=0&&(U=be,be=0,L=L.replace(".",""),I=new ue(ie),je=I.pow(L.length-ee),be=U,I.c=E(G(O(je.c),je.e,"0"),10,W,b),I.e=I.c.length),_=E(L,ie,W,ce?(J=Fe,b):(J=b,Fe)),M=U=_.length;_[--U]==0;_.pop());if(!_[0])return J.charAt(0);if(ee<0?--M:(je.c=_,je.e=M,je.s=te,je=R(je,I,Ee,De,W),_=je.c,se=je.r,M=je.e),H=M+Ee+1,ee=_[H],U=W/2,se=se||H<0||_[H+1]!=null,se=De<4?(ee!=null||se)&&(De==0||De==(je.s<0?3:2)):ee>U||ee==U&&(De==4||se||De==6&&_[H-1]&1||De==(je.s<0?8:7)),H<1||!_[0])L=se?G(J.charAt(1),-Ee,J.charAt(0)):J.charAt(0);else{if(_.length=H,se)for(--W;++_[--H]>W;)_[H]=0,H||(++M,_=[1].concat(_));for(U=_.length;!_[--U];);for(ee=0,L="";ee<=U;L+=J.charAt(_[ee++]));L=G(L,M,J.charAt(0))}return L}})(),R=(function(){function b(ie,W,te){var ce,J,H,M,U=0,se=ie.length,je=W%A,_=W/A|0;for(ie=ie.slice();se--;)H=ie[se]%A,M=ie[se]/A|0,ce=_*H+M*je,J=je*H+ce%A*A+U,U=(J/te|0)+(ce/A|0)+_*M,ie[se]=J%te;return U&&(ie=[U].concat(ie)),ie}function E(ie,W,te,ce){var J,H;if(te!=ce)H=te>ce?1:-1;else for(J=H=0;J<te;J++)if(ie[J]!=W[J]){H=ie[J]>W[J]?1:-1;break}return H}function L(ie,W,te,ce){for(var J=0;te--;)ie[te]-=J,J=ie[te]<W[te]?1:0,ie[te]=J*ce+ie[te]-W[te];for(;!ie[0]&&ie.length>1;ie.splice(0,1));}return function(ie,W,te,ce,J){var H,M,U,se,je,_,I,ee,Ee,De,Ce,Te,Ye,ve,qe,Oe,Ve,Ge=ie.s==W.s?1:-1,Ke=ie.c,et=W.c;if(!Ke||!Ke[0]||!et||!et[0])return new ue(!ie.s||!W.s||(Ke?et&&Ke[0]==et[0]:!et)?NaN:Ke&&Ke[0]==0||!et?Ge*0:Ge/0);for(ee=new ue(Ge),Ee=ee.c=[],M=ie.e-W.e,Ge=te+M+1,J||(J=g,M=B(ie.e/y)-B(W.e/y),Ge=Ge/y|0),U=0;et[U]==(Ke[U]||0);U++);if(et[U]>(Ke[U]||0)&&M--,Ge<0)Ee.push(1),se=!0;else{for(ve=Ke.length,Oe=et.length,U=0,Ge+=2,je=m(J/(et[0]+1)),je>1&&(et=b(et,je,J),Ke=b(Ke,je,J),Oe=et.length,ve=Ke.length),Ye=Oe,De=Ke.slice(0,Oe),Ce=De.length;Ce<Oe;De[Ce++]=0);Ve=et.slice(),Ve=[0].concat(Ve),qe=et[0],et[1]>=J/2&&qe++;do{if(je=0,H=E(et,De,Oe,Ce),H<0){if(Te=De[0],Oe!=Ce&&(Te=Te*J+(De[1]||0)),je=m(Te/qe),je>1)for(je>=J&&(je=J-1),_=b(et,je,J),I=_.length,Ce=De.length;E(_,De,I,Ce)==1;)je--,L(_,Oe<I?Ve:et,I,J),I=_.length,H=1;else je==0&&(H=je=1),_=et.slice(),I=_.length;if(I<Ce&&(_=[0].concat(_)),L(De,_,Ce,J),Ce=De.length,H==-1)for(;E(et,De,Oe,Ce)<1;)je++,L(De,Oe<Ce?Ve:et,Ce,J),Ce=De.length}else H===0&&(je++,De=[0]);Ee[U++]=je,De[0]?De[Ce++]=Ke[Ye]||0:(De=[Ke[Ye]],Ce=1)}while((Ye++<ve||De[0]!=null)&&Ge--);se=De[0]!=null,Ee[0]||Ee.splice(0,1)}if(J==g){for(U=1,Ge=Ee[0];Ge>=10;Ge/=10,U++);Ze(ee,te+(ee.e=U+M*y-1)+1,ce,se)}else ee.e=M,ee.r=+se;return ee}})();function $e(b,E,L,ie){var W,te,ce,J,H;if(L==null?L=Z:K(L,0,8),!b.c)return b.toString();if(W=b.c[0],ce=b.e,E==null)H=O(b.c),H=ie==1||ie==2&&(ce<=ne||ce>=me)?w(H,ce):G(H,ce,"0");else if(b=Ze(new ue(b),E,L),te=b.e,H=O(b.c),J=H.length,ie==1||ie==2&&(E<=te||te<=ne)){for(;J<E;H+="0",J++);H=w(H,te)}else if(E-=ce,H=G(H,te,"0"),te+1>J){if(--E>0)for(H+=".";E--;H+="0");}else if(E+=te-J,E>0)for(te+1==J&&(H+=".");E--;H+="0");return b.s<0&&W?"-"+H:H}function Pe(b,E){for(var L,ie,W=1,te=new ue(b[0]);W<b.length;W++)ie=new ue(b[W]),(!ie.s||(L=k(te,ie))===E||L===0&&te.s===E)&&(te=ie);return te}function Xe(b,E,L){for(var ie=1,W=E.length;!E[--W];E.pop());for(W=E[0];W>=10;W/=10,ie++);return(L=ie+L*y-1)>D?b.c=b.e=null:L<P?b.c=[b.e=0]:(b.e=L,b.c=E),b}z=(function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,L=/^\.([^.]+)$/,ie=/^-?(Infinity|NaN)$/,W=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(te,ce,J,H){var M,U=J?ce:ce.replace(W,"");if(ie.test(U))te.s=isNaN(U)?null:U<0?-1:1;else{if(!J&&(U=U.replace(b,function(se,je,_){return M=(_=_.toLowerCase())=="x"?16:_=="b"?2:8,!H||H==M?je:se}),H&&(M=H,U=U.replace(E,"$1").replace(L,"0.$1")),ce!=U))return new ue(U,M);if(ue.DEBUG)throw Error(c+"Not a"+(H?" base "+H:"")+" number: "+ce);te.s=null}te.c=te.e=null}})();function Ze(b,E,L,ie){var W,te,ce,J,H,M,U,se=b.c,je=x;if(se){e:{for(W=1,J=se[0];J>=10;J/=10,W++);if(te=E-W,te<0)te+=y,ce=E,H=se[M=0],U=m(H/je[W-ce-1]%10);else if(M=f((te+1)/y),M>=se.length)if(ie){for(;se.length<=M;se.push(0));H=U=0,W=1,te%=y,ce=te-y+1}else break e;else{for(H=J=se[M],W=1;J>=10;J/=10,W++);te%=y,ce=te-y+W,U=ce<0?0:m(H/je[W-ce-1]%10)}if(ie=ie||E<0||se[M+1]!=null||(ce<0?H:H%je[W-ce-1]),ie=L<4?(U||ie)&&(L==0||L==(b.s<0?3:2)):U>5||U==5&&(L==4||ie||L==6&&(te>0?ce>0?H/je[W-ce]:0:se[M-1])%10&1||L==(b.s<0?8:7)),E<1||!se[0])return se.length=0,ie?(E-=b.e+1,se[0]=je[(y-E%y)%y],b.e=-E||0):se[0]=b.e=0,b;if(te==0?(se.length=M,J=1,M--):(se.length=M+1,J=je[y-te],se[M]=ce>0?m(H/je[W-ce]%je[ce])*J:0),ie)for(;;)if(M==0){for(te=1,ce=se[0];ce>=10;ce/=10,te++);for(ce=se[0]+=J,J=1;ce>=10;ce/=10,J++);te!=J&&(b.e++,se[0]==g&&(se[0]=1));break}else{if(se[M]+=J,se[M]!=g)break;se[M--]=0,J=1}for(te=se.length;se[--te]===0;se.pop());}b.e>D?b.c=b.e=null:b.e<P&&(b.c=[b.e=0])}return b}function Ue(b){var E,L=b.e;return L===null?b.toString():(E=O(b.c),E=L<=ne||L>=me?w(E,L):G(E,L,"0"),b.s<0?"-"+E:E)}return $.absoluteValue=$.abs=function(){var b=new ue(this);return b.s<0&&(b.s=1),b},$.comparedTo=function(b,E){return k(this,new ue(b,E))},$.decimalPlaces=$.dp=function(b,E){var L,ie,W,te=this;if(b!=null)return K(b,0,v),E==null?E=Z:K(E,0,8),Ze(new ue(te),b+te.e+1,E);if(!(L=te.c))return null;if(ie=((W=L.length-1)-B(this.e/y))*y,W=L[W])for(;W%10==0;W/=10,ie--);return ie<0&&(ie=0),ie},$.dividedBy=$.div=function(b,E){return R(this,new ue(b,E),Q,Z)},$.dividedToIntegerBy=$.idiv=function(b,E){return R(this,new ue(b,E),0,1)},$.exponentiatedBy=$.pow=function(b,E){var L,ie,W,te,ce,J,H,M,U,se=this;if(b=new ue(b),b.c&&!b.isInteger())throw Error(c+"Exponent not an integer: "+Ue(b));if(E!=null&&(E=new ue(E)),J=b.e>14,!se.c||!se.c[0]||se.c[0]==1&&!se.e&&se.c.length==1||!b.c||!b.c[0])return U=new ue(Math.pow(+Ue(se),J?b.s*(2-j(b)):+Ue(b))),E?U.mod(E):U;if(H=b.s<0,E){if(E.c?!E.c[0]:!E.s)return new ue(NaN);ie=!H&&se.isInteger()&&E.isInteger(),ie&&(se=se.mod(E))}else{if(b.e>9&&(se.e>0||se.e<-1||(se.e==0?se.c[0]>1||J&&se.c[1]>=24e7:se.c[0]<8e13||J&&se.c[0]<=9999975e7)))return te=se.s<0&&j(b)?-0:0,se.e>-1&&(te=1/te),new ue(H?1/te:te);be&&(te=f(be/y+2))}for(J?(L=new ue(.5),H&&(b.s=1),M=j(b)):(W=Math.abs(+Ue(b)),M=W%2),U=new ue(re);;){if(M){if(U=U.times(se),!U.c)break;te?U.c.length>te&&(U.c.length=te):ie&&(U=U.mod(E))}if(W){if(W=m(W/2),W===0)break;M=W%2}else if(b=b.times(L),Ze(b,b.e+1,1),b.e>14)M=j(b);else{if(W=+Ue(b),W===0)break;M=W%2}se=se.times(se),te?se.c&&se.c.length>te&&(se.c.length=te):ie&&(se=se.mod(E))}return ie?U:(H&&(U=re.div(U)),E?U.mod(E):te?Ze(U,be,Z,ce):U)},$.integerValue=function(b){var E=new ue(this);return b==null?b=Z:K(b,0,8),Ze(E,E.e+1,b)},$.isEqualTo=$.eq=function(b,E){return k(this,new ue(b,E))===0},$.isFinite=function(){return!!this.c},$.isGreaterThan=$.gt=function(b,E){return k(this,new ue(b,E))>0},$.isGreaterThanOrEqualTo=$.gte=function(b,E){return(E=k(this,new ue(b,E)))===1||E===0},$.isInteger=function(){return!!this.c&&B(this.e/y)>this.c.length-2},$.isLessThan=$.lt=function(b,E){return k(this,new ue(b,E))<0},$.isLessThanOrEqualTo=$.lte=function(b,E){return(E=k(this,new ue(b,E)))===-1||E===0},$.isNaN=function(){return!this.s},$.isNegative=function(){return this.s<0},$.isPositive=function(){return this.s>0},$.isZero=function(){return!!this.c&&this.c[0]==0},$.minus=function(b,E){var L,ie,W,te,ce=this,J=ce.s;if(b=new ue(b,E),E=b.s,!J||!E)return new ue(NaN);if(J!=E)return b.s=-E,ce.plus(b);var H=ce.e/y,M=b.e/y,U=ce.c,se=b.c;if(!H||!M){if(!U||!se)return U?(b.s=-E,b):new ue(se?ce:NaN);if(!U[0]||!se[0])return se[0]?(b.s=-E,b):new ue(U[0]?ce:Z==3?-0:0)}if(H=B(H),M=B(M),U=U.slice(),J=H-M){for((te=J<0)?(J=-J,W=U):(M=H,W=se),W.reverse(),E=J;E--;W.push(0));W.reverse()}else for(ie=(te=(J=U.length)<(E=se.length))?J:E,J=E=0;E<ie;E++)if(U[E]!=se[E]){te=U[E]<se[E];break}if(te&&(W=U,U=se,se=W,b.s=-b.s),E=(ie=se.length)-(L=U.length),E>0)for(;E--;U[L++]=0);for(E=g-1;ie>J;){if(U[--ie]<se[ie]){for(L=ie;L&&!U[--L];U[L]=E);--U[L],U[ie]+=g}U[ie]-=se[ie]}for(;U[0]==0;U.splice(0,1),--M);return U[0]?Xe(b,U,M):(b.s=Z==3?-1:1,b.c=[b.e=0],b)},$.modulo=$.mod=function(b,E){var L,ie,W=this;return b=new ue(b,E),!W.c||!b.s||b.c&&!b.c[0]?new ue(NaN):!b.c||W.c&&!W.c[0]?new ue(W):(ae==9?(ie=b.s,b.s=1,L=R(W,b,0,3),b.s=ie,L.s*=ie):L=R(W,b,0,ae),b=W.minus(L.times(b)),!b.c[0]&&ae==1&&(b.s=W.s),b)},$.multipliedBy=$.times=function(b,E){var L,ie,W,te,ce,J,H,M,U,se,je,_,I,ee,Ee,De=this,Ce=De.c,Te=(b=new ue(b,E)).c;if(!Ce||!Te||!Ce[0]||!Te[0])return!De.s||!b.s||Ce&&!Ce[0]&&!Te||Te&&!Te[0]&&!Ce?b.c=b.e=b.s=null:(b.s*=De.s,!Ce||!Te?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(ie=B(De.e/y)+B(b.e/y),b.s*=De.s,H=Ce.length,se=Te.length,H<se&&(I=Ce,Ce=Te,Te=I,W=H,H=se,se=W),W=H+se,I=[];W--;I.push(0));for(ee=g,Ee=A,W=se;--W>=0;){for(L=0,je=Te[W]%Ee,_=Te[W]/Ee|0,ce=H,te=W+ce;te>W;)M=Ce[--ce]%Ee,U=Ce[ce]/Ee|0,J=_*M+U*je,M=je*M+J%Ee*Ee+I[te]+L,L=(M/ee|0)+(J/Ee|0)+_*U,I[te--]=M%ee;I[te]=L}return L?++ie:I.splice(0,1),Xe(b,I,ie)},$.negated=function(){var b=new ue(this);return b.s=-b.s||null,b},$.plus=function(b,E){var L,ie=this,W=ie.s;if(b=new ue(b,E),E=b.s,!W||!E)return new ue(NaN);if(W!=E)return b.s=-E,ie.minus(b);var te=ie.e/y,ce=b.e/y,J=ie.c,H=b.c;if(!te||!ce){if(!J||!H)return new ue(W/0);if(!J[0]||!H[0])return H[0]?b:new ue(J[0]?ie:W*0)}if(te=B(te),ce=B(ce),J=J.slice(),W=te-ce){for(W>0?(ce=te,L=H):(W=-W,L=J),L.reverse();W--;L.push(0));L.reverse()}for(W=J.length,E=H.length,W-E<0&&(L=H,H=J,J=L,E=W),W=0;E;)W=(J[--E]=J[E]+H[E]+W)/g|0,J[E]=g===J[E]?0:J[E]%g;return W&&(J=[W].concat(J),++ce),Xe(b,J,ce)},$.precision=$.sd=function(b,E){var L,ie,W,te=this;if(b!=null&&b!==!!b)return K(b,1,v),E==null?E=Z:K(E,0,8),Ze(new ue(te),b,E);if(!(L=te.c))return null;if(W=L.length-1,ie=W*y+1,W=L[W]){for(;W%10==0;W/=10,ie--);for(W=L[0];W>=10;W/=10,ie++);}return b&&te.e+1>ie&&(ie=te.e+1),ie},$.shiftedBy=function(b){return K(b,-S,S),this.times("1e"+b)},$.squareRoot=$.sqrt=function(){var b,E,L,ie,W,te=this,ce=te.c,J=te.s,H=te.e,M=Q+4,U=new ue("0.5");if(J!==1||!ce||!ce[0])return new ue(!J||J<0&&(!ce||ce[0])?NaN:ce?te:1/0);if(J=Math.sqrt(+Ue(te)),J==0||J==1/0?(E=O(ce),(E.length+H)%2==0&&(E+="0"),J=Math.sqrt(+E),H=B((H+1)/2)-(H<0||H%2),J==1/0?E="5e"+H:(E=J.toExponential(),E=E.slice(0,E.indexOf("e")+1)+H),L=new ue(E)):L=new ue(J+""),L.c[0]){for(H=L.e,J=H+M,J<3&&(J=0);;)if(W=L,L=U.times(W.plus(R(te,W,M,1))),O(W.c).slice(0,J)===(E=O(L.c)).slice(0,J))if(L.e<H&&--J,E=E.slice(J-3,J+1),E=="9999"||!ie&&E=="4999"){if(!ie&&(Ze(W,W.e+Q+2,0),W.times(W).eq(te))){L=W;break}M+=4,J+=4,ie=1}else{(!+E||!+E.slice(1)&&E.charAt(0)=="5")&&(Ze(L,L.e+Q+2,1),b=!L.times(L).eq(te));break}}return Ze(L,L.e+Q+1,Z,b)},$.toExponential=function(b,E){return b!=null&&(K(b,0,v),b++),$e(this,b,E,1)},$.toFixed=function(b,E){return b!=null&&(K(b,0,v),b=b+this.e+1),$e(this,b,E)},$.toFormat=function(b,E,L){var ie,W=this;if(L==null)b!=null&&E&&typeof E=="object"?(L=E,E=null):b&&typeof b=="object"?(L=b,b=E=null):L=Me;else if(typeof L!="object")throw Error(c+"Argument not an object: "+L);if(ie=W.toFixed(b,E),W.c){var te,ce=ie.split("."),J=+L.groupSize,H=+L.secondaryGroupSize,M=L.groupSeparator||"",U=ce[0],se=ce[1],je=W.s<0,_=je?U.slice(1):U,I=_.length;if(H&&(te=J,J=H,H=te,I-=te),J>0&&I>0){for(te=I%J||J,U=_.substr(0,te);te<I;te+=J)U+=M+_.substr(te,J);H>0&&(U+=M+_.slice(te)),je&&(U="-"+U)}ie=se?U+(L.decimalSeparator||"")+((H=+L.fractionGroupSize)?se.replace(new RegExp("\\d{"+H+"}\\B","g"),"$&"+(L.fractionGroupSeparator||"")):se):U}return(L.prefix||"")+ie+(L.suffix||"")},$.toFraction=function(b){var E,L,ie,W,te,ce,J,H,M,U,se,je,_=this,I=_.c;if(b!=null&&(J=new ue(b),!J.isInteger()&&(J.c||J.s!==1)||J.lt(re)))throw Error(c+"Argument "+(J.isInteger()?"out of range: ":"not an integer: ")+Ue(J));if(!I)return new ue(_);for(E=new ue(re),M=L=new ue(re),ie=H=new ue(re),je=O(I),te=E.e=je.length-_.e-1,E.c[0]=x[(ce=te%y)<0?y+ce:ce],b=!b||J.comparedTo(E)>0?te>0?E:M:J,ce=D,D=1/0,J=new ue(je),H.c[0]=0;U=R(J,E,0,1),W=L.plus(U.times(ie)),W.comparedTo(b)!=1;)L=ie,ie=W,M=H.plus(U.times(W=M)),H=W,E=J.minus(U.times(W=E)),J=W;return W=R(b.minus(L),ie,0,1),H=H.plus(W.times(M)),L=L.plus(W.times(ie)),H.s=M.s=_.s,te=te*2,se=R(M,ie,te,Z).minus(_).abs().comparedTo(R(H,L,te,Z).minus(_).abs())<1?[M,ie]:[H,L],D=ce,se},$.toNumber=function(){return+Ue(this)},$.toPrecision=function(b,E){return b!=null&&K(b,1,v),$e(this,b,E,2)},$.toString=function(b){var E,L=this,ie=L.s,W=L.e;return W===null?ie?(E="Infinity",ie<0&&(E="-"+E)):E="NaN":(b==null?E=W<=ne||W>=me?w(O(L.c),W):G(O(L.c),W,"0"):b===10&&Ae?(L=Ze(new ue(L),Q+W+1,Z),E=G(O(L.c),L.e,"0")):(K(b,2,Fe.length,"Base"),E=q(G(O(L.c),W,"0"),10,b,ie,!0)),ie<0&&L.c[0]&&(E="-"+E)),E},$.valueOf=$.toJSON=function(){return Ue(this)},$._isBigNumber=!0,T!=null&&ue.set(T),ue}function B(T){var R=T|0;return T>0||T===R?R:R-1}function O(T){for(var R,q,z=1,$=T.length,re=T[0]+"";z<$;){for(R=T[z++]+"",q=y-R.length;q--;R="0"+R);re+=R}for($=re.length;re.charCodeAt(--$)===48;);return re.slice(0,$+1||1)}function k(T,R){var q,z,$=T.c,re=R.c,Q=T.s,Z=R.s,ne=T.e,me=R.e;if(!Q||!Z)return null;if(q=$&&!$[0],z=re&&!re[0],q||z)return q?z?0:-Z:Q;if(Q!=Z)return Q;if(q=Q<0,z=ne==me,!$||!re)return z?0:!$^q?1:-1;if(!z)return ne>me^q?1:-1;for(Z=(ne=$.length)<(me=re.length)?ne:me,Q=0;Q<Z;Q++)if($[Q]!=re[Q])return $[Q]>re[Q]^q?1:-1;return ne==me?0:ne>me^q?1:-1}function K(T,R,q,z){if(T<R||T>q||T!==m(T))throw Error(c+(z||"Argument")+(typeof T=="number"?T<R||T>q?" out of range: ":" not an integer: ":" not a primitive number: ")+String(T))}function j(T){var R=T.c.length-1;return B(T.e/y)==R&&T.c[R]%2!=0}function w(T,R){return(T.length>1?T.charAt(0)+"."+T.slice(1):T)+(R<0?"e":"e+")+R}function G(T,R,q){var z,$;if(R<0){for($=q+".";++R;$+=q);T=$+T}else if(z=T.length,++R>z){for($=q,R-=z;--R;$+=q);T+=$}else R<z&&(T=T.slice(0,R)+"."+T.slice(R));return T}o=N(),o.default=o.BigNumber=o,a.exports?a.exports=o:(r||(r=typeof self<"u"&&self?self:window),r.BigNumber=o)})(bC)})(T0);var k0=T0.exports;const Da=Pf(),IC=Of(),$C=zf,VC=k0,pn={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},fs={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:F0,decimalSuffixes:Pl}=Da.currentBytes(),qf={general:{scale:1024,suffixes:Pl},binary:{scale:1024,suffixes:F0},decimal:{scale:1e3,suffixes:Pl}};function HC(a,r={},o){if(typeof r=="string"&&(r=$C.parseFormat(r)),!IC.validateFormat(r))return"ERROR: invalid format";let f=r.prefix||"",m=r.postfix||"",c=YC(a,r,o);return c=d1(c,f),c=f1(c,m),c}function YC(a,r,o){switch(r.output){case"currency":return r=ao(r,Da.currentCurrencyDefaultFormat()),e1(a,r,Da);case"percent":return r=ao(r,Da.currentPercentageDefaultFormat()),JC(a,r,Da,o);case"byte":return r=ao(r,Da.currentByteDefaultFormat()),ZC(a,r,Da,o);case"time":return r=ao(r,Da.currentTimeDefaultFormat()),WC(a);case"ordinal":return r=ao(r,Da.currentOrdinalDefaultFormat()),XC(a,r,Da);default:return ms({instance:a,providedFormat:r})}}function GC(a){let r=qf.decimal;return Jl(a._value,r.suffixes,r.scale).suffix}function KC(a){let r=qf.binary;return Jl(a._value,r.suffixes,r.scale).suffix}function QC(a){let r=qf.general;return Jl(a._value,r.suffixes,r.scale).suffix}function Jl(a,r,o){let s=r[0],f=Math.abs(a);if(f>=o){for(let m=1;m<r.length;++m){let c=Math.pow(o,m),h=Math.pow(o,m+1);if(f>=c&&f<h){s=r[m],a=a/c;break}}s===r[0]&&(a=a/Math.pow(o,r.length-1),s=r[r.length-1])}return{value:a,suffix:s}}function ZC(a,r,o,s){let f=r.base||"binary",m=Object.assign({},fs,r);const{binarySuffixes:c,decimalSuffixes:h}=o.currentBytes();let y={general:{scale:1024,suffixes:h||Pl,marker:"bd"},binary:{scale:1024,suffixes:c||F0,marker:"b"},decimal:{scale:1e3,suffixes:h||Pl,marker:"d"}}[f],{value:S,suffix:x}=Jl(a._value,y.suffixes,y.scale);return`${ms({instance:s(S),providedFormat:r,state:o,defaults:o.currentByteDefaultFormat()})}${m.spaceSeparated?" ":""}${x}`}function XC(a,r,o){let s=o.currentOrdinal(),f=Object.assign({},fs,r),m=ms({instance:a,providedFormat:r,state:o}),c=s(a._value);return`${m}${f.spaceSeparated?" ":""}${c}`}function WC(a){let r=Math.floor(a._value/60/60),o=Math.floor((a._value-r*60*60)/60),s=Math.round(a._value-r*60*60-o*60);return`${r}:${o<10?"0":""}${o}:${s<10?"0":""}${s}`}function JC(a,r,o,s){let f=r.prefixSymbol,m=ms({instance:s(a._value*100),providedFormat:r,state:o}),c=Object.assign({},fs,r);return f?`%${c.spaceSeparated?" ":""}${m}`:`${m}${c.spaceSeparated?" ":""}%`}function e1(a,r,o){const s=o.currentCurrency();let f=Object.assign({},r),m=Object.assign({},fs,f),c,h="",g=!!m.totalLength||!!m.forceAverage||m.average,y=f.currencyPosition||s.position,S=f.currencySymbol||s.symbol;const x=m.spaceSeparatedCurrency!==void 0?m.spaceSeparatedCurrency:m.spaceSeparated;f.lowPrecision===void 0&&(f.lowPrecision=!1),x&&(h=" "),y==="infix"&&(c=h+S+h);let A=ms({instance:a,providedFormat:f,state:o,decimalSeparator:c});return y==="prefix"&&(a._value<0&&m.negative==="sign"?A=`-${h}${S}${A.slice(1)}`:a._value>0&&m.forceSign?A=`+${h}${S}${A.slice(1)}`:A=S+h+A),(!y||y==="postfix")&&(h=!m.spaceSeparatedAbbreviation&&g?"":h,A=A+h+S),A}function t1({value:a,forceAverage:r,lowPrecision:o=!0,abbreviations:s,spaceSeparated:f=!1,totalLength:m=0,roundingFunction:c=Math.round}){let h="",g=Math.abs(a),y=-1;if(r&&s[r]&&pn[r]?(h=s[r],a=a/pn[r]):g>=pn.trillion||o&&c(g/pn.trillion)===1?(h=s.trillion,a=a/pn.trillion):g<pn.trillion&&g>=pn.billion||o&&c(g/pn.billion)===1?(h=s.billion,a=a/pn.billion):g<pn.billion&&g>=pn.million||o&&c(g/pn.million)===1?(h=s.million,a=a/pn.million):(g<pn.million&&g>=pn.thousand||o&&c(g/pn.thousand)===1)&&(h=s.thousand,a=a/pn.thousand),h&&(h=(f?" ":"")+h),m){let x=a<0,A=a.toString().split(".")[0],v=x?A.length-1:A.length;y=Math.max(m-v,0)}return{value:a,abbreviation:h,mantissaPrecision:y}}function n1({value:a,characteristicPrecision:r}){let[o,s]=a.toExponential().split("e"),f=+o;if(!r)return{value:f,abbreviation:`e${s}`};let m=1;return m<r&&(f=f*Math.pow(10,r-m),s=+s-(r-m),s=s>=0?`+${s}`:s),{value:f,abbreviation:`e${s}`}}function Tl(a){let r="";for(let o=0;o<a;o++)r+="0";return r}function a1(a,r){let o=a.toString(),[s,f]=o.split("e"),[m,c=""]=s.split(".");if(+f>0)o=m+c+Tl(f-c.length);else{let h=".";+m<0?h=`-0${h}`:h=`0${h}`;let g=(Tl(-f-1)+Math.abs(m)+c).substr(0,r);g.length<r&&(g+=Tl(r-g.length)),o=h+g}return+f>0&&r>0&&(o+=`.${Tl(r)}`),o}function i1(a,r,o=Math.round){return a.toString().indexOf("e")!==-1?a1(a,r):new VC(o(+`${a}e+${r}`)/Math.pow(10,r)).toFixed(r)}function r1(a,r,o,s,f,m){if(s===-1)return a;let c=i1(r,s,m),[h,g=""]=c.toString().split(".");if(g.match(/^0+$/)&&(o||f))return h;let y=g.match(/0+$/);return f&&y?`${h}.${g.toString().slice(0,y.index)}`:c.toString()}function o1(a,r,o,s){let f=a,[m,c]=f.toString().split(".");if(m.match(/^-?0$/)&&o)return c?`${m.replace("0","")}.${c}`:m.replace("0","");const h=r<0&&m.indexOf("-")===0;if(h&&(m=m.slice(1),f=f.slice(1)),m.length<s){let g=s-m.length;for(let y=0;y<g;y++)f=`0${f}`}return h&&(f=`-${f}`),f.toString()}function s1(a,r){let o=[],s=0;for(let f=a;f>0;f--)s===r&&(o.unshift(f),s=0),s++;return o}function l1(a,r,o,s,f){let m=s.currentDelimiters(),c=m.thousands;f=f||m.decimal;let h=m.thousandsSize||3,g=a.toString(),y=g.split(".")[0],S=g.split(".")[1];const x=r<0&&y.indexOf("-")===0;return o&&(x&&(y=y.slice(1)),s1(y.length,h).forEach((v,N)=>{y=y.slice(0,v+N)+c+y.slice(v+N)}),x&&(y=`-${y}`)),S?g=y+f+S:g=y,g}function u1(a,r){return a+r}function c1(a,r,o){return r===0?a:+a==0?a.replace("-",""):r>0?`+${a}`:o==="sign"?a:`(${a.replace("-","")})`}function d1(a,r){return r+a}function f1(a,r){return a+r}function ms({instance:a,providedFormat:r,state:o=Da,decimalSeparator:s,defaults:f=o.currentDefaults()}){let m=a._value;if(m===0&&o.hasZeroFormat())return o.getZeroFormat();if(!isFinite(m))return m.toString();let c=Object.assign({},fs,f,r),h=c.totalLength,g=h?0:c.characteristic,y=c.optionalCharacteristic,S=c.forceAverage,x=c.lowPrecision,A=!!h||!!S||c.average,v=h?-1:A&&r.mantissa===void 0?0:c.mantissa,N=h?!1:r.optionalMantissa===void 0?v===-1:c.optionalMantissa,B=c.trimMantissa,O=c.thousandSeparated,k=c.spaceSeparated,K=c.negative,j=c.forceSign,w=c.exponential,G=c.roundingFunction,T="";if(A){let q=t1({value:m,forceAverage:S,lowPrecision:x,abbreviations:o.currentAbbreviations(),spaceSeparated:k,roundingFunction:G,totalLength:h});m=q.value,T+=q.abbreviation,h&&(v=q.mantissaPrecision)}if(w){let q=n1({value:m,characteristicPrecision:g});m=q.value,T=q.abbreviation+T}let R=r1(m.toString(),m,N,v,B,G);return R=o1(R,m,y,g),R=l1(R,m,O,o,s),(A||w)&&(R=u1(R,T)),(j||m<0)&&(R=c1(R,m,K)),R}function ao(a,r){if(!a)return r;let o=Object.keys(a);return o.length===1&&o[0]==="output"?r:a}var m1=a=>({format:(...r)=>HC(...r,a),getByteUnit:(...r)=>QC(...r,a),getBinaryByteUnit:(...r)=>KC(...r,a),getDecimalByteUnit:(...r)=>GC(...r,a),formatOrDefault:ao});const ai=k0;function p1(a,r,o){let s=new ai(a._value),f=r;return o.isNumbro(r)&&(f=r._value),f=new ai(f),a._value=s.plus(f).toNumber(),a}function j0(a,r,o){let s=new ai(a._value),f=r;return o.isNumbro(r)&&(f=r._value),f=new ai(f),a._value=s.minus(f).toNumber(),a}function h1(a,r,o){let s=new ai(a._value),f=r;return o.isNumbro(r)&&(f=r._value),f=new ai(f),a._value=s.times(f).toNumber(),a}function y1(a,r,o){let s=new ai(a._value),f=r;return o.isNumbro(r)&&(f=r._value),f=new ai(f),a._value=s.dividedBy(f).toNumber(),a}function g1(a,r,o){let s=r;return o.isNumbro(r)&&(s=r._value),a._value=s,a}function D1(a,r,o){let s=o(a._value);return j0(s,r,o),Math.abs(s._value)}var v1=a=>({add:(r,o)=>p1(r,o,a),subtract:(r,o)=>j0(r,o,a),multiply:(r,o)=>h1(r,o,a),divide:(r,o)=>y1(r,o,a),set:(r,o)=>g1(r,o,a),difference:(r,o)=>D1(r,o,a),BigNumber:ai});const b1="2.5.0",ka=Pf(),x1=Of(),C1=LC(Yt),S1=w0();let sr=m1(Yt),lr=v1(Yt);const _1=zf;class R0{constructor(r){this._value=r}clone(){return Yt(this._value)}format(r={}){return sr.format(this,r)}formatCurrency(r){return typeof r=="string"&&(r=_1.parseFormat(r)),r=sr.formatOrDefault(r,ka.currentCurrencyDefaultFormat()),r.output="currency",sr.format(this,r)}formatTime(r={}){return r.output="time",sr.format(this,r)}binaryByteUnits(){return sr.getBinaryByteUnit(this)}decimalByteUnits(){return sr.getDecimalByteUnit(this)}byteUnits(){return sr.getByteUnit(this)}difference(r){return lr.difference(this,r)}add(r){return lr.add(this,r)}subtract(r){return lr.subtract(this,r)}multiply(r){return lr.multiply(this,r)}divide(r){return lr.divide(this,r)}set(r){return lr.set(this,M0(r))}value(){return this._value}valueOf(){return this._value}}function M0(a){let r=a;return Yt.isNumbro(a)?r=a._value:typeof a=="string"?r=Yt.unformat(a):isNaN(a)&&(r=NaN),r}function Yt(a){return new R0(M0(a))}Yt.version=b1;Yt.isNumbro=function(a){return a instanceof R0};Yt.language=ka.currentLanguage;Yt.registerLanguage=ka.registerLanguage;Yt.setLanguage=ka.setLanguage;Yt.languages=ka.languages;Yt.languageData=ka.languageData;Yt.zeroFormat=ka.setZeroFormat;Yt.defaultFormat=ka.currentDefaults;Yt.setDefaults=ka.setDefaults;Yt.defaultCurrencyFormat=ka.currentCurrencyDefaultFormat;Yt.validate=x1.validate;Yt.loadLanguagesInNode=C1.loadLanguagesInNode;Yt.unformat=S1.unformat;Yt.BigNumber=lr.BigNumber;var A1=Yt,E1=xC(A1);function w1({onlyFirst:a=!1}={}){const f="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(f,a?void 0:"g")}const T1=w1();function k1(a){if(typeof a!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof a}\``);return!a.includes("\x1B")&&!a.includes("›")?a:a.replace(T1,"")}var jd={exports:{}},sg;function F1(){return sg||(sg=1,(function(a){var r={};a.exports=r,r.eastAsianWidth=function(s){var f=s.charCodeAt(0),m=s.length==2?s.charCodeAt(1):0,c=f;return 55296<=f&&f<=56319&&56320<=m&&m<=57343&&(f&=1023,m&=1023,c=f<<10|m,c+=65536),c==12288||65281<=c&&c<=65376||65504<=c&&c<=65510?"F":c==8361||65377<=c&&c<=65470||65474<=c&&c<=65479||65482<=c&&c<=65487||65490<=c&&c<=65495||65498<=c&&c<=65500||65512<=c&&c<=65518?"H":4352<=c&&c<=4447||4515<=c&&c<=4519||4602<=c&&c<=4607||9001<=c&&c<=9002||11904<=c&&c<=11929||11931<=c&&c<=12019||12032<=c&&c<=12245||12272<=c&&c<=12283||12289<=c&&c<=12350||12353<=c&&c<=12438||12441<=c&&c<=12543||12549<=c&&c<=12589||12593<=c&&c<=12686||12688<=c&&c<=12730||12736<=c&&c<=12771||12784<=c&&c<=12830||12832<=c&&c<=12871||12880<=c&&c<=13054||13056<=c&&c<=19903||19968<=c&&c<=42124||42128<=c&&c<=42182||43360<=c&&c<=43388||44032<=c&&c<=55203||55216<=c&&c<=55238||55243<=c&&c<=55291||63744<=c&&c<=64255||65040<=c&&c<=65049||65072<=c&&c<=65106||65108<=c&&c<=65126||65128<=c&&c<=65131||110592<=c&&c<=110593||127488<=c&&c<=127490||127504<=c&&c<=127546||127552<=c&&c<=127560||127568<=c&&c<=127569||131072<=c&&c<=194367||177984<=c&&c<=196605||196608<=c&&c<=262141?"W":32<=c&&c<=126||162<=c&&c<=163||165<=c&&c<=166||c==172||c==175||10214<=c&&c<=10221||10629<=c&&c<=10630?"Na":c==161||c==164||167<=c&&c<=168||c==170||173<=c&&c<=174||176<=c&&c<=180||182<=c&&c<=186||188<=c&&c<=191||c==198||c==208||215<=c&&c<=216||222<=c&&c<=225||c==230||232<=c&&c<=234||236<=c&&c<=237||c==240||242<=c&&c<=243||247<=c&&c<=250||c==252||c==254||c==257||c==273||c==275||c==283||294<=c&&c<=295||c==299||305<=c&&c<=307||c==312||319<=c&&c<=322||c==324||328<=c&&c<=331||c==333||338<=c&&c<=339||358<=c&&c<=359||c==363||c==462||c==464||c==466||c==468||c==470||c==472||c==474||c==476||c==593||c==609||c==708||c==711||713<=c&&c<=715||c==717||c==720||728<=c&&c<=731||c==733||c==735||768<=c&&c<=879||913<=c&&c<=929||931<=c&&c<=937||945<=c&&c<=961||963<=c&&c<=969||c==1025||1040<=c&&c<=1103||c==1105||c==8208||8211<=c&&c<=8214||8216<=c&&c<=8217||8220<=c&&c<=8221||8224<=c&&c<=8226||8228<=c&&c<=8231||c==8240||8242<=c&&c<=8243||c==8245||c==8251||c==8254||c==8308||c==8319||8321<=c&&c<=8324||c==8364||c==8451||c==8453||c==8457||c==8467||c==8470||8481<=c&&c<=8482||c==8486||c==8491||8531<=c&&c<=8532||8539<=c&&c<=8542||8544<=c&&c<=8555||8560<=c&&c<=8569||c==8585||8592<=c&&c<=8601||8632<=c&&c<=8633||c==8658||c==8660||c==8679||c==8704||8706<=c&&c<=8707||8711<=c&&c<=8712||c==8715||c==8719||c==8721||c==8725||c==8730||8733<=c&&c<=8736||c==8739||c==8741||8743<=c&&c<=8748||c==8750||8756<=c&&c<=8759||8764<=c&&c<=8765||c==8776||c==8780||c==8786||8800<=c&&c<=8801||8804<=c&&c<=8807||8810<=c&&c<=8811||8814<=c&&c<=8815||8834<=c&&c<=8835||8838<=c&&c<=8839||c==8853||c==8857||c==8869||c==8895||c==8978||9312<=c&&c<=9449||9451<=c&&c<=9547||9552<=c&&c<=9587||9600<=c&&c<=9615||9618<=c&&c<=9621||9632<=c&&c<=9633||9635<=c&&c<=9641||9650<=c&&c<=9651||9654<=c&&c<=9655||9660<=c&&c<=9661||9664<=c&&c<=9665||9670<=c&&c<=9672||c==9675||9678<=c&&c<=9681||9698<=c&&c<=9701||c==9711||9733<=c&&c<=9734||c==9737||9742<=c&&c<=9743||9748<=c&&c<=9749||c==9756||c==9758||c==9792||c==9794||9824<=c&&c<=9825||9827<=c&&c<=9829||9831<=c&&c<=9834||9836<=c&&c<=9837||c==9839||9886<=c&&c<=9887||9918<=c&&c<=9919||9924<=c&&c<=9933||9935<=c&&c<=9953||c==9955||9960<=c&&c<=9983||c==10045||c==10071||10102<=c&&c<=10111||11093<=c&&c<=11097||12872<=c&&c<=12879||57344<=c&&c<=63743||65024<=c&&c<=65039||c==65533||127232<=c&&c<=127242||127248<=c&&c<=127277||127280<=c&&c<=127337||127344<=c&&c<=127386||917760<=c&&c<=917999||983040<=c&&c<=1048573||1048576<=c&&c<=1114109?"A":"N"},r.characterLength=function(s){var f=this.eastAsianWidth(s);return f=="F"||f=="W"||f=="A"?2:1};function o(s){return s.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}r.length=function(s){for(var f=o(s),m=0,c=0;c<f.length;c++)m=m+this.characterLength(f[c]);return m},r.slice=function(s,f,m){textLen=r.length(s),f=f||0,m=m||1,f<0&&(f=textLen+f),m<0&&(m=textLen+m);for(var c="",h=0,g=o(s),y=0;y<g.length;y++){var S=g[y],x=r.length(S);if(h>=f-(x==2?1:0))if(h+x<=m)c+=S;else break;h+=x}return c}})(jd)),jd.exports}var j1=F1();const R1=ri(j1);var Rd,lg;function M1(){return lg||(lg=1,Rd=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}),Rd}var N1=M1();const B1=ri(N1);function U1(a,r={}){if(typeof a!="string"||a.length===0||(r={ambiguousIsNarrow:!0,...r},a=k1(a),a.length===0))return 0;a=a.replace(B1()," ");const o=r.ambiguousIsNarrow?1:2;let s=0;for(const f of a){const m=f.codePointAt(0);if(m<=31||m>=127&&m<=159||m>=768&&m<=879)continue;switch(R1.eastAsianWidth(f)){case"F":case"W":s+=2;break;case"A":s+=o;break;default:s+=1}}return s}var Bi=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["Andorra","ad","376"],["Angola","ao","244"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54","(..) ........",0],["Armenia","am","374",".. ......"],["Aruba","aw","297"],["Australia","au","61",". .... ....",0],["Austria","at","43"],["Azerbaijan","az","994","(..) ... .. .."],["Bahamas","bs","1242"],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1246"],["Belarus","by","375","(..) ... .. .."],["Belgium","be","32","... .. .. .."],["Belize","bz","501"],["Benin","bj","229"],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55","(..) ........."],["British Indian Ocean Territory","io","246"],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599","",1],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86","... .... ...."],["Colombia","co","57","... ... ...."],["Comoros","km","269"],["Congo","cd","243"],["Congo","cg","242"],["Costa Rica","cr","506","....-...."],["Côte d'Ivoire","ci","225",".. .. .. .. .."],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599","",0],["Cyprus","cy","357",".. ......"],["Czech Republic","cz","420","... ... ..."],["Denmark","dk","45",".. .. .. .."],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic","do","1","",2],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503","....-...."],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372",".... ......"],["Ethiopia","et","251"],["Fiji","fj","679"],["Finland","fi","358",".. ... .. .."],["France","fr","33",". .. .. .. .."],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49",".... ........"],["Ghana","gh","233"],["Greece","gr","30"],["Grenada","gd","1473"],["Guadeloupe","gp","590","",0],["Guam","gu","1671"],["Guatemala","gt","502","....-...."],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509","....-...."],["Honduras","hn","504"],["Hong Kong","hk","852",".... ...."],["Hungary","hu","36"],["Iceland","is","354","... ...."],["India","in","91",".....-....."],["Indonesia","id","62"],["Iran","ir","98","... ... ...."],["Iraq","iq","964"],["Ireland","ie","353",".. ......."],["Israel","il","972","... ... ...."],["Italy","it","39","... .......",0],["Jamaica","jm","1876"],["Japan","jp","81",".. .... ...."],["Jordan","jo","962"],["Kazakhstan","kz","7","... ...-..-..",0],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996","... ... ..."],["Laos","la","856"],["Latvia","lv","371",".. ... ..."],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Macedonia","mk","389"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60","..-....-...."],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mexico","mx","52","... ... ....",0],["Micronesia","fm","691"],["Moldova","md","373","(..) ..-..-.."],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Morocco","ma","212"],["Mozambique","mz","258"],["Myanmar","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31",".. ........"],["New Caledonia","nc","687"],["New Zealand","nz","64","...-...-...."],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["North Korea","kp","850"],["Norway","no","47","... .. ..."],["Oman","om","968"],["Pakistan","pk","92","...-......."],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63",".... ......."],["Poland","pl","48","...-...-..."],["Portugal","pt","351"],["Puerto Rico","pr","1","",3],["Qatar","qa","974"],["Réunion","re","262"],["Romania","ro","40"],["Russia","ru","7","(...) ...-..-..",1],["Rwanda","rw","250"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65","....-...."],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82","... .... ...."],["South Sudan","ss","211"],["Spain","es","34","... ... ..."],["Sri Lanka","lk","94"],["Sudan","sd","249"],["Suriname","sr","597"],["Swaziland","sz","268"],["Sweden","se","46","(...) ...-..."],["Switzerland","ch","41",".. ... .. .."],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia","tn","216"],["Turkey","tr","90","... ... .. .."],["Turkmenistan","tm","993"],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380","(..) ... .. .."],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",".... ......"],["United States","us","1","(...) ...-....",0],["Uruguay","uy","598"],["Uzbekistan","uz","998",".. ... .. .."],["Vanuatu","vu","678"],["Vatican City","va","39",".. .... ....",1],["Venezuela","ve","58"],["Vietnam","vn","84"],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"]],O1="react-international-phone-",N0=(...a)=>a.filter(r=>!!r).join(" ").trim(),z1=(...a)=>N0(...a).split(" ").map(r=>`${O1}${r}`).join(" "),ug=({addPrefix:a,rawClassNames:r})=>N0(z1(...a),...r),P1=({value:a,mask:r,maskSymbol:o,offset:s=0,trimNonMaskCharsLeftover:f=!1})=>{if(a.length<s)return a;let m=a.slice(0,s),c=a.slice(s),h=m,g=0;for(let y of r.split("")){if(g>=c.length){if(!f&&y!==o){h+=y;continue}break}y===o?(h+=c[g],g+=1):h+=y}return h},ql=a=>a.replace(/\D/g,""),Wa=a=>{let[r,o,s,f,m,c]=a;return{name:r,iso2:o,dialCode:s,format:f,priority:m,areaCodes:c}},q1=a=>`Field "${a}" is not supported`,Ml=({field:a,value:r,countries:o=Bi})=>{if(["priority"].includes(a))throw new Error(q1(a));let s=o.find(f=>{let m=Wa(f);return r===m[a]});if(s)return Wa(s)},cg=({phone:a,countries:r=Bi,currentCountryIso2:o})=>{let s={country:void 0,fullDialCodeMatch:!1};if(!a)return s;let f=ql(a);if(!f)return s;let m=s,c=({country:h,fullDialCodeMatch:g})=>{let y=h.dialCode===m.country?.dialCode,S=(h.priority??0)<(m.country?.priority??0);(!y||S)&&(m={country:h,fullDialCodeMatch:g})};for(let h of r){let g=Wa(h),{dialCode:y,areaCodes:S}=g;if(f.startsWith(y)){let x=m.country?Number(y)>=Number(m.country.dialCode):!0;if(S){let A=f.substring(y.length);for(let v of S)if(A.startsWith(v))return{country:g,fullDialCodeMatch:!0}}(x||y===f||!m.fullDialCodeMatch)&&c({country:g,fullDialCodeMatch:!0})}m.fullDialCodeMatch||f.length<y.length&&y.startsWith(f)&&(!m.country||Number(y)<=Number(m.country.dialCode))&&c({country:g,fullDialCodeMatch:!1})}if(o){let h=Ml({value:o,field:"iso2",countries:r});if(!h)return m;let g=h?(y=>{if(!y?.areaCodes)return!1;let S=f.substring(y.dialCode.length);return y.areaCodes.some(x=>x.startsWith(S))})(h):!1;m&&m.country?.dialCode===h.dialCode&&m.country!==h&&m.fullDialCodeMatch&&(!h.areaCodes||g)&&(m={country:h,fullDialCodeMatch:!0})}return m},L1=({phone:a,dialCode:r,prefix:o="+",charAfterDialCode:s=" "})=>{if(!a||!r)return a;let f=a;return f.startsWith(o)&&(f=f.replace(o,"")),f.startsWith(r)?(f=f.replace(r,""),f.startsWith(s)&&(f=f.replace(s,"")),f):a},I1=({phone:a,dialCode:r,prefix:o="+",charAfterDialCode:s=" "})=>`${o}${r}${s}${L1({phone:a,dialCode:r,charAfterDialCode:s,prefix:o})}`,$1=(a,r)=>{let o=r.disableDialCodeAndPrefix?!1:r.forceDialCode,s=r.disableDialCodeAndPrefix?!1:r.insertDialCodeOnEmpty,f=a,m=y=>r.trimNonDigitsEnd?y.trim():y;if(!f)return s&&!f.length||o?m(`${r.prefix}${r.dialCode}${r.charAfterDialCode}`):m(f);if(f=ql(f),f===r.dialCode&&!r.disableDialCodeAndPrefix)return m(`${r.prefix}${r.dialCode}${r.charAfterDialCode}`);if(r.dialCode.startsWith(f)&&!r.disableDialCodeAndPrefix)return m(o?`${r.prefix}${r.dialCode}${r.charAfterDialCode}`:`${r.prefix}${f}`);if(!f.startsWith(r.dialCode)&&!r.disableDialCodeAndPrefix){if(o)return m(`${r.prefix}${r.dialCode}${r.charAfterDialCode}`);if(f.length<r.dialCode.length)return m(`${r.prefix}${f}`)}let c=()=>{let y=r.dialCode.length;r.disableDialCodeAndPrefix&&(y=0);let S=f.slice(0,y),x=f.slice(y);return{phoneLeftSide:S,phoneRightSide:x}},{phoneLeftSide:h,phoneRightSide:g}=c();return h=`${r.prefix}${h}${r.charAfterDialCode}`,g=P1({value:g,mask:r.mask,maskSymbol:r.maskChar,trimNonMaskCharsLeftover:r.trimNonDigitsEnd}),r.disableDialCodeAndPrefix&&(h=""),m(`${h}${g}`)},es=a=>/\d/.test(a),V1=({phoneBeforeInput:a,phoneAfterInput:r,phoneAfterFormatted:o,cursorPositionAfterInput:s,leftOffset:f=0,deletion:m})=>{if(s<f)return f;if(!a)return o.length;let c=m==="backward";if(s===0&&r.length>0&&o.length>0){if(c)return 0;for(let x=0;x<o.length;x+=1)if(es(o[x]))return x;return o.length}if(r.length<a.length&&r.length===1)return o.length;let h=null;for(let x=s-1;x>=0;x-=1)if(es(r[x])){h=x;break}if(h===null)return s!==0?s:o.length;let g=0;for(let x=0;x<h;x+=1)es(r[x])&&(g+=1);c&&(g-=1);let y=0,S=0;for(let x=0;x<o.length&&(y+=1,es(o[x])&&(S+=1),S!==g+1);x+=1);for(;!es(o[y])&&y<o.length;)y+=1;return c&&(y+=1),y},H1=(a,r)=>{let o=parseInt(a,16);return Number(o+r).toString(16)},Y1="abcdefghijklmnopqrstuvwxyz",G1="1f1e6",dg=Y1.split("").reduce((a,r,o)=>({...a,[r]:H1(G1,o)}),{}),K1=a=>[dg[a[0]],dg[a[1]]].join("-"),Nl=({iso2:a,size:r,src:o,protocol:s="https",disableLazyLoading:f,className:m,style:c,...h})=>{if(!a)return Ne.createElement("img",{className:ug({addPrefix:["flag-emoji"],rawClassNames:[m]}),width:r,height:r,...h});let g=()=>{if(o)return o;let y=K1(a);return`${s}://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${y}.svg`};return Ne.createElement("img",{className:ug({addPrefix:["flag-emoji"],rawClassNames:[m]}),src:g(),width:r,height:r,draggable:!1,"data-country":a,loading:f?void 0:"lazy",style:{width:r,height:r,...c},alt:"",...h})},Q1=()=>{let a=V.useRef(),r=V.useRef(Date.now());return{check:()=>{let o=Date.now(),s=a.current?o-r.current:void 0;return a.current=r.current,r.current=o,s}}},Z1={size:20,overrideLastItemDebounceMS:-1};function X1(a,r){let{size:o,overrideLastItemDebounceMS:s,onChange:f}={...Z1,...r},[m,c]=V.useState(a),[h,g]=V.useState([m]),[y,S]=V.useState(0),x=Q1();return[m,(A,v)=>{if(typeof A=="object"&&Object.entries(A).toString()===Object.entries(m).toString()||A===m)return;let N=s>0,B=x.check(),O=N&&B!==void 0?B>s:!0;if(v?.overrideLastItem!==void 0?v.overrideLastItem:!O)g(k=>[...k.slice(0,y),A]);else{let k=h.length>=o;g(K=>[...K.slice(k?1:0,y+1),A]),k||S(K=>K+1)}c(A),f?.(A)},()=>{if(y<=0)return{success:!1};let A=h[y-1];return c(A),S(v=>v-1),f?.(A),{success:!0,value:A}},()=>{if(y+1>=h.length)return{success:!1};let A=h[y+1];return c(A),S(v=>v+1),f?.(A),{success:!0,value:A}}]}var W1=".",ya={defaultCountry:"us",value:"",prefix:"+",defaultMask:"............",charAfterDialCode:" ",historySaveDebounceMS:200,disableCountryGuess:!1,disableDialCodePrefill:!1,forceDialCode:!1,disableDialCodeAndPrefix:!1,countries:Bi},J1=({defaultCountry:a=ya.defaultCountry,value:r=ya.value,countries:o=ya.countries,prefix:s=ya.prefix,defaultMask:f=ya.defaultMask,charAfterDialCode:m=ya.charAfterDialCode,historySaveDebounceMS:c=ya.historySaveDebounceMS,disableCountryGuess:h=ya.disableCountryGuess,disableDialCodePrefill:g=ya.disableDialCodePrefill,forceDialCode:y=ya.forceDialCode,disableDialCodeAndPrefix:S=ya.disableDialCodeAndPrefix,onChange:x})=>{let A=S?!1:!h,v=V.useRef(null),N=({value:re,country:Q,trimNonDigitsEnd:Z,insertDialCodeOnEmpty:ne,forceDisableCountryGuess:me})=>{let P=!me&&A?cg({phone:re,countries:o,currentCountryIso2:Q.iso2}):void 0,D=P?.country??Q;return{phone:D?$1(re,{prefix:s,mask:D.format||f,maskChar:W1,dialCode:D.dialCode,trimNonDigitsEnd:Z,charAfterDialCode:m,forceDialCode:y,insertDialCodeOnEmpty:ne,disableDialCodeAndPrefix:S}):re,countryGuessResult:P,formatCountry:D}},B=re=>{Promise.resolve().then(()=>{v.current?.setSelectionRange(re,re)})},[{phone:O,country:k},K,j,w]=X1(()=>{let re=(S?null:cg({phone:r,countries:o,currentCountryIso2:a}))?.country||Ml({value:a,field:"iso2",countries:o});re||console.error(`[react-international-phone]: can not find a country with "${a}" iso2 code`);let Q=re||Wa(o.find(ne=>Wa(ne).iso2==="us")),Z=N({value:r,country:Q,insertDialCodeOnEmpty:!g}).phone;return B(Z.length),{phone:Z,country:Q.iso2}},{overrideLastItemDebounceMS:c,onChange:x}),G=V.useMemo(()=>Ml({value:k,field:"iso2",countries:o}),[o,k]),T=(re,{deletion:Q,cursorPosition:Z,insertDialCodeOnEmpty:ne,inserted:me}={})=>{let P=re,D=Z;y&&!S&&G&&!ql(re).startsWith(G.dialCode)&&re&&(me&&re.startsWith(s)&&re.length-(Z??0)===0?P=re:(P=O,D=0));let{phone:F,countryGuessResult:ae}=N({value:P,country:G,trimNonDigitsEnd:Q==="backward",insertDialCodeOnEmpty:ne,forceDisableCountryGuess:y&&!!Q&&ql(P).length<G.dialCode.length}),be=G;A&&ae?.country&&ae.country.name!==k&&ae.fullDialCodeMatch&&(be=ae.country);let Me=V1({cursorPositionAfterInput:D??0,phoneBeforeInput:O,phoneAfterInput:re,phoneAfterFormatted:F,leftOffset:y?s.length+(G?.dialCode?.length??0)+m.length:0,deletion:Q});return K({phone:F,country:be.iso2}),B(Me),F};V.useEffect(()=>{let re=v.current;if(!re)return;let Q=Z=>{if(!Z.key)return;let ne=Z.ctrlKey,me=Z.shiftKey,P=Z.key.toLowerCase()==="z";!ne||!P||(me?w():j())};return re.addEventListener("keydown",Q),()=>{re.removeEventListener("keydown",Q)}},[v,j,w]);let R=re=>{re.preventDefault();let Q=re.nativeEvent.inputType,Z=()=>{if(Q?.toLocaleLowerCase().includes("delete")??!1)return Q?.toLocaleLowerCase().includes("forward")?"forward":"backward"},ne=Q?.startsWith("insertFrom"),me=T(re.target.value,{deletion:Z(),inserted:ne,cursorPosition:re.target.selectionStart??0});return S&&G?I1({phone:me,dialCode:G.dialCode,charAfterDialCode:m,prefix:s}):me},q=re=>{let Q=Ml({value:re,field:"iso2",countries:o});if(!Q)return;let Z=S?"":`${s}${Q.dialCode}${m}`;K({phone:Z,country:Q.iso2}),Promise.resolve().then(()=>{v.current?.focus()})},[z,$]=V.useState(!1);return V.useEffect(()=>{if(!z){$(!0),r!==O&&x?.({phone:O,country:k});return}r!==O&&T(r)},[r]),{phone:O,country:k,setCountry:q,handlePhoneValueChange:R,inputRef:v}},Md,fg;function eS(){if(fg)return Md;fg=1;var a=xx(),r=Cx(),o=g0(),s=r(function(f,m,c,h){a(m,o(m),f,h)});return Md=s,Md}var Nd,mg;function B0(){if(mg)return Nd;mg=1;var a=Sx(),r=_x(),o=Ax(),s="[object DOMException]",f="[object Error]";function m(c){if(!r(c))return!1;var h=a(c);return h==f||h==s||typeof c.message=="string"&&typeof c.name=="string"&&!o(c)}return Nd=m,Nd}var Bd,pg;function tS(){if(pg)return Bd;pg=1;var a=Ex(),r=wx(),o=B0(),s=r(function(f,m){try{return a(f,void 0,m)}catch(c){return o(c)?c:new Error(c)}});return Bd=s,Bd}var Ud,hg;function nS(){if(hg)return Ud;hg=1;var a=Tx();function r(o,s){return a(s,function(f){return o[f]})}return Ud=r,Ud}var Od,yg;function aS(){if(yg)return Od;yg=1;var a=kx(),r=Object.prototype,o=r.hasOwnProperty;function s(f,m,c,h){return f===void 0||a(f,r[c])&&!o.call(h,c)?m:f}return Od=s,Od}var zd,gg;function iS(){if(gg)return zd;gg=1;var a={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function r(o){return"\\"+a[o]}return zd=r,zd}var Pd,Dg;function U0(){if(Dg)return Pd;Dg=1;var a=/<%=([\s\S]+?)%>/g;return Pd=a,Pd}var qd,vg;function rS(){if(vg)return qd;vg=1;function a(r){return function(o){return r?.[o]}}return qd=a,qd}var Ld,bg;function oS(){if(bg)return Ld;bg=1;var a=rS(),r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},o=a(r);return Ld=o,Ld}var Id,xg;function sS(){if(xg)return Id;xg=1;var a=oS(),r=Nf(),o=/[&<>"']/g,s=RegExp(o.source);function f(m){return m=r(m),m&&s.test(m)?m.replace(o,a):m}return Id=f,Id}var $d,Cg;function lS(){if(Cg)return $d;Cg=1;var a=/<%-([\s\S]+?)%>/g;return $d=a,$d}var Vd,Sg;function uS(){if(Sg)return Vd;Sg=1;var a=/<%([\s\S]+?)%>/g;return Vd=a,Vd}var Hd,_g;function cS(){if(_g)return Hd;_g=1;var a=sS(),r=lS(),o=uS(),s=U0(),f={escape:r,evaluate:o,interpolate:s,variable:"",imports:{_:{escape:a}}};return Hd=f,Hd}var Yd,Ag;function dS(){if(Ag)return Yd;Ag=1;var a=Fx(),r=eS(),o=tS(),s=nS(),f=aS(),m=iS(),c=B0(),h=jx(),g=g0(),y=U0(),S=cS(),x=Nf(),A="Invalid `variable` option passed into `_.template`",v="Invalid `imports` option passed into `_.template`",N=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,k=/[()=,{}\[\]\/\s]/,K=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,j=/($^)/,w=/['\n\r\u2028\u2029\\]/g,G=Object.prototype,T=G.hasOwnProperty;function R(q,z,$){var re=S.imports._.templateSettings||S;$&&h(q,z,$)&&(z=void 0),q=x(q),z=r({},z,re,f);var Q=r({},z.imports,re.imports,f),Z=g(Q),ne=s(Q,Z);a(Z,function(ue){if(k.test(ue))throw new Error(v)});var me,P,D=0,F=z.interpolate||j,ae="__p += '",be=RegExp((z.escape||j).source+"|"+F.source+"|"+(F===y?K:j).source+"|"+(z.evaluate||j).source+"|$","g"),Me=T.call(z,"sourceURL")?"//# sourceURL="+(z.sourceURL+"").replace(/\s/g," ")+`
10
10
  `:"";q.replace(be,function(ue,$e,Pe,Xe,Ze,Ue){return Pe||(Pe=Xe),ae+=q.slice(D,Ue).replace(w,m),$e&&(me=!0,ae+=`' +
11
11
  __e(`+$e+`) +
12
12
  '`),Ze&&(P=!0,ae+=`';
@@ -23,8 +23,8 @@ __p += '`),Pe&&(ae+=`' +
23
23
  function print() { __p += __j.call(arguments, '') }
24
24
  `:`;
25
25
  `)+ae+`return __p
26
- }`;var Ae=o(function(){return Function(Z,Me+"return "+ae).apply(void 0,ne)});if(Ae.source=ae,c(Ae))throw Ae;return Ae}return Yd=R,Yd}var dS=cS();const fS=ri(dS),Ll={refund:"refund",stakeReturn:"stake_return"},mS=Wl({common:{id:"ID",url:"URL",none:"None",createdAt:"Created At",updatedAt:"Updated At",billingPeriod:"Billing Period",resumesAt:"Resume At",actions:"Actions",options:"Options",advanced:"Advanced options",login:"Login to access this page",accessDenied:"You do not have permission to access other customer data",settings:"Settings",preview:"Preview",required:"Required",setup:"Setup",amount:"Amount",total:"Total",totalDue:"Total Due",subtotal:"Subtotal",status:"Status",livemode:"Test mode",afterTime:"After {time}",timeAgo:"{time} ago",save:"Save",saved:"Changes saved",remove:"Remove",removed:"Resource removed",confirm:"Confirm",clear:"Clear",show:"Show",hide:"Hide",selectTimeRange:"Select time range",startDate:"Start date",endDate:"End date",upload:"Upload",change:"Change",cancel:"Cancel",close:"Close",back:"Back",every:"every",per:"per {interval}",slash:"/ {interval}",unit:"units",edit:"Edit",quantity:"Quantity",yes:"Yes",no:"No",email:"Email",did:"DID",txHash:"Transaction",txGas:"Transaction Gas",delegateTxHash:"Delegate Transaction",stakeTxHash:"Stake Transaction",slashTxHash:"Slash Transaction",transferTxHash:"Transfer Transaction",mintTxHash:"Mint Transaction",pending:"Pending",failed:"Failed",completed:"Completed",creditTransaction:"Credit Transaction",creditAmount:"Credit Amount",remainingBalance:"Remaining Balance",credits:"credits",ofCredits:"of credits",creditActivity:{consumption:"Credit Consumed",paidGrant:"Credit Top-up",paidAmount:"Paid {amount}",promotionalGrant:"Bonus",resetGrant:"Credit Reset",repayment:"Repayment"},transferStatus:"Transaction Status",sourceData:"Source Data",viewGrant:"View Grant",viewSubscription:"Subscription Detail",view:"View",meterEvent:"Meter Event",source:"Source",viewDetail:"View Detail",viewTransactionDetail:"Transaction Detail",viewConsumptionDetail:"Consumption Detail",customer:"Customer",currency:"Currency",network:"Network",custom:"Custom",description:"Description",statementDescriptor:"Statement descriptor",loadMore:"View more {resource}",loadingMore:"Loading more {resource}...",noMore:"No more {resource}",copied:"Copied",previous:"Back",continue:"Continue",qty:"Qty {count}",each:"{unit} each",trial:"Free for {count} {interval}",billed:"billed {rule}",metered:"based on usage",minute:"minute",hour:"hour",day:"day",week:"week",month:"month",year:"year",hourly:"hourly",daily:"daily",weekly:"weekly",monthly:"monthly",yearly:"yearly",month3:"every 3 months",month6:"every 6 months",recurring:"every {count} {interval}",minutes:"minutes",hours:"hours",days:"days",weeks:"weeks",months:"months",years:"years",type:"type",donation:"Donation",recoverFrom:"Recovered From",quantityLimitPerCheckout:"Exceed purchase limit",quantityNotEnough:"Exceed inventory",amountPrecisionLimit:"Amount decimal places must be less than or equal to {precision}",saveAsDefaultPriceSuccess:"Set default price successfully",stakeAmount:"Stake Amount",slashStakeAmount:"Slash Stake Amount",know:"I know",relatedSubscription:"Subscription",subscriptionOrCredit:"Subscription / Credit",purchaseItems:"Purchase Items",connect:{defaultScan:"Use the following methods to complete this action",scan:"Use the following methods to complete this {action}",confirm:"Confirm",cancel:"Cancel"},paymentMethod:"Payment Method",viewInvoice:"Invoice Detail",submit:"Submit",expired:"Expired",consumed:"Consumed",nextCharge:"Next charge"},payment:{checkout:{contact:"Contact information",method:"Payment method",processing:"Processing",payment:"Pay",try:"Try for free",include:"This includes:",subscription:"Subscribe",donate:"Donate",select:"Select",selected:"Selected",noPricing:"No items to purchase",setup:"Subscribe",continue:"Confirm {action}",connect:"Connect and {action}",login:"Login to load and save contact information",next:{subscription:"View subscription",invoice:"View invoice",view:"View"},paymentRequired:"Payment Required",quote:{title:"Price Locked",locked:"Exchange rate locked",expired:"Quote updating...",expiredMessage:"Quote updating...",expiring:"Quote updating...",remaining:"Quote updates in {time}",currentRate:"Current Exchange Rate",expiresIn:"Updates in",exchangeRate:"Exchange Rate",provider:"Provider",source:"Source",dynamicItems:"Dynamic Pricing Items",dynamicPricingInfo:"Dynamic pricing: 1 {symbol} = {rate} {currency}",referenceUnavailable:"Reference price will update shortly.",rateLine:"1 {symbol} ≈ {rate}",validity:"Quote valid: {time}",lockedWithTime:"Price locked: {time}",lockExpired:"Price lock expired. Please re-confirm.",detailProvider:"Provider",detailUpdatedAt:"Last updated",detailValidity:"Quote validity",detailLock:"Price lock",detailPriceImpact:"Price impact",detailSlippage:"Slippage limit",detailRefresh:"Refresh quote",slippage:{title:"Slippage Limit",tooltip:"Set the minimum exchange rate you are willing to accept. If the rate falls below this value at payment time, the transaction will be rejected.",percentMode:"Percentage",rateMode:"Exact Rate",invalid:"Please enter a valid value",invalidPositive:"Please enter a value greater than 0",rateRequired:"Exchange rate information required",invalidRate:"Invalid exchange rate value",minAcceptableRate:"Minimum Acceptable Rate",maxPayableIncrease:"Maximum Payment Increase",percentInputLabel:"Slippage Percentage",rateInputLabel:"Minimum Acceptable Rate ({currency})",minRateHint:"Minimum acceptable rate: {rate} {currency}",maxPayableHint:"Maximum payment increase: +{percent}%"},slippageLimit:{title:"Slippage Limit Configuration",description:"Set the minimum exchange rate you are willing to accept. If the rate falls below this value, the transaction will pause and ask for your confirmation.",configTogglePercent:"Percentage",configToggleRate:"Exact Rate",recommended:"Recommended",derivedCurrentRate:"Current reference rate",derivedMinRate:"Minimum acceptable rate"},rateUpdateLine:"1 {symbol} ≈ {rate} · updates in {time}",updateHint:"Prices will auto-refresh after update.",lockExpiredTitle:"Price lock expired",lockExpiredDescription:"The lock window has ended. Please re-confirm the latest price.",lockExpiredConfirm:"Re-lock price",slippageExceededTitle:"Rate below slippage limit",slippageExceededDescription:"The current rate is below your minimum acceptable rate. Please refresh the quote and try again.",updated:{pleaseRetry:"Price updated, please resubmit"},priceUpdatedTitle:"Price updated",priceUpdatedDescriptionRate:"Due to TBA exchange rate changes, the amount has been recalculated.",priceUpdatedDescriptionRecalc:"The amount has been recalculated.",priceUpdatedNewTotalLabel:"Updated total",priceUpdatedOldTotal:"Previous total: {total}",priceUpdatedConfirm:"Confirm and continue"},staking:{title:"Staking Required",tooltip:"Staking is used to ensure that future invoices can be paid normally. Revoking the staking from DID Wallet means canceling the subscription."},stakingConfirm:"In this payment, the staked amount is separate from the product cost.",donation:{between:"Please enter an amount between {min} and {max}.",custom:"Custom Amount",select:"Select Amount",summary:"{total} supporters {totalAmount} {symbol}",empty:"No supporters yet",gaveTips:"{count} people gave tips",tipAmount:"Tip Amount",tabHint:"to switch amount",benefits:{one:"{name} will receive all tips",multiple:"Tips will be distributed to {count} beneficiaries",view:"Click to view details"},inactive:"Donation feature is not enabled",enable:"Enable Donation",enableSuccess:"Successfully enabled",configPrompt:"The donation feature is enabled. You can configure donation options in Payment Kit",configNow:"Configure Now",later:"Configure Later",configTip:"Configure donation settings in Payment Kit"},cardPay:"{action} with bank card",skipPaymentMethod:"Skip, bind later",empty:"Nothing to pay",per:"per",pay:"Pay {payee}",try1:"Try {name}",try2:"Try {name} and {count} more",sub1:"Subscribe to {name}",sub2:"Subscribe to {name} and {count} more",then:"Then {subscription} {recurring}",meteredThen:"Then {recurring} based on usage",metered:"{recurring} based on usage",free:"{count} {interval} free",least:"continue with at least",completed:{payment:"Purchase successful",subscription:"Subscription successful",setup:"Subscription successful",donate:"Donation successful",tip:"A payment to {payee} has been completed. You can view the details of this payment in your account.",summary:{paid:"You've paid {amount}"}},vendor:{accountRequired:"This action requires a unified account. Please switch accounts and try again.",processing:"Processing...",progress:"Progress {progress}%",delivered:"Installation completed",failed:"Processing failed",failedMsg:"An exception occurred during installation. We will automatically process a refund for you. We apologize for the inconvenience. Thank you for your understanding!",launcher:{processing:"Installing {name}",completed:"{name} installed successfully",failed:"Failed to install {name}"},didnames:{processing:"Domain ({name}) registering",completed:"Domain ({name}) registered successfully",failed:"Domain ({name}) registered failed"},arcSphereToast:"Successfully installed, three seconds to return to the page continue..."},priceChange:{unavailable:"Unable to fetch exchange rate. Please try again later.",unstable:"Price is volatile. Please try again later.",title:"Price Changed",description:"Price changed significantly. Please refresh the quote and try again.",action:"Refresh Quote",cancel:"Cancel"},confirm:{withStake:"By confirming, you allow {payee} to charge your account for future payments and, if necessary, slash your stake. You can cancel your subscription or withdraw your stake at any time.",withoutStake:"By confirming, you allow {payee} to charge your account for future payments. You can cancel your subscription at any time."},required:"Required",invalid:"Invalid",billing:{auto:"Country",required:"Billing address",country:"Country",state:"State or province",city:"City or town",line1:"Address",line2:"Line2",postal_code:"Postal code"},customer:{name:"Name",email:"Email",phone:"Phone",phonePlaceholder:"Phone number",phoneTip:"In case we need to contact you about your order"},customerInfo:"Customer Information",upsell:{save:"Save with {recurring} billing",revert:"Switch to {recurring} billing",off:"{saving}% off"},cross_sell:{add:"Add to order",remove:"Remove from order"},dynamicPricing:"Dynamic Price",credit:{normal:{oneTime:"Purchase {amount}.",oneTimeWithExpiry:"Purchase {amount} (valid for {duration} {unit}).",recurring:"Subscription: {amount} {period}.",recurringWithExpiry:"Subscription: {amount} {period} (valid for {duration} {unit})."},pending:{notEnough:"You have a usage overage of {amount}. To restore access, a minimum purchase of {quantity} units is required.",oneTimeEnough:"You have a usage overage of {amount}. This purchase adds {totalAmount}. After covering the overage, your new available balance will be {availableAmount}.",oneTimeEnoughWithExpiry:"You have a usage overage of {amount}. This purchase adds {totalAmount} (valid for {duration} {unit}). After covering the overage, your new available balance will be {availableAmount}.",recurringEnough:"You have a usage overage of {amount}. This subscription adds {totalAmount} {period}. After covering the overage, your new available balance will be {availableAmount}.",recurringEnoughWithExpiry:"You have a usage overage of {amount}. This subscription adds {totalAmount} {period} (valid for {duration} {unit}). After covering the overage, your new available balance will be {availableAmount}."},schedule:{periodic:"Grant {amount} every {interval}.",withRefresh:"Grant {amount} every {interval}; unused credits expire with the next grant."},topupDescription:"Purchase {creditName} at {unitPrice} per credit."},expired:{title:"Expired Link",description:"This link has expired. This means that your payment has already been processed or your session has expired."},complete:{title:"Checkout Completed",description:"This checkout session has completed. This means that your payment has already been successfully processed."},emptyItems:{title:"Nothing to show here",description:"It seems this checkout session is not configured properly"},stopAcceptingOrders:{title:"Service Suspended",description:"New order placement is temporarily unavailable due to a system-level service suspension."},error:{title:"Something went wrong"},orderSummary:"Order Summary",orderSummarySubtitle:"Items included in this purchase",paymentDetails:"Payment Details",productListTotal:"Includes {total} items",headerTitle:{subscribe:"Subscribe to {name}",purchase:"Purchase {name}"},planFeatures:"Plan Features",typeBadge:{subscription:"SUBSCRIPTION",topup:"TOP-UP",oneTime:"ONE-TIME"},subtitle:{subscriptionInterval:"{interval} subscription",creditsTopup:"Credits top-up",addonFor:"Add-on for {product}",oneTime:"One-time purchase"},creditTopup:{title:"Get {name}",question:"How many {symbol} do you want?",credits:"Credits",increment:"Increments of {step} {symbol}",validFor:"Credits are valid for {duration} {unit} after purchase.",willReceive:"You'll receive",packInfo:"Includes {packs} credit packs ({perPack} per pack)",autoMatch:"We'll automatically match the closest credit pack.",autoMatchTooltip:"{symbol} are sold in packs of {step}",pendingWarning:"You have a usage overage of {pendingAmount}. You need at least {minCredits} to restore access.",pendingEnough:"You have a usage overage of {pendingAmount}. After covering the overage, your available balance will be {availableAmount}."},promotion:{add_code:"Add promotion code",enter_code:"Enter promotion code",placeholder:"Enter code",apply:"Apply",applied:"Applied promotion codes",dialog:{title:"Add promotion code"},error:{unknown:"Unknown error",network:"Network error occurred",removal:"Failed to remove code"}},coupon:{noDiscount:"No discount",percentage:"{percent}% off",fixedAmount:"{amount} {symbol} off",terms:{forever:"{couponOff} forever",once:"{couponOff} once",repeating:"{couponOff} for {months} month{months > 1 ? 's' : ''}"}},connectModal:{title:"{action}",scan:"Use the following methods to complete this payment",confirm:"Confirm",cancel:"Cancel"},fastPay:{title:"Confirm Payment",confirmMessage:"You will pay {amount} {symbol} from {sourceType}.",autoPaymentReason:"Your payment will be processed automatically as your account has sufficient balance. Please confirm the following details before proceeding.",payer:"Account",amount:"Amount",failed:"Account changed, please pay manually.",balanceLink:"View Balance",credit:{title:"Confirm Credit Payment",availableAmount:"Available Credit: {amount}",confirmMessage:"You will use {amount} credits to subscribe to this service.",meteringSubscriptionMessage:"This subscription service will deduct credits in real-time based on actual usage. You currently have {available} credits available. Confirm to continue?",insufficientTitle:"Insufficient Credit",insufficientMessage:"This subscription service will deduct credits in real-time based on actual usage. You currently have insufficient credits. Please top up your credits first."}}},autoTopup:{title:"Auto Top-Up",enableLabel:"Auto Top-Up",purchaseConfig:"Credit Purchase Configuration",triggerThreshold:"When credits are below",thresholdPlaceholder:"Enter threshold amount",thresholdDescription:"Credits remaining to trigger auto top-up",thresholdMinError:"Threshold must be greater than 0",thresholdFormatError:"Please enter a valid number",creditsIncluded:"{num} included",purchaseBelow:"Purchase this package",perPackage:"per package",quantity:"Quantity",selectPaymentMethod:"Select payment method",paymentInformation:"Payment Information",saveConfiguration:"Save Configuration",saveSuccess:"Auto top-up configuration saved successfully",disableSuccess:"Auto top-up disabled successfully",authorizationRequired:"Payment authorization is required to complete the setup",cryptoAuthorizationNote:"You will need to authorize payments from your wallet to enable automatic top-ups",tip:"With auto top-up enabled, the system automatically buys the specified credit package when your balance drops below the threshold.",authTitle:"Auto Top-Up Authorization",authTip:"Please complete the authorization process to enable automatic top-up",rechargeAmount:"Top-up Amount per Time",currentPaymentMethod:"Current Payment Method",changePaymentMethod:"Change Payment Method",keepCurrent:"Keep Current",changePaymentMethodTip:"You will be redirected to set up a new payment method when saving.",noPaymentMethodSetup:"No payment method configured. Please set up a payment method first.",addFunds:"Add Funds",advanced:"Advanced Options",enabled:"Enabled",disabled:"Disabled",notConfigured:"Auto Top-Up not configured",setup:"Enable Auto Top-Up",ruleDisplay:"When balance < {threshold}, top-up {amount} to get {credits} credits",activeDescription:"Auto top-up is enabled. When Credits drop below {threshold}, the system will automatically purchase {credits} Credits for {amount}",activeDescriptionWithCredits:"Auto top-up is enabled. When Credits drop below {threshold}, the system will automatically purchase {credits}.",purchaseAmount:"Purchase Amount",paymentMethod:"Payment Method",walletBalance:"Wallet Balance",paymentAddress:"Payment Address",inactiveDescription:"Enable auto top-up to automatically renew when {name} are insufficient, effectively avoiding service interruptions.",showDetails:"Show Method",hideDetails:"Hide Method",dailyLimits:{maxAmount:"Daily Top-up Amount Limit",maxAmountPlaceholder:"0 means unlimited",maxAmountDescription:"The maximum amount of top-up you can make each day, 0 means unlimited",maxAttempts:"Daily Top-up Attempts Limit",maxAttemptsPlaceholder:"0 means unlimited",maxAttemptsDescription:"The maximum number of top-up attempts you can make each day, 0 means unlimited"},dynamicPricing:{title:"Dynamic Pricing",currentRate:"Current Exchange Rate",slippageTolerance:"Slippage Tolerance",minAcceptableRate:"Min Acceptable Rate",configureSlippage:"Configure Slippage"}},customer:{payments:"Payment History",invoices:"Invoice History",details:"Details",summary:"Summary",products:"Products",update:"Update Information",empty:"It seems you do not have any subscriptions or payments here",cancel:{button:"Unsubscribe",title:"Cancel your subscription",comment:"Any additional feedback?",description:"Your subscription will be canceled, but it is still available until the end of your current billing period on {date}.",trialDescription:"Free trial subscriptions will be canceled immediately and no longer available, confirm to continue.",feedback:{tip:"We would love your feedback, it will help us improve our service",too_expensive:"The service is too expensive",missing_features:"Features are missing for this service",switched_service:"I have switched to an alternative service",unused:"I no longer use this service",customer_service:"The customer service is poor",too_complex:"The service is too complex to use",low_quality:"The service does not work well",other:"Other reasons"}},pastDue:{button:"Pay",invoices:"Past Due Invoices",warning:"Past due invoices need to be paid immediately, otherwise you cannot make new purchases anymore.",alert:{title:"You have unpaid invoices",customMessage:"Please pay immediately, otherwise new purchases or subscriptions will be prohibited.",confirm:"Pay Now"},view:"View Due Invoices"},recover:{button:"Resume Subscription",title:"Resume Your Subscription",description:"Your subscription will not be canceled and will be automatically renewed on {date}, please confirm to continue.",success:"Subscription resumed successfully",reStakeTitle:"Re-stake to resume subscription",stakeRequiredDescription:"Your previous stake has been revoked. You need to re-stake to resume your subscription.",stakeWarning:"Please ensure you have sufficient balance for staking before proceeding."},changePlan:{button:"Change Plan",current:"Current",pay:"Payment Required",scan:"Complete the payment to upgrade your subscription",success:"Your subscription is successfully upgraded",error:"Failed to upgrade your subscription",config:"Switch to another plan or billing cycle",confirm:"Confirm changes to your subscription",summary:"What you will pay for starting {date}",total:"Total (metered items excluded)",appliedCredit:"Credit applied",newCredit:"Credit issued",remaining:"Amount due today",tableNotFound:"Plan updates are not available"},changePayment:{limit:"Your changes to payment method will not affect existing open or past-due invoices, all future payments will use the new payment method unless you change it again.",review:"Review subscription items",select:"Select payment method",submit:"Confirm change",confirm:"By confirming this change, you allow {payee} to charge {symbol} from your account for future payments in accordance with their terms. You can always change your payment method.",completed:"Your payment method has been successfully updated, all future payments will use the new payment method unless you change it again.",title:"Payment Method Change",reauthorizationRequired:"Slippage settings updated. Re-authorization required to ensure sufficient allowance.",reauthorizationTitle:"Re-authorize Payment",reauthorizationCompleted:"Payment authorization has been successfully updated."},invoice:{summary:"Summary",details:"Details",download:"Download PDF",unitPrice:"Unit Price",amountPaid:"Amount Paid",rawQuantity:"Raw Quantity: {quantity}",amountDue:"Amount Due",amountApplied:"Applied Credit",pay:"Pay this invoice",paySuccess:"You have successfully paid the invoice",payProcessing:"Payment is being processed, please refresh in a moment",payError:"Failed to pay the invoice",sync:"Sync Status",syncing:"Syncing...",syncSuccess:"Synced successfully",renew:"Renew the subscription",renewSuccess:"You have successfully renewed the subscription",renewError:"Failed to renew the subscription",empty:"There are no invoices",next:"No invoices yet, next invoice will be generated on {date}",invoiceNumber:"Invoice Number",emptyList:"No Invoices",noPaymentRequired:"No Payment Required",slippageExceeded:"Slippage Exceeded",slippageExceededDetail:"Exchange rate slippage exceeded threshold, auto-payment failed. Current rate {currentRate}, minimum acceptable {minRate}",payBatch:"Pay Due Invoices",stripePayDescription:"Complete payment using your saved payment method or add a new one.",amount:"Amount",paymentConfirmTitle:"Payment Confirmation",paymentConfirmDescription:"After completing this payment, the payment method you use will be automatically set as the default for this subscription. Additionally, we will retry payment for any other unpaid invoices associated with this subscription.",continue:"Continue",priceChanged:"The exchange rate has changed by {percent}%. The payment amount will be updated. Do you want to continue?",paymentCancelled:"Payment cancelled",credit:"Credit",creditRefresh:"Refresh every {interval} {unit}",quote:{exchangeRate:"Exchange Rate",baseAmount:"Base Amount",providers:"Providers",rateTimestamp:"Rate Timestamp",consensusMethod:"Consensus",rateStatus:"Rate Status",rateStatusNormal:"Normal",rateStatusDegraded:"Degraded",slippage:"Slippage",atPaymentRate:"(at payment rate {rate})"}},overduePayment:{setupPaymentDescription:"Use your saved card or add a new one to complete payment via Stripe.",totalAmount:"Total Amount"},payment:{empty:"There are no payments",emptyList:"No Payments"},refund:{empty:"There are no refunds",emptyList:"No Refunds"},subscriptions:{plan:"Plan",nextInvoice:"Next Invoice",title:"Manage subscriptions",view:"Manage Subscription",current:"Current subscription",viewAll:"View all",empty:"There are no subscriptions here",changePayment:"Change payment method",trialLeft:"Trial Left",owner:"Subscription Owner"},overdue:{title:"You have {count} due invoices for {subscriptionCount} subscriptions, totaling {total} {symbol}{method}. ",simpleTitle:"You have {count} due invoices. ",empty:"Great! You have no due invoices.",defaultAlert:"Please pay immediately to avoid service disruption."}},invoice:{reason:{creation:"Subscription create",cycle:"Subscription cycle",staking:"Subscription staking",update:"Subscription update",recover:"Subscription recover",threshold:"Metered usage billing",cancel:"Subscription cancel",manual:"Manual invoice",upcoming:"Upcoming invoice",slashStake:"Slash stake",stake:"Stake",payment:"Payment",returnStake:"Return stake",stakeForChangePlan:"Subscription plan update",stakeForChangePayment:"Subscription payment method update",recharge:"Add funds",rechargeForSubscription:"Add funds for subscription",overdraftProtection:"SubGuard™ Fee",stakeForSubscriptionOverdraftProtection:"SubGuard™",reStakeToResumeSubscription:"Subscription resume",gas:"Gas",fee:"Fee"}},subscription:{overdue:{simpleTitle:"There are {count} due invoices for your subscription {name}, you need to pay them to activate your subscription or before making new purchases.",title:"There are {count} due invoices for your subscription {name}, the total due amount is {total} {symbol}{method}, you need to pay them to activate your subscription or before making new purchases.",payNow:"Pay Now",notSupport:"This payment method is not supported",total:"Total {total} {currency}{method}",view:"View Subscription Details",viewNow:"View Now",pastDue:"Past Due Invoices",description:"If you have any questions, you can choose ",list:"Past Due Invoices:",empty:"There are no overdue invoices for your subscription {name}.",retry:"Retry",paid:"Paid",processing:"Processing"}},dynamicPricing:{unavailable:{title:"Unable to Calculate Real-Time Price",message:"Exchange rate service is currently unavailable. Products with dynamic pricing cannot be purchased at this moment.",retry:"Retry"}}},refund:{type:{[Ll.refund]:"Refund",[Ll.stakeReturn]:"Stake Return"}},empty:{records:"No matching records found"},benefits:{title:"{count} Beneficiaries"}}),pS=Wl({common:{id:"ID",url:"URL",none:"无",createdAt:"创建时间",updatedAt:"更新时间",billingPeriod:"账单周期",resumesAt:"恢复时间",actions:"操作",options:"选项",advanced:"高级选项",settings:"设置",preview:"预览",required:"必填",setup:"设置",login:"登录以访问此页面",accessDenied:"您无权访问其他客户的数据",amount:"金额",total:"总计",totalDue:"应付总额",subtotal:"小计",status:"状态",livemode:"测试模式",afterTime:"在{time}后",timeAgo:"{time}前",save:"保存",saved:"更改已保存",remove:"删除",removed:"资源已删除",upload:"上传",change:"更换",confirm:"确认",cancel:"取消",clear:"清空",show:"显示",hide:"隐藏",selectTimeRange:"选择时间范围",startDate:"开始日期",endDate:"结束日期",close:"关闭",back:"返回",every:"每",per:"每{interval}",slash:"每{interval}",unit:"件",edit:"编辑",quantity:"数量",yes:"是",no:"否",email:"邮箱",did:"DID",txHash:"交易哈希",txGas:"交易费用",delegateTxHash:"授权交易",stakeTxHash:"质押交易",slashTxHash:"罚没交易",transferTxHash:"扣款交易",mintTxHash:"铸造交易",pending:"处理中",failed:"失败",completed:"已完成",creditTransaction:"信用交易",creditAmount:"信用额度",remainingBalance:"剩余余额",credits:"额度",ofCredits:"额度",creditActivity:{consumption:"额度消耗",paidGrant:"额度充值",paidAmount:"支付 {amount}",promotionalGrant:"赠送",resetGrant:"额度重置",repayment:"支付欠费"},transferStatus:"交易状态",sourceData:"源数据",viewGrant:"查看额度",viewSubscription:"订阅详情",view:"查看",meterEvent:"计量事件",source:"来源",viewDetail:"查看详情",viewTransactionDetail:"交易详情",viewConsumptionDetail:"消费详情",customer:"客户",currency:"币种",network:"网络",custom:"自定义",description:"描述",statementDescriptor:"声明描述",loadMore:"查看更多{resource}",loadingMore:"正在加载更多{resource}...",noMore:"没有更多{resource}",copied:"已复制",previous:"返回",continue:"继续",qty:"{count} 件",each:"每件 {unit}",trial:"免费试用 {count} {interval}",billed:"{rule}收费",metered:"按用量",minute:"分钟",hour:"小时",day:"天",week:"周",month:"月",year:"年",hourly:"每小时",daily:"每天",weekly:"每周",monthly:"每月",yearly:"每年",month3:"每季度",month6:"每半年",recurring:"每{count}{interval}",minutes:"分钟",hours:"小时",days:"天",weeks:"周",months:"月",years:"年",type:"类型",donation:"打赏",recoverFrom:"恢复自",quantityLimitPerCheckout:"超出购买限制",quantityNotEnough:"库存不足",amountPrecisionLimit:"金额小数位数必须在 {precision} 位以内",saveAsDefaultPriceSuccess:"设置默认价格成功",stakeAmount:"质押金额",slashStakeAmount:"罚没金额",know:"我知道了",relatedSubscription:"订阅",subscriptionOrCredit:"订阅 / 额度",purchaseItems:"购买项",connect:{defaultScan:"使用以下方式完成本次操作",scan:"使用以下方式完成本次{action}",confirm:"确认",cancel:"取消"},paymentMethod:"支付方式",viewInvoice:"账单详情",submit:"提交",expired:"已过期",consumed:"已消费",nextCharge:"下次扣款"},payment:{checkout:{contact:"联系信息",method:"支付方式",processing:"处理中",payment:"支付",try:"免费试用",include:"包括:",subscription:"订阅",donate:"捐赠",select:"选择",selected:"已选",noPricing:"没有可购买的物品",setup:"订阅",continue:"确认{action}",connect:"连接并{action}",login:"登录以加载并保存联系信息",next:{subscription:"查看订阅",invoice:"查看账单",view:"查看"},paymentRequired:"支付金额",quote:{title:"价格已锁定",locked:"汇率已锁定",expired:"报价更新中…",expiredMessage:"报价更新中…",expiring:"报价更新中…",remaining:"报价将在 {time} 后更新",currentRate:"当前汇率",expiresIn:"更新时间",exchangeRate:"汇率",provider:"数据提供方",source:"数据来源",dynamicItems:"动态定价商品",dynamicPricingInfo:"动态计价:1 {symbol} = {rate} {currency}",referenceUnavailable:"稍后更新",rateLine:"1 {symbol} ≈ {rate}",validity:"报价有效期:{time}",lockedWithTime:"价格已锁定:{time}",lockExpired:"价格锁定已过期,请重新确认",detailProvider:"数据源",detailUpdatedAt:"最近更新",detailValidity:"报价有效期",detailLock:"锁价剩余",detailPriceImpact:"价格影响",detailSlippage:"滑点下限",detailRefresh:"刷新报价",slippage:{title:"滑点下限",tooltip:"设置您愿意接受的最低汇率。支付时汇率低于此值,交易将被拒绝。",percentMode:"百分比",rateMode:"精确汇率",invalid:"请输入有效的数值",invalidPositive:"请输入大于 0 的数值",rateRequired:"需要汇率信息",invalidRate:"无效的汇率值",minAcceptableRate:"最低可接受汇率",maxPayableIncrease:"最大支付增幅",percentInputLabel:"滑点百分比",rateInputLabel:"最低可接受汇率 ({currency})",minRateHint:"最低可接受汇率: {rate} {currency}",maxPayableHint:"最大支付增幅: +{percent}%"},slippageLimit:{title:"滑点下限配置",description:"设置您愿意接受的最低汇率。支付时汇率低于此值,交易将被暂停并提示您确认。",configTogglePercent:"百分比",configToggleRate:"精确汇率",recommended:"推荐",derivedCurrentRate:"当前参考汇率",derivedMinRate:"最低可接受汇率"},rateUpdateLine:"1 {symbol} ≈ {rate} · {time} 后自动更新",updateHint:"更新后将自动刷新价格",lockExpiredTitle:"价格已过期",lockExpiredDescription:"锁定时间已结束,请重新确认价格后继续支付。",lockExpiredConfirm:"重新锁定价格",slippageExceededTitle:"汇率低于滑点下限",slippageExceededDescription:"当前汇率低于您设置的最低可接受汇率。请刷新报价后重试。",updated:{pleaseRetry:"价格已更新,请重新提交"},priceUpdatedTitle:"价格已更新",priceUpdatedDescriptionRate:"由于 TBA 汇率变化,系统已重新计算本次金额。",priceUpdatedDescriptionRecalc:"系统已重新计算本次金额。",priceUpdatedNewTotalLabel:"更新后总计",priceUpdatedOldTotal:"原总计:{total}",priceUpdatedConfirm:"确认并继续支付"},staking:{title:"质押金额",tooltip:"质押相当于保证金,用于确保未来的账单能够正常扣款,如果你从 DID Wallet 撤销质押,订阅也会被取消。"},stakingConfirm:"在此支付中,质押金额与产品费用分开",donation:{between:"金额必须大于 {min} 且小于 {max}",custom:"输入金额",select:"选择金额",summary:"共有 {total} 人支持 {totalAmount} {symbol}",empty:"❤️ 支持一下",gaveTips:"已有 {count} 人打赏",tipAmount:"打赏金额",tabHint:"快速切换金额",benefits:{one:"{name} 将获得全部打赏",multiple:"打赏将按比例分配给 {count} 位受益人",view:"点击查看详情"},inactive:"打赏功能暂未开启",enable:"启用打赏",enableSuccess:"启用成功",configPrompt:"打赏功能已启用,您可以前往 Payment Kit 进一步配置打赏选项",configNow:"立即配置",later:"稍后配置",configTip:"前往 Payment Kit 配置打赏选项"},cardPay:"使用银行卡{action}",skipPaymentMethod:"跳过,稍后绑定",empty:"没有可支付的项目",per:"每",pay:"付款给 {payee}",try1:"免费试用 {name}",try2:"免费试用 {name} 等{count}个产品",sub1:"订阅 {name}",sub2:"订阅 {name} 等{count}个产品",then:"然后 {subscription} {recurring}",meteredThen:"然后{recurring}按用量计费",metered:"{recurring}按用量计费",free:"免费试用 {count} {interval}",least:"至少",completed:{payment:"购买成功",subscription:"订阅成功",setup:"订阅成功",donate:"捐赠成功",tip:"向 {payee} 的付款已完成。您可以在您的账户中查看此付款的详细信息。",summary:{paid:"本次支付 {amount}"}},vendor:{accountRequired:"您当前使用的是非统一账户登录,此服务需要您使用统一账户。请切换到统一账户登录后重试。",processing:"正在安装中...",progress:"进度 {progress}%",delivered:"安装成功",failed:"安装失败",failedMsg:"很抱歉,安装过程中遇到了一些问题。我们正在处理这个问题,稍后会自动为您退款。感谢您的耐心等待!",launcher:{processing:"正在安装 {name}",completed:"安装 {name} 成功",failed:"安装 {name} 失败"},didnames:{processing:"正在注册 {name}",completed:"注册 {name} 成功",failed:"注册 {name} 失败"},arcSphereToast:"支付并安装成功,三秒后返回页面继续..."},priceChange:{unavailable:"无法获取汇率,请稍后重试。",unstable:"当前汇率波动较大,请稍后重试。",title:"汇率变化",description:"汇率变化较大,请刷新报价后重试。",action:"刷新报价",cancel:"取消"},confirm:{withStake:"确认订阅,即表示您授权 {payee} 从您的账户扣取未来款项,并在必要时罚没质押。您可随时取消订阅或撤销质押。",withoutStake:"确认订阅,即表示您授权 {payee} 从您的账户扣取未来款项。您可随时取消订阅。"},required:"必填项",invalid:"无效",billing:{auto:"国家/地区",required:"账单地址",country:"国家/地区",state:"州或省",city:"城市或镇",line1:"地址",line2:"地址2",postal_code:"邮政编码"},customer:{name:"姓名",email:"邮件",phone:"电话",phonePlaceholder:"电话号码",phoneTip:"以防需要与您联系有关您的订单"},customerInfo:"客户信息",upsell:{save:"使用{recurring}计费方式",revert:"切换到{recurring}计费方式",off:"省 {saving}%"},expired:{title:"链接已过期",description:"此链接已过期。这意味着您的付款已经处理完成或会话已过期。"},complete:{title:"结账已完成",description:"此结账会话已完成。这意味着您的付款已成功处理完成。"},cross_sell:{add:"添加到订单",remove:"从订单移除"},dynamicPricing:"动态定价",promotion:{add_code:"添加促销码",enter_code:"输入促销码",apply:"应用",applied:"已应用的促销码",placeholder:"输入促销码",duration_once:"1次优惠 {amount} {symbol}",duration_repeating:"{months}个月优惠 {amount} {symbol}",duration_forever:"永久优惠 {amount} {symbol}",dialog:{title:"添加促销码"},error:{invalid:"无效的促销码",expired:"促销码已过期",used:"促销码已被使用",not_applicable:"促销码不适用于此订单"}},coupon:{noDiscount:"无优惠",percentage:"{percent}%",fixedAmount:"{amount} {symbol}",terms:{forever:"永久享 {couponOff} 折扣",once:"单次享 {couponOff} 折扣",repeating:"{months} 个月内享 {couponOff} 折扣"}},credit:{normal:{oneTime:"购买 {amount}。",oneTimeWithExpiry:"购买 {amount}(有效期 {duration} {unit})。",recurring:"订阅:{period}{amount}。",recurringWithExpiry:"订阅:{period}{amount}(有效期 {duration} {unit})。"},pending:{notEnough:"您有 {amount} 的使用超额。要恢复访问,需要至少购买 {quantity} 数量。",oneTimeEnough:"您有 {amount} 的使用超额。本次购买将增加 {totalAmount}。扣除超额后,您的新可用余额将为 {availableAmount}。",oneTimeEnoughWithExpiry:"您有 {amount} 的使用超额。本次购买将增加 {totalAmount}(有效期 {duration} {unit})。扣除超额后,您的新可用余额将为 {availableAmount}。",recurringEnough:"您有 {amount} 的使用超额。本订阅{period}将增加 {totalAmount}。扣除超额后,您的新可用余额将为 {availableAmount}。",recurringEnoughWithExpiry:"您有 {amount} 的使用超额。本订阅{period}将增加 {totalAmount}(有效期 {duration} {unit})。扣除超额后,您的新可用余额将为 {availableAmount}。"},schedule:{periodic:"每{interval}发放 {amount}。",withRefresh:"每{interval}发放 {amount},未使用额度将在下次发放时过期。"},topupDescription:"购买 {creditName},单价 {unitPrice}/额度。"},emptyItems:{title:"没有任何购买项目",description:"可能这个付款链接没有正确配置"},stopAcceptingOrders:{title:"暂停服务",description:"因系统策略调整,当前已暂停新订单服务。"},error:{title:"出了点问题"},orderSummary:"订单概览",orderSummarySubtitle:"本次交易包含以下项目",paymentDetails:"支付信息",productListTotal:"包括 {total} 项",headerTitle:{subscribe:"订阅 {name}",purchase:"购买 {name}"},planFeatures:"功能特性",typeBadge:{subscription:"订阅",topup:"充值",oneTime:"一次性购买"},subtitle:{subscriptionInterval:"{interval}订阅",creditsTopup:"余额充值",addonFor:"{product} 的附加项",oneTime:"一次性购买"},creditTopup:{title:"购买 {name}",question:"你需要多少 {symbol}?",credits:"额度",increment:"每次增减 {step} {symbol}",validFor:"额度在购买后 {duration} {unit}内有效。",willReceive:"你将获得",packInfo:"包含 {packs} 个额度包(每包 {perPack})",autoMatch:"我们将自动匹配最接近的额度包。",autoMatchTooltip:"{symbol} 按每包 {step} 个出售",pendingWarning:"您有 {pendingAmount} 的使用超额,至少需要购买 {minCredits} 才能恢复访问。",pendingEnough:"您有 {pendingAmount} 的使用超额,扣除后您的可用余额将为 {availableAmount}。"},connectModal:{title:"{action}",scan:"使用以下方式完成本次支付",confirm:"确认",cancel:"取消"},fastPay:{title:"确认支付",confirmMessage:"您将支付 {amount} {symbol},从{sourceType}扣除。",autoPaymentReason:"该支付可以自动处理,因为您的账户余额充足,请在继续之前确认以下详细信息。",payer:"账户地址",amount:"支付金额",failed:"账户发生变化,无法自动完成支付,请手动支付。",balanceLink:"查看余额",credit:{title:"确认额度支付",availableAmount:"可用额度:{amount}",confirmMessage:"您将使用 {amount} 额度来订阅此服务。",meteringSubscriptionMessage:"此订阅服务将根据实际使用情况实时扣除额度。您当前可用额度为 {available},确认是否继续?",insufficientTitle:"额度不足",insufficientMessage:"此订阅服务将根据实际使用情况实时扣除额度。您当前可用额度不足,请先充值额度。"}}},autoTopup:{title:"自动充值",enableLabel:"自动充值",purchaseConfig:"购买配置",triggerThreshold:"当额度低于",thresholdPlaceholder:"输入触发阈值",thresholdDescription:"触发自动充值的剩余额度",thresholdMinError:"阈值必须大于0",thresholdFormatError:"请输入有效数字",creditsIncluded:"包含 {num}",purchaseBelow:"购买此套餐",perPackage:"每包",quantity:"数量",selectPaymentMethod:"选择支付方式",paymentInformation:"支付信息",saveConfiguration:"保存配置",saveSuccess:"自动充值配置保存成功",disableSuccess:"已关闭自动充值",stripeSetupRequired:"需要信用卡授权以进行自动支付",cryptoAuthorizationNote:"您需要从钱包授权支付以启用自动充值",tip:"启用自动充值后,当您的额度低于阈值时,系统将自动购买指定数量的额度套餐。",authTitle:"自动充值授权",authTip:"请完成授权流程以启用自动充值",rechargeAmount:"每次充值金额",currentPaymentMethod:"当前支付方式",changePaymentMethod:"更换支付方式",keepCurrent:"保持当前",changePaymentMethodTip:"保存时将引导您设置新的支付方式。",noPaymentMethodSetup:"未配置支付方式,请先设置支付方式。",addFunds:"充值",advanced:"高级选项",enabled:"已启用",disabled:"已禁用",notConfigured:"尚未配置自动充值",setup:"去启用",ruleDisplay:"额度低于{threshold}时,充值{amount}可获得{credits}额度",activeDescription:"自动充值已启用,当 Credits 低于 {threshold} 时,系统会自动充值购买 {credits} Credits,支付金额为 {amount}",activeDescriptionWithCredits:"自动充值已启用,当 Credits 低于 {threshold} 时,系统会自动购买 {credits} 额度。",purchaseAmount:"购买所需金额",paymentMethod:"支付方式",walletBalance:"钱包余额",paymentAddress:"支付地址",inactiveDescription:"开启自动充值,即可在 {name} 不足时自动续费,有效避免服务中断。",showDetails:"展开支付信息",hideDetails:"收起",dailyLimits:{maxAmount:"每日充值金额上限",maxAmountPlaceholder:"0表示无限制",maxAmountDescription:"每日可充值的最大总金额,0 表示无限制",maxAttempts:"每日充值次数上限",maxAttemptsPlaceholder:"0表示无限制",maxAttemptsDescription:"每日可充值的最大次数,0 表示无限制"},dynamicPricing:{title:"动态定价",currentRate:"当前汇率",slippageTolerance:"滑点容差",minAcceptableRate:"最低可接受汇率",configureSlippage:"配置滑点"}},customer:{payments:"支付历史",invoices:"账单历史",details:"账户详情",summary:"计费摘要",products:"产品信息",update:"更新客户信息",empty:"看起来您在这里没有任何订阅或支付",cancel:{button:"取消订阅",title:"取消您的订阅",comment:"你还有其他反馈么?",description:"您的订阅将被取消,但仍然可用直到您当前计费周期结束于{date}。",trialDescription:"免费试用的订阅将被立即取消,不再可用,确认是否继续。",feedback:{tip:"我们希望听到您的反馈,这将帮助我们改进我们的服务",too_expensive:"服务费用太高",missing_features:"服务缺少功能",switched_service:"我已切换到其他服务",unused:"我不再使用此服务",customer_service:"客户服务不佳",too_complex:"服务使用过于复杂",low_quality:"服务质量不佳",other:"其他原因"}},pastDue:{button:"续费",invoices:"欠费帐单",warning:"请尽快支付欠费账单,否则你将无法继续使用服务或购买新服务。",alert:{title:"你有欠费账单",description:"看起来你有欠费的账单,在你支付所有欠费账单之前,新的购买或者订阅将被禁止,请不要调皮。",customMessage:"请立即支付,否则新的购买或者订阅将被禁止。",confirm:"去支付"},view:"查看欠费明细"},recover:{button:"恢复订阅",title:"恢复您的订阅",description:"您的订阅将不会被取消,并将在{date}自动续订,请确认是否继续。",success:"订阅恢复成功",reStakeTitle:"重新质押以恢复订阅",stakeRequiredDescription:"您之前的质押已被申请取回,需要重新质押才能恢复订阅。"},changePlan:{button:"切换套餐",current:"当前订阅",pay:"需要支付",scan:"完成支付以更新你的订阅",success:"你的订阅已经更新成功",error:"订阅更新失败",config:"切换套餐或周期",confirm:"确认变更细节",summary:"新的付款计划({date} 开始)",total:"套餐定价(不含按量部分)",appliedCredit:"信用扣除",newCredit:"信用增加",remaining:"还需支付",tableNotFound:"套餐变更不可用"},changePayment:{limit:"你对支付方式的变更不会影响已经生成或者欠费的账单,只会影响未来的账单。你可以在下一张账单生成之前变更支付方式。",review:"查看订阅详情",select:"选择支付方式",submit:"确认变更",confirm:"确认变更方式意味着你允许 {payee} 使用新的支付方式支付你的未来账单。你可以随时再次变更支付方式。",completed:"你的支付方式 已经更新成功。你可以在你的账户中查看此支付方式的详细信息。",title:"支付方式变更",reauthorizationRequired:"滑点设置已更新。需要重新授权以确保授权金额充足。",reauthorizationTitle:"重新授权支付",reauthorizationCompleted:"支付授权已成功更新。"},invoice:{summary:"摘要",details:"详情",download:"下载PDF",unitPrice:"单价",rawQuantity:"汇总前数量: {quantity}",amountPaid:"已支付",amountDue:"待支付",amountApplied:"余额变更",pay:"支付此账单",paySuccess:"支付成功",payProcessing:"支付处理中,请稍候刷新查看",payError:"支付失败",sync:"同步状态",syncing:"同步中...",syncSuccess:"同步成功",renew:"恢复订阅",renewSuccess:"订阅恢复成功",renewError:"订阅恢复失败",empty:"没有任何账单",next:"还没有账单,下次账单将在 {date} 生成",invoiceNumber:"账单编号",emptyList:"没有账单",noPaymentRequired:"无需支付",slippageExceeded:"滑点超限",slippageExceededDetail:"汇率滑点超过下限,无法自动扣款。当前汇率 {currentRate},最低可接受 {minRate}",payBatch:"支付欠款",paymentConfirmTitle:"支付确认",paymentConfirmDescription:"完成本次支付后,您使用的支付方式将自动设置为该订阅的默认支付方式。此外,我们还将对该订阅的其他欠费账单进行重试收费。",continue:"继续",priceChanged:"汇率已变动 {percent}%。支付金额将会更新,是否继续?",paymentCancelled:"支付已取消",credit:"额度",creditRefresh:"每{interval}{unit}刷新",quote:{exchangeRate:"汇率",baseAmount:"USD 本位金额",providers:"数据源",rateTimestamp:"汇率时间",consensusMethod:"汇率算法",rateStatus:"汇率状态",rateStatusNormal:"正常",rateStatusDegraded:"降级",slippage:"滑点",atPaymentRate:"(按支付时汇率 {rate})"}},payment:{empty:"没有支付记录",emptyList:"没有支付记录"},refund:{empty:"没有退款记录",emptyList:"没有退款记录"},subscriptions:{plan:"订阅",nextInvoice:"下次账单",title:"订阅管理",view:"管理订阅",current:"当前订阅",viewAll:"查看所有",empty:"没有任何订阅",changePayment:"切换支付方式",trialLeft:"剩余试用时长",owner:"订阅拥有者"},overdue:{title:"您有 {count} 张欠费账单,涉及 {subscriptionCount} 个订阅,总金额 {total} {symbol}{method}。",simpleTitle:"您有 {count} 张欠费账单,",empty:"恭喜!您当前没有欠费账单。",defaultAlert:"请立即支付,以免影响您的使用。"}},invoice:{reason:{creation:"订阅创建",cycle:"自动扣费",staking:"订阅创建",update:"订阅更新",recover:"订阅恢复",threshold:"用量账单",cancel:"订阅取消",manual:"人工账单",upcoming:"未来账单",slashStake:"罚没质押",stake:"押金",payment:"付款",returnStake:"退押金",stakeForChangePlan:"订阅套餐更新",stakeForChangePayment:"订阅支付方式更新",recharge:"充值",rechargeForSubscription:"订阅充值",overdraftProtection:"订阅守护服务费",stakeForSubscriptionOverdraftProtection:"订阅守护服务",reStakeToResumeSubscription:"订阅恢复",gas:"手续费",fee:"服务费"}},subscription:{overdue:{title:"您的【{name}】订阅共有 {count} 张欠费账单,总计 {total} {symbol}{method},您需要支付这些账单以激活您的订阅,或在进行新的购买之前完成支付。",simpleTitle:"您的【{name}】订阅共有 {count} 张欠费账单,您需要支付这些账单以激活您的订阅,或在进行新的购买之前完成支付。",payNow:"立即支付",notSupport:"暂不支持该支付方式",total:"总计 {total} {currency}{method}",view:"查看订阅详情",pastDue:"欠费账单",viewNow:"立即查看",description:"如果您有任何疑问,可以选择 ",list:"欠费账单:",empty:"您的【{name}】订阅当前没有欠费账单",retry:"重新支付",paid:"已支付",processing:"支付中"}},dynamicPricing:{unavailable:{title:"暂时无法计算实时价格",message:"当前汇率服务不可用,基于动态定价的商品暂时无法购买。",retry:"重试"}}},refund:{type:{[Ll.refund]:"退款",[Ll.stakeReturn]:"退押金"}},empty:{records:"没有找到匹配的记录"},benefits:{title:"{count} 位受益人"}}),O0={zh:pS,en:mS},Eg=(a,r={})=>{try{return fS(a,{interpolate:/{([\s\S]+?)}/g,escape:/{([\s\S]+?)}/g})(r)}catch(o){return console.error(`Error evaluating template: ${a}`,o),""}},z0=({fallbackLocale:a="en"},r=O0)=>(o,s=a,f={})=>!r[s]||!r[s][o]?a&&r[a]?.[o]?Eg(r[a]?.[o],f):o:Eg(r[s][o],f),hS=z0({fallbackLocale:"en"}),Ie=hS;var Bl={exports:{}},yS=Bl.exports,wg;function gS(){return wg||(wg=1,(function(a,r){(function(o,s){a.exports=s()})(yS,(function(){var o,s,f=1e3,m=6e4,c=36e5,h=864e5,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y=31536e6,S=2628e6,x=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,A={years:y,months:S,days:h,hours:c,minutes:m,seconds:f,milliseconds:1,weeks:6048e5},v=function(T){return T instanceof w},N=function(T,R,q){return new w(T,q,R.$l)},B=function(T){return s.p(T)+"s"},O=function(T){return T<0},k=function(T){return O(T)?Math.ceil(T):Math.floor(T)},K=function(T){return Math.abs(T)},j=function(T,R){return T?O(T)?{negative:!0,format:""+K(T)+R}:{negative:!1,format:""+T+R}:{negative:!1,format:""}},w=(function(){function T(q,z,$){var re=this;if(this.$d={},this.$l=$,q===void 0&&(this.$ms=0,this.parseFromMilliseconds()),z)return N(q*A[B(z)],this);if(typeof q=="number")return this.$ms=q,this.parseFromMilliseconds(),this;if(typeof q=="object")return Object.keys(q).forEach((function(ne){re.$d[B(ne)]=q[ne]})),this.calMilliseconds(),this;if(typeof q=="string"){var Q=q.match(x);if(Q){var Z=Q.slice(2).map((function(ne){return ne!=null?Number(ne):0}));return this.$d.years=Z[0],this.$d.months=Z[1],this.$d.weeks=Z[2],this.$d.days=Z[3],this.$d.hours=Z[4],this.$d.minutes=Z[5],this.$d.seconds=Z[6],this.calMilliseconds(),this}}return this}var R=T.prototype;return R.calMilliseconds=function(){var q=this;this.$ms=Object.keys(this.$d).reduce((function(z,$){return z+(q.$d[$]||0)*A[$]}),0)},R.parseFromMilliseconds=function(){var q=this.$ms;this.$d.years=k(q/y),q%=y,this.$d.months=k(q/S),q%=S,this.$d.days=k(q/h),q%=h,this.$d.hours=k(q/c),q%=c,this.$d.minutes=k(q/m),q%=m,this.$d.seconds=k(q/f),q%=f,this.$d.milliseconds=q},R.toISOString=function(){var q=j(this.$d.years,"Y"),z=j(this.$d.months,"M"),$=+this.$d.days||0;this.$d.weeks&&($+=7*this.$d.weeks);var re=j($,"D"),Q=j(this.$d.hours,"H"),Z=j(this.$d.minutes,"M"),ne=this.$d.seconds||0;this.$d.milliseconds&&(ne+=this.$d.milliseconds/1e3,ne=Math.round(1e3*ne)/1e3);var me=j(ne,"S"),P=q.negative||z.negative||re.negative||Q.negative||Z.negative||me.negative,D=Q.format||Z.format||me.format?"T":"",F=(P?"-":"")+"P"+q.format+z.format+re.format+D+Q.format+Z.format+me.format;return F==="P"||F==="-P"?"P0D":F},R.toJSON=function(){return this.toISOString()},R.format=function(q){var z=q||"YYYY-MM-DDTHH:mm:ss",$={Y:this.$d.years,YY:s.s(this.$d.years,2,"0"),YYYY:s.s(this.$d.years,4,"0"),M:this.$d.months,MM:s.s(this.$d.months,2,"0"),D:this.$d.days,DD:s.s(this.$d.days,2,"0"),H:this.$d.hours,HH:s.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,"0"),SSS:s.s(this.$d.milliseconds,3,"0")};return z.replace(g,(function(re,Q){return Q||String($[re])}))},R.as=function(q){return this.$ms/A[B(q)]},R.get=function(q){var z=this.$ms,$=B(q);return $==="milliseconds"?z%=1e3:z=$==="weeks"?k(z/A[$]):this.$d[$],z||0},R.add=function(q,z,$){var re;return re=z?q*A[B(z)]:v(q)?q.$ms:N(q,this).$ms,N(this.$ms+re*($?-1:1),this)},R.subtract=function(q,z){return this.add(q,z,!0)},R.locale=function(q){var z=this.clone();return z.$l=q,z},R.clone=function(){return N(this.$ms,this)},R.humanize=function(q){return o().add(this.$ms,"ms").locale(this.$l).fromNow(!q)},R.valueOf=function(){return this.asMilliseconds()},R.milliseconds=function(){return this.get("milliseconds")},R.asMilliseconds=function(){return this.as("milliseconds")},R.seconds=function(){return this.get("seconds")},R.asSeconds=function(){return this.as("seconds")},R.minutes=function(){return this.get("minutes")},R.asMinutes=function(){return this.as("minutes")},R.hours=function(){return this.get("hours")},R.asHours=function(){return this.as("hours")},R.days=function(){return this.get("days")},R.asDays=function(){return this.as("days")},R.weeks=function(){return this.get("weeks")},R.asWeeks=function(){return this.as("weeks")},R.months=function(){return this.get("months")},R.asMonths=function(){return this.as("months")},R.years=function(){return this.get("years")},R.asYears=function(){return this.as("years")},T})(),G=function(T,R,q){return T.add(R.years()*q,"y").add(R.months()*q,"M").add(R.days()*q,"d").add(R.hours()*q,"h").add(R.minutes()*q,"m").add(R.seconds()*q,"s").add(R.milliseconds()*q,"ms")};return function(T,R,q){o=q,s=q().$utils(),q.duration=function(re,Q){var Z=q.locale();return N(re,{$l:Z},Q)},q.isDuration=v;var z=R.prototype.add,$=R.prototype.subtract;R.prototype.add=function(re,Q){return v(re)?G(this,re,1):z.bind(this)(re,Q)},R.prototype.subtract=function(re,Q){return v(re)?G(this,re,-1):$.bind(this)(re,Q)}}}))})(Bl)),Bl.exports}var DS=gS();const vS=ri(DS);Ht(()=>import("./vendor-blocklet-D_i_QeSo.js").then(a=>a.e),[]);Ht(()=>import("./vendor-blocklet-D_i_QeSo.js").then(a=>a.z),[]);Sn.extend(jx);Sn.extend(Rx);Sn.extend(vS);Sn.extend(Mx);Sn.extend(Nx);const us="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk",bS=(a,r,o="en")=>{let s="";if(a.percent_off&&a.percent_off>0&&(s=Ie("payment.checkout.coupon.percentage",o,{percent:a.percent_off})),a.amount_off&&a.amount_off!=="0"){const{symbol:f}=r;s=a.currency_id===r.id?a.amount_off||"":a.currency_options?.[r.id]?.amount_off||"",s&&(s=Ie("payment.checkout.coupon.fixedAmount",o,{amount:Ca(s,r.decimal),symbol:f}))}return s?Ie(`payment.checkout.coupon.terms.${a.duration}`,o,{couponOff:s,months:a.duration_in_months||0}):Ie("payment.checkout.coupon.noDiscount")},Qn=()=>{const a=window.blocklet?.prefix||"/",r=window.location?.origin;if(window.__PAYMENT_KIT_BASE_URL)try{if(new URL(window.__PAYMENT_KIT_BASE_URL).origin!==window.location.origin)return window.__PAYMENT_KIT_BASE_URL}catch{console.warn("Invalid baseUrl for PaymentProvider",window.__PAYMENT_KIT_BASE_URL)}if((window.blocklet?.componentId||"").split("/").pop()===us)return Dt(r,a);const s=(window.blocklet?.componentMountPoints||[]).find(f=>f?.did===us);return s?Dt(r,s.mountPoint):Dt(r,a)};function Lf(){try{const a=Qn(),r=new URL(a).origin,o=window.location.origin;return r!==o}catch{return!1}}function ln(a,r="en",o="YYYY-MM-DD HH:mm:ss"){return a?Sn(a).locale(eu(r)).format(o):"-"}function xS(a,r="en"){return a?Sn(a).locale(eu(r)).format("lll"):"-"}function CS(a,r="YYYY-MM-DD HH:mm:ss",o="en"){return a?Sn(a).locale(eu(o)).format(r):"-"}function SS(a,r="en"){return Sn(a).locale(eu(r)).format("YYYY-MM-DD HH:mm")}const eu=(a="en")=>a==="tw"?"zh":a,nw=a=>a==="zh"?"zh_CN":"en_US",Pt=a=>{if(!a)return"Unknown error";const{details:r,errors:o,response:s}=a;return Array.isArray(o)?o.map(f=>f.message).join(`
27
- `):Array.isArray(r)?`Validate failed: ${r.map(m=>{const c=m.message.replace(/["]/g,"'");return`${m.path.join(".")}: ${c}`}).join(";")}`:s?s.data?.error||`${a.message}: ${JSON.stringify(s.data)}`:a.message};function Ui(a="",r=18,o=6,s=!0,f=!0){return a?Ja(qt(a,r),o,s,f):"0"}const P0={USD:"$",EUR:"€",GBP:"£",JPY:"¥",CNY:"¥",KRW:"₩",INR:"₹",AUD:"A$",CAD:"C$",CHF:"Fr",HKD:"HK$",SGD:"S$",NZD:"NZ$"};function dr(a,r,o=!0){const s=P0[r];return s?`${s}${a}`:`${a} ${o?r:""}`}function kl(a,r,o="en",s=!0){const f=P0[r];return f?`${f}${a} ${s?Ie("common.credits",o):""}`:`${a} ${s?r:""}`}function Ja(a,r=6,o=!0,s=!0){if(!a||a==="0")return"0";const f=A1(a),m={thousandSeparated:s,...(r||r===0)&&{mantissa:r}},c=f.format(m);if(!o)return c;const[h,g]=c.split(".");return g?[h,DC(g,"0")].filter(Boolean).join("."):h}function un(a,r,o=6,s=!0,f=!0){if(!r)return Ja(a,o,s,f);const m=Number(a);if(!Number.isFinite(m))return Ja(a,o,s,f);const c=Math.abs(m),h=c>0&&c<.01?o:2;return Ja(a,h,s,f)}const Tg=8;function q0(a,r,o=$f){if(a==null||!r||r<=0)return null;const s=ES(a,r,o);return AS(s,o)}function If(a,r,o){if(!o&&o!=="0"||r==null)return null;try{const s=a instanceof ze?a:new ze(a||"0"),f=new ze(10).pow(new ze(r));if(f.isZero())return null;const m=new ze(o.replace(".","")),c=o.includes(".")&&o.split(".")[1]?.length||0,h=new ze(10).pow(new ze(c)),g=new ze(10).pow(new ze(Tg)),y=s.mul(m).mul(g).div(f.mul(h));return qt(y.toString(),Tg)}catch{return null}}function zi(a,r="en"){if(!a&&a!=="0")return null;const o=Number(a);return Number.isFinite(o)?new Intl.NumberFormat(r,{minimumFractionDigits:2,maximumFractionDigits:2}).format(o):null}function Il(a){if(!a&&a!=="0")return null;const r=String(a),o=Number(r);return Number.isFinite(o)?r:null}function aw(a,r="USD",o=2){if(a==null)return null;const s=Number(a);if(!Number.isFinite(s))return null;const f=s.toFixed(o);return r==="USD"?`$${f}`:`${f} ${r}`}const kg=(a,r,o,s=1,f=!0,m="en")=>{if(!r)return"";if(a.custom_unit_amount)return`Custom (${r.symbol})`;if(a.pricing_type==="dynamic"&&a.base_amount&&a.base_currency==="USD"){const g=a.base_amount,y=Number(g)*s,S=zi(y.toString(),m);if(a?.type==="recurring"&&a.recurring){const x=Rn(a.recurring,!1,"slash",m);return o?`$${S} / ${o} ${x}`:a.recurring.usage_type==="metered"?`$${S} / unit ${x}`:`$${S} ${x}`}return`$${S}`}const c=nu(a,r),h=f?qt(new ze(c).mul(new ze(s)),r.decimal).toString():+c*s;if(a?.type==="recurring"&&a.recurring){const g=Rn(a.recurring,!1,"slash",m);return o?`${h} ${r.symbol} / ${o} ${g}`:a.recurring.usage_type==="metered"?`${h} ${r.symbol} / unit ${g}`:`${h} ${r.symbol} ${g}`}return`${h} ${r.symbol}`},iw=(a,r,o,s=1,f=!0,m="en")=>{if(!r)return"";if(a.pricing_type==="dynamic"&&a.base_amount&&a.base_currency==="USD"){const g=a.base_amount,y=Number(g)*s,S=zi(y.toString(),m);return a?.type==="recurring"&&a.recurring?o?`$${S} / ${o}`:a.recurring.usage_type==="metered"?`$${S} / unit`:`$${S}`:`$${S}`}const c=nu(a,r),h=f?qt(new ze(c).mul(new ze(s)),r.decimal).toString():+c*s;return a?.type==="recurring"&&a.recurring?o?`${h} ${r.symbol} / ${o}`:a.recurring.usage_type==="metered"?`${h} ${r.symbol} / unit`:`${h} ${r.symbol}`:`${h} ${r.symbol}`};function tu(a){for(const r of a)if(r.price?.product?.statement_descriptor)return r.price?.product?.statement_descriptor;return window.blocklet?.appName}function Rn(a,r=!0,o="per",s="en"){const f={hour:"hourly",day:"daily",week:"weekly",month:"monthly",year:"yearly"};if(!a)return"";if(+a.interval_count==1){const m=Ie(`common.${a.interval}`,s);return r?Ie(`common.${f[a.interval]}`,s):o?Ie(`common.${o}`,s,{interval:m}):m}if(a.interval==="month"){if(a.interval_count===3)return Ie("common.month3",s);if(a.interval_count===6)return Ie("common.month6",s)}return Ie("common.recurring",s,{count:a.interval_count,interval:Ie(`common.${a.interval}s`,s)})}function nu(a,r){const s=_S(a).find(f=>f.currency_id===r?.id);return s?s.custom_unit_amount?s.custom_unit_amount.preset||s.custom_unit_amount.presets[0]:s.unit_amount:a.currency_id===r?.id?a.custom_unit_amount?a.custom_unit_amount.preset||a.custom_unit_amount.presets[0]:a.unit_amount:(console.warn(`Currency ${r?.id} not configured for price`,a),"0")}function _S(a){return Array.isArray(a.currency_options)?a.currency_options:[{currency_id:a.currency_id,unit_amount:a.unit_amount,custom_unit_amount:a.custom_unit_amount||null,tiers:null}]}const $f=8;function AS(a,r=$f){const o=a.isNeg(),f=a.abs().toString().padStart(r+1,"0"),m=f.slice(0,f.length-r)||"0",c=f.slice(-r).replace(/0+$/,""),h=c?`${m}.${c}`:m;return o?`-${h}`:h}function ES(a,r,o=$f){if(!a||!r)return new ze(0);const s=String(a),[f="0",m=""]=s.split("."),c=`${m}`.padEnd(o,"0").slice(0,o),h=`${f.replace("-","")}${c}`||"0",g=new ze(h).mul(new ze(r));return s.startsWith("-")?g.neg():g}function $l(a,r,{useUpsell:o=!0,exchangeRate:s=null}={}){if(!r)return{unitAmount:new ze(0),totalAmount:new ze(0),isDynamicQuote:!1};const f=o&&a.upsell_price||a.price,m=new ze(a.quantity||0),c=a?.quoted_amount,h=a?.quote_currency_id,g=f?.pricing_type==="dynamic";if(g&&c&&h===r.id){const x=new ze(c||"0");return{unitAmount:m.gt(new ze(0))?x.add(m).sub(new ze(1)).div(m):new ze(0),totalAmount:x,isDynamicQuote:!0}}if(g&&s&&f?.base_amount){const x=Number(s);if(x>0&&Number.isFinite(x)){const A=Number(f.base_amount);if(A>0&&Number.isFinite(A)){const v=A/x,N=Kn(v.toFixed(r.decimal||8),r.decimal||8);return{unitAmount:N,totalAmount:N.mul(m),isDynamicQuote:!1}}}}const S=new ze(nu(f,r));return{unitAmount:S,totalAmount:S.mul(m),isDynamicQuote:!1}}function wS(a,r,{trialEnd:o,trialInDays:s,exchangeRate:f=null},m="en"){if(!r)return{primary:"",secondary:"",quantity:""};const c=a.upsell_price||a.price;if(!c)return{primary:"",secondary:"",quantity:""};let h=Ie("common.qty",m,{count:a.quantity});(c.recurring?.usage_type==="metered"||+a.quantity==1)&&(h="");const{unitAmount:g,totalAmount:y}=$l(a,r,{exchangeRate:f}),S=c?.pricing_type==="dynamic",x=O=>{const k=qt(O,r.decimal);return un(k,S,6)},A=`${x(y)} ${r.symbol}`,v=`${x(g)} ${r.symbol}`,N=L0({trialInDays:s,trialEnd:o},m),B=(O,k)=>c.product.unit_label?`${O}/${c.product.unit_label}`:c.recurring?.usage_type==="metered"||a.quantity===1?k:h?Ie("common.each",m,{unit:v}):"";return c.type==="recurring"&&c.recurring?N.count>0?{primary:Ie("common.trial",m,{count:N.count,interval:N.interval}),secondary:`${B(A,A)} ${Rn(c.recurring,!1,"slash",m)}`,quantity:h}:{primary:A,secondary:B(A,""),quantity:h}:{primary:A,secondary:B(A,""),quantity:h}}function rw(a){switch(a){case"active":return"success";case"trialing":return"primary";case"incomplete":case"incomplete_expired":case"paused":return"warning";case"past_due":case"unpaid":return"error";default:return"default"}}function ow(a){switch(a){case"succeeded":return"success";case"requires_payment_method":case"requires_confirmation":case"requires_action":case"requires_capture":return"warning";default:return"default"}}function sw(a){switch(a){case"succeeded":return"success";case"requires_action":return"warning";default:return"default"}}function lw(a){switch(a){case"paid":return"success";case"deferred":return"warning";case"failed":return"warning";default:return"default"}}function Vl(a){switch(a){case"paid":return"success";case"open":return"secondary";case"uncollectible":return"warning";default:return"default"}}function Hl(a,r,o=!1,s=!0,{exchangeRate:f=null}={}){if(a.find(h=>(s&&h.upsell_price||h.price)?.custom_unit_amount)&&a.length>1)throw new Error("Multiple items with custom unit amount are not supported");let m=new ze(0);const c=a.filter(h=>(s&&h.upsell_price||h.price)!=null).reduce((h,g)=>{const y=g?.quote_currency_id,S=y&&y!==r.id;if(g.custom_amount&&!S)return h.add(new ze(g.custom_amount));const x=s&&g.upsell_price||g.price,{totalAmount:A}=$l(g,r,{useUpsell:s,exchangeRate:f});return x?.type==="recurring"&&(m=m.add(A),o||x.recurring?.usage_type==="metered")?h:h.add(A)},new ze(0)).toString();return{subtotal:c,total:c,renew:un(m.toString(),!!f),discount:"0",shipping:"0",tax:"0"}}function Fg(a){const{interval:r}=a,o=+a.interval_count||1,s=1440*60*1e3;switch(r){case"hour":return 3600*1e3;case"day":return o*s;case"week":return o*7*s;case"month":return o*30*s;case"year":return o*365*s;default:throw new Error(`Unsupported recurring interval: ${r}`)}}function TS(a,r){if(a[0]?.upsell_price_id||!a[0]?.price?.upsell?.upsells_to)return"0";const o=Hl(a,r,!1,!1),s=Hl(a.map(y=>({...y,upsell_price_id:y.price.upsell?.upsells_to_id,upsell_price:y.price.upsell?.upsells_to})),r,!1,!0),f=a[0].price?.recurring,m=a[0].price?.upsell?.upsells_to?.recurring;if(!f||!m)return"0";const c=Math.floor(Fg(m)/Fg(f)),h=new ze(o.total).mul(new ze(c)),g=new ze(s.total);return Number(h.sub(g).mul(new ze(100)).div(h).toString()).toFixed(0)}function Gd(a,r,o,s="en"){return o?Ie("payment.checkout.meteredThen",s,{subscription:a,recurring:r}):Ie("payment.checkout.then",s,{subscription:a,recurring:r})}function Kd(a,r,o,s="en"){return o?Ie("payment.checkout.metered",s,{recurring:r}):[a,r].filter(Boolean).join(" ")}function ts({amount:a,then:r,actualAmount:o,showThen:s},f,m,c="en"){return Number(o)===0&&m?Ie("payment.checkout.metered",c,{recurring:f}):s?[a,r].filter(Boolean).join(", "):[a,r].filter(Boolean).join(" ")}function kS(a){const r=new Set;for(const o of a)if(o.price?.recurring?.interval&&o.price?.type==="recurring"&&(r.add(`${o.price.recurring.interval}-${o.price.recurring.interval_count}`),r.size>1))return!0;return!1}function L0({trialInDays:a,trialEnd:r},o="en"){const s=Sn().unix(),f=(m,c)=>Ie(`common.${c>1?`${m}s`:m}`,o);if(r>0&&r>s){if(r-s<3600){const c=Math.ceil((r-s)/60);return{count:c,interval:f("minute",c)}}if(r-s<86400){const c=Math.ceil((r-s)/3600);return{count:c,interval:f("hour",c)}}const m=Math.ceil((r-s)/86400);return{count:m,interval:f("day",m)}}return a>0?{count:a,interval:f("day",a)}:{count:0,interval:Ie("common.day",o)}}function FS(a,r,{trialInDays:o,trialEnd:s},f="en",{exchangeRate:m=null}={}){const c=tu(a),{total:h}=Hl(a,r,o>0,!0,{exchangeRate:m}),g=qt(h,r.decimal),y=`${qt(h,r.decimal)} ${r.symbol}`,S=L0({trialInDays:o,trialEnd:s},f);if(a.length===0)return{action:Ie("payment.checkout.empty",f),amount:"0",then:"",actualAmount:"0",priceDisplay:"0"};const{name:x}=a[0]?.price?.product||{name:""};if(a.every(w=>w.price?.type==="one_time")){const w=Ie("payment.checkout.pay",f,{payee:c});return a.length>1?{action:w,amount:y,actualAmount:g,priceDisplay:y}:{action:w,amount:y,then:"",actualAmount:g,priceDisplay:y}}const A=a.find(w=>w.price?.type==="recurring"),v=Rn((A?.upsell_price||A?.price)?.recurring,!1,"per",f),N=a.some(w=>w.price?.type==="recurring"&&w.price?.recurring?.usage_type==="metered"),B=kS(a);if(a.every(w=>w.price?.type==="recurring")){const w=[N?Ie("payment.checkout.least",f):"",un(qt(a.reduce((q,z)=>(z.upsell_price||z.price)?.recurring?.usage_type==="metered"?q:q.add($l(z,r,{exchangeRate:m}).totalAmount),new ze(0)),r.decimal),!!m),r.symbol].filter(Boolean).join(" ");if(a.length>1){if(S.count>0){const re=Gd(w,v,N&&Number(w)===0,f),Q=Kd(w,v,N&&Number(w)===0,f),Z={action:Ie("payment.checkout.try2",f,{name:x,count:a.length-1}),amount:Ie("payment.checkout.free",f,{count:S.count,interval:S.interval}),then:re,thenValue:Q,showThen:!0,actualAmount:"0"};return{...Z,priceDisplay:ts({amount:Z.amount,then:re,actualAmount:Z.actualAmount,showThen:Z.showThen},v,N,f)}}const q=N?Ie("payment.checkout.meteredThen",f,{recurring:v}):v,z=N?Ie("payment.checkout.metered",f,{recurring:v}):v,$={action:Ie("payment.checkout.sub2",f,{name:x,count:a.length-1}),amount:y,then:q,thenValue:z,showThen:N,actualAmount:g};return{...$,priceDisplay:ts({amount:$.amount,then:q,actualAmount:$.actualAmount,showThen:$.showThen},v,N,f)}}if(S.count>0){const q=Gd(w,v,N&&Number(w)===0,f),z=Kd(w,v,N&&Number(w)===0,f),$={action:Ie("payment.checkout.try1",f,{name:x}),amount:Ie("payment.checkout.free",f,{count:S.count,interval:S.interval}),then:q,thenValue:z,showThen:!0,actualAmount:"0"};return{...$,priceDisplay:ts({amount:$.amount,then:q,actualAmount:$.actualAmount,showThen:$.showThen},v,N,f)}}const G=N?Ie("payment.checkout.meteredThen",f,{recurring:v}):v,T=N?Ie("payment.checkout.metered",f,{recurring:v}):v,R={action:Ie("payment.checkout.sub1",f,{name:x}),amount:y,then:G,thenValue:T,showThen:N&&!B,actualAmount:g};return{...R,priceDisplay:ts({amount:R.amount,then:G,actualAmount:R.actualAmount,showThen:R.showThen},v,N,f)}}const O=qt(a.filter(w=>w.price?.type==="recurring").reduce((w,G)=>G.price?.recurring?.usage_type==="metered"?w:w.add($l(G,r,{useUpsell:!1,exchangeRate:m}).totalAmount),new ze(0)),r.decimal),k=Gd(`${O} ${r.symbol}`,v,N&&Number(O)===0,f),K=Kd(`${O} ${r.symbol}`,v,N&&Number(O)===0,f),j={action:Ie("payment.checkout.pay",f,{payee:c}),amount:y,then:k,thenValue:K,showThen:!B,actualAmount:g};return{...j,priceDisplay:ts({amount:j.amount,then:k,actualAmount:j.actualAmount,showThen:j.showThen},v,N,f)}}function Ca(a,r,o=2){const s=qt(a,r),f=Number(s);if(!Number.isFinite(f))return Ui(a,r,o,!0,!1);const m=Math.abs(f),c=m>0&&m<.01?r:2;return Ja(s,c,!0,!1)}function au(a,r){for(const o of a)for(const s of o.payment_currencies)if(s.id===r)return{object:"payment_currency",...s,paymentMethod:D0(o,["payment_currencies"])};return null}function Vf(a){return Bi.some(r=>r[1]===a)}function uw(a){try{a.stopPropagation(),a.preventDefault()}catch{}}function cw(a,r=2){const o=a.map(s=>s.price?.product?.name).filter(Boolean);return o.slice(0,r).join(", ")+(o.length>r?` and ${o.length-r} more`:"")}const ns=(a,r="en")=>{const o=Sn().isSame(Sn(a),"day");return{time:ln(a,r,o?"HH:mm:ss":"YYYY-MM-DD"),isToday:o}},dw=(a,r="en")=>{if(a.status==="active"||a.status==="trialing"){if(a.cancel_at){const f=a.cancel_at*1e3,{time:m,isToday:c}=ns(f,r);return{action:f>Date.now()?"willEnd":"ended",time:m,isToday:c}}if(a.cancel_at_period_end){const f=a.current_period_end*1e3,{time:m,isToday:c}=ns(f,r);return{action:"willEnd",time:m,isToday:c}}const{time:o,isToday:s}=ns(a.current_period_end*1e3,r);return{action:"renew",time:o,isToday:s}}if(a.status==="past_due"){const o=(a.cancel_at||a.current_period_end)*1e3,{time:s,isToday:f}=ns(o,r);return{action:o>Date.now()?"willEnd":"ended",time:s,isToday:f}}if(a.status==="canceled"){const{time:o,isToday:s}=ns(a.canceled_at*1e3,r);return{action:"ended",time:o,isToday:s}}return null},fw=(a,r)=>a.status==="active"||a.status==="trialing"?a.cancel_at_period_end?a.cancelation_details?.reason==="payment_failed"?null:{action:"recover",variant:"contained",color:"primary",canRenew:!1,...r?.recover}:a.cancel_at&&a.cancel_at!==a.current_period_end?null:{action:"cancel",variant:"outlined",color:"inherit",canRenew:!1,...r?.cancel}:a.status==="past_due"?{action:"pastDue",variant:"contained",color:"primary",canRenew:a.cancel_at&&a.cancel_at!==a.current_period_end,...r?.pastDue}:a.status!=="canceled"&&a.cancel_at_period_end?{action:"recover",variant:"contained",color:"primary",canRenew:!1,...r?.recover}:null,mw=(a={})=>{const r=new URLSearchParams(window.location.search);return Object.keys(a).forEach(o=>{r.set(o,a[o])}),r.toString()},jS=(a=[])=>{const r=[];return a.forEach(o=>{(o.paymentCurrencies||o.payment_currencies||[]).forEach(f=>{r.push({...f,method:o})})}),r},I0=(a,r)=>{if(!r)return{text:"N/A",link:"",gas:""};if(a.type==="arcblock"&&r.arcblock?.tx_hash)return{link:Dt(a.settings.arcblock?.explorer_host,"/txs",r.arcblock?.tx_hash),text:r.arcblock?.tx_hash,gas:""};if(a.type==="bitcoin"&&r.bitcoin?.tx_hash)return{link:Dt(a.settings.bitcoin?.explorer_host,"/tx",r.bitcoin?.tx_hash),text:r.bitcoin?.tx_hash,gas:""};if(a.type==="ethereum"&&r.ethereum?.tx_hash)return{link:Dt(a.settings.ethereum?.explorer_host,"/tx",r.ethereum?.tx_hash),text:(r.ethereum?.tx_hash).toUpperCase(),gas:new ze(r.ethereum.gas_price).mul(new ze(r.ethereum.gas_used)).toString()};if(a.type==="base"&&r.base?.tx_hash)return{link:Dt(a.settings.base?.explorer_host,"/tx",r.base?.tx_hash),text:(r.base?.tx_hash).toUpperCase(),gas:""};if(a.type==="stripe"){const o=a.livemode?"https://dashboard.stripe.com":"https://dashboard.stripe.com/test";return{link:Dt(a.settings.stripe?.dashboard||o,"payments",r.stripe?.payment_intent_id),text:r.stripe?.payment_intent_id,gas:""}}return{text:"N/A",link:"",gas:""}};function Hf(a){const r={};return new URL(a).searchParams.forEach((s,f)=>{r[f]=s}),r}function Df(a,r,o="en"){const s=Number(r),{quantity_available:f=0,quantity_sold:m=0,quantity_limit_per_checkout:c=0}=a||{};return f>0&&m+s>f?Ie("common.quantityNotEnough",o):c>0&&c<s?Ie("common.quantityLimitPerCheckout",o):""}function pw(a){return a==="canceled"?"Ended":a}function jg(a,r="en",o=6){if(!a)return"";const[,s]=String(a).split(".");return s&&s.length>o?Ie("common.amountPrecisionLimit",r,{precision:o}):""}function hw(a){return typeof a=="string"&&/\s/.test(a)?"break-word":"break-all"}function iu(){const a=navigator.userAgent.toLowerCase(),r=a.indexOf("safari")>-1&&a.indexOf("chrome")===-1,o=a.indexOf("mobile")>-1||/iphone|ipad|ipod/.test(a),s=/iphone|ipad|ipod/.test(a);return r&&o&&s}function RS(a,r,o=!1){if(!a||!r)return a;if(!o)return a.length<=r?a:`${a.substring(0,r)}...`;let s=0,f="";for(let m=0;m<a.length;m++){const c=B1(a.charAt(m));if(s+c>r)break;f+=a.charAt(m),s+=c}return f===a?f:`${f}...`}function yw(a,r,o=48){if(!a)return"";const s=typeof r=="number"?r:Sn(r).unix();return`/.well-known/service/user/avatar/${a}?imageFilter=resize&w=${o}&h=${o}&updateAt=${s||Sn().unix()}`}function gw(a,r){return r?.type&&["arcblock","ethereum","base"].includes(r?.type)&&a?.[r?.type]?.tx_hash}function MS(a,r="en"){const{billing_reason:o,description:s}=a,f={subscription_create:Ie("payment.invoice.reason.creation",r),subscription_cycle:Ie("payment.invoice.reason.cycle",r),subscription_update:Ie("payment.invoice.reason.update",r),subscription_recover:Ie("payment.invoice.reason.recover",r),subscription_threshold:Ie("payment.invoice.reason.threshold",r),subscription_cancel:Ie("payment.invoice.reason.cancel",r),manual:Ie("payment.invoice.reason.manual",r),upcoming:Ie("payment.invoice.reason.upcoming",r),slash_stake:Ie("payment.invoice.reason.slashStake",r),stake:Ie("payment.invoice.reason.stake",r),return_stake:Ie("payment.invoice.reason.returnStake",r),recharge:Ie("payment.invoice.reason.recharge",r),stake_overdraft_protection:Ie("payment.invoice.reason.stake",r),overdraft_protection:Ie("payment.invoice.reason.fee",r),auto_recharge:Ie("payment.invoice.reason.recharge",r)};let m=Ie("payment.invoice.reason.payment",r);return(o.includes("stake")||o.includes("recharge")||o==="overdraft_protection")&&(m=f[o]),s?.startsWith("Subscription ")||s?.startsWith("Slash stake")?{description:f[o],reason:f[o],type:m}:{description:{"Stake for subscription plan change":Ie("payment.invoice.reason.stakeForChangePlan",r),"Stake for subscription payment change":Ie("payment.invoice.reason.stakeForChangePayment",r),"Stake for subscription":Ie("payment.invoice.reason.staking",r),"Return Subscription staking":Ie("payment.invoice.reason.returnStake",r),"Recharge for subscription":Ie("payment.invoice.reason.rechargeForSubscription",r),"Add funds for subscription":Ie("payment.invoice.reason.rechargeForSubscription",r),"Overdraft protection":Ie("payment.invoice.reason.overdraftProtection",r),"Stake for subscription overdraft protection":Ie("payment.invoice.reason.stakeForSubscriptionOverdraftProtection",r),"Re-stake to resume subscription":Ie("payment.invoice.reason.reStakeToResumeSubscription",r)}[s]||s,reason:f[o]||o,type:m}}function Dw(a,r="en"){return Dt(window.location.origin,Bx(".well-known/service/user",{locale:r,did:a}))}function vw(a){if(!a)return[];const r=a.split(/(#([^#]*)#)/),o=[];for(let s=0;s<r.length;s++){const f=r[s];if(f){if(s%3===0)o.push({type:"text",content:f});else if(s%3===1&&f.startsWith("#")&&f.endsWith("#")){const m=f.slice(1,-1);m.length>=0&&o.push({type:"marked",content:m})}}}return o.filter(s=>s.content!=="")}function NS(a,r){if(!a||!r)return"";const o=a?.settings?.[a?.type]?.explorer_host||"";return a.type==="arcblock"&&r?Dt(o,"accounts",r,"tokens"):["ethereum","base"].includes(a.type)&&r?Dt(o,"address",r):""}function bw(a){return!!(a.type==="recurring"&&a.recurring?.usage_type==="metered"&&a.recurring?.meter_id)}function BS(a,r,o){return o?!1:a&&a.type==="arcblock"?r.type!=="credit":!1}function US(a,r){if(!r||!a)return a;try{const o=new URL(a);return o.searchParams.set("locale",r),o.toString()}catch{if(/[?&]locale=[^&]*/.test(a))return a.replace(/([?&])locale=[^&]*/,`$1locale=${r}`);const s=a.includes("?")?"&":"?";return`${a}${s}locale=${r}`}}function Yf(a){return a.palette.getContrastText(a.palette.primary.main)}const ot=v0();ot.interceptors.request.use(a=>{const r=Qn();a.baseURL=r||"";const o=Ux(window.blocklet?.languages),s=new URLSearchParams(a.url?.split("?").pop());a.params={...a.params||{},locale:o};const f=window.__PAYMENT_KIT_AUTH_TOKEN;if(f&&typeof a.params.authToken>"u"&&!s.has("authToken")&&(a.params.authToken=f),typeof a.params.livemode>"u"&&s.has("livemode")===!1){const m=localStorage.getItem("livemode");a.params.livemode=E0(m)?!0:JSON.parse(m)}return a},a=>Promise.reject(a));var ps=a=>a.type==="checkbox",ur=a=>a instanceof Date,Mn=a=>a==null;const $0=a=>typeof a=="object";var Zt=a=>!Mn(a)&&!Array.isArray(a)&&$0(a)&&!ur(a),V0=a=>Zt(a)&&a.target?ps(a.target)?a.target.checked:a.target.value:a,H0=(a,r)=>r.split(".").some((o,s,f)=>!isNaN(Number(o))&&a.has(f.slice(0,s).join("."))),OS=a=>{const r=a.constructor&&a.constructor.prototype;return Zt(r)&&r.hasOwnProperty("isPrototypeOf")},Gf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Mt(a){if(a instanceof Date)return new Date(a);const r=typeof FileList<"u"&&a instanceof FileList;if(Gf&&(a instanceof Blob||r))return a;const o=Array.isArray(a);if(!o&&!(Zt(a)&&OS(a)))return a;const s=o?[]:Object.create(Object.getPrototypeOf(a));for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&(s[f]=Mt(a[f]));return s}var ru=a=>/^\w*$/.test(a),Tt=a=>a===void 0,ou=a=>Array.isArray(a)?a.filter(Boolean):[],Kf=a=>ou(a.replace(/["|']|\]/g,"").split(/\.|\[/)),Be=(a,r,o)=>{if(!r||!Zt(a))return o;const s=(ru(r)?[r]:Kf(r)).reduce((f,m)=>Mn(f)?f:f[m],a);return Tt(s)||s===a?Tt(a[r])?o:a[r]:s},Hn=a=>typeof a=="boolean",xn=a=>typeof a=="function",_t=(a,r,o)=>{let s=-1;const f=ru(r)?[r]:Kf(r),m=f.length,c=m-1;for(;++s<m;){const h=f[s];let g=o;if(s!==c){const y=a[h];g=Zt(y)||Array.isArray(y)?y:isNaN(+f[s+1])?{}:[]}if(h==="__proto__"||h==="constructor"||h==="prototype")return;a[h]=g,a=a[h]}};const Ni={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},da={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},va={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Qd="form",Y0="root",Qf=Ne.createContext(null);Qf.displayName="HookFormControlContext";const su=()=>Ne.useContext(Qf);var G0=(a,r,o,s=!0)=>{const f={defaultValues:r._defaultValues};for(const m in a)Object.defineProperty(f,m,{get:()=>{const c=m;return r._proxyFormState[c]!==da.all&&(r._proxyFormState[c]=!s||da.all),o&&(o[c]=!0),a[c]}});return f};const lu=typeof window<"u"?Ne.useLayoutEffect:Ne.useEffect;function zS(a){const r=su(),{control:o=r,disabled:s,name:f,exact:m}=a||{},[c,h]=Ne.useState(o._formState),g=Ne.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return lu(()=>o._subscribe({name:f,formState:g.current,exact:m,callback:y=>{!s&&h({...o._formState,...y})}}),[f,s,m]),Ne.useEffect(()=>{g.current.isValid&&o._setValid(!0)},[o]),Ne.useMemo(()=>G0(c,o,g.current,!1),[c,o])}var Cn=a=>typeof a=="string",vf=(a,r,o,s,f)=>Cn(a)?(s&&r.watch.add(a),Be(o,a,f)):Array.isArray(a)?a.map(m=>(s&&r.watch.add(m),Be(o,m))):(s&&(r.watchAll=!0),o),bf=a=>Mn(a)||!$0(a);function xa(a,r,o=new WeakSet){if(bf(a)||bf(r))return Object.is(a,r);if(ur(a)&&ur(r))return Object.is(a.getTime(),r.getTime());const s=Object.keys(a),f=Object.keys(r);if(s.length!==f.length)return!1;if(o.has(a)||o.has(r))return!0;o.add(a),o.add(r);for(const m of s){const c=a[m];if(!f.includes(m))return!1;if(m!=="ref"){const h=r[m];if(ur(c)&&ur(h)||(Zt(c)||Array.isArray(c))&&(Zt(h)||Array.isArray(h))?!xa(c,h,o):!Object.is(c,h))return!1}}return!0}function ba(a){const r=su(),{control:o=r,name:s,defaultValue:f,disabled:m,exact:c,compute:h}=a||{},g=Ne.useRef(f),y=Ne.useRef(h),S=Ne.useRef(void 0),x=Ne.useRef(o),A=Ne.useRef(s);y.current=h;const[v,N]=Ne.useState(()=>{const w=o._getWatch(s,g.current);return y.current?y.current(w):w}),B=Ne.useCallback(w=>{const G=vf(s,o._names,w||o._formValues,!1,g.current);return y.current?y.current(G):G},[o._formValues,o._names,s]),O=Ne.useCallback(w=>{if(!m){const G=vf(s,o._names,w||o._formValues,!1,g.current);if(y.current){const T=y.current(G);xa(T,S.current)||(N(T),S.current=T)}else N(G)}},[o._formValues,o._names,m,s]);lu(()=>((x.current!==o||!xa(A.current,s))&&(x.current=o,A.current=s,O()),o._subscribe({name:s,formState:{values:!0},exact:c,callback:w=>{O(w.values)}})),[o,c,s,O]),Ne.useEffect(()=>o._removeUnmounted());const k=x.current!==o,K=A.current,j=Ne.useMemo(()=>{if(m)return null;const w=!k&&!xa(K,s);return k||w?B():null},[m,k,s,K,B]);return j!==null?j:v}function PS(a){const r=su(),{name:o,disabled:s,control:f=r,shouldUnregister:m,defaultValue:c,exact:h=!0}=a,g=H0(f._names.array,o),y=Ne.useMemo(()=>Be(f._formValues,o,Be(f._defaultValues,o,c)),[f,o,c]),S=ba({control:f,name:o,defaultValue:y,exact:h}),x=zS({control:f,name:o,exact:h}),A=Ne.useRef(a),v=Ne.useRef(void 0),N=Ne.useRef(f.register(o,{...a.rules,value:S,...Hn(a.disabled)?{disabled:a.disabled}:{}}));A.current=a;const B=Ne.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Be(x.errors,o)},isDirty:{enumerable:!0,get:()=>!!Be(x.dirtyFields,o)},isTouched:{enumerable:!0,get:()=>!!Be(x.touchedFields,o)},isValidating:{enumerable:!0,get:()=>!!Be(x.validatingFields,o)},error:{enumerable:!0,get:()=>Be(x.errors,o)}}),[x,o]),O=Ne.useCallback(w=>N.current.onChange({target:{value:V0(w),name:o},type:Ni.CHANGE}),[o]),k=Ne.useCallback(()=>N.current.onBlur({target:{value:Be(f._formValues,o),name:o},type:Ni.BLUR}),[o,f._formValues]),K=Ne.useCallback(w=>{const G=Be(f._fields,o);G&&G._f&&w&&(G._f.ref={focus:()=>xn(w.focus)&&w.focus(),select:()=>xn(w.select)&&w.select(),setCustomValidity:T=>xn(w.setCustomValidity)&&w.setCustomValidity(T),reportValidity:()=>xn(w.reportValidity)&&w.reportValidity()})},[f._fields,o]),j=Ne.useMemo(()=>({name:o,value:S,...Hn(s)||x.disabled?{disabled:x.disabled||s}:{},onChange:O,onBlur:k,ref:K}),[o,s,x.disabled,O,k,K,S]);return Ne.useEffect(()=>{const w=f._options.shouldUnregister||m,G=v.current;G&&G!==o&&!g&&f.unregister(G),f.register(o,{...A.current.rules,...Hn(A.current.disabled)?{disabled:A.current.disabled}:{}});const T=(R,q)=>{const z=Be(f._fields,R);z&&z._f&&(z._f.mount=q)};if(T(o,!0),w){const R=Mt(Be(f._options.defaultValues,o,A.current.defaultValue));_t(f._defaultValues,o,R),Tt(Be(f._formValues,o))&&_t(f._formValues,o,R)}return!g&&f.register(o),v.current=o,()=>{(g?w&&!f._state.action:w)?f.unregister(o):T(o,!1)}},[o,f,g,m]),Ne.useEffect(()=>{f._setDisabledField({disabled:s,name:o})},[s,o,f]),Ne.useMemo(()=>({field:j,formState:x,fieldState:B}),[j,x,B])}const Yl=a=>a.render(PS(a)),Zf=Ne.createContext(null);Zf.displayName="HookFormContext";const hs=()=>Ne.useContext(Zf),K0=a=>{const{children:r,watch:o,getValues:s,getFieldState:f,setError:m,clearErrors:c,setValue:h,trigger:g,formState:y,resetField:S,reset:x,handleSubmit:A,unregister:v,control:N,register:B,setFocus:O,subscribe:k}=a,K=Ne.useMemo(()=>({watch:o,getValues:s,getFieldState:f,setError:m,clearErrors:c,setValue:h,trigger:g,formState:y,resetField:S,reset:x,handleSubmit:A,unregister:v,control:N,register:B,setFocus:O,subscribe:k}),[c,N,y,f,s,A,B,x,S,m,O,h,k,g,v,o]);return Ne.createElement(Zf.Provider,{value:K},Ne.createElement(Qf.Provider,{value:K.control},r))};var qS=(a,r,o,s,f)=>r?{...o[a],types:{...o[a]&&o[a].types?o[a].types:{},[s]:f||!0}}:{},Bn=a=>Array.isArray(a)?a:[a],Rg=()=>{let a=[];return{get observers(){return a},next:f=>{for(const m of a)m.next&&m.next(f)},subscribe:f=>(a.push(f),{unsubscribe:()=>{a=a.filter(m=>m!==f)}}),unsubscribe:()=>{a=[]}}};function Q0(a,r){const o={};for(const s in a)if(a.hasOwnProperty(s)){const f=a[s],m=r[s];if(f&&Zt(f)&&m){const c=Q0(f,m);Zt(c)&&(o[s]=c)}else a[s]&&(o[s]=m)}return o}var yn=a=>Zt(a)&&!Object.keys(a).length,Xf=a=>a.type==="file",Gl=a=>{if(!Gf)return!1;const r=a?a.ownerDocument:0;return a instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Z0=a=>a.type==="select-multiple",Wf=a=>a.type==="radio",LS=a=>Wf(a)||ps(a),Zd=a=>Gl(a)&&a.isConnected;function IS(a,r){const o=r.slice(0,-1).length;let s=0;for(;s<o;)a=Tt(a)?s++:a[r[s++]];return a}function $S(a){for(const r in a)if(a.hasOwnProperty(r)&&!Tt(a[r]))return!1;return!0}function Qt(a,r){const o=Array.isArray(r)?r:ru(r)?[r]:Kf(r),s=o.length===1?a:IS(a,o),f=o.length-1,m=o[f];return s&&delete s[m],f!==0&&(Zt(s)&&yn(s)||Array.isArray(s)&&$S(s))&&Qt(a,o.slice(0,-1)),a}var VS=a=>{for(const r in a)if(xn(a[r]))return!0;return!1};function X0(a){return Array.isArray(a)||Zt(a)&&!VS(a)}function xf(a,r={}){for(const o in a){const s=a[o];X0(s)?(r[o]=Array.isArray(s)?[]:{},xf(s,r[o])):Tt(s)||(r[o]=!0)}return r}function rs(a,r,o){o||(o=xf(r));for(const s in a){const f=a[s];if(X0(f))Tt(r)||bf(o[s])?o[s]=xf(f,Array.isArray(f)?[]:{}):rs(f,Mn(r)?{}:r[s],o[s]);else{const m=r[s];o[s]=!xa(f,m)}}return o}const Mg={value:!1,isValid:!1},Ng={value:!0,isValid:!0};var W0=a=>{if(Array.isArray(a)){if(a.length>1){const r=a.filter(o=>o&&o.checked&&!o.disabled).map(o=>o.value);return{value:r,isValid:!!r.length}}return a[0].checked&&!a[0].disabled?a[0].attributes&&!Tt(a[0].attributes.value)?Tt(a[0].value)||a[0].value===""?Ng:{value:a[0].value,isValid:!0}:Ng:Mg}return Mg},J0=(a,{valueAsNumber:r,valueAsDate:o,setValueAs:s})=>Tt(a)?a:r?a===""?NaN:a&&+a:o&&Cn(a)?new Date(a):s?s(a):a;const Bg={isValid:!1,value:null};var eD=a=>Array.isArray(a)?a.reduce((r,o)=>o&&o.checked&&!o.disabled?{isValid:!0,value:o.value}:r,Bg):Bg;function Ug(a){const r=a.ref;return Xf(r)?r.files:Wf(r)?eD(a.refs).value:Z0(r)?[...r.selectedOptions].map(({value:o})=>o):ps(r)?W0(a.refs).value:J0(Tt(r.value)?a.ref.value:r.value,a)}var HS=a=>a.substring(0,a.search(/\.\d+(\.|$)/))||a,YS=(a,r,o,s)=>{const f={};for(const m of a){const c=Be(r,m);c&&_t(f,m,c._f)}return{criteriaMode:o,names:[...a],fields:f,shouldUseNativeValidation:s}},Kl=a=>a instanceof RegExp,as=a=>Tt(a)?a:Kl(a)?a.source:Zt(a)?Kl(a.value)?a.value.source:a.value:a,io=a=>({isOnSubmit:!a||a===da.onSubmit,isOnBlur:a===da.onBlur,isOnChange:a===da.onChange,isOnAll:a===da.all,isOnTouch:a===da.onTouched});const Og="AsyncFunction";var GS=a=>!!a&&!!a.validate&&!!(xn(a.validate)&&a.validate.constructor.name===Og||Zt(a.validate)&&Object.values(a.validate).find(r=>r.constructor.name===Og)),KS=a=>a.mount&&(a.required||a.min||a.max||a.maxLength||a.minLength||a.pattern||a.validate),Cf=(a,r,o)=>!o&&(r.watchAll||r.watch.has(a)||[...r.watch].some(s=>a.startsWith(s)&&/^\.\w+/.test(a.slice(s.length))));const oo=(a,r,o,s)=>{for(const f of o||Object.keys(a)){const m=Be(a,f);if(m){const{_f:c,...h}=m;if(c){if(c.refs&&c.refs[0]&&r(c.refs[0],f)&&!s)return!0;if(c.ref&&r(c.ref,c.name)&&!s)return!0;if(oo(h,r))break}else if(Zt(h)&&oo(h,r))break}}};function zg(a,r,o){const s=Be(a,o);if(s||ru(o))return{error:s,name:o};const f=o.split(".");for(;f.length;){const m=f.join("."),c=Be(r,m),h=Be(a,m);if(c&&!Array.isArray(c)&&o!==m)return{name:o};if(h&&h.type)return{name:m,error:h};if(h&&h.root&&h.root.type)return{name:`${m}.root`,error:h.root};f.pop()}return{name:o}}var QS=(a,r,o,s)=>{o(a);const{name:f,...m}=a;return yn(m)||Object.keys(m).length>=Object.keys(r).length||Object.keys(m).find(c=>r[c]===(!s||da.all))},ZS=(a,r,o)=>!a||!r||a===r||Bn(a).some(s=>s&&(o?s===r:s.startsWith(r)||r.startsWith(s))),XS=(a,r,o,s,f)=>f.isOnAll?!1:!o&&f.isOnTouch?!(r||a):(o?s.isOnBlur:f.isOnBlur)?!a:(o?s.isOnChange:f.isOnChange)?a:!0,WS=(a,r)=>!ou(Be(a,r)).length&&Qt(a,r),tD=(a,r,o)=>{const s=Bn(Be(a,o));return _t(s,Y0,r[o]),_t(a,o,s),a};function Pg(a,r,o="validate"){if(Cn(a)||Array.isArray(a)&&a.every(Cn)||Hn(a)&&!a)return{type:o,message:Cn(a)?a:"",ref:r}}var eo=a=>Zt(a)&&!Kl(a)?a:{value:a,message:""},Sf=async(a,r,o,s,f,m)=>{const{ref:c,refs:h,required:g,maxLength:y,minLength:S,min:x,max:A,pattern:v,validate:N,name:B,valueAsNumber:O,mount:k}=a._f,K=Be(o,B);if(!k||r.has(B))return{};const j=h?h[0]:c,w=Q=>{f&&j.reportValidity&&(j.setCustomValidity(Hn(Q)?"":Q||""),j.reportValidity())},G={},T=Wf(c),R=ps(c),q=T||R,z=(O||Xf(c))&&Tt(c.value)&&Tt(K)||Gl(c)&&c.value===""||K===""||Array.isArray(K)&&!K.length,$=qS.bind(null,B,s,G),re=(Q,Z,ne,me=va.maxLength,P=va.minLength)=>{const D=Q?Z:ne;G[B]={type:Q?me:P,message:D,ref:c,...$(Q?me:P,D)}};if(m?!Array.isArray(K)||!K.length:g&&(!q&&(z||Mn(K))||Hn(K)&&!K||R&&!W0(h).isValid||T&&!eD(h).isValid)){const{value:Q,message:Z}=Cn(g)?{value:!!g,message:g}:eo(g);if(Q&&(G[B]={type:va.required,message:Z,ref:j,...$(va.required,Z)},!s))return w(Z),G}if(!z&&(!Mn(x)||!Mn(A))){let Q,Z;const ne=eo(A),me=eo(x);if(!Mn(K)&&!isNaN(K)){const P=c.valueAsNumber||K&&+K;Mn(ne.value)||(Q=P>ne.value),Mn(me.value)||(Z=P<me.value)}else{const P=c.valueAsDate||new Date(K),D=be=>new Date(new Date().toDateString()+" "+be),F=c.type=="time",ae=c.type=="week";Cn(ne.value)&&K&&(Q=F?D(K)>D(ne.value):ae?K>ne.value:P>new Date(ne.value)),Cn(me.value)&&K&&(Z=F?D(K)<D(me.value):ae?K<me.value:P<new Date(me.value))}if((Q||Z)&&(re(!!Q,ne.message,me.message,va.max,va.min),!s))return w(G[B].message),G}if((y||S)&&!z&&(Cn(K)||m&&Array.isArray(K))){const Q=eo(y),Z=eo(S),ne=!Mn(Q.value)&&K.length>+Q.value,me=!Mn(Z.value)&&K.length<+Z.value;if((ne||me)&&(re(ne,Q.message,Z.message),!s))return w(G[B].message),G}if(v&&!z&&Cn(K)){const{value:Q,message:Z}=eo(v);if(Kl(Q)&&!K.match(Q)&&(G[B]={type:va.pattern,message:Z,ref:c,...$(va.pattern,Z)},!s))return w(Z),G}if(N){if(xn(N)){const Q=await N(K,o),Z=Pg(Q,j);if(Z&&(G[B]={...Z,...$(va.validate,Z.message)},!s))return w(Z.message),G}else if(Zt(N)){let Q={};for(const Z in N){if(!yn(Q)&&!s)break;const ne=Pg(await N[Z](K,o),j,Z);ne&&(Q={...ne,...$(Z,ne.message)},w(ne.message),s&&(G[B]=Q))}if(!yn(Q)&&(G[B]={ref:j,...Q},!s))return G}}return w(!0),G};const JS={mode:da.onSubmit,reValidateMode:da.onChange,shouldFocusError:!0};function e_(a={}){let r={...JS,...a},o={submitCount:0,isDirty:!1,isReady:!1,isLoading:xn(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},s={},f=Zt(r.defaultValues)||Zt(r.values)?Mt(r.defaultValues||r.values)||{}:{},m=r.shouldUnregister?{}:Mt(f),c={action:!1,mount:!1,watch:!1,keepIsValid:!1},h={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},g,y=0;const S={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},x={...S};let A={...x};const v={array:Rg(),state:Rg()},N=r.criteriaMode===da.all,B=_=>I=>{clearTimeout(y),y=setTimeout(_,I)},O=async _=>{if(!c.keepIsValid&&!r.disabled&&(x.isValid||A.isValid||_)){let I;r.resolver?(I=yn((await z()).errors),k()):I=await Q({fields:s,onlyCheckValid:!0,eventType:Ni.VALID}),I!==o.isValid&&v.state.next({isValid:I})}},k=(_,I)=>{!r.disabled&&(x.isValidating||x.validatingFields||A.isValidating||A.validatingFields)&&((_||Array.from(h.mount)).forEach(ee=>{ee&&(I?_t(o.validatingFields,ee,I):Qt(o.validatingFields,ee))}),v.state.next({validatingFields:o.validatingFields,isValidating:!yn(o.validatingFields)}))},K=_=>{const I=rs(f,m),ee=HS(_);_t(o.dirtyFields,ee,Be(I,ee))},j=(_,I=[],ee,Ee,De=!0,Ce=!0)=>{if(Ee&&ee&&!r.disabled){if(c.action=!0,Ce&&Array.isArray(Be(s,_))){const Te=ee(Be(s,_),Ee.argA,Ee.argB);De&&_t(s,_,Te)}if(Ce&&Array.isArray(Be(o.errors,_))){const Te=ee(Be(o.errors,_),Ee.argA,Ee.argB);De&&_t(o.errors,_,Te),WS(o.errors,_)}if((x.touchedFields||A.touchedFields)&&Ce&&Array.isArray(Be(o.touchedFields,_))){const Te=ee(Be(o.touchedFields,_),Ee.argA,Ee.argB);De&&_t(o.touchedFields,_,Te)}(x.dirtyFields||A.dirtyFields)&&K(_),v.state.next({name:_,isDirty:ne(_,I),dirtyFields:o.dirtyFields,errors:o.errors,isValid:o.isValid})}else _t(m,_,I)},w=(_,I)=>{_t(o.errors,_,I),v.state.next({errors:o.errors})},G=_=>{o.errors=_,v.state.next({errors:o.errors,isValid:!1})},T=(_,I,ee,Ee)=>{const De=Be(s,_);if(De){const Ce=Be(m,_,Tt(ee)?Be(f,_):ee);Tt(Ce)||Ee&&Ee.defaultChecked||I?_t(m,_,I?Ce:Ug(De._f)):D(_,Ce),c.mount&&!c.action&&O()}},R=(_,I,ee,Ee,De)=>{let Ce=!1,Te=!1;const Ye={name:_};if(!r.disabled){if(!ee||Ee){(x.isDirty||A.isDirty)&&(Te=o.isDirty,o.isDirty=Ye.isDirty=ne(),Ce=Te!==Ye.isDirty);const ve=xa(Be(f,_),I);Te=!!Be(o.dirtyFields,_),ve?Qt(o.dirtyFields,_):_t(o.dirtyFields,_,!0),Ye.dirtyFields=o.dirtyFields,Ce=Ce||(x.dirtyFields||A.dirtyFields)&&Te!==!ve}if(ee){const ve=Be(o.touchedFields,_);ve||(_t(o.touchedFields,_,ee),Ye.touchedFields=o.touchedFields,Ce=Ce||(x.touchedFields||A.touchedFields)&&ve!==ee)}Ce&&De&&v.state.next(Ye)}return Ce?Ye:{}},q=(_,I,ee,Ee)=>{const De=Be(o.errors,_),Ce=(x.isValid||A.isValid)&&Hn(I)&&o.isValid!==I;if(r.delayError&&ee?(g=B(()=>w(_,ee)),g(r.delayError)):(clearTimeout(y),g=null,ee?_t(o.errors,_,ee):Qt(o.errors,_)),(ee?!xa(De,ee):De)||!yn(Ee)||Ce){const Te={...Ee,...Ce&&Hn(I)?{isValid:I}:{},errors:o.errors,name:_};o={...o,...Te},v.state.next(Te)}},z=async _=>(k(_,!0),await r.resolver(m,r.context,YS(_||h.mount,s,r.criteriaMode,r.shouldUseNativeValidation))),$=async _=>{const{errors:I}=await z(_);if(k(_),_)for(const ee of _){const Ee=Be(I,ee);Ee?_t(o.errors,ee,Ee):Qt(o.errors,ee)}else o.errors=I;return I},re=async({name:_,eventType:I})=>{if(a.validate){const ee=await a.validate({formValues:m,formState:o,name:_,eventType:I});if(Zt(ee))for(const Ee in ee)ee[Ee]&&Pe(`${Qd}.${Ee}`,{message:Cn(ee.message)?ee.message:"",type:va.validate});else Cn(ee)||!ee?Pe(Qd,{message:ee||"",type:va.validate}):$e(Qd);return ee}return!0},Q=async({fields:_,onlyCheckValid:I,name:ee,eventType:Ee,context:De={valid:!0,runRootValidation:!1}})=>{if(a.validate&&(De.runRootValidation=!0,!await re({name:ee,eventType:Ee})&&(De.valid=!1,I)))return De.valid;for(const Ce in _){const Te=_[Ce];if(Te){const{_f:Ye,...ve}=Te;if(Ye){const qe=h.array.has(Ye.name),Oe=Te._f&&GS(Te._f);Oe&&x.validatingFields&&k([Ye.name],!0);const Ve=await Sf(Te,h.disabled,m,N,r.shouldUseNativeValidation&&!I,qe);if(Oe&&x.validatingFields&&k([Ye.name]),Ve[Ye.name]&&(De.valid=!1,I)||(!I&&(Be(Ve,Ye.name)?qe?tD(o.errors,Ve,Ye.name):_t(o.errors,Ye.name,Ve[Ye.name]):Qt(o.errors,Ye.name)),a.shouldUseNativeValidation&&Ve[Ye.name]))break}!yn(ve)&&await Q({context:De,onlyCheckValid:I,fields:ve,name:Ce,eventType:Ee})}}return De.valid},Z=()=>{for(const _ of h.unMount){const I=Be(s,_);I&&(I._f.refs?I._f.refs.every(ee=>!Zd(ee)):!Zd(I._f.ref))&&b(_)}h.unMount=new Set},ne=(_,I)=>!r.disabled&&(_&&I&&_t(m,_,I),!xa(Ae(),f)),me=(_,I,ee)=>vf(_,h,{...c.mount?m:Tt(I)?f:Cn(_)?{[_]:I}:I},ee,I),P=_=>ou(Be(c.mount?m:f,_,r.shouldUnregister?Be(f,_,[]):[])),D=(_,I,ee={})=>{const Ee=Be(s,_);let De=I;if(Ee){const Ce=Ee._f;Ce&&(!Ce.disabled&&_t(m,_,J0(I,Ce)),De=Gl(Ce.ref)&&Mn(I)?"":I,Z0(Ce.ref)?[...Ce.ref.options].forEach(Te=>Te.selected=De.includes(Te.value)):Ce.refs?ps(Ce.ref)?Ce.refs.forEach(Te=>{(!Te.defaultChecked||!Te.disabled)&&(Array.isArray(De)?Te.checked=!!De.find(Ye=>Ye===Te.value):Te.checked=De===Te.value||!!De)}):Ce.refs.forEach(Te=>Te.checked=Te.value===De):Xf(Ce.ref)?Ce.ref.value="":(Ce.ref.value=De,Ce.ref.type||v.state.next({name:_,values:Mt(m)})))}(ee.shouldDirty||ee.shouldTouch)&&R(_,De,ee.shouldTouch,ee.shouldDirty,!0),ee.shouldValidate&&Fe(_)},F=(_,I,ee)=>{for(const Ee in I){if(!I.hasOwnProperty(Ee))return;const De=I[Ee],Ce=_+"."+Ee,Te=Be(s,Ce);(h.array.has(_)||Zt(De)||Te&&!Te._f)&&!ur(De)?F(Ce,De,ee):D(Ce,De,ee)}},ae=(_,I,ee={})=>{const Ee=Be(s,_),De=h.array.has(_),Ce=Mt(I);_t(m,_,Ce),De?(v.array.next({name:_,values:Mt(m)}),(x.isDirty||x.dirtyFields||A.isDirty||A.dirtyFields)&&ee.shouldDirty&&(K(_),v.state.next({name:_,dirtyFields:o.dirtyFields,isDirty:ne(_,Ce)}))):Ee&&!Ee._f&&!Mn(Ce)?F(_,Ce,ee):D(_,Ce,ee),Cf(_,h)?v.state.next({...o,name:_,values:Mt(m)}):v.state.next({name:c.mount?_:void 0,values:Mt(m)})},be=async _=>{c.mount=!0;const I=_.target;let ee=I.name,Ee=!0;const De=Be(s,ee),Ce=ve=>{Ee=Number.isNaN(ve)||ur(ve)&&isNaN(ve.getTime())||xa(ve,Be(m,ee,ve))},Te=io(r.mode),Ye=io(r.reValidateMode);if(De){let ve,qe;const Oe=I.type?Ug(De._f):V0(_),Ve=_.type===Ni.BLUR||_.type===Ni.FOCUS_OUT,Ge=!KS(De._f)&&!a.validate&&!r.resolver&&!Be(o.errors,ee)&&!De._f.deps||XS(Ve,Be(o.touchedFields,ee),o.isSubmitted,Ye,Te),Ke=Cf(ee,h,Ve);_t(m,ee,Oe),Ve?(!I||!I.readOnly)&&(De._f.onBlur&&De._f.onBlur(_),g&&g(0)):De._f.onChange&&De._f.onChange(_);const et=R(ee,Oe,Ve),Lt=!yn(et)||Ke;if(!Ve&&v.state.next({name:ee,type:_.type,values:Mt(m)}),Ge)return(x.isValid||A.isValid)&&(r.mode==="onBlur"?Ve&&O():Ve||O()),Lt&&v.state.next({name:ee,...Ke?{}:et});if(!r.resolver&&a.validate&&await re({name:ee,eventType:_.type}),!Ve&&Ke&&v.state.next({...o}),r.resolver){const{errors:It}=await z([ee]);if(k([ee]),Ce(Oe),Ee){const kt=zg(o.errors,s,ee),zt=zg(It,s,kt.name||ee);ve=zt.error,ee=zt.name,qe=yn(It)}}else k([ee],!0),ve=(await Sf(De,h.disabled,m,N,r.shouldUseNativeValidation))[ee],k([ee]),Ce(Oe),Ee&&(ve?qe=!1:(x.isValid||A.isValid)&&(qe=await Q({fields:s,onlyCheckValid:!0,name:ee,eventType:_.type})));Ee&&(De._f.deps&&(!Array.isArray(De._f.deps)||De._f.deps.length>0)&&Fe(De._f.deps),q(ee,qe,ve,et))}},Me=(_,I)=>{if(Be(o.errors,I)&&_.focus)return _.focus(),1},Fe=async(_,I={})=>{let ee,Ee;const De=Bn(_);if(r.resolver){const Ce=await $(Tt(_)?_:De);ee=yn(Ce),Ee=_?!De.some(Te=>Be(Ce,Te)):ee}else _?(Ee=(await Promise.all(De.map(async Ce=>{const Te=Be(s,Ce);return await Q({fields:Te&&Te._f?{[Ce]:Te}:Te,eventType:Ni.TRIGGER})}))).every(Boolean),!(!Ee&&!o.isValid)&&O()):Ee=ee=await Q({fields:s,name:_,eventType:Ni.TRIGGER});return v.state.next({...!Cn(_)||(x.isValid||A.isValid)&&ee!==o.isValid?{}:{name:_},...r.resolver||!_?{isValid:ee}:{},errors:o.errors}),I.shouldFocus&&!Ee&&oo(s,Me,_?De:h.mount),Ee},Ae=(_,I)=>{let ee={...c.mount?m:f};return I&&(ee=Q0(I.dirtyFields?o.dirtyFields:o.touchedFields,ee)),Tt(_)?ee:Cn(_)?Be(ee,_):_.map(Ee=>Be(ee,Ee))},ue=(_,I)=>({invalid:!!Be((I||o).errors,_),isDirty:!!Be((I||o).dirtyFields,_),error:Be((I||o).errors,_),isValidating:!!Be(o.validatingFields,_),isTouched:!!Be((I||o).touchedFields,_)}),$e=_=>{const I=_?Bn(_):void 0;I?.forEach(ee=>Qt(o.errors,ee)),I?I.forEach(ee=>{v.state.next({name:ee,errors:o.errors})}):v.state.next({errors:{}})},Pe=(_,I,ee)=>{const Ee=(Be(s,_,{_f:{}})._f||{}).ref,De=Be(o.errors,_)||{},{ref:Ce,message:Te,type:Ye,...ve}=De;_t(o.errors,_,{...ve,...I,ref:Ee}),v.state.next({name:_,errors:o.errors,isValid:!1}),ee&&ee.shouldFocus&&Ee&&Ee.focus&&Ee.focus()},Xe=(_,I)=>xn(_)?v.state.subscribe({next:ee=>"values"in ee&&_(me(void 0,I),ee)}):me(_,I,!0),Ze=_=>v.state.subscribe({next:I=>{ZS(_.name,I.name,_.exact)&&QS(I,_.formState||x,U,_.reRenderRoot)&&_.callback({values:{...m},...o,...I,defaultValues:f})}}).unsubscribe,Ue=_=>(c.mount=!0,A={...A,..._.formState},Ze({..._,formState:{...S,..._.formState}})),b=(_,I={})=>{for(const ee of _?Bn(_):h.mount)h.mount.delete(ee),h.array.delete(ee),I.keepValue||(Qt(s,ee),Qt(m,ee)),!I.keepError&&Qt(o.errors,ee),!I.keepDirty&&Qt(o.dirtyFields,ee),!I.keepTouched&&Qt(o.touchedFields,ee),!I.keepIsValidating&&Qt(o.validatingFields,ee),!r.shouldUnregister&&!I.keepDefaultValue&&Qt(f,ee);v.state.next({values:Mt(m)}),v.state.next({...o,...I.keepDirty?{isDirty:ne()}:{}}),!I.keepIsValid&&O()},E=({disabled:_,name:I})=>{if(Hn(_)&&c.mount||_||h.disabled.has(I)){const De=h.disabled.has(I)!==!!_;_?h.disabled.add(I):h.disabled.delete(I),De&&c.mount&&!c.action&&O()}},L=(_,I={})=>{let ee=Be(s,_);const Ee=Hn(I.disabled)||Hn(r.disabled),De=!h.registerName.has(_)&&ee&&!ee._f.mount;return _t(s,_,{...ee||{},_f:{...ee&&ee._f?ee._f:{ref:{name:_}},name:_,mount:!0,...I}}),h.mount.add(_),ee&&!De?E({disabled:Hn(I.disabled)?I.disabled:r.disabled,name:_}):T(_,!0,I.value),{...Ee?{disabled:I.disabled||r.disabled}:{},...r.progressive?{required:!!I.required,min:as(I.min),max:as(I.max),minLength:as(I.minLength),maxLength:as(I.maxLength),pattern:as(I.pattern)}:{},name:_,onChange:be,onBlur:be,ref:Ce=>{if(Ce){h.registerName.add(_),L(_,I),h.registerName.delete(_),ee=Be(s,_);const Te=Tt(Ce.value)&&Ce.querySelectorAll&&Ce.querySelectorAll("input,select,textarea")[0]||Ce,Ye=LS(Te),ve=ee._f.refs||[];if(Ye?ve.find(qe=>qe===Te):Te===ee._f.ref)return;_t(s,_,{_f:{...ee._f,...Ye?{refs:[...ve.filter(Zd),Te,...Array.isArray(Be(f,_))?[{}]:[]],ref:{type:Te.type,name:_}}:{ref:Te}}}),T(_,!1,void 0,Te)}else ee=Be(s,_,{}),ee._f&&(ee._f.mount=!1),(r.shouldUnregister||I.shouldUnregister)&&!(H0(h.array,_)&&c.action)&&h.unMount.add(_)}}},ie=()=>r.shouldFocusError&&oo(s,Me,h.mount),W=_=>{Hn(_)&&(v.state.next({disabled:_}),oo(s,(I,ee)=>{const Ee=Be(s,ee);Ee&&(I.disabled=Ee._f.disabled||_,Array.isArray(Ee._f.refs)&&Ee._f.refs.forEach(De=>{De.disabled=Ee._f.disabled||_}))},0,!1))},te=(_,I)=>async ee=>{let Ee;ee&&(ee.preventDefault&&ee.preventDefault(),ee.persist&&ee.persist());let De=Mt(m);if(v.state.next({isSubmitting:!0}),r.resolver){const{errors:Ce,values:Te}=await z();k(),o.errors=Ce,De=Mt(Te)}else await Q({fields:s,eventType:Ni.SUBMIT});if(h.disabled.size)for(const Ce of h.disabled)Qt(De,Ce);if(Qt(o.errors,Y0),yn(o.errors)){v.state.next({errors:{}});try{await _(De,ee)}catch(Ce){Ee=Ce}}else I&&await I({...o.errors},ee),ie(),setTimeout(ie);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:yn(o.errors)&&!Ee,submitCount:o.submitCount+1,errors:o.errors}),Ee)throw Ee},ce=(_,I={})=>{Be(s,_)&&(Tt(I.defaultValue)?ae(_,Mt(Be(f,_))):(ae(_,I.defaultValue),_t(f,_,Mt(I.defaultValue))),I.keepTouched||Qt(o.touchedFields,_),I.keepDirty||(Qt(o.dirtyFields,_),o.isDirty=I.defaultValue?ne(_,Mt(Be(f,_))):ne()),I.keepError||(Qt(o.errors,_),x.isValid&&O()),v.state.next({...o}))},J=(_,I={})=>{const ee=_?Mt(_):f,Ee=Mt(ee),De=yn(_),Ce=De?f:Ee;if(I.keepDefaultValues||(f=ee),!I.keepValues){if(I.keepDirtyValues){const Te=new Set([...h.mount,...Object.keys(rs(f,m))]);for(const Ye of Array.from(Te)){const ve=Be(o.dirtyFields,Ye),qe=Be(m,Ye),Oe=Be(Ce,Ye);ve&&!Tt(qe)?_t(Ce,Ye,qe):!ve&&!Tt(Oe)&&ae(Ye,Oe)}}else{if(Gf&&Tt(_))for(const Te of h.mount){const Ye=Be(s,Te);if(Ye&&Ye._f){const ve=Array.isArray(Ye._f.refs)?Ye._f.refs[0]:Ye._f.ref;if(Gl(ve)){const qe=ve.closest("form");if(qe){qe.reset();break}}}}if(I.keepFieldsRef)for(const Te of h.mount)ae(Te,Be(Ce,Te));else s={}}m=r.shouldUnregister?I.keepDefaultValues?Mt(f):{}:Mt(Ce),v.array.next({values:{...Ce}}),v.state.next({values:{...Ce}})}h={mount:I.keepDirtyValues?h.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!x.isValid||!!I.keepIsValid||!!I.keepDirtyValues||!r.shouldUnregister&&!yn(Ce),c.watch=!!r.shouldUnregister,c.keepIsValid=!!I.keepIsValid,c.action=!1,I.keepErrors||(o.errors={}),v.state.next({submitCount:I.keepSubmitCount?o.submitCount:0,isDirty:De?!1:I.keepDirty?o.isDirty:!!(I.keepDefaultValues&&!xa(_,f)),isSubmitted:I.keepIsSubmitted?o.isSubmitted:!1,dirtyFields:De?{}:I.keepDirtyValues?I.keepDefaultValues&&m?rs(f,m):o.dirtyFields:I.keepDefaultValues&&_?rs(f,_):I.keepDirty?o.dirtyFields:{},touchedFields:I.keepTouched?o.touchedFields:{},errors:I.keepErrors?o.errors:{},isSubmitSuccessful:I.keepIsSubmitSuccessful?o.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:f})},H=(_,I)=>J(xn(_)?_(m):_,{...r.resetOptions,...I}),M=(_,I={})=>{const ee=Be(s,_),Ee=ee&&ee._f;if(Ee){const De=Ee.refs?Ee.refs[0]:Ee.ref;De.focus&&setTimeout(()=>{De.focus(),I.shouldSelect&&xn(De.select)&&De.select()})}},U=_=>{o={...o,..._}},je={control:{register:L,unregister:b,getFieldState:ue,handleSubmit:te,setError:Pe,_subscribe:Ze,_runSchema:z,_updateIsValidating:k,_focusError:ie,_getWatch:me,_getDirty:ne,_setValid:O,_setFieldArray:j,_setDisabledField:E,_setErrors:G,_getFieldArray:P,_reset:J,_resetDefaultValues:()=>xn(r.defaultValues)&&r.defaultValues().then(_=>{H(_,r.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:Z,_disableForm:W,_subjects:v,_proxyFormState:x,get _fields(){return s},get _formValues(){return m},get _state(){return c},set _state(_){c=_},get _defaultValues(){return f},get _names(){return h},set _names(_){h=_},get _formState(){return o},get _options(){return r},set _options(_){r={...r,..._}}},subscribe:Ue,trigger:Fe,register:L,handleSubmit:te,watch:Xe,setValue:ae,getValues:Ae,reset:H,resetField:ce,clearErrors:$e,unregister:b,setError:Pe,setFocus:M,getFieldState:ue};return{...je,formControl:je}}var ji=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const a=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const o=(Math.random()*16+a)%16|0;return(r=="x"?o:o&3|8).toString(16)})},Xd=(a,r,o={})=>o.shouldFocus||Tt(o.shouldFocus)?o.focusName||`${a}.${Tt(o.focusIndex)?r:o.focusIndex}.`:"",Wd=(a,r)=>[...a,...Bn(r)],Jd=a=>Array.isArray(a)?a.map(()=>{}):void 0;function ef(a,r,o){return[...a.slice(0,r),...Bn(o),...a.slice(r)]}var tf=(a,r,o)=>Array.isArray(a)?(Tt(a[o])&&(a[o]=void 0),a.splice(o,0,a.splice(r,1)[0]),a):[],nf=(a,r)=>[...Bn(r),...Bn(a)];function t_(a,r){let o=0;const s=[...a];for(const f of r)s.splice(f-o,1),o++;return ou(s).length?s:[]}var af=(a,r)=>Tt(r)?[]:t_(a,Bn(r).sort((o,s)=>o-s)),rf=(a,r,o)=>{[a[r],a[o]]=[a[o],a[r]]},qg=(a,r,o)=>(a[r]=o,a);function xw(a){const r=su(),{control:o=r,name:s,keyName:f="id",shouldUnregister:m,rules:c}=a,[h,g]=Ne.useState(o._getFieldArray(s)),y=Ne.useRef(o._getFieldArray(s).map(ji)),S=Ne.useRef(!1);o._names.array.add(s),Ne.useMemo(()=>c&&h.length>=0&&o.register(s,c),[o,s,h.length,c]),lu(()=>o._subjects.array.subscribe({next:({values:w,name:G})=>{if(G===s||!G){const T=Be(w,s);Array.isArray(T)&&(g(T),y.current=T.map(ji))}}}).unsubscribe,[o,s]);const x=Ne.useCallback(w=>{S.current=!0,o._setFieldArray(s,w)},[o,s]),A=(w,G)=>{const T=Bn(Mt(w)),R=Wd(o._getFieldArray(s),T);o._names.focus=Xd(s,R.length-1,G),y.current=Wd(y.current,T.map(ji)),x(R),g(R),o._setFieldArray(s,R,Wd,{argA:Jd(w)})},v=(w,G)=>{const T=Bn(Mt(w)),R=nf(o._getFieldArray(s),T);o._names.focus=Xd(s,0,G),y.current=nf(y.current,T.map(ji)),x(R),g(R),o._setFieldArray(s,R,nf,{argA:Jd(w)})},N=w=>{const G=af(o._getFieldArray(s),w);y.current=af(y.current,w),x(G),g(G),!Array.isArray(Be(o._fields,s))&&_t(o._fields,s,void 0),o._setFieldArray(s,G,af,{argA:w})},B=(w,G,T)=>{const R=Bn(Mt(G)),q=ef(o._getFieldArray(s),w,R);o._names.focus=Xd(s,w,T),y.current=ef(y.current,w,R.map(ji)),x(q),g(q),o._setFieldArray(s,q,ef,{argA:w,argB:Jd(G)})},O=(w,G)=>{const T=o._getFieldArray(s);rf(T,w,G),rf(y.current,w,G),x(T),g(T),o._setFieldArray(s,T,rf,{argA:w,argB:G},!1)},k=(w,G)=>{const T=o._getFieldArray(s);tf(T,w,G),tf(y.current,w,G),x(T),g(T),o._setFieldArray(s,T,tf,{argA:w,argB:G},!1)},K=(w,G)=>{const T=Mt(G),R=qg(o._getFieldArray(s),w,T);y.current=[...R].map((q,z)=>!q||z===w?ji():y.current[z]),x(R),g([...R]),o._setFieldArray(s,R,qg,{argA:w,argB:T},!0,!1)},j=w=>{const G=Bn(Mt(w));y.current=G.map(ji),x([...G]),g([...G]),o._setFieldArray(s,[...G],T=>T,{},!0,!1)};return Ne.useEffect(()=>{if(o._state.action=!1,Cf(s,o._names)&&o._subjects.state.next({...o._formState}),S.current&&(!io(o._options.mode).isOnSubmit||o._formState.isSubmitted)&&!io(o._options.reValidateMode).isOnSubmit)if(o._options.resolver)o._runSchema([s]).then(w=>{o._updateIsValidating([s]);const G=Be(w.errors,s),T=Be(o._formState.errors,s);(T?!G&&T.type||G&&(T.type!==G.type||T.message!==G.message):G&&G.type)&&(G?_t(o._formState.errors,s,G):Qt(o._formState.errors,s),o._subjects.state.next({errors:o._formState.errors}))});else{const w=Be(o._fields,s);w&&w._f&&!(io(o._options.reValidateMode).isOnSubmit&&io(o._options.mode).isOnSubmit)&&Sf(w,o._names.disabled,o._formValues,o._options.criteriaMode===da.all,o._options.shouldUseNativeValidation,!0).then(G=>!yn(G)&&o._subjects.state.next({errors:tD(o._formState.errors,G,s)}))}o._subjects.state.next({name:s,values:Mt(o._formValues)}),o._names.focus&&oo(o._fields,(w,G)=>{if(o._names.focus&&G.startsWith(o._names.focus)&&w.focus)return w.focus(),1}),o._names.focus="",o._setValid(),S.current=!1},[h,s,o]),Ne.useEffect(()=>(!Be(o._formValues,s)&&o._setFieldArray(s),()=>{const w=(G,T)=>{const R=Be(o._fields,G);R&&R._f&&(R._f.mount=T)};o._options.shouldUnregister||m?o.unregister(s):w(s,!1)}),[s,o,f,m]),{swap:Ne.useCallback(O,[x,s,o]),move:Ne.useCallback(k,[x,s,o]),prepend:Ne.useCallback(v,[x,s,o]),append:Ne.useCallback(A,[x,s,o]),remove:Ne.useCallback(N,[x,s,o]),insert:Ne.useCallback(B,[x,s,o]),update:Ne.useCallback(K,[x,s,o]),replace:Ne.useCallback(j,[x,s,o]),fields:Ne.useMemo(()=>h.map((w,G)=>({...w,[f]:y.current[G]||ji()})),[h,f])}}function nD(a={}){const r=Ne.useRef(void 0),o=Ne.useRef(void 0),[s,f]=Ne.useState({isDirty:!1,isValidating:!1,isLoading:xn(a.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:a.errors||{},disabled:a.disabled||!1,isReady:!1,defaultValues:xn(a.defaultValues)?void 0:a.defaultValues});if(!r.current)if(a.formControl)r.current={...a.formControl,formState:s},a.defaultValues&&!xn(a.defaultValues)&&a.formControl.reset(a.defaultValues,a.resetOptions);else{const{formControl:c,...h}=e_(a);r.current={...h,formState:s}}const m=r.current.control;return m._options=a,lu(()=>{const c=m._subscribe({formState:m._proxyFormState,callback:()=>f({...m._formState}),reRenderRoot:!0});return f(h=>({...h,isReady:!0})),m._formState.isReady=!0,c},[m]),Ne.useEffect(()=>m._disableForm(a.disabled),[m,a.disabled]),Ne.useEffect(()=>{a.mode&&(m._options.mode=a.mode),a.reValidateMode&&(m._options.reValidateMode=a.reValidateMode)},[m,a.mode,a.reValidateMode]),Ne.useEffect(()=>{a.errors&&(m._setErrors(a.errors),m._focusError())},[m,a.errors]),Ne.useEffect(()=>{a.shouldUnregister&&m._subjects.state.next({values:m._getWatch()})},[m,a.shouldUnregister]),Ne.useEffect(()=>{if(m._proxyFormState.isDirty){const c=m._getDirty();c!==s.isDirty&&m._subjects.state.next({isDirty:c})}},[m,s.isDirty]),Ne.useEffect(()=>{var c;a.values&&!xa(a.values,o.current)?(m._reset(a.values,{keepFieldsRef:!0,...m._options.resetOptions}),!((c=m._options.resetOptions)===null||c===void 0)&&c.keepIsValid||m._setValid(),o.current=a.values,f(h=>({...h}))):m._resetDefaultValues()},[m,a.values]),Ne.useEffect(()=>{m._state.mount||(m._setValid(),m._state.mount=!0),m._state.watch&&(m._state.watch=!1,m._subjects.state.next({...m._formState})),m._removeUnmounted()}),r.current.formState=Ne.useMemo(()=>G0(s,m),[m,s]),r.current}let os=[];const n_=(a,r)=>{if(a!=null&&r!=null)return os=[...os,[a,r]],()=>{os=os.filter(o=>o[1]!==r)}},aD=a=>{let{type:r}=a;typeof a=="string"&&(r=a);const o=[];typeof a=="string"?o.push({type:r}):o.push(a),os.forEach(([s,f])=>{typeof s=="string"&&s!==r||Array.isArray(s)&&!s.includes(r)||s instanceof RegExp&&!s.test(r)||typeof s=="function"&&!s(...o)||f(...o)})},iD=(a,r,o=[])=>(V.useEffect(()=>n_(a,r),o),aD);class ro{constructor(){this.cacheMap=new Map}static getInstance(){return ro.instance||(ro.instance=new ro),ro.instance}get(r){return this.cacheMap.get(r)}set(r,o){this.cacheMap.set(r,o)}delete(r){this.cacheMap.delete(r)}}const Fl=ro.getInstance();class rD{constructor(r,o,s={}){this.cacheKey=r,this.fetchData=o,this.options={strategy:"session",ttl:0,...s}}getCache(){const{strategy:r}=this.options;switch(r){case"local":return localStorage;case"memory":return Fl;default:return sessionStorage}}getCachedData(){const r=this.getCache(),o=this.options.strategy==="memory"?r.get(this.cacheKey):r.getItem(this.cacheKey);if(!o)return null;const s=JSON.parse(o);return this.options.ttl&&s.timestamp&&Date.now()-s.timestamp>this.options.ttl?(this.clearCache(),null):s.data}setCachedData(r){const o=this.getCache(),s=JSON.stringify({data:r,timestamp:Date.now()});this.options.strategy==="memory"?o.set(this.cacheKey,s):o.setItem(this.cacheKey,s)}clearCache(){const r=this.getCache();this.options.strategy==="memory"?r.delete(this.cacheKey):r.removeItem(this.cacheKey)}fetch(r=!1){const o=!r&&this.getCachedData();if(o)return Promise.resolve(o);const s=Fl.get(this.cacheKey);if(s?.promise)return s.promise;const f=this.fetchData().then(({data:m})=>(this.setCachedData(m),m)).finally(()=>{Fl.delete(this.cacheKey)});return Fl.set(this.cacheKey,{promise:f}),f}}const a_=a=>a?{...a,paymentMethods:a.paymentMethods||[],baseCurrency:a.baseCurrency||{}}:{paymentMethods:[],baseCurrency:{}},oD=V.createContext({api:ot}),{Provider:i_,Consumer:Cw}=oD,r_=(a=!1)=>{const r=localStorage.getItem("livemode")!=="false",o=`payment-settings-${window.location.pathname}-${r}`;return new rD(o,()=>ot.get("/api/settings",{params:{livemode:r}})).fetch(a)},o_=(a,r)=>r.reduce((s,f)=>s.concat(f.payment_currencies),[]).find(s=>s.id===a),s_=(a,r)=>r.find(o=>o.id===a);function sD({session:a,connect:r,children:o,baseUrl:s=void 0,authToken:f=void 0}){const[m,c]=V.useState(!1);f?window.__PAYMENT_KIT_AUTH_TOKEN=f:window.__PAYMENT_KIT_AUTH_TOKEN="",V.useEffect(()=>{(async()=>{if(!s){window.__PAYMENT_KIT_BASE_URL="",c(!1);return}const w=new URL(s);if(w.origin===window.location.origin){window.__PAYMENT_KIT_BASE_URL="",c(!1);return}c(!0);try{const G=Dt(w.origin,"__blocklet__.js?type=json"),T=`cross-origin-blocklet-${w.origin}`,q=await new rD(T,()=>zx.get(G).then($=>({data:$.data})),{strategy:"session",ttl:600*1e3}).fetch();if((q?.componentId||"").split("/").pop()===us)window.__PAYMENT_KIT_BASE_URL=Dt(w.origin,q.prefix||"/");else{const $=(q?.componentMountPoints||[]).find(re=>re?.did===us);window.__PAYMENT_KIT_BASE_URL=$?Dt(w.origin,$.mountPoint):s}}catch(G){console.warn(`Failed to fetch blocklet json from ${s}:`,G),window.__PAYMENT_KIT_BASE_URL=s}finally{c(!1)}})()},[s]);const[h,g]=Ox("livemode",{defaultValue:!0}),{data:y={paymentMethods:[],baseCurrency:{}},error:S,run:x,loading:A}=Pi(r_,{refreshDeps:[h]});iD(["paymentMethod.created","paymentMethod.updated","paymentCurrency.added","paymentCurrency.updated"],()=>x(!0),[x]);const v=Qn(),[N,B]=V.useState(!0),[O,k]=V.useState({paying:!1,stripePaying:!1}),K=j=>{k(w=>({...w,...j}))};return S?u.jsx(mr,{severity:"error",children:S.message}):A||m?null:u.jsx(i_,{value:{session:a,connect:r,prefix:v,livemode:!!h,settings:a_(y),getCurrency:j=>o_(j,y?.paymentMethods||[]),getMethod:j=>s_(j,y?.paymentMethods||[]),refresh:x,setLivemode:g,api:ot,payable:N,setPayable:B,paymentState:O,setPaymentState:K},children:o})}function _n(){return V.useContext(oD)}function l_(a){return a==="standalone"?{height:"100vh",maxHeight:"100%"}:{height:"auto",minHeight:200}}function so({title:a,description:r,button:o="Back",mode:s="standalone"}){const f=l_(s);return u.jsx(ge,{sx:[{alignItems:"center",justifyContent:"center"},...Array.isArray(f)?f:[f]],children:u.jsxs(ge,{direction:"column",sx:{alignItems:"center",justifyContent:"center",width:"280px"},children:[u.jsx(oe,{variant:"h5",sx:{mb:2},children:a}),u.jsx(oe,{variant:"body1",sx:{mb:2,textAlign:"center"},children:r}),typeof o=="string"?u.jsx(pt,{variant:"text",size:"small",sx:{color:"text.link"},component:cr,href:window.blocklet?.appUrl,children:o}):o]})})}function Lg(a){return u.jsxs(oe,{...a,sx:[{color:"text.lighter",fontSize:12},...Array.isArray(a.sx)?a.sx:[a.sx]],children:["Powered by"," ",u.jsx(oe,{component:"span",sx:{fontWeight:"bold",fontSize:12},children:"ArcBlock"})]})}var jl={exports:{}},Ig;function u_(){if(Ig)return jl.exports;Ig=1;const a=Px(),r=async(o,s)=>{s={interval:20,timeout:1/0,leadingCheck:!0,...s};let f;const m=new Promise((c,h)=>{const g=async()=>{try{const y=await o();if(typeof y!="boolean")throw new TypeError("Expected condition to return a boolean");y===!0?c():f=setTimeout(g,s.interval)}catch(y){h(y)}};s.leadingCheck?g():f=setTimeout(g,s.interval)});if(s.timeout!==1/0)try{return await a(m,s.timeout)}catch(c){throw f&&clearTimeout(f),c}return m};return jl.exports=r,jl.exports.default=r,jl.exports}var c_=u_();const lD=ri(c_);function uu(a){if(a==null)throw new TypeError("Expected a string but received a ".concat(a));if(a.constructor.name!=="String")throw new TypeError("Expected a string but received a ".concat(a.constructor.name))}function d_(a){return Object.prototype.toString.call(a)==="[object RegExp]"}function $g(a,r){for(var o=0;o<r.length;o++){var s=r[o];if(a===s||d_(s)&&s.test(a))return!0}return!1}function _f(a){"@babel/helpers - typeof";return _f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_f(a)}function of(a,r){uu(a);var o,s;_f(r)==="object"?(o=r.min||0,s=r.max):(o=arguments[1],s=arguments[2]);var f=encodeURI(a).split(/%..|./).length-1;return f>=o&&(typeof s>"u"||f<=s)}function Af(a){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Af(a)}function uD(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;(Af(a)!=="object"||a===null)&&(a={});for(var o in r)typeof a[o]>"u"&&(a[o]=r[o]);return a}var f_={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function m_(a,r){uu(a),r=uD(r,f_),r.allow_trailing_dot&&a[a.length-1]==="."&&(a=a.substring(0,a.length-1)),r.allow_wildcard===!0&&a.indexOf("*.")===0&&(a=a.substring(2));var o=a.split("."),s=o[o.length-1];return r.require_tld&&(o.length<2||!r.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(s)||/\s/.test(s))||!r.allow_numeric_tld&&/^\d+$/.test(s)?!1:o.every(function(f){return!(f.length>63&&!r.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(f)||/[\uff01-\uff5e]/.test(f)||/^-|-$/.test(f)||!r.allow_underscores&&/_/.test(f))})}function Ef(a){"@babel/helpers - typeof";return Ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ef(a)}var Vg="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",Mi="(".concat(Vg,"[.]){3}").concat(Vg),p_=new RegExp("^".concat(Mi,"$")),nn="(?:[0-9a-fA-F]{1,4})",h_=new RegExp("^("+"(?:".concat(nn,":){7}(?:").concat(nn,"|:)|")+"(?:".concat(nn,":){6}(?:").concat(Mi,"|:").concat(nn,"|:)|")+"(?:".concat(nn,":){5}(?::").concat(Mi,"|(:").concat(nn,"){1,2}|:)|")+"(?:".concat(nn,":){4}(?:(:").concat(nn,"){0,1}:").concat(Mi,"|(:").concat(nn,"){1,3}|:)|")+"(?:".concat(nn,":){3}(?:(:").concat(nn,"){0,2}:").concat(Mi,"|(:").concat(nn,"){1,4}|:)|")+"(?:".concat(nn,":){2}(?:(:").concat(nn,"){0,3}:").concat(Mi,"|(:").concat(nn,"){1,5}|:)|")+"(?:".concat(nn,":){1}(?:(:").concat(nn,"){0,4}:").concat(Mi,"|(:").concat(nn,"){1,6}|:)|")+"(?::((?::".concat(nn,"){0,5}:").concat(Mi,"|(?::").concat(nn,"){1,7}|:))")+")(%[0-9a-zA-Z.]{1,})?$");function Ql(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};uu(a);var o=(Ef(r)==="object"?r.version:arguments[1])||"";return o?o.toString()==="4"?p_.test(a):o.toString()==="6"?h_.test(a):!1:Ql(a,{version:4})||Ql(a,{version:6})}var y_={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},g_=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,D_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,v_=/^[a-z\d]+$/,b_=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,x_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,C_=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,S_=254;function __(a){var r=a.replace(/^"(.+)"$/,"$1");if(!r.trim())return!1;var o=/[\.";<>]/.test(r);if(o){if(r===a)return!1;var s=r.split('"').length===r.split('\\"').length;if(!s)return!1}return!0}function Hg(a,r){if(uu(a),r=uD(r,y_),r.require_display_name||r.allow_display_name){var o=a.match(g_);if(o){var s=o[1];if(a=a.replace(s,"").replace(/(^<|>$)/g,""),s.endsWith(" ")&&(s=s.slice(0,-1)),!__(s))return!1}else if(r.require_display_name)return!1}if(!r.ignore_max_length&&a.length>S_)return!1;var f=a.split("@"),m=f.pop(),c=m.toLowerCase();if(r.host_blacklist.length>0&&$g(c,r.host_blacklist)||r.host_whitelist.length>0&&!$g(c,r.host_whitelist))return!1;var h=f.join("@");if(r.domain_specific_validation&&(c==="gmail.com"||c==="googlemail.com")){h=h.toLowerCase();var g=h.split("+")[0];if(!of(g.replace(/\./g,""),{min:6,max:30}))return!1;for(var y=g.split("."),S=0;S<y.length;S++)if(!v_.test(y[S]))return!1}if(r.ignore_max_length===!1&&(!of(h,{max:64})||!of(m,{max:254})))return!1;if(!m_(m,{require_tld:r.require_tld,ignore_max_length:r.ignore_max_length,allow_underscores:r.allow_underscores})){if(!r.allow_ip_domain)return!1;if(!Ql(m)){if(!m.startsWith("[")||!m.endsWith("]"))return!1;var x=m.slice(1,-1);if(x.length===0||!Ql(x))return!1}}if(r.blacklisted_chars&&h.search(new RegExp("[".concat(r.blacklisted_chars,"]+"),"g"))!==-1)return!1;if(h[0]==='"'&&h[h.length-1]==='"')return h=h.slice(1,h.length-1),r.allow_utf8_local_part?C_.test(h):b_.test(h);for(var A=r.allow_utf8_local_part?x_:D_,v=h.split("."),N=0;N<v.length;N++)if(!A.test(v[N]))return!1;return!0}function Nn({children:a,required:r=!1,tooltip:o="",description:s="",boxSx:f={},...m}){return u.jsxs(Se,{sx:{mb:1,width:"100%",...f},children:[u.jsxs(Lb,{...m,sx:{display:"flex",alignItems:"center",gap:.5,fontSize:"0.875rem",fontWeight:500,color:"text.primary","&.MuiFormLabel-root":{display:"flex",alignItems:"center",gap:.5,fontWeight:500,color:"text.primary"},...m.sx||{}},children:[a,r&&u.jsx(oe,{component:"span",color:"error",children:"*"}),o&&(typeof o=="string"?u.jsx(Un,{title:o,children:u.jsx(i0,{fontSize:"small",sx:{opacity:.7,fontSize:"1rem"}})}):o)]}),s&&u.jsx(oe,{variant:"caption",sx:{color:"text.secondary"},children:s})]})}function A_({error:a}){return u.jsx(ls,{position:"end",children:u.jsx(oe,{component:"span",color:"error",children:a})})}function Xa({ref:a=void 0,name:r,label:o="",placeholder:s="",rules:f={},errorPosition:m="bottom",wrapperStyle:c={},inputProps:h={},required:g=!1,tooltip:y="",description:S="",layout:x="vertical",slotProps:A,...v}){const{control:N,formState:B}=hs(),O=cs(),k=jf(O.breakpoints.down("sm")),K=V.useRef(null);V.useImperativeHandle(a,()=>K.current);const j=yf(B.errors,r)?.message,w=x==="horizontal"&&!k,G={htmlInput:{...h,...A?.htmlInput},input:Object.assign(v.InputProps||{},A?.input||{},m==="right"&&j?{endAdornment:u.jsx(A_,{error:j})}:{})},T=()=>o?u.jsx(Nn,{required:g,tooltip:y,description:S,boxSx:w?{width:"fit-content",whiteSpace:"nowrap",minWidth:"fit-content"}:void 0,children:o}):null;return u.jsx(Yl,{name:r,control:N,rules:f,render:({field:R})=>u.jsx(Se,{sx:{width:"100%",...c},children:w?u.jsxs(ge,{direction:"row",spacing:2,sx:{alignItems:"center",justifyContent:"space-between"},children:[T(),u.jsx(Yn,{fullWidth:!1,error:!!j,helperText:m==="bottom"&&j?j:"",placeholder:s,size:"small",...R,...v,inputRef:K,slotProps:G,sx:{flex:1,...v.sx}})]}):u.jsxs(u.Fragment,{children:[T(),u.jsx(Yn,{fullWidth:!0,error:!!j,helperText:m==="bottom"&&j?j:"",placeholder:s,size:"small",...R,...v,inputRef:K,slotProps:G})]})})})}const E_="/.well-known/service/relay",cD=()=>yf(window,"blocklet.appPid")||yf(window,"blocklet.appId")||"",sf=a=>`relay:${cD()}:${a}`,w_=()=>window.location.protocol==="https:"?"wss:":"ws:",T_=()=>new URL(window.location.href).host;function cu(a){const r=V.useRef(null),o=V.useRef(null);return V.useEffect(()=>(cD()&&(!r.current||r.current.isConnected()===!1)&&(r.current=new qx(`${w_()}//${T_()}${E_}`,{longpollerTimeout:5e3,heartbeatIntervalMs:30*1e3}),r.current.connect()),()=>{r.current&&(r.current.disconnect(),r.current=null)}),[]),V.useEffect(()=>{{let s=!1;o.current?o.current.channel!==a&&(r.current?.unsubscribe(sf(o.current.channel)),s=!0):s=!0,s&&r.current&&(o.current=r.current.subscribe(sf(a)),o.current.channel=a)}return()=>{o.current&&(r.current?.unsubscribe(sf(o.current.channel)),o.current=null)}},[a]),o.current}const k_="md";function qi(a=k_){const r=cs();return{isMobile:jf(r.breakpoints.down(a)),mobileSize:`${r.breakpoints.values[a]}px`}}function F_(){try{return hs()}catch{return null}}function j_({ref:a,...r}){return u.jsx($b,{direction:"up",ref:a,timeout:200,...r})}function wf({ref:a=void 0,value:r,onChange:o,name:s="",sx:f={},showDialCode:m=!1,label:c="",bordered:h=!1,allowClear:g=!1,disabled:y=!1}){const S=F_(),[x,A]=V.useState(!1),[v,N]=V.useState(""),B=V.useRef(null),O=V.useRef(null),k=V.useRef(null),[K,j]=V.useState(-1),w=V.useRef(40),{isMobile:G}=qi(),T=V.useRef(!1);V.useEffect(()=>{if(!x)return()=>{};const D=()=>{T.current=!1};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[x]);const R=()=>{k.current&&(k.current.scrollTop=0)},q=()=>{if(!k.current||!x)return;const D=k.current.querySelectorAll(".MuiMenuItem-root");if(D.length>0){const F=D[0];F.offsetHeight>0&&(w.current=F.offsetHeight)}},z=D=>{if(!k.current)return;x&&!T.current&&(q(),T.current=!0);const F=k.current.clientHeight,ae=D*w.current;if(D<2)k.current.scrollTop=0;else if(D>$.length-3)k.current.scrollTop=k.current.scrollHeight-F;else{const be=ae-F/2+w.current/2;k.current.scrollTop=Math.max(0,be)}};V.useEffect(()=>{let D=null;return x?D=setTimeout(()=>{R(),!G&&B.current&&B.current.focus()},100):(N(""),j(-1)),()=>{D&&clearTimeout(D)}},[x,G]);const $=V.useMemo(()=>v?Bi.filter(D=>{const F=Wa(D);return F.name.toLowerCase().includes(v.toLowerCase())||F.iso2.toLowerCase().includes(v.toLowerCase())||`+${F.dialCode}`.includes(v)}):Bi,[v]);V.useEffect(()=>{R(),j(-1)},[v]),V.useEffect(()=>{let D=null;return K>=0&&(D=setTimeout(()=>{z(K)},10)),()=>{D&&clearTimeout(D)}},[K,$.length]);const re=V.useMemo(()=>{const D=Bi.find(F=>F[1]===r);return r&&D?Wa(D):{name:""}},[r]),Q=D=>{o(D),S&&s&&S.setValue(s,D),A(!1)},Z=D=>{D.preventDefault(),D.stopPropagation(),o(""),S&&s&&S.setValue(s,"")},ne=D=>{D.stopPropagation(),N(D.target.value)},me=D=>{if(D.stopPropagation(),D.key==="Escape"){A(!1);return}const F=ae=>{D.preventDefault(),j(be=>ae==="next"?be===-1||be>=$.length-1?0:be+1:be===-1||be<=0?$.length-1:be-1)};if(D.key==="Tab"){F(D.shiftKey?"prev":"next");return}if(D.key==="ArrowDown"){F("next");return}if(D.key==="ArrowUp"){F("prev");return}if(D.key==="Enter"&&K>=0&&K<$.length){D.preventDefault();const ae=Wa($[K]);Q(ae.iso2)}},P=u.jsxs(u.Fragment,{children:[u.jsx(Se,{sx:{position:"sticky",top:0,zIndex:1,bgcolor:"background.paper",p:1},onClick:D=>{D.stopPropagation()},children:u.jsx(Yn,{inputRef:B,autoFocus:!G,fullWidth:!0,placeholder:c||"Search country...",value:v,onChange:ne,onKeyDown:me,onClick:D=>D.stopPropagation(),size:"small",variant:"outlined",disabled:y})}),u.jsx(Se,{ref:k,sx:{flex:1,overflowY:"auto",overflowX:"hidden",maxHeight:G?"calc(60vh - 80px)":"calc(300px - 65px)",scrollBehavior:"smooth"},children:$.length>0?$.map((D,F)=>{const ae=Wa(D),be=F===K;return u.jsxs(Hy,{value:ae.iso2,selected:ae.iso2===r,onClick:()=>Q(ae.iso2),sx:{display:"flex",alignItems:"center","&.Mui-selected":{backgroundColor:"primary.lighter"},"&:hover":{backgroundColor:"grey.100"},...be?{backgroundColor:"grey.100",outline:"none"}:{}},children:[u.jsx(Nl,{iso2:ae.iso2,style:{marginRight:"8px"}}),u.jsx(oe,{children:ae.name}),m&&u.jsx(oe,{sx:{color:"text.secondary",ml:1},children:`+${ae.dialCode}`})]},ae.iso2)}):u.jsx(Hy,{disabled:!0,children:u.jsx(oe,{sx:{color:"text.secondary"},children:"No countries found"})})})]});return G?u.jsxs(Se,{ref:a,sx:{...f},children:[u.jsxs(Se,{onClick:()=>{y||A(!0)},sx:{display:"flex",alignItems:"center",flexWrap:"nowrap",gap:.5,cursor:"pointer",padding:"8px",paddingRight:"24px",position:"relative",...h?{}:{border:"none"},"-webkit-tap-highlight-color":"transparent",userSelect:"none",background:"none","&:hover, &:focus, &:active":{backgroundColor:"transparent",outline:"none"},...y?{backgroundColor:"grey.100",cursor:"not-allowed",color:"text.disabled","&:hover, &:focus, &:active":{backgroundColor:"grey.100",color:"text.disabled"}}:{},touchAction:"manipulation"},children:[r?u.jsxs(u.Fragment,{children:[u.jsx(Nl,{iso2:r,style:{display:"flex"}}),u.jsx(oe,{sx:{flex:1},children:re?.name}),g&&u.jsx(Se,{component:"button",type:"button",onClick:Z,onMouseDown:D=>{D.stopPropagation(),D.preventDefault()},onTouchStart:D=>{D.stopPropagation()},sx:{display:"flex",alignItems:"center",cursor:"pointer",p:.5,mr:1,borderRadius:"50%",border:"none",background:"transparent","&:hover":{backgroundColor:"action.hover"}},children:u.jsx(mf,{fontSize:"small"})})]}):u.jsx(oe,{sx:{color:"text.secondary",flex:1},children:c||"Select country..."}),u.jsx(Se,{sx:{position:"absolute",right:"8px",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"5px solid currentColor"}})]}),u.jsxs(lo,{open:x,onClose:()=>A(!1),fullWidth:!0,maxWidth:"xs",slotProps:{paper:{sx:{position:"absolute",bottom:0,m:0,p:0,borderBottomLeftRadius:0,borderBottomRightRadius:0,width:"100%"}}},slots:{transition:j_},children:[u.jsxs(Se,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[u.jsx(oe,{variant:"h6",children:"Select Country"}),u.jsx(ei,{edge:"end",onClick:()=>A(!1),sx:{"-webkit-tap-highlight-color":"transparent"},children:"✕"})]}),u.jsx(uo,{sx:{"&.MuiDialogContent-root":{p:0}},children:P})]})]}):u.jsx(Ib,{ref:a,open:x,onOpen:()=>A(!0),onClose:()=>A(!1),MenuProps:{style:{maxHeight:"300px",top:"10px"},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{ref:O,sx:{display:"flex","& .MuiList-root":{pt:0,display:"flex",flexDirection:"column",overflowY:"hidden",width:"100%"}}}},sx:{width:"100%",minWidth:"60px",fieldset:{display:"none"},'&.Mui-focused:has(div[aria-expanded="false"])':{fieldset:{display:"block"}},".MuiSelect-select":{padding:"8px",paddingRight:g&&r?"48px !important":"24px !important"},svg:{right:0},".MuiMenuItem-root":{justifyContent:"flex-start"},...f},value:r,onChange:D=>{o(D.target.value),S&&s&&S.setValue(s,D.target.value)},disabled:y,renderValue:D=>u.jsx(Se,{sx:{display:"flex",alignItems:"center",flexWrap:"nowrap",gap:.5,cursor:"pointer",width:"100%"},children:D?u.jsxs(ge,{direction:"row",sx:{alignItems:"center",gap:.5,justifyContent:"space-between",width:"100%"},children:[u.jsxs(ge,{direction:"row",sx:{alignItems:"center",gap:.5},children:[u.jsx(Nl,{iso2:D,style:{display:"flex"}}),u.jsx(oe,{sx:{flex:1},children:re?.name})]}),g&&r&&u.jsx(Se,{onClick:Z,onMouseDown:F=>{F.stopPropagation(),F.preventDefault()},onTouchStart:F=>{F.stopPropagation()},sx:{display:"flex",alignItems:"center",cursor:"pointer",p:0,borderRadius:"50%",border:"none",background:"transparent",zIndex:2,marginRight:"-28px","&:hover":{backgroundColor:"action.hover"}},children:u.jsx(mf,{fontSize:"small"})})]}):u.jsx(oe,{sx:{color:"text.secondary",flex:1},children:c||"Select country..."})}),children:P})}const to=/^\d{3}$/,xt=/^\d{4}$/,bt=/^\d{5}$/,ca=/^\d{6}$/,Yg={GB:/^GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\d{1,4}$/i,JE:/^JE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/i,GG:/^GY\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/i,IM:/^IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/i,US:/^\d{5}([ -]\d{4})?$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ ]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,DE:/^\d{5}$/,JP:/^\d{3}-?\d{4}$/,FR:/^\d{2}[ ]?\d{3}$/,AU:xt,IT:/^\d{5}$/,CH:xt,AT:xt,ES:/^\d{5}$/,NL:/^\d{4}[ ]?[A-Z]{2}$/i,BE:xt,DK:xt,SE:/^\d{3}[ ]?\d{2}$/,NO:xt,BR:/^\d{5}-?\d{3}$/,PT:/^\d{4}(-\d{3})?$/,FI:bt,AX:/^22\d{3}$/,KR:/^\d{5}$/,CN:/^\d{6}$/,TW:/^\d{3}(\d{2})?$/,SG:ca,DZ:bt,AD:/^AD\d{3}$/,AR:/^([A-HJ-NP-Z])?\d{4}([A-Z]{3})?$/i,AM:/^(37)?\d{4}$/,AZ:/^\d{4}$/,BH:/^((1[0-2]|[2-9])\d{2})?$/,BD:xt,BB:/^(BB\d{5})?$/i,BY:ca,BM:/^[A-Z]{2}[ ]?[A-Z0-9]{2}$/i,BA:/^\d{5}$/,IO:/^BBND 1ZZ$/i,BN:/^[A-Z]{2}[ ]?\d{4}$/i,BG:xt,KH:bt,CV:xt,CL:/^\d{7}$/,CR:/^\d{4,5}|\d{3}-\d{4}$/,HR:/^\d{5}$/,CY:xt,CZ:/^\d{3}[ ]?\d{2}$/,DO:bt,EC:/^([A-Z]\d{4}[A-Z]|(?:[A-Z]{2})?\d{6})?$/i,EG:bt,EE:bt,FO:to,GE:xt,GR:/^\d{3}[ ]?\d{2}$/,GL:/^39\d{2}$/,GT:bt,HT:/^\d{4}$/,HN:/^(?:\d{5})?$/,HU:xt,IS:to,IN:/^[1-9]\d{5}$/,ID:bt,IL:bt,JO:bt,KZ:ca,KE:bt,KW:bt,LA:bt,LV:xt,LB:/^(\d{4}([ ]?\d{4})?)?$/,LI:/^(948[5-9])|(949[0-7])$/,LT:bt,LU:xt,MK:xt,MY:bt,MV:bt,MT:/^[A-Z]{3}[ ]?\d{2,4}$/i,MU:/^(\d{3}[A-Z]{2}\d{3})?$/i,MX:bt,MD:xt,MC:/^980\d{2}$/,MA:bt,NP:bt,NZ:xt,NI:/^((\d{4}-)?\d{3}-\d{3}(-\d{1})?)?$/,NG:/^(\d{6})?$/,OM:/^(PC )?\d{3}$/i,PK:bt,PY:xt,PH:xt,PL:/^\d{2}-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,RO:ca,RU:ca,SM:/^4789\d$/,SA:bt,SN:bt,SK:/^\d{3}[ ]?\d{2}$/,SI:xt,ZA:xt,LK:bt,TJ:ca,TH:bt,TN:xt,TR:bt,TM:ca,UA:bt,UY:bt,UZ:ca,VA:/^00120$/,VE:xt,ZM:bt,AS:/^96799$/,CC:/^6799$/,CK:xt,RS:ca,ME:/^8\d{4}$/,CS:/^\d{5}$/,YU:/^\d{5}$/,CX:/^6798$/,ET:xt,FK:/^FIQQ 1ZZ$/i,NF:/^2899$/,FM:/^(9694[1-4])([ -]\d{4})?$/,GF:/^9[78]3\d{2}$/,GN:to,GP:/^9[78][01]\d{2}$/,GS:/^SIQQ 1ZZ$/i,GU:/^969[123]\d([ -]\d{4})?$/,GW:xt,HM:xt,IQ:bt,KG:ca,LR:xt,LS:to,MG:to,MH:/^969[67]\d([ -]\d{4})?$/,MN:ca,MP:/^9695[012]([ -]\d{4})?$/,MQ:/^9[78]2\d{2}$/,NC:/^988\d{2}$/,NE:xt,VI:/^008(([0-4]\d)|(5[01]))([ -]\d{4})?$/,VN:ca,PF:/^987\d{2}$/,PG:to,PM:/^9[78]5\d{2}$/,PN:/^PCRN 1ZZ$/i,PW:/^96940$/,RE:/^9[78]4\d{2}$/,SH:/^(ASCN|STHL) 1ZZ$/i,SJ:xt,SO:bt,SZ:/^[HLMS]\d{3}$/i,TC:/^TKCA 1ZZ$/i,WF:/^986\d{2}$/,XK:bt,YT:/^976\d{2}$/};function Tf(a,r){if(!a)return!0;try{const o=r?.toUpperCase();return o?!Yg[o]||Yg[o].test(a):!1}catch(o){return console.error(o),!1}}function gn(a,r,o="en"){if(!r||!r[a])return{};const s=r[a],f={};return s.pattern&&(f.pattern={value:new RegExp(s.pattern),message:s.pattern_message?.[o]||Ie("payment.checkout.invalid",o)}),f}function R_({mode:a,sx:r={},fieldValidation:o={},errorPosition:s="right"}){const{t:f,locale:m}=ft(),{control:c}=hs(),h=ba({control:c,name:"billing_address.country"});return a==="required"?u.jsx(Gn,{in:!0,children:u.jsx(ge,{className:"cko-payment-address cko-payment-form",sx:r,children:u.jsxs(ge,{direction:"column",className:"cko-payment-form",spacing:0,children:[u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.line1")}),u.jsx(Xa,{name:"billing_address.line1",rules:{required:f("payment.checkout.required"),...gn("billing_address.line1",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.line1")}),u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.city")}),u.jsx(Xa,{name:"billing_address.city",rules:{required:f("payment.checkout.required"),...gn("billing_address.city",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.city")}),u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.state")}),u.jsx(Xa,{name:"billing_address.state",rules:{required:f("payment.checkout.required"),...gn("billing_address.state",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.state")}),u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.postal_code")}),u.jsx(Xa,{name:"billing_address.postal_code",rules:{required:f("payment.checkout.required"),validate:g=>Tf(g,h)?!0:f("payment.checkout.invalid"),...gn("billing_address.postal_code",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.postal_code"),InputProps:{startAdornment:u.jsx(ls,{position:"start",style:{marginRight:"2px",marginLeft:"-8px"},children:u.jsx(Yl,{name:"billing_address.country",control:c,render:({field:g})=>u.jsx(wf,{...g,ref:g.ref,sx:{"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"}}})})})}})]})})}):u.jsx(Gn,{in:!0,children:u.jsx(ge,{className:"cko-payment-address cko-payment-form",sx:r,children:u.jsxs(ge,{direction:"column",className:"cko-payment-form",spacing:0,children:[u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.state")}),u.jsx(Xa,{name:"billing_address.state",rules:{required:f("payment.checkout.required"),...gn("billing_address.state",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.state")}),u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.postal_code")}),u.jsx(ge,{direction:"row",spacing:0,children:u.jsx(Xa,{name:"billing_address.postal_code",rules:{required:f("payment.checkout.required"),validate:g=>Tf(g,h)?!0:f("payment.checkout.invalid"),...gn("billing_address.postal_code",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.postal_code"),InputProps:{startAdornment:u.jsx(ls,{position:"start",style:{marginRight:"2px",marginLeft:"-8px"},children:u.jsx(Yl,{name:"billing_address.country",control:c,render:({field:g})=>u.jsx(wf,{...g,ref:g.ref,sx:{".MuiOutlinedInput-notchedOutline":{borderColor:"transparent !important"}}})})})}})})]})})})}function M_({value:a,currencies:r,onChange:o}){return u.jsx(N_,{className:"cko-currency-selector",count:r.length,style:{display:r.length>1?"grid":"block",width:"100%",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))"},children:r.map(s=>{const f=s.id===a;return u.jsx(pf,{variant:"outlined",onClick:()=>o(s.id,s.method?.id),className:f?"cko-payment-card":"cko-payment-card-unselect",children:u.jsxs(ge,{direction:"row",sx:{alignItems:"center",position:"relative"},children:[u.jsx(pr,{src:s.logo,alt:s.name,sx:{width:40,height:40,marginRight:"12px"}}),u.jsxs("div",{children:[u.jsx(oe,{variant:"h5",component:"div",sx:{fontSize:"16px",color:"text.primary",fontWeight:"500"},children:s.symbol}),u.jsx(oe,{gutterBottom:!0,sx:{color:"text.lighter",fontSize:14},children:s.method.name})]}),u.jsx(Vb,{checked:f,sx:{position:"absolute",right:0}})]})},s.id)})})}const N_=Zn("section")`
26
+ }`;var Ae=o(function(){return Function(Z,Me+"return "+ae).apply(void 0,ne)});if(Ae.source=ae,c(Ae))throw Ae;return Ae}return Yd=R,Yd}var fS=dS();const mS=ri(fS),Ll={refund:"refund",stakeReturn:"stake_return"},pS=Wl({common:{id:"ID",url:"URL",none:"None",createdAt:"Created At",updatedAt:"Updated At",billingPeriod:"Billing Period",resumesAt:"Resume At",actions:"Actions",options:"Options",advanced:"Advanced options",login:"Login to access this page",accessDenied:"You do not have permission to access other customer data",settings:"Settings",preview:"Preview",required:"Required",setup:"Setup",amount:"Amount",total:"Total",totalDue:"Total Due",subtotal:"Subtotal",status:"Status",livemode:"Test mode",afterTime:"After {time}",timeAgo:"{time} ago",save:"Save",saved:"Changes saved",remove:"Remove",removed:"Resource removed",confirm:"Confirm",clear:"Clear",show:"Show",hide:"Hide",selectTimeRange:"Select time range",startDate:"Start date",endDate:"End date",upload:"Upload",change:"Change",cancel:"Cancel",close:"Close",back:"Back",every:"every",per:"per {interval}",slash:"/ {interval}",unit:"units",edit:"Edit",quantity:"Quantity",yes:"Yes",no:"No",email:"Email",did:"DID",txHash:"Transaction",txGas:"Transaction Gas",delegateTxHash:"Delegate Transaction",stakeTxHash:"Stake Transaction",slashTxHash:"Slash Transaction",transferTxHash:"Transfer Transaction",mintTxHash:"Mint Transaction",pending:"Pending",failed:"Failed",completed:"Completed",creditTransaction:"Credit Transaction",creditAmount:"Credit Amount",remainingBalance:"Remaining Balance",credits:"credits",ofCredits:"of credits",creditActivity:{consumption:"Credit Consumed",paidGrant:"Credit Top-up",paidAmount:"Paid {amount}",promotionalGrant:"Bonus",resetGrant:"Credit Reset",repayment:"Repayment"},transferStatus:"Transaction Status",sourceData:"Source Data",viewGrant:"View Grant",viewSubscription:"Subscription Detail",view:"View",meterEvent:"Meter Event",source:"Source",viewDetail:"View Detail",viewTransactionDetail:"Transaction Detail",viewConsumptionDetail:"Consumption Detail",customer:"Customer",currency:"Currency",network:"Network",custom:"Custom",description:"Description",statementDescriptor:"Statement descriptor",loadMore:"View more {resource}",loadingMore:"Loading more {resource}...",noMore:"No more {resource}",copied:"Copied",previous:"Back",continue:"Continue",qty:"Qty {count}",each:"{unit} each",trial:"Free for {count} {interval}",billed:"billed {rule}",metered:"based on usage",minute:"minute",hour:"hour",day:"day",week:"week",month:"month",year:"year",hourly:"hourly",daily:"daily",weekly:"weekly",monthly:"monthly",yearly:"yearly",month3:"every 3 months",month6:"every 6 months",recurring:"every {count} {interval}",minutes:"minutes",hours:"hours",days:"days",weeks:"weeks",months:"months",years:"years",type:"type",donation:"Donation",recoverFrom:"Recovered From",quantityLimitPerCheckout:"Exceed purchase limit",quantityNotEnough:"Exceed inventory",amountPrecisionLimit:"Amount decimal places must be less than or equal to {precision}",saveAsDefaultPriceSuccess:"Set default price successfully",stakeAmount:"Stake Amount",slashStakeAmount:"Slash Stake Amount",know:"I know",relatedSubscription:"Subscription",subscriptionOrCredit:"Subscription / Credit",purchaseItems:"Purchase Items",connect:{defaultScan:"Use the following methods to complete this action",scan:"Use the following methods to complete this {action}",confirm:"Confirm",cancel:"Cancel"},paymentMethod:"Payment Method",viewInvoice:"Invoice Detail",submit:"Submit",expired:"Expired",consumed:"Consumed",nextCharge:"Next charge"},payment:{checkout:{contact:"Contact information",method:"Payment method",processing:"Processing",payment:"Pay",try:"Try for free",include:"This includes:",subscription:"Subscribe",donate:"Donate",select:"Select",selected:"Selected",noPricing:"No items to purchase",setup:"Subscribe",continue:"Confirm {action}",connect:"Connect and {action}",login:"Login to load and save contact information",next:{subscription:"View subscription",invoice:"View invoice",view:"View"},paymentRequired:"Payment Required",quote:{title:"Price Locked",locked:"Exchange rate locked",expired:"Quote updating...",expiredMessage:"Quote updating...",expiring:"Quote updating...",remaining:"Quote updates in {time}",currentRate:"Current Exchange Rate",expiresIn:"Updates in",exchangeRate:"Exchange Rate",provider:"Provider",source:"Source",dynamicItems:"Dynamic Pricing Items",dynamicPricingInfo:"Dynamic pricing: 1 {symbol} = {rate} {currency}",referenceUnavailable:"Reference price will update shortly.",rateLine:"1 {symbol} ≈ {rate}",validity:"Quote valid: {time}",lockedWithTime:"Price locked: {time}",lockExpired:"Price lock expired. Please re-confirm.",detailProvider:"Provider",detailUpdatedAt:"Last updated",detailValidity:"Quote validity",detailLock:"Price lock",detailPriceImpact:"Price impact",detailSlippage:"Slippage limit",detailRefresh:"Refresh quote",slippage:{title:"Slippage Limit",tooltip:"Set the minimum exchange rate you are willing to accept. If the rate falls below this value at payment time, the transaction will be rejected.",percentMode:"Percentage",rateMode:"Exact Rate",invalid:"Please enter a valid value",invalidPositive:"Please enter a value greater than 0",rateRequired:"Exchange rate information required",invalidRate:"Invalid exchange rate value",minAcceptableRate:"Minimum Acceptable Rate",maxPayableIncrease:"Maximum Payment Increase",percentInputLabel:"Slippage Percentage",rateInputLabel:"Minimum Acceptable Rate ({currency})",minRateHint:"Minimum acceptable rate: {rate} {currency}",maxPayableHint:"Maximum payment increase: +{percent}%"},slippageLimit:{title:"Slippage Limit Configuration",description:"Set the minimum exchange rate you are willing to accept. If the rate falls below this value, the transaction will pause and ask for your confirmation.",configTogglePercent:"Percentage",configToggleRate:"Exact Rate",recommended:"Recommended",derivedCurrentRate:"Current reference rate",derivedMinRate:"Minimum acceptable rate"},rateUpdateLine:"1 {symbol} ≈ {rate} · updates in {time}",updateHint:"Prices will auto-refresh after update.",lockExpiredTitle:"Price lock expired",lockExpiredDescription:"The lock window has ended. Please re-confirm the latest price.",lockExpiredConfirm:"Re-lock price",slippageExceededTitle:"Rate below slippage limit",slippageExceededDescription:"The current rate is below your minimum acceptable rate. Please refresh the quote and try again.",updated:{pleaseRetry:"Price updated, please resubmit"},priceUpdatedTitle:"Price updated",priceUpdatedDescriptionRate:"Due to TBA exchange rate changes, the amount has been recalculated.",priceUpdatedDescriptionRecalc:"The amount has been recalculated.",priceUpdatedNewTotalLabel:"Updated total",priceUpdatedOldTotal:"Previous total: {total}",priceUpdatedConfirm:"Confirm and continue"},staking:{title:"Staking Required",tooltip:"Staking is used to ensure that future invoices can be paid normally. Revoking the staking from DID Wallet means canceling the subscription."},stakingConfirm:"In this payment, the staked amount is separate from the product cost.",donation:{between:"Please enter an amount between {min} and {max}.",custom:"Custom Amount",select:"Select Amount",summary:"{total} supporters {totalAmount} {symbol}",empty:"No supporters yet",gaveTips:"{count} people gave tips",tipAmount:"Tip Amount",tabHint:"to switch amount",benefits:{one:"{name} will receive all tips",multiple:"Tips will be distributed to {count} beneficiaries",view:"Click to view details"},inactive:"Donation feature is not enabled",enable:"Enable Donation",enableSuccess:"Successfully enabled",configPrompt:"The donation feature is enabled. You can configure donation options in Payment Kit",configNow:"Configure Now",later:"Configure Later",configTip:"Configure donation settings in Payment Kit"},cardPay:"{action} with bank card",skipPaymentMethod:"Skip, bind later",empty:"Nothing to pay",per:"per",pay:"Pay {payee}",try1:"Try {name}",try2:"Try {name} and {count} more",sub1:"Subscribe to {name}",sub2:"Subscribe to {name} and {count} more",then:"Then {subscription} {recurring}",meteredThen:"Then {recurring} based on usage",metered:"{recurring} based on usage",free:"{count} {interval} free",least:"continue with at least",completed:{payment:"Purchase successful",subscription:"Subscription successful",setup:"Subscription successful",donate:"Donation successful",tip:"A payment to {payee} has been completed. You can view the details of this payment in your account.",summary:{paid:"You've paid {amount}"}},vendor:{accountRequired:"This action requires a unified account. Please switch accounts and try again.",processing:"Processing...",progress:"Progress {progress}%",delivered:"Installation completed",failed:"Processing failed",failedMsg:"An exception occurred during installation. We will automatically process a refund for you. We apologize for the inconvenience. Thank you for your understanding!",launcher:{processing:"Installing {name}",completed:"{name} installed successfully",failed:"Failed to install {name}"},didnames:{processing:"Domain ({name}) registering",completed:"Domain ({name}) registered successfully",failed:"Domain ({name}) registered failed"},arcSphereToast:"Successfully installed, three seconds to return to the page continue..."},priceChange:{unavailable:"Unable to fetch exchange rate. Please try again later.",unstable:"Price is volatile. Please try again later.",title:"Price Changed",description:"Price changed significantly. Please refresh the quote and try again.",action:"Refresh Quote",cancel:"Cancel"},confirm:{withStake:"By confirming, you allow {payee} to charge your account for future payments and, if necessary, slash your stake. You can cancel your subscription or withdraw your stake at any time.",withoutStake:"By confirming, you allow {payee} to charge your account for future payments. You can cancel your subscription at any time."},required:"Required",invalid:"Invalid",billing:{auto:"Country",required:"Billing address",country:"Country",state:"State or province",city:"City or town",line1:"Address",line2:"Line2",postal_code:"Postal code"},customer:{name:"Name",email:"Email",phone:"Phone",phonePlaceholder:"Phone number",phoneTip:"In case we need to contact you about your order"},customerInfo:"Customer Information",upsell:{save:"Save with {recurring} billing",revert:"Switch to {recurring} billing",off:"{saving}% off"},cross_sell:{add:"Add to order",remove:"Remove from order"},dynamicPricing:"Dynamic Price",credit:{normal:{oneTime:"Purchase {amount}.",oneTimeWithExpiry:"Purchase {amount} (valid for {duration} {unit}).",recurring:"Subscription: {amount} {period}.",recurringWithExpiry:"Subscription: {amount} {period} (valid for {duration} {unit})."},pending:{notEnough:"You have a usage overage of {amount}. To restore access, a minimum purchase of {quantity} units is required.",oneTimeEnough:"You have a usage overage of {amount}. This purchase adds {totalAmount}. After covering the overage, your new available balance will be {availableAmount}.",oneTimeEnoughWithExpiry:"You have a usage overage of {amount}. This purchase adds {totalAmount} (valid for {duration} {unit}). After covering the overage, your new available balance will be {availableAmount}.",recurringEnough:"You have a usage overage of {amount}. This subscription adds {totalAmount} {period}. After covering the overage, your new available balance will be {availableAmount}.",recurringEnoughWithExpiry:"You have a usage overage of {amount}. This subscription adds {totalAmount} {period} (valid for {duration} {unit}). After covering the overage, your new available balance will be {availableAmount}."},schedule:{periodic:"Grant {amount} every {interval}.",withRefresh:"Grant {amount} every {interval}; unused credits expire with the next grant."},topupDescription:"Purchase {creditName} at {unitPrice} per credit."},expired:{title:"Expired Link",description:"This link has expired. This means that your payment has already been processed or your session has expired."},complete:{title:"Checkout Completed",description:"This checkout session has completed. This means that your payment has already been successfully processed."},emptyItems:{title:"Nothing to show here",description:"It seems this checkout session is not configured properly"},stopAcceptingOrders:{title:"Service Suspended",description:"New order placement is temporarily unavailable due to a system-level service suspension."},error:{title:"Something went wrong"},orderSummary:"Order Summary",orderSummarySubtitle:"Items included in this purchase",paymentDetails:"Payment Details",productListTotal:"Includes {total} items",headerTitle:{subscribe:"Subscribe to {name}",purchase:"Purchase {name}"},planFeatures:"Plan Features",typeBadge:{subscription:"SUBSCRIPTION",topup:"TOP-UP",oneTime:"ONE-TIME"},subtitle:{subscriptionInterval:"{interval} subscription",creditsTopup:"Credits top-up",addonFor:"Add-on for {product}",oneTime:"One-time purchase"},creditTopup:{title:"Get {name}",question:"How many {symbol} do you want?",credits:"Credits",increment:"Increments of {step} {symbol}",validFor:"Credits are valid for {duration} {unit} after purchase.",willReceive:"You'll receive",packInfo:"Includes {packs} credit packs ({perPack} per pack)",autoMatch:"We'll automatically match the closest credit pack.",autoMatchTooltip:"{symbol} are sold in packs of {step}",pendingWarning:"You have a usage overage of {pendingAmount}. You need at least {minCredits} to restore access.",pendingEnough:"You have a usage overage of {pendingAmount}. After covering the overage, your available balance will be {availableAmount}."},promotion:{add_code:"Add promotion code",enter_code:"Enter promotion code",placeholder:"Enter code",apply:"Apply",applied:"Applied promotion codes",dialog:{title:"Add promotion code"},error:{unknown:"Unknown error",network:"Network error occurred",removal:"Failed to remove code"}},coupon:{noDiscount:"No discount",percentage:"{percent}% off",fixedAmount:"{amount} {symbol} off",terms:{forever:"{couponOff} forever",once:"{couponOff} once",repeating:"{couponOff} for {months} month{months > 1 ? 's' : ''}"}},connectModal:{title:"{action}",scan:"Use the following methods to complete this payment",confirm:"Confirm",cancel:"Cancel"},fastPay:{title:"Confirm Payment",confirmMessage:"You will pay {amount} {symbol} from {sourceType}.",autoPaymentReason:"Your payment will be processed automatically as your account has sufficient balance. Please confirm the following details before proceeding.",payer:"Account",amount:"Amount",failed:"Account changed, please pay manually.",balanceLink:"View Balance",credit:{title:"Confirm Credit Payment",availableAmount:"Available Credit: {amount}",confirmMessage:"You will use {amount} credits to subscribe to this service.",meteringSubscriptionMessage:"This subscription service will deduct credits in real-time based on actual usage. You currently have {available} credits available. Confirm to continue?",insufficientTitle:"Insufficient Credit",insufficientMessage:"This subscription service will deduct credits in real-time based on actual usage. You currently have insufficient credits. Please top up your credits first."}}},autoTopup:{title:"Auto Top-Up",enableLabel:"Auto Top-Up",purchaseConfig:"Credit Purchase Configuration",triggerThreshold:"When credits are below",thresholdPlaceholder:"Enter threshold amount",thresholdDescription:"Credits remaining to trigger auto top-up",thresholdMinError:"Threshold must be greater than 0",thresholdFormatError:"Please enter a valid number",creditsIncluded:"{num} included",purchaseBelow:"Purchase this package",perPackage:"per package",quantity:"Quantity",selectPaymentMethod:"Select payment method",paymentInformation:"Payment Information",saveConfiguration:"Save Configuration",saveSuccess:"Auto top-up configuration saved successfully",disableSuccess:"Auto top-up disabled successfully",authorizationRequired:"Payment authorization is required to complete the setup",cryptoAuthorizationNote:"You will need to authorize payments from your wallet to enable automatic top-ups",tip:"With auto top-up enabled, the system automatically buys the specified credit package when your balance drops below the threshold.",authTitle:"Auto Top-Up Authorization",authTip:"Please complete the authorization process to enable automatic top-up",rechargeAmount:"Top-up Amount per Time",currentPaymentMethod:"Current Payment Method",changePaymentMethod:"Change Payment Method",keepCurrent:"Keep Current",changePaymentMethodTip:"You will be redirected to set up a new payment method when saving.",noPaymentMethodSetup:"No payment method configured. Please set up a payment method first.",addFunds:"Add Funds",advanced:"Advanced Options",enabled:"Enabled",disabled:"Disabled",notConfigured:"Auto Top-Up not configured",setup:"Enable Auto Top-Up",ruleDisplay:"When balance < {threshold}, top-up {amount} to get {credits} credits",activeDescription:"Auto top-up is enabled. When Credits drop below {threshold}, the system will automatically purchase {credits} Credits for {amount}",activeDescriptionWithCredits:"Auto top-up is enabled. When Credits drop below {threshold}, the system will automatically purchase {credits}.",purchaseAmount:"Purchase Amount",paymentMethod:"Payment Method",walletBalance:"Wallet Balance",paymentAddress:"Payment Address",inactiveDescription:"Enable auto top-up to automatically renew when {name} are insufficient, effectively avoiding service interruptions.",showDetails:"Show Method",hideDetails:"Hide Method",dailyLimits:{maxAmount:"Daily Top-up Amount Limit",maxAmountPlaceholder:"0 means unlimited",maxAmountDescription:"The maximum amount of top-up you can make each day, 0 means unlimited",maxAttempts:"Daily Top-up Attempts Limit",maxAttemptsPlaceholder:"0 means unlimited",maxAttemptsDescription:"The maximum number of top-up attempts you can make each day, 0 means unlimited"},dynamicPricing:{title:"Dynamic Pricing",currentRate:"Current Exchange Rate",slippageTolerance:"Slippage Tolerance",minAcceptableRate:"Min Acceptable Rate",configureSlippage:"Configure Slippage"}},customer:{payments:"Payment History",invoices:"Invoice History",details:"Details",summary:"Summary",products:"Products",update:"Update Information",empty:"It seems you do not have any subscriptions or payments here",cancel:{button:"Unsubscribe",title:"Cancel your subscription",comment:"Any additional feedback?",description:"Your subscription will be canceled, but it is still available until the end of your current billing period on {date}.",trialDescription:"Free trial subscriptions will be canceled immediately and no longer available, confirm to continue.",feedback:{tip:"We would love your feedback, it will help us improve our service",too_expensive:"The service is too expensive",missing_features:"Features are missing for this service",switched_service:"I have switched to an alternative service",unused:"I no longer use this service",customer_service:"The customer service is poor",too_complex:"The service is too complex to use",low_quality:"The service does not work well",other:"Other reasons"}},pastDue:{button:"Pay",invoices:"Past Due Invoices",warning:"Past due invoices need to be paid immediately, otherwise you cannot make new purchases anymore.",alert:{title:"You have unpaid invoices",customMessage:"Please pay immediately, otherwise new purchases or subscriptions will be prohibited.",confirm:"Pay Now"},view:"View Due Invoices"},recover:{button:"Resume Subscription",title:"Resume Your Subscription",description:"Your subscription will not be canceled and will be automatically renewed on {date}, please confirm to continue.",success:"Subscription resumed successfully",reStakeTitle:"Re-stake to resume subscription",stakeRequiredDescription:"Your previous stake has been revoked. You need to re-stake to resume your subscription.",stakeWarning:"Please ensure you have sufficient balance for staking before proceeding."},changePlan:{button:"Change Plan",current:"Current",pay:"Payment Required",scan:"Complete the payment to upgrade your subscription",success:"Your subscription is successfully upgraded",error:"Failed to upgrade your subscription",config:"Switch to another plan or billing cycle",confirm:"Confirm changes to your subscription",summary:"What you will pay for starting {date}",total:"Total (metered items excluded)",appliedCredit:"Credit applied",newCredit:"Credit issued",remaining:"Amount due today",tableNotFound:"Plan updates are not available"},changePayment:{limit:"Your changes to payment method will not affect existing open or past-due invoices, all future payments will use the new payment method unless you change it again.",review:"Review subscription items",select:"Select payment method",submit:"Confirm change",confirm:"By confirming this change, you allow {payee} to charge {symbol} from your account for future payments in accordance with their terms. You can always change your payment method.",completed:"Your payment method has been successfully updated, all future payments will use the new payment method unless you change it again.",title:"Payment Method Change",reauthorizationRequired:"Slippage settings updated. Re-authorization required to ensure sufficient allowance.",reauthorizationTitle:"Re-authorize Payment",reauthorizationCompleted:"Payment authorization has been successfully updated."},invoice:{summary:"Summary",details:"Details",download:"Download PDF",unitPrice:"Unit Price",amountPaid:"Amount Paid",rawQuantity:"Raw Quantity: {quantity}",amountDue:"Amount Due",amountApplied:"Applied Credit",pay:"Pay this invoice",paySuccess:"You have successfully paid the invoice",payProcessing:"Payment is being processed, please refresh in a moment",payError:"Failed to pay the invoice",sync:"Sync Status",syncing:"Syncing...",syncSuccess:"Synced successfully",renew:"Renew the subscription",renewSuccess:"You have successfully renewed the subscription",renewError:"Failed to renew the subscription",empty:"There are no invoices",next:"No invoices yet, next invoice will be generated on {date}",invoiceNumber:"Invoice Number",emptyList:"No Invoices",noPaymentRequired:"No Payment Required",slippageExceeded:"Slippage Exceeded",slippageExceededDetail:"Exchange rate slippage exceeded threshold, auto-payment failed. Current rate {currentRate}, minimum acceptable {minRate}",payBatch:"Pay Due Invoices",stripePayDescription:"Complete payment using your saved payment method or add a new one.",amount:"Amount",paymentConfirmTitle:"Payment Confirmation",paymentConfirmDescription:"After completing this payment, the payment method you use will be automatically set as the default for this subscription. Additionally, we will retry payment for any other unpaid invoices associated with this subscription.",continue:"Continue",priceChanged:"The exchange rate has changed by {percent}%. The payment amount will be updated. Do you want to continue?",paymentCancelled:"Payment cancelled",credit:"Credit",creditRefresh:"Refresh every {interval} {unit}",quote:{exchangeRate:"Exchange Rate",baseAmount:"Base Amount",providers:"Providers",rateTimestamp:"Rate Timestamp",consensusMethod:"Consensus",rateStatus:"Rate Status",rateStatusNormal:"Normal",rateStatusDegraded:"Degraded",slippage:"Slippage",atPaymentRate:"(at payment rate {rate})"}},overduePayment:{setupPaymentDescription:"Use your saved card or add a new one to complete payment via Stripe.",totalAmount:"Total Amount"},payment:{empty:"There are no payments",emptyList:"No Payments"},refund:{empty:"There are no refunds",emptyList:"No Refunds"},subscriptions:{plan:"Plan",nextInvoice:"Next Invoice",title:"Manage subscriptions",view:"Manage Subscription",current:"Current subscription",viewAll:"View all",empty:"There are no subscriptions here",changePayment:"Change payment method",trialLeft:"Trial Left",owner:"Subscription Owner"},overdue:{title:"You have {count} due invoices for {subscriptionCount} subscriptions, totaling {total} {symbol}{method}. ",simpleTitle:"You have {count} due invoices. ",empty:"Great! You have no due invoices.",defaultAlert:"Please pay immediately to avoid service disruption."}},invoice:{reason:{creation:"Subscription create",cycle:"Subscription cycle",staking:"Subscription staking",update:"Subscription update",recover:"Subscription recover",threshold:"Metered usage billing",cancel:"Subscription cancel",manual:"Manual invoice",upcoming:"Upcoming invoice",slashStake:"Slash stake",stake:"Stake",payment:"Payment",returnStake:"Return stake",stakeForChangePlan:"Subscription plan update",stakeForChangePayment:"Subscription payment method update",recharge:"Add funds",rechargeForSubscription:"Add funds for subscription",overdraftProtection:"SubGuard™ Fee",stakeForSubscriptionOverdraftProtection:"SubGuard™",reStakeToResumeSubscription:"Subscription resume",gas:"Gas",fee:"Fee"}},subscription:{overdue:{simpleTitle:"There are {count} due invoices for your subscription {name}, you need to pay them to activate your subscription or before making new purchases.",title:"There are {count} due invoices for your subscription {name}, the total due amount is {total} {symbol}{method}, you need to pay them to activate your subscription or before making new purchases.",payNow:"Pay Now",notSupport:"This payment method is not supported",total:"Total {total} {currency}{method}",view:"View Subscription Details",viewNow:"View Now",pastDue:"Past Due Invoices",description:"If you have any questions, you can choose ",list:"Past Due Invoices:",empty:"There are no overdue invoices for your subscription {name}.",retry:"Retry",paid:"Paid",processing:"Processing"}},dynamicPricing:{unavailable:{title:"Unable to Calculate Real-Time Price",message:"Exchange rate service is currently unavailable. Products with dynamic pricing cannot be purchased at this moment.",retry:"Retry"}}},refund:{type:{[Ll.refund]:"Refund",[Ll.stakeReturn]:"Stake Return"}},empty:{records:"No matching records found"},benefits:{title:"{count} Beneficiaries"}}),hS=Wl({common:{id:"ID",url:"URL",none:"无",createdAt:"创建时间",updatedAt:"更新时间",billingPeriod:"账单周期",resumesAt:"恢复时间",actions:"操作",options:"选项",advanced:"高级选项",settings:"设置",preview:"预览",required:"必填",setup:"设置",login:"登录以访问此页面",accessDenied:"您无权访问其他客户的数据",amount:"金额",total:"总计",totalDue:"应付总额",subtotal:"小计",status:"状态",livemode:"测试模式",afterTime:"在{time}后",timeAgo:"{time}前",save:"保存",saved:"更改已保存",remove:"删除",removed:"资源已删除",upload:"上传",change:"更换",confirm:"确认",cancel:"取消",clear:"清空",show:"显示",hide:"隐藏",selectTimeRange:"选择时间范围",startDate:"开始日期",endDate:"结束日期",close:"关闭",back:"返回",every:"每",per:"每{interval}",slash:"每{interval}",unit:"件",edit:"编辑",quantity:"数量",yes:"是",no:"否",email:"邮箱",did:"DID",txHash:"交易哈希",txGas:"交易费用",delegateTxHash:"授权交易",stakeTxHash:"质押交易",slashTxHash:"罚没交易",transferTxHash:"扣款交易",mintTxHash:"铸造交易",pending:"处理中",failed:"失败",completed:"已完成",creditTransaction:"信用交易",creditAmount:"信用额度",remainingBalance:"剩余余额",credits:"额度",ofCredits:"额度",creditActivity:{consumption:"额度消耗",paidGrant:"额度充值",paidAmount:"支付 {amount}",promotionalGrant:"赠送",resetGrant:"额度重置",repayment:"支付欠费"},transferStatus:"交易状态",sourceData:"源数据",viewGrant:"查看额度",viewSubscription:"订阅详情",view:"查看",meterEvent:"计量事件",source:"来源",viewDetail:"查看详情",viewTransactionDetail:"交易详情",viewConsumptionDetail:"消费详情",customer:"客户",currency:"币种",network:"网络",custom:"自定义",description:"描述",statementDescriptor:"声明描述",loadMore:"查看更多{resource}",loadingMore:"正在加载更多{resource}...",noMore:"没有更多{resource}",copied:"已复制",previous:"返回",continue:"继续",qty:"{count} 件",each:"每件 {unit}",trial:"免费试用 {count} {interval}",billed:"{rule}收费",metered:"按用量",minute:"分钟",hour:"小时",day:"天",week:"周",month:"月",year:"年",hourly:"每小时",daily:"每天",weekly:"每周",monthly:"每月",yearly:"每年",month3:"每季度",month6:"每半年",recurring:"每{count}{interval}",minutes:"分钟",hours:"小时",days:"天",weeks:"周",months:"月",years:"年",type:"类型",donation:"打赏",recoverFrom:"恢复自",quantityLimitPerCheckout:"超出购买限制",quantityNotEnough:"库存不足",amountPrecisionLimit:"金额小数位数必须在 {precision} 位以内",saveAsDefaultPriceSuccess:"设置默认价格成功",stakeAmount:"质押金额",slashStakeAmount:"罚没金额",know:"我知道了",relatedSubscription:"订阅",subscriptionOrCredit:"订阅 / 额度",purchaseItems:"购买项",connect:{defaultScan:"使用以下方式完成本次操作",scan:"使用以下方式完成本次{action}",confirm:"确认",cancel:"取消"},paymentMethod:"支付方式",viewInvoice:"账单详情",submit:"提交",expired:"已过期",consumed:"已消费",nextCharge:"下次扣款"},payment:{checkout:{contact:"联系信息",method:"支付方式",processing:"处理中",payment:"支付",try:"免费试用",include:"包括:",subscription:"订阅",donate:"捐赠",select:"选择",selected:"已选",noPricing:"没有可购买的物品",setup:"订阅",continue:"确认{action}",connect:"连接并{action}",login:"登录以加载并保存联系信息",next:{subscription:"查看订阅",invoice:"查看账单",view:"查看"},paymentRequired:"支付金额",quote:{title:"价格已锁定",locked:"汇率已锁定",expired:"报价更新中…",expiredMessage:"报价更新中…",expiring:"报价更新中…",remaining:"报价将在 {time} 后更新",currentRate:"当前汇率",expiresIn:"更新时间",exchangeRate:"汇率",provider:"数据提供方",source:"数据来源",dynamicItems:"动态定价商品",dynamicPricingInfo:"动态计价:1 {symbol} = {rate} {currency}",referenceUnavailable:"稍后更新",rateLine:"1 {symbol} ≈ {rate}",validity:"报价有效期:{time}",lockedWithTime:"价格已锁定:{time}",lockExpired:"价格锁定已过期,请重新确认",detailProvider:"数据源",detailUpdatedAt:"最近更新",detailValidity:"报价有效期",detailLock:"锁价剩余",detailPriceImpact:"价格影响",detailSlippage:"滑点下限",detailRefresh:"刷新报价",slippage:{title:"滑点下限",tooltip:"设置您愿意接受的最低汇率。支付时汇率低于此值,交易将被拒绝。",percentMode:"百分比",rateMode:"精确汇率",invalid:"请输入有效的数值",invalidPositive:"请输入大于 0 的数值",rateRequired:"需要汇率信息",invalidRate:"无效的汇率值",minAcceptableRate:"最低可接受汇率",maxPayableIncrease:"最大支付增幅",percentInputLabel:"滑点百分比",rateInputLabel:"最低可接受汇率 ({currency})",minRateHint:"最低可接受汇率: {rate} {currency}",maxPayableHint:"最大支付增幅: +{percent}%"},slippageLimit:{title:"滑点下限配置",description:"设置您愿意接受的最低汇率。支付时汇率低于此值,交易将被暂停并提示您确认。",configTogglePercent:"百分比",configToggleRate:"精确汇率",recommended:"推荐",derivedCurrentRate:"当前参考汇率",derivedMinRate:"最低可接受汇率"},rateUpdateLine:"1 {symbol} ≈ {rate} · {time} 后自动更新",updateHint:"更新后将自动刷新价格",lockExpiredTitle:"价格已过期",lockExpiredDescription:"锁定时间已结束,请重新确认价格后继续支付。",lockExpiredConfirm:"重新锁定价格",slippageExceededTitle:"汇率低于滑点下限",slippageExceededDescription:"当前汇率低于您设置的最低可接受汇率。请刷新报价后重试。",updated:{pleaseRetry:"价格已更新,请重新提交"},priceUpdatedTitle:"价格已更新",priceUpdatedDescriptionRate:"由于 TBA 汇率变化,系统已重新计算本次金额。",priceUpdatedDescriptionRecalc:"系统已重新计算本次金额。",priceUpdatedNewTotalLabel:"更新后总计",priceUpdatedOldTotal:"原总计:{total}",priceUpdatedConfirm:"确认并继续支付"},staking:{title:"质押金额",tooltip:"质押相当于保证金,用于确保未来的账单能够正常扣款,如果你从 DID Wallet 撤销质押,订阅也会被取消。"},stakingConfirm:"在此支付中,质押金额与产品费用分开",donation:{between:"金额必须大于 {min} 且小于 {max}",custom:"输入金额",select:"选择金额",summary:"共有 {total} 人支持 {totalAmount} {symbol}",empty:"❤️ 支持一下",gaveTips:"已有 {count} 人打赏",tipAmount:"打赏金额",tabHint:"快速切换金额",benefits:{one:"{name} 将获得全部打赏",multiple:"打赏将按比例分配给 {count} 位受益人",view:"点击查看详情"},inactive:"打赏功能暂未开启",enable:"启用打赏",enableSuccess:"启用成功",configPrompt:"打赏功能已启用,您可以前往 Payment Kit 进一步配置打赏选项",configNow:"立即配置",later:"稍后配置",configTip:"前往 Payment Kit 配置打赏选项"},cardPay:"使用银行卡{action}",skipPaymentMethod:"跳过,稍后绑定",empty:"没有可支付的项目",per:"每",pay:"付款给 {payee}",try1:"免费试用 {name}",try2:"免费试用 {name} 等{count}个产品",sub1:"订阅 {name}",sub2:"订阅 {name} 等{count}个产品",then:"然后 {subscription} {recurring}",meteredThen:"然后{recurring}按用量计费",metered:"{recurring}按用量计费",free:"免费试用 {count} {interval}",least:"至少",completed:{payment:"购买成功",subscription:"订阅成功",setup:"订阅成功",donate:"捐赠成功",tip:"向 {payee} 的付款已完成。您可以在您的账户中查看此付款的详细信息。",summary:{paid:"本次支付 {amount}"}},vendor:{accountRequired:"您当前使用的是非统一账户登录,此服务需要您使用统一账户。请切换到统一账户登录后重试。",processing:"正在安装中...",progress:"进度 {progress}%",delivered:"安装成功",failed:"安装失败",failedMsg:"很抱歉,安装过程中遇到了一些问题。我们正在处理这个问题,稍后会自动为您退款。感谢您的耐心等待!",launcher:{processing:"正在安装 {name}",completed:"安装 {name} 成功",failed:"安装 {name} 失败"},didnames:{processing:"正在注册 {name}",completed:"注册 {name} 成功",failed:"注册 {name} 失败"},arcSphereToast:"支付并安装成功,三秒后返回页面继续..."},priceChange:{unavailable:"无法获取汇率,请稍后重试。",unstable:"当前汇率波动较大,请稍后重试。",title:"汇率变化",description:"汇率变化较大,请刷新报价后重试。",action:"刷新报价",cancel:"取消"},confirm:{withStake:"确认订阅,即表示您授权 {payee} 从您的账户扣取未来款项,并在必要时罚没质押。您可随时取消订阅或撤销质押。",withoutStake:"确认订阅,即表示您授权 {payee} 从您的账户扣取未来款项。您可随时取消订阅。"},required:"必填项",invalid:"无效",billing:{auto:"国家/地区",required:"账单地址",country:"国家/地区",state:"州或省",city:"城市或镇",line1:"地址",line2:"地址2",postal_code:"邮政编码"},customer:{name:"姓名",email:"邮件",phone:"电话",phonePlaceholder:"电话号码",phoneTip:"以防需要与您联系有关您的订单"},customerInfo:"客户信息",upsell:{save:"使用{recurring}计费方式",revert:"切换到{recurring}计费方式",off:"省 {saving}%"},expired:{title:"链接已过期",description:"此链接已过期。这意味着您的付款已经处理完成或会话已过期。"},complete:{title:"结账已完成",description:"此结账会话已完成。这意味着您的付款已成功处理完成。"},cross_sell:{add:"添加到订单",remove:"从订单移除"},dynamicPricing:"动态定价",promotion:{add_code:"添加促销码",enter_code:"输入促销码",apply:"应用",applied:"已应用的促销码",placeholder:"输入促销码",duration_once:"1次优惠 {amount} {symbol}",duration_repeating:"{months}个月优惠 {amount} {symbol}",duration_forever:"永久优惠 {amount} {symbol}",dialog:{title:"添加促销码"},error:{invalid:"无效的促销码",expired:"促销码已过期",used:"促销码已被使用",not_applicable:"促销码不适用于此订单"}},coupon:{noDiscount:"无优惠",percentage:"{percent}%",fixedAmount:"{amount} {symbol}",terms:{forever:"永久享 {couponOff} 折扣",once:"单次享 {couponOff} 折扣",repeating:"{months} 个月内享 {couponOff} 折扣"}},credit:{normal:{oneTime:"购买 {amount}。",oneTimeWithExpiry:"购买 {amount}(有效期 {duration} {unit})。",recurring:"订阅:{period}{amount}。",recurringWithExpiry:"订阅:{period}{amount}(有效期 {duration} {unit})。"},pending:{notEnough:"您有 {amount} 的使用超额。要恢复访问,需要至少购买 {quantity} 数量。",oneTimeEnough:"您有 {amount} 的使用超额。本次购买将增加 {totalAmount}。扣除超额后,您的新可用余额将为 {availableAmount}。",oneTimeEnoughWithExpiry:"您有 {amount} 的使用超额。本次购买将增加 {totalAmount}(有效期 {duration} {unit})。扣除超额后,您的新可用余额将为 {availableAmount}。",recurringEnough:"您有 {amount} 的使用超额。本订阅{period}将增加 {totalAmount}。扣除超额后,您的新可用余额将为 {availableAmount}。",recurringEnoughWithExpiry:"您有 {amount} 的使用超额。本订阅{period}将增加 {totalAmount}(有效期 {duration} {unit})。扣除超额后,您的新可用余额将为 {availableAmount}。"},schedule:{periodic:"每{interval}发放 {amount}。",withRefresh:"每{interval}发放 {amount},未使用额度将在下次发放时过期。"},topupDescription:"购买 {creditName},单价 {unitPrice}/额度。"},emptyItems:{title:"没有任何购买项目",description:"可能这个付款链接没有正确配置"},stopAcceptingOrders:{title:"暂停服务",description:"因系统策略调整,当前已暂停新订单服务。"},error:{title:"出了点问题"},orderSummary:"订单概览",orderSummarySubtitle:"本次交易包含以下项目",paymentDetails:"支付信息",productListTotal:"包括 {total} 项",headerTitle:{subscribe:"订阅 {name}",purchase:"购买 {name}"},planFeatures:"功能特性",typeBadge:{subscription:"订阅",topup:"充值",oneTime:"一次性购买"},subtitle:{subscriptionInterval:"{interval}订阅",creditsTopup:"余额充值",addonFor:"{product} 的附加项",oneTime:"一次性购买"},creditTopup:{title:"购买 {name}",question:"你需要多少 {symbol}?",credits:"额度",increment:"每次增减 {step} {symbol}",validFor:"额度在购买后 {duration} {unit}内有效。",willReceive:"你将获得",packInfo:"包含 {packs} 个额度包(每包 {perPack})",autoMatch:"我们将自动匹配最接近的额度包。",autoMatchTooltip:"{symbol} 按每包 {step} 个出售",pendingWarning:"您有 {pendingAmount} 的使用超额,至少需要购买 {minCredits} 才能恢复访问。",pendingEnough:"您有 {pendingAmount} 的使用超额,扣除后您的可用余额将为 {availableAmount}。"},connectModal:{title:"{action}",scan:"使用以下方式完成本次支付",confirm:"确认",cancel:"取消"},fastPay:{title:"确认支付",confirmMessage:"您将支付 {amount} {symbol},从{sourceType}扣除。",autoPaymentReason:"该支付可以自动处理,因为您的账户余额充足,请在继续之前确认以下详细信息。",payer:"账户地址",amount:"支付金额",failed:"账户发生变化,无法自动完成支付,请手动支付。",balanceLink:"查看余额",credit:{title:"确认额度支付",availableAmount:"可用额度:{amount}",confirmMessage:"您将使用 {amount} 额度来订阅此服务。",meteringSubscriptionMessage:"此订阅服务将根据实际使用情况实时扣除额度。您当前可用额度为 {available},确认是否继续?",insufficientTitle:"额度不足",insufficientMessage:"此订阅服务将根据实际使用情况实时扣除额度。您当前可用额度不足,请先充值额度。"}}},autoTopup:{title:"自动充值",enableLabel:"自动充值",purchaseConfig:"购买配置",triggerThreshold:"当额度低于",thresholdPlaceholder:"输入触发阈值",thresholdDescription:"触发自动充值的剩余额度",thresholdMinError:"阈值必须大于0",thresholdFormatError:"请输入有效数字",creditsIncluded:"包含 {num}",purchaseBelow:"购买此套餐",perPackage:"每包",quantity:"数量",selectPaymentMethod:"选择支付方式",paymentInformation:"支付信息",saveConfiguration:"保存配置",saveSuccess:"自动充值配置保存成功",disableSuccess:"已关闭自动充值",stripeSetupRequired:"需要信用卡授权以进行自动支付",cryptoAuthorizationNote:"您需要从钱包授权支付以启用自动充值",tip:"启用自动充值后,当您的额度低于阈值时,系统将自动购买指定数量的额度套餐。",authTitle:"自动充值授权",authTip:"请完成授权流程以启用自动充值",rechargeAmount:"每次充值金额",currentPaymentMethod:"当前支付方式",changePaymentMethod:"更换支付方式",keepCurrent:"保持当前",changePaymentMethodTip:"保存时将引导您设置新的支付方式。",noPaymentMethodSetup:"未配置支付方式,请先设置支付方式。",addFunds:"充值",advanced:"高级选项",enabled:"已启用",disabled:"已禁用",notConfigured:"尚未配置自动充值",setup:"去启用",ruleDisplay:"额度低于{threshold}时,充值{amount}可获得{credits}额度",activeDescription:"自动充值已启用,当 Credits 低于 {threshold} 时,系统会自动充值购买 {credits} Credits,支付金额为 {amount}",activeDescriptionWithCredits:"自动充值已启用,当 Credits 低于 {threshold} 时,系统会自动购买 {credits} 额度。",purchaseAmount:"购买所需金额",paymentMethod:"支付方式",walletBalance:"钱包余额",paymentAddress:"支付地址",inactiveDescription:"开启自动充值,即可在 {name} 不足时自动续费,有效避免服务中断。",showDetails:"展开支付信息",hideDetails:"收起",dailyLimits:{maxAmount:"每日充值金额上限",maxAmountPlaceholder:"0表示无限制",maxAmountDescription:"每日可充值的最大总金额,0 表示无限制",maxAttempts:"每日充值次数上限",maxAttemptsPlaceholder:"0表示无限制",maxAttemptsDescription:"每日可充值的最大次数,0 表示无限制"},dynamicPricing:{title:"动态定价",currentRate:"当前汇率",slippageTolerance:"滑点容差",minAcceptableRate:"最低可接受汇率",configureSlippage:"配置滑点"}},customer:{payments:"支付历史",invoices:"账单历史",details:"账户详情",summary:"计费摘要",products:"产品信息",update:"更新客户信息",empty:"看起来您在这里没有任何订阅或支付",cancel:{button:"取消订阅",title:"取消您的订阅",comment:"你还有其他反馈么?",description:"您的订阅将被取消,但仍然可用直到您当前计费周期结束于{date}。",trialDescription:"免费试用的订阅将被立即取消,不再可用,确认是否继续。",feedback:{tip:"我们希望听到您的反馈,这将帮助我们改进我们的服务",too_expensive:"服务费用太高",missing_features:"服务缺少功能",switched_service:"我已切换到其他服务",unused:"我不再使用此服务",customer_service:"客户服务不佳",too_complex:"服务使用过于复杂",low_quality:"服务质量不佳",other:"其他原因"}},pastDue:{button:"续费",invoices:"欠费帐单",warning:"请尽快支付欠费账单,否则你将无法继续使用服务或购买新服务。",alert:{title:"你有欠费账单",description:"看起来你有欠费的账单,在你支付所有欠费账单之前,新的购买或者订阅将被禁止,请不要调皮。",customMessage:"请立即支付,否则新的购买或者订阅将被禁止。",confirm:"去支付"},view:"查看欠费明细"},recover:{button:"恢复订阅",title:"恢复您的订阅",description:"您的订阅将不会被取消,并将在{date}自动续订,请确认是否继续。",success:"订阅恢复成功",reStakeTitle:"重新质押以恢复订阅",stakeRequiredDescription:"您之前的质押已被申请取回,需要重新质押才能恢复订阅。"},changePlan:{button:"切换套餐",current:"当前订阅",pay:"需要支付",scan:"完成支付以更新你的订阅",success:"你的订阅已经更新成功",error:"订阅更新失败",config:"切换套餐或周期",confirm:"确认变更细节",summary:"新的付款计划({date} 开始)",total:"套餐定价(不含按量部分)",appliedCredit:"信用扣除",newCredit:"信用增加",remaining:"还需支付",tableNotFound:"套餐变更不可用"},changePayment:{limit:"你对支付方式的变更不会影响已经生成或者欠费的账单,只会影响未来的账单。你可以在下一张账单生成之前变更支付方式。",review:"查看订阅详情",select:"选择支付方式",submit:"确认变更",confirm:"确认变更方式意味着你允许 {payee} 使用新的支付方式支付你的未来账单。你可以随时再次变更支付方式。",completed:"你的支付方式 已经更新成功。你可以在你的账户中查看此支付方式的详细信息。",title:"支付方式变更",reauthorizationRequired:"滑点设置已更新。需要重新授权以确保授权金额充足。",reauthorizationTitle:"重新授权支付",reauthorizationCompleted:"支付授权已成功更新。"},invoice:{summary:"摘要",details:"详情",download:"下载PDF",unitPrice:"单价",rawQuantity:"汇总前数量: {quantity}",amountPaid:"已支付",amountDue:"待支付",amountApplied:"余额变更",pay:"支付此账单",paySuccess:"支付成功",payProcessing:"支付处理中,请稍候刷新查看",payError:"支付失败",sync:"同步状态",syncing:"同步中...",syncSuccess:"同步成功",renew:"恢复订阅",renewSuccess:"订阅恢复成功",renewError:"订阅恢复失败",empty:"没有任何账单",next:"还没有账单,下次账单将在 {date} 生成",invoiceNumber:"账单编号",emptyList:"没有账单",noPaymentRequired:"无需支付",slippageExceeded:"滑点超限",slippageExceededDetail:"汇率滑点超过下限,无法自动扣款。当前汇率 {currentRate},最低可接受 {minRate}",payBatch:"支付欠款",paymentConfirmTitle:"支付确认",paymentConfirmDescription:"完成本次支付后,您使用的支付方式将自动设置为该订阅的默认支付方式。此外,我们还将对该订阅的其他欠费账单进行重试收费。",continue:"继续",priceChanged:"汇率已变动 {percent}%。支付金额将会更新,是否继续?",paymentCancelled:"支付已取消",credit:"额度",creditRefresh:"每{interval}{unit}刷新",quote:{exchangeRate:"汇率",baseAmount:"USD 本位金额",providers:"数据源",rateTimestamp:"汇率时间",consensusMethod:"汇率算法",rateStatus:"汇率状态",rateStatusNormal:"正常",rateStatusDegraded:"降级",slippage:"滑点",atPaymentRate:"(按支付时汇率 {rate})"}},payment:{empty:"没有支付记录",emptyList:"没有支付记录"},refund:{empty:"没有退款记录",emptyList:"没有退款记录"},subscriptions:{plan:"订阅",nextInvoice:"下次账单",title:"订阅管理",view:"管理订阅",current:"当前订阅",viewAll:"查看所有",empty:"没有任何订阅",changePayment:"切换支付方式",trialLeft:"剩余试用时长",owner:"订阅拥有者"},overdue:{title:"您有 {count} 张欠费账单,涉及 {subscriptionCount} 个订阅,总金额 {total} {symbol}{method}。",simpleTitle:"您有 {count} 张欠费账单,",empty:"恭喜!您当前没有欠费账单。",defaultAlert:"请立即支付,以免影响您的使用。"}},invoice:{reason:{creation:"订阅创建",cycle:"自动扣费",staking:"订阅创建",update:"订阅更新",recover:"订阅恢复",threshold:"用量账单",cancel:"订阅取消",manual:"人工账单",upcoming:"未来账单",slashStake:"罚没质押",stake:"押金",payment:"付款",returnStake:"退押金",stakeForChangePlan:"订阅套餐更新",stakeForChangePayment:"订阅支付方式更新",recharge:"充值",rechargeForSubscription:"订阅充值",overdraftProtection:"订阅守护服务费",stakeForSubscriptionOverdraftProtection:"订阅守护服务",reStakeToResumeSubscription:"订阅恢复",gas:"手续费",fee:"服务费"}},subscription:{overdue:{title:"您的【{name}】订阅共有 {count} 张欠费账单,总计 {total} {symbol}{method},您需要支付这些账单以激活您的订阅,或在进行新的购买之前完成支付。",simpleTitle:"您的【{name}】订阅共有 {count} 张欠费账单,您需要支付这些账单以激活您的订阅,或在进行新的购买之前完成支付。",payNow:"立即支付",notSupport:"暂不支持该支付方式",total:"总计 {total} {currency}{method}",view:"查看订阅详情",pastDue:"欠费账单",viewNow:"立即查看",description:"如果您有任何疑问,可以选择 ",list:"欠费账单:",empty:"您的【{name}】订阅当前没有欠费账单",retry:"重新支付",paid:"已支付",processing:"支付中"}},dynamicPricing:{unavailable:{title:"暂时无法计算实时价格",message:"当前汇率服务不可用,基于动态定价的商品暂时无法购买。",retry:"重试"}}},refund:{type:{[Ll.refund]:"退款",[Ll.stakeReturn]:"退押金"}},empty:{records:"没有找到匹配的记录"},benefits:{title:"{count} 位受益人"}}),O0={zh:hS,en:pS},Eg=(a,r={})=>{try{return mS(a,{interpolate:/{([\s\S]+?)}/g,escape:/{([\s\S]+?)}/g})(r)}catch(o){return console.error(`Error evaluating template: ${a}`,o),""}},z0=({fallbackLocale:a="en"},r=O0)=>(o,s=a,f={})=>!r[s]||!r[s][o]?a&&r[a]?.[o]?Eg(r[a]?.[o],f):o:Eg(r[s][o],f),yS=z0({fallbackLocale:"en"}),Ie=yS;var Bl={exports:{}},gS=Bl.exports,wg;function DS(){return wg||(wg=1,(function(a,r){(function(o,s){a.exports=s()})(gS,(function(){var o,s,f=1e3,m=6e4,c=36e5,h=864e5,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y=31536e6,S=2628e6,x=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,A={years:y,months:S,days:h,hours:c,minutes:m,seconds:f,milliseconds:1,weeks:6048e5},v=function(T){return T instanceof w},N=function(T,R,q){return new w(T,q,R.$l)},B=function(T){return s.p(T)+"s"},O=function(T){return T<0},k=function(T){return O(T)?Math.ceil(T):Math.floor(T)},K=function(T){return Math.abs(T)},j=function(T,R){return T?O(T)?{negative:!0,format:""+K(T)+R}:{negative:!1,format:""+T+R}:{negative:!1,format:""}},w=(function(){function T(q,z,$){var re=this;if(this.$d={},this.$l=$,q===void 0&&(this.$ms=0,this.parseFromMilliseconds()),z)return N(q*A[B(z)],this);if(typeof q=="number")return this.$ms=q,this.parseFromMilliseconds(),this;if(typeof q=="object")return Object.keys(q).forEach((function(ne){re.$d[B(ne)]=q[ne]})),this.calMilliseconds(),this;if(typeof q=="string"){var Q=q.match(x);if(Q){var Z=Q.slice(2).map((function(ne){return ne!=null?Number(ne):0}));return this.$d.years=Z[0],this.$d.months=Z[1],this.$d.weeks=Z[2],this.$d.days=Z[3],this.$d.hours=Z[4],this.$d.minutes=Z[5],this.$d.seconds=Z[6],this.calMilliseconds(),this}}return this}var R=T.prototype;return R.calMilliseconds=function(){var q=this;this.$ms=Object.keys(this.$d).reduce((function(z,$){return z+(q.$d[$]||0)*A[$]}),0)},R.parseFromMilliseconds=function(){var q=this.$ms;this.$d.years=k(q/y),q%=y,this.$d.months=k(q/S),q%=S,this.$d.days=k(q/h),q%=h,this.$d.hours=k(q/c),q%=c,this.$d.minutes=k(q/m),q%=m,this.$d.seconds=k(q/f),q%=f,this.$d.milliseconds=q},R.toISOString=function(){var q=j(this.$d.years,"Y"),z=j(this.$d.months,"M"),$=+this.$d.days||0;this.$d.weeks&&($+=7*this.$d.weeks);var re=j($,"D"),Q=j(this.$d.hours,"H"),Z=j(this.$d.minutes,"M"),ne=this.$d.seconds||0;this.$d.milliseconds&&(ne+=this.$d.milliseconds/1e3,ne=Math.round(1e3*ne)/1e3);var me=j(ne,"S"),P=q.negative||z.negative||re.negative||Q.negative||Z.negative||me.negative,D=Q.format||Z.format||me.format?"T":"",F=(P?"-":"")+"P"+q.format+z.format+re.format+D+Q.format+Z.format+me.format;return F==="P"||F==="-P"?"P0D":F},R.toJSON=function(){return this.toISOString()},R.format=function(q){var z=q||"YYYY-MM-DDTHH:mm:ss",$={Y:this.$d.years,YY:s.s(this.$d.years,2,"0"),YYYY:s.s(this.$d.years,4,"0"),M:this.$d.months,MM:s.s(this.$d.months,2,"0"),D:this.$d.days,DD:s.s(this.$d.days,2,"0"),H:this.$d.hours,HH:s.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,"0"),SSS:s.s(this.$d.milliseconds,3,"0")};return z.replace(g,(function(re,Q){return Q||String($[re])}))},R.as=function(q){return this.$ms/A[B(q)]},R.get=function(q){var z=this.$ms,$=B(q);return $==="milliseconds"?z%=1e3:z=$==="weeks"?k(z/A[$]):this.$d[$],z||0},R.add=function(q,z,$){var re;return re=z?q*A[B(z)]:v(q)?q.$ms:N(q,this).$ms,N(this.$ms+re*($?-1:1),this)},R.subtract=function(q,z){return this.add(q,z,!0)},R.locale=function(q){var z=this.clone();return z.$l=q,z},R.clone=function(){return N(this.$ms,this)},R.humanize=function(q){return o().add(this.$ms,"ms").locale(this.$l).fromNow(!q)},R.valueOf=function(){return this.asMilliseconds()},R.milliseconds=function(){return this.get("milliseconds")},R.asMilliseconds=function(){return this.as("milliseconds")},R.seconds=function(){return this.get("seconds")},R.asSeconds=function(){return this.as("seconds")},R.minutes=function(){return this.get("minutes")},R.asMinutes=function(){return this.as("minutes")},R.hours=function(){return this.get("hours")},R.asHours=function(){return this.as("hours")},R.days=function(){return this.get("days")},R.asDays=function(){return this.as("days")},R.weeks=function(){return this.get("weeks")},R.asWeeks=function(){return this.as("weeks")},R.months=function(){return this.get("months")},R.asMonths=function(){return this.as("months")},R.years=function(){return this.get("years")},R.asYears=function(){return this.as("years")},T})(),G=function(T,R,q){return T.add(R.years()*q,"y").add(R.months()*q,"M").add(R.days()*q,"d").add(R.hours()*q,"h").add(R.minutes()*q,"m").add(R.seconds()*q,"s").add(R.milliseconds()*q,"ms")};return function(T,R,q){o=q,s=q().$utils(),q.duration=function(re,Q){var Z=q.locale();return N(re,{$l:Z},Q)},q.isDuration=v;var z=R.prototype.add,$=R.prototype.subtract;R.prototype.add=function(re,Q){return v(re)?G(this,re,1):z.bind(this)(re,Q)},R.prototype.subtract=function(re,Q){return v(re)?G(this,re,-1):$.bind(this)(re,Q)}}}))})(Bl)),Bl.exports}var vS=DS();const bS=ri(vS);Ht(()=>import("./vendor-blocklet-DcLR2Cyf.js").then(a=>a.e),[]);Ht(()=>import("./vendor-blocklet-DcLR2Cyf.js").then(a=>a.z),[]);Sn.extend(Rx);Sn.extend(Mx);Sn.extend(bS);Sn.extend(Nx);Sn.extend(Bx);const us="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk",xS=(a,r,o="en")=>{let s="";if(a.percent_off&&a.percent_off>0&&(s=Ie("payment.checkout.coupon.percentage",o,{percent:a.percent_off})),a.amount_off&&a.amount_off!=="0"){const{symbol:f}=r;s=a.currency_id===r.id?a.amount_off||"":a.currency_options?.[r.id]?.amount_off||"",s&&(s=Ie("payment.checkout.coupon.fixedAmount",o,{amount:Ca(s,r.decimal),symbol:f}))}return s?Ie(`payment.checkout.coupon.terms.${a.duration}`,o,{couponOff:s,months:a.duration_in_months||0}):Ie("payment.checkout.coupon.noDiscount")},Qn=()=>{const a=window.blocklet?.prefix||"/",r=window.location?.origin;if(window.__PAYMENT_KIT_BASE_URL)try{if(new URL(window.__PAYMENT_KIT_BASE_URL).origin!==window.location.origin)return window.__PAYMENT_KIT_BASE_URL}catch{console.warn("Invalid baseUrl for PaymentProvider",window.__PAYMENT_KIT_BASE_URL)}if((window.blocklet?.componentId||"").split("/").pop()===us)return Dt(r,a);const s=(window.blocklet?.componentMountPoints||[]).find(f=>f?.did===us);return s?Dt(r,s.mountPoint):Dt(r,a)};function Lf(){try{const a=Qn(),r=new URL(a).origin,o=window.location.origin;return r!==o}catch{return!1}}function ln(a,r="en",o="YYYY-MM-DD HH:mm:ss"){return a?Sn(a).locale(eu(r)).format(o):"-"}function CS(a,r="en"){return a?Sn(a).locale(eu(r)).format("lll"):"-"}function SS(a,r="YYYY-MM-DD HH:mm:ss",o="en"){return a?Sn(a).locale(eu(o)).format(r):"-"}function _S(a,r="en"){return Sn(a).locale(eu(r)).format("YYYY-MM-DD HH:mm")}const eu=(a="en")=>a==="tw"?"zh":a,aw=a=>a==="zh"?"zh_CN":"en_US",Pt=a=>{if(!a)return"Unknown error";const{details:r,errors:o,response:s}=a;return Array.isArray(o)?o.map(f=>f.message).join(`
27
+ `):Array.isArray(r)?`Validate failed: ${r.map(m=>{const c=m.message.replace(/["]/g,"'");return`${m.path.join(".")}: ${c}`}).join(";")}`:s?s.data?.error||`${a.message}: ${JSON.stringify(s.data)}`:a.message};function Ui(a="",r=18,o=6,s=!0,f=!0){return a?Ja(qt(a,r),o,s,f):"0"}const P0={USD:"$",EUR:"€",GBP:"£",JPY:"¥",CNY:"¥",KRW:"₩",INR:"₹",AUD:"A$",CAD:"C$",CHF:"Fr",HKD:"HK$",SGD:"S$",NZD:"NZ$"};function dr(a,r,o=!0){const s=P0[r];return s?`${s}${a}`:`${a} ${o?r:""}`}function kl(a,r,o="en",s=!0){const f=P0[r];return f?`${f}${a} ${s?Ie("common.credits",o):""}`:`${a} ${s?r:""}`}function Ja(a,r=6,o=!0,s=!0){if(!a||a==="0")return"0";const f=E1(a),m={thousandSeparated:s,...(r||r===0)&&{mantissa:r}},c=f.format(m);if(!o)return c;const[h,g]=c.split(".");return g?[h,vC(g,"0")].filter(Boolean).join("."):h}function un(a,r,o=6,s=!0,f=!0){if(!r)return Ja(a,o,s,f);const m=Number(a);if(!Number.isFinite(m))return Ja(a,o,s,f);const c=Math.abs(m),h=c>0&&c<.01?o:2;return Ja(a,h,s,f)}const Tg=8;function q0(a,r,o=$f){if(a==null||!r||r<=0)return null;const s=wS(a,r,o);return ES(s,o)}function If(a,r,o){if(!o&&o!=="0"||r==null)return null;try{const s=a instanceof ze?a:new ze(a||"0"),f=new ze(10).pow(new ze(r));if(f.isZero())return null;const m=new ze(o.replace(".","")),c=o.includes(".")&&o.split(".")[1]?.length||0,h=new ze(10).pow(new ze(c)),g=new ze(10).pow(new ze(Tg)),y=s.mul(m).mul(g).div(f.mul(h));return qt(y.toString(),Tg)}catch{return null}}function zi(a,r="en"){if(!a&&a!=="0")return null;const o=Number(a);return Number.isFinite(o)?new Intl.NumberFormat(r,{minimumFractionDigits:2,maximumFractionDigits:2}).format(o):null}function Il(a){if(!a&&a!=="0")return null;const r=String(a),o=Number(r);return Number.isFinite(o)?r:null}function iw(a,r="USD",o=2){if(a==null)return null;const s=Number(a);if(!Number.isFinite(s))return null;const f=s.toFixed(o);return r==="USD"?`$${f}`:`${f} ${r}`}const kg=(a,r,o,s=1,f=!0,m="en")=>{if(!r)return"";if(a.custom_unit_amount)return`Custom (${r.symbol})`;if(a.pricing_type==="dynamic"&&a.base_amount&&a.base_currency==="USD"){const g=a.base_amount,y=Number(g)*s,S=zi(y.toString(),m);if(a?.type==="recurring"&&a.recurring){const x=Rn(a.recurring,!1,"slash",m);return o?`$${S} / ${o} ${x}`:a.recurring.usage_type==="metered"?`$${S} / unit ${x}`:`$${S} ${x}`}return`$${S}`}const c=nu(a,r),h=f?qt(new ze(c).mul(new ze(s)),r.decimal).toString():+c*s;if(a?.type==="recurring"&&a.recurring){const g=Rn(a.recurring,!1,"slash",m);return o?`${h} ${r.symbol} / ${o} ${g}`:a.recurring.usage_type==="metered"?`${h} ${r.symbol} / unit ${g}`:`${h} ${r.symbol} ${g}`}return`${h} ${r.symbol}`},rw=(a,r,o,s=1,f=!0,m="en")=>{if(!r)return"";if(a.pricing_type==="dynamic"&&a.base_amount&&a.base_currency==="USD"){const g=a.base_amount,y=Number(g)*s,S=zi(y.toString(),m);return a?.type==="recurring"&&a.recurring?o?`$${S} / ${o}`:a.recurring.usage_type==="metered"?`$${S} / unit`:`$${S}`:`$${S}`}const c=nu(a,r),h=f?qt(new ze(c).mul(new ze(s)),r.decimal).toString():+c*s;return a?.type==="recurring"&&a.recurring?o?`${h} ${r.symbol} / ${o}`:a.recurring.usage_type==="metered"?`${h} ${r.symbol} / unit`:`${h} ${r.symbol}`:`${h} ${r.symbol}`};function tu(a){for(const r of a)if(r.price?.product?.statement_descriptor)return r.price?.product?.statement_descriptor;return window.blocklet?.appName}function Rn(a,r=!0,o="per",s="en"){const f={hour:"hourly",day:"daily",week:"weekly",month:"monthly",year:"yearly"};if(!a)return"";if(+a.interval_count==1){const m=Ie(`common.${a.interval}`,s);return r?Ie(`common.${f[a.interval]}`,s):o?Ie(`common.${o}`,s,{interval:m}):m}if(a.interval==="month"){if(a.interval_count===3)return Ie("common.month3",s);if(a.interval_count===6)return Ie("common.month6",s)}return Ie("common.recurring",s,{count:a.interval_count,interval:Ie(`common.${a.interval}s`,s)})}function nu(a,r){const s=AS(a).find(f=>f.currency_id===r?.id);return s?s.custom_unit_amount?s.custom_unit_amount.preset||s.custom_unit_amount.presets[0]:s.unit_amount:a.currency_id===r?.id?a.custom_unit_amount?a.custom_unit_amount.preset||a.custom_unit_amount.presets[0]:a.unit_amount:(console.warn(`Currency ${r?.id} not configured for price`,a),"0")}function AS(a){return Array.isArray(a.currency_options)?a.currency_options:[{currency_id:a.currency_id,unit_amount:a.unit_amount,custom_unit_amount:a.custom_unit_amount||null,tiers:null}]}const $f=8;function ES(a,r=$f){const o=a.isNeg(),f=a.abs().toString().padStart(r+1,"0"),m=f.slice(0,f.length-r)||"0",c=f.slice(-r).replace(/0+$/,""),h=c?`${m}.${c}`:m;return o?`-${h}`:h}function wS(a,r,o=$f){if(!a||!r)return new ze(0);const s=String(a),[f="0",m=""]=s.split("."),c=`${m}`.padEnd(o,"0").slice(0,o),h=`${f.replace("-","")}${c}`||"0",g=new ze(h).mul(new ze(r));return s.startsWith("-")?g.neg():g}function $l(a,r,{useUpsell:o=!0,exchangeRate:s=null}={}){if(!r)return{unitAmount:new ze(0),totalAmount:new ze(0),isDynamicQuote:!1};const f=o&&a.upsell_price||a.price,m=new ze(a.quantity||0),c=a?.quoted_amount,h=a?.quote_currency_id,g=f?.pricing_type==="dynamic";if(g&&c&&h===r.id){const x=new ze(c||"0");return{unitAmount:m.gt(new ze(0))?x.add(m).sub(new ze(1)).div(m):new ze(0),totalAmount:x,isDynamicQuote:!0}}if(g&&s&&f?.base_amount){const x=Number(s);if(x>0&&Number.isFinite(x)){const A=Number(f.base_amount);if(A>0&&Number.isFinite(A)){const v=A/x,N=Kn(v.toFixed(r.decimal||8),r.decimal||8);return{unitAmount:N,totalAmount:N.mul(m),isDynamicQuote:!1}}}}const S=new ze(nu(f,r));return{unitAmount:S,totalAmount:S.mul(m),isDynamicQuote:!1}}function TS(a,r,{trialEnd:o,trialInDays:s,exchangeRate:f=null},m="en"){if(!r)return{primary:"",secondary:"",quantity:""};const c=a.upsell_price||a.price;if(!c)return{primary:"",secondary:"",quantity:""};let h=Ie("common.qty",m,{count:a.quantity});(c.recurring?.usage_type==="metered"||+a.quantity==1)&&(h="");const{unitAmount:g,totalAmount:y}=$l(a,r,{exchangeRate:f}),S=c?.pricing_type==="dynamic",x=O=>{const k=qt(O,r.decimal);return un(k,S,6)},A=`${x(y)} ${r.symbol}`,v=`${x(g)} ${r.symbol}`,N=L0({trialInDays:s,trialEnd:o},m),B=(O,k)=>c.product.unit_label?`${O}/${c.product.unit_label}`:c.recurring?.usage_type==="metered"||a.quantity===1?k:h?Ie("common.each",m,{unit:v}):"";return c.type==="recurring"&&c.recurring?N.count>0?{primary:Ie("common.trial",m,{count:N.count,interval:N.interval}),secondary:`${B(A,A)} ${Rn(c.recurring,!1,"slash",m)}`,quantity:h}:{primary:A,secondary:B(A,""),quantity:h}:{primary:A,secondary:B(A,""),quantity:h}}function ow(a){switch(a){case"active":return"success";case"trialing":return"primary";case"incomplete":case"incomplete_expired":case"paused":return"warning";case"past_due":case"unpaid":return"error";default:return"default"}}function sw(a){switch(a){case"succeeded":return"success";case"requires_payment_method":case"requires_confirmation":case"requires_action":case"requires_capture":return"warning";default:return"default"}}function lw(a){switch(a){case"succeeded":return"success";case"requires_action":return"warning";default:return"default"}}function uw(a){switch(a){case"paid":return"success";case"deferred":return"warning";case"failed":return"warning";default:return"default"}}function Vl(a){switch(a){case"paid":return"success";case"open":return"secondary";case"uncollectible":return"warning";default:return"default"}}function Hl(a,r,o=!1,s=!0,{exchangeRate:f=null}={}){if(a.find(h=>(s&&h.upsell_price||h.price)?.custom_unit_amount)&&a.length>1)throw new Error("Multiple items with custom unit amount are not supported");let m=new ze(0);const c=a.filter(h=>(s&&h.upsell_price||h.price)!=null).reduce((h,g)=>{const y=g?.quote_currency_id,S=y&&y!==r.id;if(g.custom_amount&&!S)return h.add(new ze(g.custom_amount));const x=s&&g.upsell_price||g.price,{totalAmount:A}=$l(g,r,{useUpsell:s,exchangeRate:f});return x?.type==="recurring"&&(m=m.add(A),o||x.recurring?.usage_type==="metered")?h:h.add(A)},new ze(0)).toString();return{subtotal:c,total:c,renew:un(m.toString(),!!f),discount:"0",shipping:"0",tax:"0"}}function Fg(a){const{interval:r}=a,o=+a.interval_count||1,s=1440*60*1e3;switch(r){case"hour":return 3600*1e3;case"day":return o*s;case"week":return o*7*s;case"month":return o*30*s;case"year":return o*365*s;default:throw new Error(`Unsupported recurring interval: ${r}`)}}function kS(a,r){if(a[0]?.upsell_price_id||!a[0]?.price?.upsell?.upsells_to)return"0";const o=Hl(a,r,!1,!1),s=Hl(a.map(y=>({...y,upsell_price_id:y.price.upsell?.upsells_to_id,upsell_price:y.price.upsell?.upsells_to})),r,!1,!0),f=a[0].price?.recurring,m=a[0].price?.upsell?.upsells_to?.recurring;if(!f||!m)return"0";const c=Math.floor(Fg(m)/Fg(f)),h=new ze(o.total).mul(new ze(c)),g=new ze(s.total);return Number(h.sub(g).mul(new ze(100)).div(h).toString()).toFixed(0)}function Gd(a,r,o,s="en"){return o?Ie("payment.checkout.meteredThen",s,{subscription:a,recurring:r}):Ie("payment.checkout.then",s,{subscription:a,recurring:r})}function Kd(a,r,o,s="en"){return o?Ie("payment.checkout.metered",s,{recurring:r}):[a,r].filter(Boolean).join(" ")}function ts({amount:a,then:r,actualAmount:o,showThen:s},f,m,c="en"){return Number(o)===0&&m?Ie("payment.checkout.metered",c,{recurring:f}):s?[a,r].filter(Boolean).join(", "):[a,r].filter(Boolean).join(" ")}function FS(a){const r=new Set;for(const o of a)if(o.price?.recurring?.interval&&o.price?.type==="recurring"&&(r.add(`${o.price.recurring.interval}-${o.price.recurring.interval_count}`),r.size>1))return!0;return!1}function L0({trialInDays:a,trialEnd:r},o="en"){const s=Sn().unix(),f=(m,c)=>Ie(`common.${c>1?`${m}s`:m}`,o);if(r>0&&r>s){if(r-s<3600){const c=Math.ceil((r-s)/60);return{count:c,interval:f("minute",c)}}if(r-s<86400){const c=Math.ceil((r-s)/3600);return{count:c,interval:f("hour",c)}}const m=Math.ceil((r-s)/86400);return{count:m,interval:f("day",m)}}return a>0?{count:a,interval:f("day",a)}:{count:0,interval:Ie("common.day",o)}}function jS(a,r,{trialInDays:o,trialEnd:s},f="en",{exchangeRate:m=null}={}){const c=tu(a),{total:h}=Hl(a,r,o>0,!0,{exchangeRate:m}),g=qt(h,r.decimal),y=`${qt(h,r.decimal)} ${r.symbol}`,S=L0({trialInDays:o,trialEnd:s},f);if(a.length===0)return{action:Ie("payment.checkout.empty",f),amount:"0",then:"",actualAmount:"0",priceDisplay:"0"};const{name:x}=a[0]?.price?.product||{name:""};if(a.every(w=>w.price?.type==="one_time")){const w=Ie("payment.checkout.pay",f,{payee:c});return a.length>1?{action:w,amount:y,actualAmount:g,priceDisplay:y}:{action:w,amount:y,then:"",actualAmount:g,priceDisplay:y}}const A=a.find(w=>w.price?.type==="recurring"),v=Rn((A?.upsell_price||A?.price)?.recurring,!1,"per",f),N=a.some(w=>w.price?.type==="recurring"&&w.price?.recurring?.usage_type==="metered"),B=FS(a);if(a.every(w=>w.price?.type==="recurring")){const w=[N?Ie("payment.checkout.least",f):"",un(qt(a.reduce((q,z)=>(z.upsell_price||z.price)?.recurring?.usage_type==="metered"?q:q.add($l(z,r,{exchangeRate:m}).totalAmount),new ze(0)),r.decimal),!!m),r.symbol].filter(Boolean).join(" ");if(a.length>1){if(S.count>0){const re=Gd(w,v,N&&Number(w)===0,f),Q=Kd(w,v,N&&Number(w)===0,f),Z={action:Ie("payment.checkout.try2",f,{name:x,count:a.length-1}),amount:Ie("payment.checkout.free",f,{count:S.count,interval:S.interval}),then:re,thenValue:Q,showThen:!0,actualAmount:"0"};return{...Z,priceDisplay:ts({amount:Z.amount,then:re,actualAmount:Z.actualAmount,showThen:Z.showThen},v,N,f)}}const q=N?Ie("payment.checkout.meteredThen",f,{recurring:v}):v,z=N?Ie("payment.checkout.metered",f,{recurring:v}):v,$={action:Ie("payment.checkout.sub2",f,{name:x,count:a.length-1}),amount:y,then:q,thenValue:z,showThen:N,actualAmount:g};return{...$,priceDisplay:ts({amount:$.amount,then:q,actualAmount:$.actualAmount,showThen:$.showThen},v,N,f)}}if(S.count>0){const q=Gd(w,v,N&&Number(w)===0,f),z=Kd(w,v,N&&Number(w)===0,f),$={action:Ie("payment.checkout.try1",f,{name:x}),amount:Ie("payment.checkout.free",f,{count:S.count,interval:S.interval}),then:q,thenValue:z,showThen:!0,actualAmount:"0"};return{...$,priceDisplay:ts({amount:$.amount,then:q,actualAmount:$.actualAmount,showThen:$.showThen},v,N,f)}}const G=N?Ie("payment.checkout.meteredThen",f,{recurring:v}):v,T=N?Ie("payment.checkout.metered",f,{recurring:v}):v,R={action:Ie("payment.checkout.sub1",f,{name:x}),amount:y,then:G,thenValue:T,showThen:N&&!B,actualAmount:g};return{...R,priceDisplay:ts({amount:R.amount,then:G,actualAmount:R.actualAmount,showThen:R.showThen},v,N,f)}}const O=qt(a.filter(w=>w.price?.type==="recurring").reduce((w,G)=>G.price?.recurring?.usage_type==="metered"?w:w.add($l(G,r,{useUpsell:!1,exchangeRate:m}).totalAmount),new ze(0)),r.decimal),k=Gd(`${O} ${r.symbol}`,v,N&&Number(O)===0,f),K=Kd(`${O} ${r.symbol}`,v,N&&Number(O)===0,f),j={action:Ie("payment.checkout.pay",f,{payee:c}),amount:y,then:k,thenValue:K,showThen:!B,actualAmount:g};return{...j,priceDisplay:ts({amount:j.amount,then:k,actualAmount:j.actualAmount,showThen:j.showThen},v,N,f)}}function Ca(a,r,o=2){const s=qt(a,r),f=Number(s);if(!Number.isFinite(f))return Ui(a,r,o,!0,!1);const m=Math.abs(f),c=m>0&&m<.01?r:2;return Ja(s,c,!0,!1)}function au(a,r){for(const o of a)for(const s of o.payment_currencies)if(s.id===r)return{object:"payment_currency",...s,paymentMethod:D0(o,["payment_currencies"])};return null}function Vf(a){return Bi.some(r=>r[1]===a)}function cw(a){try{a.stopPropagation(),a.preventDefault()}catch{}}function dw(a,r=2){const o=a.map(s=>s.price?.product?.name).filter(Boolean);return o.slice(0,r).join(", ")+(o.length>r?` and ${o.length-r} more`:"")}const ns=(a,r="en")=>{const o=Sn().isSame(Sn(a),"day");return{time:ln(a,r,o?"HH:mm:ss":"YYYY-MM-DD"),isToday:o}},fw=(a,r="en")=>{if(a.status==="active"||a.status==="trialing"){if(a.cancel_at){const f=a.cancel_at*1e3,{time:m,isToday:c}=ns(f,r);return{action:f>Date.now()?"willEnd":"ended",time:m,isToday:c}}if(a.cancel_at_period_end){const f=a.current_period_end*1e3,{time:m,isToday:c}=ns(f,r);return{action:"willEnd",time:m,isToday:c}}const{time:o,isToday:s}=ns(a.current_period_end*1e3,r);return{action:"renew",time:o,isToday:s}}if(a.status==="past_due"){const o=(a.cancel_at||a.current_period_end)*1e3,{time:s,isToday:f}=ns(o,r);return{action:o>Date.now()?"willEnd":"ended",time:s,isToday:f}}if(a.status==="canceled"){const{time:o,isToday:s}=ns(a.canceled_at*1e3,r);return{action:"ended",time:o,isToday:s}}return null},mw=(a,r)=>a.status==="active"||a.status==="trialing"?a.cancel_at_period_end?a.cancelation_details?.reason==="payment_failed"?null:{action:"recover",variant:"contained",color:"primary",canRenew:!1,...r?.recover}:a.cancel_at&&a.cancel_at!==a.current_period_end?null:{action:"cancel",variant:"outlined",color:"inherit",canRenew:!1,...r?.cancel}:a.status==="past_due"?{action:"pastDue",variant:"contained",color:"primary",canRenew:a.cancel_at&&a.cancel_at!==a.current_period_end,...r?.pastDue}:a.status!=="canceled"&&a.cancel_at_period_end?{action:"recover",variant:"contained",color:"primary",canRenew:!1,...r?.recover}:null,pw=(a={})=>{const r=new URLSearchParams(window.location.search);return Object.keys(a).forEach(o=>{r.set(o,a[o])}),r.toString()},RS=(a=[])=>{const r=[];return a.forEach(o=>{(o.paymentCurrencies||o.payment_currencies||[]).forEach(f=>{r.push({...f,method:o})})}),r},I0=(a,r)=>{if(!r)return{text:"N/A",link:"",gas:""};if(a.type==="arcblock"&&r.arcblock?.tx_hash)return{link:Dt(a.settings.arcblock?.explorer_host,"/txs",r.arcblock?.tx_hash),text:r.arcblock?.tx_hash,gas:""};if(a.type==="bitcoin"&&r.bitcoin?.tx_hash)return{link:Dt(a.settings.bitcoin?.explorer_host,"/tx",r.bitcoin?.tx_hash),text:r.bitcoin?.tx_hash,gas:""};if(a.type==="ethereum"&&r.ethereum?.tx_hash)return{link:Dt(a.settings.ethereum?.explorer_host,"/tx",r.ethereum?.tx_hash),text:(r.ethereum?.tx_hash).toUpperCase(),gas:new ze(r.ethereum.gas_price).mul(new ze(r.ethereum.gas_used)).toString()};if(a.type==="base"&&r.base?.tx_hash)return{link:Dt(a.settings.base?.explorer_host,"/tx",r.base?.tx_hash),text:(r.base?.tx_hash).toUpperCase(),gas:""};if(a.type==="stripe"){const o=a.livemode?"https://dashboard.stripe.com":"https://dashboard.stripe.com/test";return{link:Dt(a.settings.stripe?.dashboard||o,"payments",r.stripe?.payment_intent_id),text:r.stripe?.payment_intent_id,gas:""}}return{text:"N/A",link:"",gas:""}};function Hf(a){const r={};return new URL(a).searchParams.forEach((s,f)=>{r[f]=s}),r}function Df(a,r,o="en"){const s=Number(r),{quantity_available:f=0,quantity_sold:m=0,quantity_limit_per_checkout:c=0}=a||{};return f>0&&m+s>f?Ie("common.quantityNotEnough",o):c>0&&c<s?Ie("common.quantityLimitPerCheckout",o):""}function hw(a){return a==="canceled"?"Ended":a}function jg(a,r="en",o=6){if(!a)return"";const[,s]=String(a).split(".");return s&&s.length>o?Ie("common.amountPrecisionLimit",r,{precision:o}):""}function yw(a){return typeof a=="string"&&/\s/.test(a)?"break-word":"break-all"}function iu(){const a=navigator.userAgent.toLowerCase(),r=a.indexOf("safari")>-1&&a.indexOf("chrome")===-1,o=a.indexOf("mobile")>-1||/iphone|ipad|ipod/.test(a),s=/iphone|ipad|ipod/.test(a);return r&&o&&s}function MS(a,r,o=!1){if(!a||!r)return a;if(!o)return a.length<=r?a:`${a.substring(0,r)}...`;let s=0,f="";for(let m=0;m<a.length;m++){const c=U1(a.charAt(m));if(s+c>r)break;f+=a.charAt(m),s+=c}return f===a?f:`${f}...`}function gw(a,r,o=48){if(!a)return"";const s=typeof r=="number"?r:Sn(r).unix();return`/.well-known/service/user/avatar/${a}?imageFilter=resize&w=${o}&h=${o}&updateAt=${s||Sn().unix()}`}function Dw(a,r){return r?.type&&["arcblock","ethereum","base"].includes(r?.type)&&a?.[r?.type]?.tx_hash}function NS(a,r="en"){const{billing_reason:o,description:s}=a,f={subscription_create:Ie("payment.invoice.reason.creation",r),subscription_cycle:Ie("payment.invoice.reason.cycle",r),subscription_update:Ie("payment.invoice.reason.update",r),subscription_recover:Ie("payment.invoice.reason.recover",r),subscription_threshold:Ie("payment.invoice.reason.threshold",r),subscription_cancel:Ie("payment.invoice.reason.cancel",r),manual:Ie("payment.invoice.reason.manual",r),upcoming:Ie("payment.invoice.reason.upcoming",r),slash_stake:Ie("payment.invoice.reason.slashStake",r),stake:Ie("payment.invoice.reason.stake",r),return_stake:Ie("payment.invoice.reason.returnStake",r),recharge:Ie("payment.invoice.reason.recharge",r),stake_overdraft_protection:Ie("payment.invoice.reason.stake",r),overdraft_protection:Ie("payment.invoice.reason.fee",r),auto_recharge:Ie("payment.invoice.reason.recharge",r)};let m=Ie("payment.invoice.reason.payment",r);return(o.includes("stake")||o.includes("recharge")||o==="overdraft_protection")&&(m=f[o]),s?.startsWith("Subscription ")||s?.startsWith("Slash stake")?{description:f[o],reason:f[o],type:m}:{description:{"Stake for subscription plan change":Ie("payment.invoice.reason.stakeForChangePlan",r),"Stake for subscription payment change":Ie("payment.invoice.reason.stakeForChangePayment",r),"Stake for subscription":Ie("payment.invoice.reason.staking",r),"Return Subscription staking":Ie("payment.invoice.reason.returnStake",r),"Recharge for subscription":Ie("payment.invoice.reason.rechargeForSubscription",r),"Add funds for subscription":Ie("payment.invoice.reason.rechargeForSubscription",r),"Overdraft protection":Ie("payment.invoice.reason.overdraftProtection",r),"Stake for subscription overdraft protection":Ie("payment.invoice.reason.stakeForSubscriptionOverdraftProtection",r),"Re-stake to resume subscription":Ie("payment.invoice.reason.reStakeToResumeSubscription",r)}[s]||s,reason:f[o]||o,type:m}}function vw(a,r="en"){return Dt(window.location.origin,Ux(".well-known/service/user",{locale:r,did:a}))}function bw(a){if(!a)return[];const r=a.split(/(#([^#]*)#)/),o=[];for(let s=0;s<r.length;s++){const f=r[s];if(f){if(s%3===0)o.push({type:"text",content:f});else if(s%3===1&&f.startsWith("#")&&f.endsWith("#")){const m=f.slice(1,-1);m.length>=0&&o.push({type:"marked",content:m})}}}return o.filter(s=>s.content!=="")}function BS(a,r){if(!a||!r)return"";const o=a?.settings?.[a?.type]?.explorer_host||"";return a.type==="arcblock"&&r?Dt(o,"accounts",r,"tokens"):["ethereum","base"].includes(a.type)&&r?Dt(o,"address",r):""}function xw(a){return!!(a.type==="recurring"&&a.recurring?.usage_type==="metered"&&a.recurring?.meter_id)}function US(a,r,o){return o?!1:a&&a.type==="arcblock"?r.type!=="credit":!1}function OS(a,r){if(!r||!a)return a;try{const o=new URL(a);return o.searchParams.set("locale",r),o.toString()}catch{if(/[?&]locale=[^&]*/.test(a))return a.replace(/([?&])locale=[^&]*/,`$1locale=${r}`);const s=a.includes("?")?"&":"?";return`${a}${s}locale=${r}`}}function Yf(a){return a.palette.getContrastText(a.palette.primary.main)}const ot=v0();ot.interceptors.request.use(a=>{const r=Qn();a.baseURL=r||"";const o=Ox(window.blocklet?.languages),s=new URLSearchParams(a.url?.split("?").pop());a.params={...a.params||{},locale:o};const f=window.__PAYMENT_KIT_AUTH_TOKEN;if(f&&typeof a.params.authToken>"u"&&!s.has("authToken")&&(a.params.authToken=f),typeof a.params.livemode>"u"&&s.has("livemode")===!1){const m=localStorage.getItem("livemode");a.params.livemode=E0(m)?!0:JSON.parse(m)}return a},a=>Promise.reject(a));var ps=a=>a.type==="checkbox",ur=a=>a instanceof Date,Mn=a=>a==null;const $0=a=>typeof a=="object";var Zt=a=>!Mn(a)&&!Array.isArray(a)&&$0(a)&&!ur(a),V0=a=>Zt(a)&&a.target?ps(a.target)?a.target.checked:a.target.value:a,H0=(a,r)=>r.split(".").some((o,s,f)=>!isNaN(Number(o))&&a.has(f.slice(0,s).join("."))),zS=a=>{const r=a.constructor&&a.constructor.prototype;return Zt(r)&&r.hasOwnProperty("isPrototypeOf")},Gf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Mt(a){if(a instanceof Date)return new Date(a);const r=typeof FileList<"u"&&a instanceof FileList;if(Gf&&(a instanceof Blob||r))return a;const o=Array.isArray(a);if(!o&&!(Zt(a)&&zS(a)))return a;const s=o?[]:Object.create(Object.getPrototypeOf(a));for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&(s[f]=Mt(a[f]));return s}var ru=a=>/^\w*$/.test(a),Tt=a=>a===void 0,ou=a=>Array.isArray(a)?a.filter(Boolean):[],Kf=a=>ou(a.replace(/["|']|\]/g,"").split(/\.|\[/)),Be=(a,r,o)=>{if(!r||!Zt(a))return o;const s=(ru(r)?[r]:Kf(r)).reduce((f,m)=>Mn(f)?f:f[m],a);return Tt(s)||s===a?Tt(a[r])?o:a[r]:s},Hn=a=>typeof a=="boolean",xn=a=>typeof a=="function",_t=(a,r,o)=>{let s=-1;const f=ru(r)?[r]:Kf(r),m=f.length,c=m-1;for(;++s<m;){const h=f[s];let g=o;if(s!==c){const y=a[h];g=Zt(y)||Array.isArray(y)?y:isNaN(+f[s+1])?{}:[]}if(h==="__proto__"||h==="constructor"||h==="prototype")return;a[h]=g,a=a[h]}};const Ni={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},da={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},va={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Qd="form",Y0="root",Qf=Ne.createContext(null);Qf.displayName="HookFormControlContext";const su=()=>Ne.useContext(Qf);var G0=(a,r,o,s=!0)=>{const f={defaultValues:r._defaultValues};for(const m in a)Object.defineProperty(f,m,{get:()=>{const c=m;return r._proxyFormState[c]!==da.all&&(r._proxyFormState[c]=!s||da.all),o&&(o[c]=!0),a[c]}});return f};const lu=typeof window<"u"?Ne.useLayoutEffect:Ne.useEffect;function PS(a){const r=su(),{control:o=r,disabled:s,name:f,exact:m}=a||{},[c,h]=Ne.useState(o._formState),g=Ne.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return lu(()=>o._subscribe({name:f,formState:g.current,exact:m,callback:y=>{!s&&h({...o._formState,...y})}}),[f,s,m]),Ne.useEffect(()=>{g.current.isValid&&o._setValid(!0)},[o]),Ne.useMemo(()=>G0(c,o,g.current,!1),[c,o])}var Cn=a=>typeof a=="string",vf=(a,r,o,s,f)=>Cn(a)?(s&&r.watch.add(a),Be(o,a,f)):Array.isArray(a)?a.map(m=>(s&&r.watch.add(m),Be(o,m))):(s&&(r.watchAll=!0),o),bf=a=>Mn(a)||!$0(a);function xa(a,r,o=new WeakSet){if(bf(a)||bf(r))return Object.is(a,r);if(ur(a)&&ur(r))return Object.is(a.getTime(),r.getTime());const s=Object.keys(a),f=Object.keys(r);if(s.length!==f.length)return!1;if(o.has(a)||o.has(r))return!0;o.add(a),o.add(r);for(const m of s){const c=a[m];if(!f.includes(m))return!1;if(m!=="ref"){const h=r[m];if(ur(c)&&ur(h)||(Zt(c)||Array.isArray(c))&&(Zt(h)||Array.isArray(h))?!xa(c,h,o):!Object.is(c,h))return!1}}return!0}function ba(a){const r=su(),{control:o=r,name:s,defaultValue:f,disabled:m,exact:c,compute:h}=a||{},g=Ne.useRef(f),y=Ne.useRef(h),S=Ne.useRef(void 0),x=Ne.useRef(o),A=Ne.useRef(s);y.current=h;const[v,N]=Ne.useState(()=>{const w=o._getWatch(s,g.current);return y.current?y.current(w):w}),B=Ne.useCallback(w=>{const G=vf(s,o._names,w||o._formValues,!1,g.current);return y.current?y.current(G):G},[o._formValues,o._names,s]),O=Ne.useCallback(w=>{if(!m){const G=vf(s,o._names,w||o._formValues,!1,g.current);if(y.current){const T=y.current(G);xa(T,S.current)||(N(T),S.current=T)}else N(G)}},[o._formValues,o._names,m,s]);lu(()=>((x.current!==o||!xa(A.current,s))&&(x.current=o,A.current=s,O()),o._subscribe({name:s,formState:{values:!0},exact:c,callback:w=>{O(w.values)}})),[o,c,s,O]),Ne.useEffect(()=>o._removeUnmounted());const k=x.current!==o,K=A.current,j=Ne.useMemo(()=>{if(m)return null;const w=!k&&!xa(K,s);return k||w?B():null},[m,k,s,K,B]);return j!==null?j:v}function qS(a){const r=su(),{name:o,disabled:s,control:f=r,shouldUnregister:m,defaultValue:c,exact:h=!0}=a,g=H0(f._names.array,o),y=Ne.useMemo(()=>Be(f._formValues,o,Be(f._defaultValues,o,c)),[f,o,c]),S=ba({control:f,name:o,defaultValue:y,exact:h}),x=PS({control:f,name:o,exact:h}),A=Ne.useRef(a),v=Ne.useRef(void 0),N=Ne.useRef(f.register(o,{...a.rules,value:S,...Hn(a.disabled)?{disabled:a.disabled}:{}}));A.current=a;const B=Ne.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Be(x.errors,o)},isDirty:{enumerable:!0,get:()=>!!Be(x.dirtyFields,o)},isTouched:{enumerable:!0,get:()=>!!Be(x.touchedFields,o)},isValidating:{enumerable:!0,get:()=>!!Be(x.validatingFields,o)},error:{enumerable:!0,get:()=>Be(x.errors,o)}}),[x,o]),O=Ne.useCallback(w=>N.current.onChange({target:{value:V0(w),name:o},type:Ni.CHANGE}),[o]),k=Ne.useCallback(()=>N.current.onBlur({target:{value:Be(f._formValues,o),name:o},type:Ni.BLUR}),[o,f._formValues]),K=Ne.useCallback(w=>{const G=Be(f._fields,o);G&&G._f&&w&&(G._f.ref={focus:()=>xn(w.focus)&&w.focus(),select:()=>xn(w.select)&&w.select(),setCustomValidity:T=>xn(w.setCustomValidity)&&w.setCustomValidity(T),reportValidity:()=>xn(w.reportValidity)&&w.reportValidity()})},[f._fields,o]),j=Ne.useMemo(()=>({name:o,value:S,...Hn(s)||x.disabled?{disabled:x.disabled||s}:{},onChange:O,onBlur:k,ref:K}),[o,s,x.disabled,O,k,K,S]);return Ne.useEffect(()=>{const w=f._options.shouldUnregister||m,G=v.current;G&&G!==o&&!g&&f.unregister(G),f.register(o,{...A.current.rules,...Hn(A.current.disabled)?{disabled:A.current.disabled}:{}});const T=(R,q)=>{const z=Be(f._fields,R);z&&z._f&&(z._f.mount=q)};if(T(o,!0),w){const R=Mt(Be(f._options.defaultValues,o,A.current.defaultValue));_t(f._defaultValues,o,R),Tt(Be(f._formValues,o))&&_t(f._formValues,o,R)}return!g&&f.register(o),v.current=o,()=>{(g?w&&!f._state.action:w)?f.unregister(o):T(o,!1)}},[o,f,g,m]),Ne.useEffect(()=>{f._setDisabledField({disabled:s,name:o})},[s,o,f]),Ne.useMemo(()=>({field:j,formState:x,fieldState:B}),[j,x,B])}const Yl=a=>a.render(qS(a)),Zf=Ne.createContext(null);Zf.displayName="HookFormContext";const hs=()=>Ne.useContext(Zf),K0=a=>{const{children:r,watch:o,getValues:s,getFieldState:f,setError:m,clearErrors:c,setValue:h,trigger:g,formState:y,resetField:S,reset:x,handleSubmit:A,unregister:v,control:N,register:B,setFocus:O,subscribe:k}=a,K=Ne.useMemo(()=>({watch:o,getValues:s,getFieldState:f,setError:m,clearErrors:c,setValue:h,trigger:g,formState:y,resetField:S,reset:x,handleSubmit:A,unregister:v,control:N,register:B,setFocus:O,subscribe:k}),[c,N,y,f,s,A,B,x,S,m,O,h,k,g,v,o]);return Ne.createElement(Zf.Provider,{value:K},Ne.createElement(Qf.Provider,{value:K.control},r))};var LS=(a,r,o,s,f)=>r?{...o[a],types:{...o[a]&&o[a].types?o[a].types:{},[s]:f||!0}}:{},Bn=a=>Array.isArray(a)?a:[a],Rg=()=>{let a=[];return{get observers(){return a},next:f=>{for(const m of a)m.next&&m.next(f)},subscribe:f=>(a.push(f),{unsubscribe:()=>{a=a.filter(m=>m!==f)}}),unsubscribe:()=>{a=[]}}};function Q0(a,r){const o={};for(const s in a)if(a.hasOwnProperty(s)){const f=a[s],m=r[s];if(f&&Zt(f)&&m){const c=Q0(f,m);Zt(c)&&(o[s]=c)}else a[s]&&(o[s]=m)}return o}var yn=a=>Zt(a)&&!Object.keys(a).length,Xf=a=>a.type==="file",Gl=a=>{if(!Gf)return!1;const r=a?a.ownerDocument:0;return a instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Z0=a=>a.type==="select-multiple",Wf=a=>a.type==="radio",IS=a=>Wf(a)||ps(a),Zd=a=>Gl(a)&&a.isConnected;function $S(a,r){const o=r.slice(0,-1).length;let s=0;for(;s<o;)a=Tt(a)?s++:a[r[s++]];return a}function VS(a){for(const r in a)if(a.hasOwnProperty(r)&&!Tt(a[r]))return!1;return!0}function Qt(a,r){const o=Array.isArray(r)?r:ru(r)?[r]:Kf(r),s=o.length===1?a:$S(a,o),f=o.length-1,m=o[f];return s&&delete s[m],f!==0&&(Zt(s)&&yn(s)||Array.isArray(s)&&VS(s))&&Qt(a,o.slice(0,-1)),a}var HS=a=>{for(const r in a)if(xn(a[r]))return!0;return!1};function X0(a){return Array.isArray(a)||Zt(a)&&!HS(a)}function xf(a,r={}){for(const o in a){const s=a[o];X0(s)?(r[o]=Array.isArray(s)?[]:{},xf(s,r[o])):Tt(s)||(r[o]=!0)}return r}function rs(a,r,o){o||(o=xf(r));for(const s in a){const f=a[s];if(X0(f))Tt(r)||bf(o[s])?o[s]=xf(f,Array.isArray(f)?[]:{}):rs(f,Mn(r)?{}:r[s],o[s]);else{const m=r[s];o[s]=!xa(f,m)}}return o}const Mg={value:!1,isValid:!1},Ng={value:!0,isValid:!0};var W0=a=>{if(Array.isArray(a)){if(a.length>1){const r=a.filter(o=>o&&o.checked&&!o.disabled).map(o=>o.value);return{value:r,isValid:!!r.length}}return a[0].checked&&!a[0].disabled?a[0].attributes&&!Tt(a[0].attributes.value)?Tt(a[0].value)||a[0].value===""?Ng:{value:a[0].value,isValid:!0}:Ng:Mg}return Mg},J0=(a,{valueAsNumber:r,valueAsDate:o,setValueAs:s})=>Tt(a)?a:r?a===""?NaN:a&&+a:o&&Cn(a)?new Date(a):s?s(a):a;const Bg={isValid:!1,value:null};var eD=a=>Array.isArray(a)?a.reduce((r,o)=>o&&o.checked&&!o.disabled?{isValid:!0,value:o.value}:r,Bg):Bg;function Ug(a){const r=a.ref;return Xf(r)?r.files:Wf(r)?eD(a.refs).value:Z0(r)?[...r.selectedOptions].map(({value:o})=>o):ps(r)?W0(a.refs).value:J0(Tt(r.value)?a.ref.value:r.value,a)}var YS=a=>a.substring(0,a.search(/\.\d+(\.|$)/))||a,GS=(a,r,o,s)=>{const f={};for(const m of a){const c=Be(r,m);c&&_t(f,m,c._f)}return{criteriaMode:o,names:[...a],fields:f,shouldUseNativeValidation:s}},Kl=a=>a instanceof RegExp,as=a=>Tt(a)?a:Kl(a)?a.source:Zt(a)?Kl(a.value)?a.value.source:a.value:a,io=a=>({isOnSubmit:!a||a===da.onSubmit,isOnBlur:a===da.onBlur,isOnChange:a===da.onChange,isOnAll:a===da.all,isOnTouch:a===da.onTouched});const Og="AsyncFunction";var KS=a=>!!a&&!!a.validate&&!!(xn(a.validate)&&a.validate.constructor.name===Og||Zt(a.validate)&&Object.values(a.validate).find(r=>r.constructor.name===Og)),QS=a=>a.mount&&(a.required||a.min||a.max||a.maxLength||a.minLength||a.pattern||a.validate),Cf=(a,r,o)=>!o&&(r.watchAll||r.watch.has(a)||[...r.watch].some(s=>a.startsWith(s)&&/^\.\w+/.test(a.slice(s.length))));const oo=(a,r,o,s)=>{for(const f of o||Object.keys(a)){const m=Be(a,f);if(m){const{_f:c,...h}=m;if(c){if(c.refs&&c.refs[0]&&r(c.refs[0],f)&&!s)return!0;if(c.ref&&r(c.ref,c.name)&&!s)return!0;if(oo(h,r))break}else if(Zt(h)&&oo(h,r))break}}};function zg(a,r,o){const s=Be(a,o);if(s||ru(o))return{error:s,name:o};const f=o.split(".");for(;f.length;){const m=f.join("."),c=Be(r,m),h=Be(a,m);if(c&&!Array.isArray(c)&&o!==m)return{name:o};if(h&&h.type)return{name:m,error:h};if(h&&h.root&&h.root.type)return{name:`${m}.root`,error:h.root};f.pop()}return{name:o}}var ZS=(a,r,o,s)=>{o(a);const{name:f,...m}=a;return yn(m)||Object.keys(m).length>=Object.keys(r).length||Object.keys(m).find(c=>r[c]===(!s||da.all))},XS=(a,r,o)=>!a||!r||a===r||Bn(a).some(s=>s&&(o?s===r:s.startsWith(r)||r.startsWith(s))),WS=(a,r,o,s,f)=>f.isOnAll?!1:!o&&f.isOnTouch?!(r||a):(o?s.isOnBlur:f.isOnBlur)?!a:(o?s.isOnChange:f.isOnChange)?a:!0,JS=(a,r)=>!ou(Be(a,r)).length&&Qt(a,r),tD=(a,r,o)=>{const s=Bn(Be(a,o));return _t(s,Y0,r[o]),_t(a,o,s),a};function Pg(a,r,o="validate"){if(Cn(a)||Array.isArray(a)&&a.every(Cn)||Hn(a)&&!a)return{type:o,message:Cn(a)?a:"",ref:r}}var eo=a=>Zt(a)&&!Kl(a)?a:{value:a,message:""},Sf=async(a,r,o,s,f,m)=>{const{ref:c,refs:h,required:g,maxLength:y,minLength:S,min:x,max:A,pattern:v,validate:N,name:B,valueAsNumber:O,mount:k}=a._f,K=Be(o,B);if(!k||r.has(B))return{};const j=h?h[0]:c,w=Q=>{f&&j.reportValidity&&(j.setCustomValidity(Hn(Q)?"":Q||""),j.reportValidity())},G={},T=Wf(c),R=ps(c),q=T||R,z=(O||Xf(c))&&Tt(c.value)&&Tt(K)||Gl(c)&&c.value===""||K===""||Array.isArray(K)&&!K.length,$=LS.bind(null,B,s,G),re=(Q,Z,ne,me=va.maxLength,P=va.minLength)=>{const D=Q?Z:ne;G[B]={type:Q?me:P,message:D,ref:c,...$(Q?me:P,D)}};if(m?!Array.isArray(K)||!K.length:g&&(!q&&(z||Mn(K))||Hn(K)&&!K||R&&!W0(h).isValid||T&&!eD(h).isValid)){const{value:Q,message:Z}=Cn(g)?{value:!!g,message:g}:eo(g);if(Q&&(G[B]={type:va.required,message:Z,ref:j,...$(va.required,Z)},!s))return w(Z),G}if(!z&&(!Mn(x)||!Mn(A))){let Q,Z;const ne=eo(A),me=eo(x);if(!Mn(K)&&!isNaN(K)){const P=c.valueAsNumber||K&&+K;Mn(ne.value)||(Q=P>ne.value),Mn(me.value)||(Z=P<me.value)}else{const P=c.valueAsDate||new Date(K),D=be=>new Date(new Date().toDateString()+" "+be),F=c.type=="time",ae=c.type=="week";Cn(ne.value)&&K&&(Q=F?D(K)>D(ne.value):ae?K>ne.value:P>new Date(ne.value)),Cn(me.value)&&K&&(Z=F?D(K)<D(me.value):ae?K<me.value:P<new Date(me.value))}if((Q||Z)&&(re(!!Q,ne.message,me.message,va.max,va.min),!s))return w(G[B].message),G}if((y||S)&&!z&&(Cn(K)||m&&Array.isArray(K))){const Q=eo(y),Z=eo(S),ne=!Mn(Q.value)&&K.length>+Q.value,me=!Mn(Z.value)&&K.length<+Z.value;if((ne||me)&&(re(ne,Q.message,Z.message),!s))return w(G[B].message),G}if(v&&!z&&Cn(K)){const{value:Q,message:Z}=eo(v);if(Kl(Q)&&!K.match(Q)&&(G[B]={type:va.pattern,message:Z,ref:c,...$(va.pattern,Z)},!s))return w(Z),G}if(N){if(xn(N)){const Q=await N(K,o),Z=Pg(Q,j);if(Z&&(G[B]={...Z,...$(va.validate,Z.message)},!s))return w(Z.message),G}else if(Zt(N)){let Q={};for(const Z in N){if(!yn(Q)&&!s)break;const ne=Pg(await N[Z](K,o),j,Z);ne&&(Q={...ne,...$(Z,ne.message)},w(ne.message),s&&(G[B]=Q))}if(!yn(Q)&&(G[B]={ref:j,...Q},!s))return G}}return w(!0),G};const e_={mode:da.onSubmit,reValidateMode:da.onChange,shouldFocusError:!0};function t_(a={}){let r={...e_,...a},o={submitCount:0,isDirty:!1,isReady:!1,isLoading:xn(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},s={},f=Zt(r.defaultValues)||Zt(r.values)?Mt(r.defaultValues||r.values)||{}:{},m=r.shouldUnregister?{}:Mt(f),c={action:!1,mount:!1,watch:!1,keepIsValid:!1},h={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},g,y=0;const S={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},x={...S};let A={...x};const v={array:Rg(),state:Rg()},N=r.criteriaMode===da.all,B=_=>I=>{clearTimeout(y),y=setTimeout(_,I)},O=async _=>{if(!c.keepIsValid&&!r.disabled&&(x.isValid||A.isValid||_)){let I;r.resolver?(I=yn((await z()).errors),k()):I=await Q({fields:s,onlyCheckValid:!0,eventType:Ni.VALID}),I!==o.isValid&&v.state.next({isValid:I})}},k=(_,I)=>{!r.disabled&&(x.isValidating||x.validatingFields||A.isValidating||A.validatingFields)&&((_||Array.from(h.mount)).forEach(ee=>{ee&&(I?_t(o.validatingFields,ee,I):Qt(o.validatingFields,ee))}),v.state.next({validatingFields:o.validatingFields,isValidating:!yn(o.validatingFields)}))},K=_=>{const I=rs(f,m),ee=YS(_);_t(o.dirtyFields,ee,Be(I,ee))},j=(_,I=[],ee,Ee,De=!0,Ce=!0)=>{if(Ee&&ee&&!r.disabled){if(c.action=!0,Ce&&Array.isArray(Be(s,_))){const Te=ee(Be(s,_),Ee.argA,Ee.argB);De&&_t(s,_,Te)}if(Ce&&Array.isArray(Be(o.errors,_))){const Te=ee(Be(o.errors,_),Ee.argA,Ee.argB);De&&_t(o.errors,_,Te),JS(o.errors,_)}if((x.touchedFields||A.touchedFields)&&Ce&&Array.isArray(Be(o.touchedFields,_))){const Te=ee(Be(o.touchedFields,_),Ee.argA,Ee.argB);De&&_t(o.touchedFields,_,Te)}(x.dirtyFields||A.dirtyFields)&&K(_),v.state.next({name:_,isDirty:ne(_,I),dirtyFields:o.dirtyFields,errors:o.errors,isValid:o.isValid})}else _t(m,_,I)},w=(_,I)=>{_t(o.errors,_,I),v.state.next({errors:o.errors})},G=_=>{o.errors=_,v.state.next({errors:o.errors,isValid:!1})},T=(_,I,ee,Ee)=>{const De=Be(s,_);if(De){const Ce=Be(m,_,Tt(ee)?Be(f,_):ee);Tt(Ce)||Ee&&Ee.defaultChecked||I?_t(m,_,I?Ce:Ug(De._f)):D(_,Ce),c.mount&&!c.action&&O()}},R=(_,I,ee,Ee,De)=>{let Ce=!1,Te=!1;const Ye={name:_};if(!r.disabled){if(!ee||Ee){(x.isDirty||A.isDirty)&&(Te=o.isDirty,o.isDirty=Ye.isDirty=ne(),Ce=Te!==Ye.isDirty);const ve=xa(Be(f,_),I);Te=!!Be(o.dirtyFields,_),ve?Qt(o.dirtyFields,_):_t(o.dirtyFields,_,!0),Ye.dirtyFields=o.dirtyFields,Ce=Ce||(x.dirtyFields||A.dirtyFields)&&Te!==!ve}if(ee){const ve=Be(o.touchedFields,_);ve||(_t(o.touchedFields,_,ee),Ye.touchedFields=o.touchedFields,Ce=Ce||(x.touchedFields||A.touchedFields)&&ve!==ee)}Ce&&De&&v.state.next(Ye)}return Ce?Ye:{}},q=(_,I,ee,Ee)=>{const De=Be(o.errors,_),Ce=(x.isValid||A.isValid)&&Hn(I)&&o.isValid!==I;if(r.delayError&&ee?(g=B(()=>w(_,ee)),g(r.delayError)):(clearTimeout(y),g=null,ee?_t(o.errors,_,ee):Qt(o.errors,_)),(ee?!xa(De,ee):De)||!yn(Ee)||Ce){const Te={...Ee,...Ce&&Hn(I)?{isValid:I}:{},errors:o.errors,name:_};o={...o,...Te},v.state.next(Te)}},z=async _=>(k(_,!0),await r.resolver(m,r.context,GS(_||h.mount,s,r.criteriaMode,r.shouldUseNativeValidation))),$=async _=>{const{errors:I}=await z(_);if(k(_),_)for(const ee of _){const Ee=Be(I,ee);Ee?_t(o.errors,ee,Ee):Qt(o.errors,ee)}else o.errors=I;return I},re=async({name:_,eventType:I})=>{if(a.validate){const ee=await a.validate({formValues:m,formState:o,name:_,eventType:I});if(Zt(ee))for(const Ee in ee)ee[Ee]&&Pe(`${Qd}.${Ee}`,{message:Cn(ee.message)?ee.message:"",type:va.validate});else Cn(ee)||!ee?Pe(Qd,{message:ee||"",type:va.validate}):$e(Qd);return ee}return!0},Q=async({fields:_,onlyCheckValid:I,name:ee,eventType:Ee,context:De={valid:!0,runRootValidation:!1}})=>{if(a.validate&&(De.runRootValidation=!0,!await re({name:ee,eventType:Ee})&&(De.valid=!1,I)))return De.valid;for(const Ce in _){const Te=_[Ce];if(Te){const{_f:Ye,...ve}=Te;if(Ye){const qe=h.array.has(Ye.name),Oe=Te._f&&KS(Te._f);Oe&&x.validatingFields&&k([Ye.name],!0);const Ve=await Sf(Te,h.disabled,m,N,r.shouldUseNativeValidation&&!I,qe);if(Oe&&x.validatingFields&&k([Ye.name]),Ve[Ye.name]&&(De.valid=!1,I)||(!I&&(Be(Ve,Ye.name)?qe?tD(o.errors,Ve,Ye.name):_t(o.errors,Ye.name,Ve[Ye.name]):Qt(o.errors,Ye.name)),a.shouldUseNativeValidation&&Ve[Ye.name]))break}!yn(ve)&&await Q({context:De,onlyCheckValid:I,fields:ve,name:Ce,eventType:Ee})}}return De.valid},Z=()=>{for(const _ of h.unMount){const I=Be(s,_);I&&(I._f.refs?I._f.refs.every(ee=>!Zd(ee)):!Zd(I._f.ref))&&b(_)}h.unMount=new Set},ne=(_,I)=>!r.disabled&&(_&&I&&_t(m,_,I),!xa(Ae(),f)),me=(_,I,ee)=>vf(_,h,{...c.mount?m:Tt(I)?f:Cn(_)?{[_]:I}:I},ee,I),P=_=>ou(Be(c.mount?m:f,_,r.shouldUnregister?Be(f,_,[]):[])),D=(_,I,ee={})=>{const Ee=Be(s,_);let De=I;if(Ee){const Ce=Ee._f;Ce&&(!Ce.disabled&&_t(m,_,J0(I,Ce)),De=Gl(Ce.ref)&&Mn(I)?"":I,Z0(Ce.ref)?[...Ce.ref.options].forEach(Te=>Te.selected=De.includes(Te.value)):Ce.refs?ps(Ce.ref)?Ce.refs.forEach(Te=>{(!Te.defaultChecked||!Te.disabled)&&(Array.isArray(De)?Te.checked=!!De.find(Ye=>Ye===Te.value):Te.checked=De===Te.value||!!De)}):Ce.refs.forEach(Te=>Te.checked=Te.value===De):Xf(Ce.ref)?Ce.ref.value="":(Ce.ref.value=De,Ce.ref.type||v.state.next({name:_,values:Mt(m)})))}(ee.shouldDirty||ee.shouldTouch)&&R(_,De,ee.shouldTouch,ee.shouldDirty,!0),ee.shouldValidate&&Fe(_)},F=(_,I,ee)=>{for(const Ee in I){if(!I.hasOwnProperty(Ee))return;const De=I[Ee],Ce=_+"."+Ee,Te=Be(s,Ce);(h.array.has(_)||Zt(De)||Te&&!Te._f)&&!ur(De)?F(Ce,De,ee):D(Ce,De,ee)}},ae=(_,I,ee={})=>{const Ee=Be(s,_),De=h.array.has(_),Ce=Mt(I);_t(m,_,Ce),De?(v.array.next({name:_,values:Mt(m)}),(x.isDirty||x.dirtyFields||A.isDirty||A.dirtyFields)&&ee.shouldDirty&&(K(_),v.state.next({name:_,dirtyFields:o.dirtyFields,isDirty:ne(_,Ce)}))):Ee&&!Ee._f&&!Mn(Ce)?F(_,Ce,ee):D(_,Ce,ee),Cf(_,h)?v.state.next({...o,name:_,values:Mt(m)}):v.state.next({name:c.mount?_:void 0,values:Mt(m)})},be=async _=>{c.mount=!0;const I=_.target;let ee=I.name,Ee=!0;const De=Be(s,ee),Ce=ve=>{Ee=Number.isNaN(ve)||ur(ve)&&isNaN(ve.getTime())||xa(ve,Be(m,ee,ve))},Te=io(r.mode),Ye=io(r.reValidateMode);if(De){let ve,qe;const Oe=I.type?Ug(De._f):V0(_),Ve=_.type===Ni.BLUR||_.type===Ni.FOCUS_OUT,Ge=!QS(De._f)&&!a.validate&&!r.resolver&&!Be(o.errors,ee)&&!De._f.deps||WS(Ve,Be(o.touchedFields,ee),o.isSubmitted,Ye,Te),Ke=Cf(ee,h,Ve);_t(m,ee,Oe),Ve?(!I||!I.readOnly)&&(De._f.onBlur&&De._f.onBlur(_),g&&g(0)):De._f.onChange&&De._f.onChange(_);const et=R(ee,Oe,Ve),Lt=!yn(et)||Ke;if(!Ve&&v.state.next({name:ee,type:_.type,values:Mt(m)}),Ge)return(x.isValid||A.isValid)&&(r.mode==="onBlur"?Ve&&O():Ve||O()),Lt&&v.state.next({name:ee,...Ke?{}:et});if(!r.resolver&&a.validate&&await re({name:ee,eventType:_.type}),!Ve&&Ke&&v.state.next({...o}),r.resolver){const{errors:It}=await z([ee]);if(k([ee]),Ce(Oe),Ee){const kt=zg(o.errors,s,ee),zt=zg(It,s,kt.name||ee);ve=zt.error,ee=zt.name,qe=yn(It)}}else k([ee],!0),ve=(await Sf(De,h.disabled,m,N,r.shouldUseNativeValidation))[ee],k([ee]),Ce(Oe),Ee&&(ve?qe=!1:(x.isValid||A.isValid)&&(qe=await Q({fields:s,onlyCheckValid:!0,name:ee,eventType:_.type})));Ee&&(De._f.deps&&(!Array.isArray(De._f.deps)||De._f.deps.length>0)&&Fe(De._f.deps),q(ee,qe,ve,et))}},Me=(_,I)=>{if(Be(o.errors,I)&&_.focus)return _.focus(),1},Fe=async(_,I={})=>{let ee,Ee;const De=Bn(_);if(r.resolver){const Ce=await $(Tt(_)?_:De);ee=yn(Ce),Ee=_?!De.some(Te=>Be(Ce,Te)):ee}else _?(Ee=(await Promise.all(De.map(async Ce=>{const Te=Be(s,Ce);return await Q({fields:Te&&Te._f?{[Ce]:Te}:Te,eventType:Ni.TRIGGER})}))).every(Boolean),!(!Ee&&!o.isValid)&&O()):Ee=ee=await Q({fields:s,name:_,eventType:Ni.TRIGGER});return v.state.next({...!Cn(_)||(x.isValid||A.isValid)&&ee!==o.isValid?{}:{name:_},...r.resolver||!_?{isValid:ee}:{},errors:o.errors}),I.shouldFocus&&!Ee&&oo(s,Me,_?De:h.mount),Ee},Ae=(_,I)=>{let ee={...c.mount?m:f};return I&&(ee=Q0(I.dirtyFields?o.dirtyFields:o.touchedFields,ee)),Tt(_)?ee:Cn(_)?Be(ee,_):_.map(Ee=>Be(ee,Ee))},ue=(_,I)=>({invalid:!!Be((I||o).errors,_),isDirty:!!Be((I||o).dirtyFields,_),error:Be((I||o).errors,_),isValidating:!!Be(o.validatingFields,_),isTouched:!!Be((I||o).touchedFields,_)}),$e=_=>{const I=_?Bn(_):void 0;I?.forEach(ee=>Qt(o.errors,ee)),I?I.forEach(ee=>{v.state.next({name:ee,errors:o.errors})}):v.state.next({errors:{}})},Pe=(_,I,ee)=>{const Ee=(Be(s,_,{_f:{}})._f||{}).ref,De=Be(o.errors,_)||{},{ref:Ce,message:Te,type:Ye,...ve}=De;_t(o.errors,_,{...ve,...I,ref:Ee}),v.state.next({name:_,errors:o.errors,isValid:!1}),ee&&ee.shouldFocus&&Ee&&Ee.focus&&Ee.focus()},Xe=(_,I)=>xn(_)?v.state.subscribe({next:ee=>"values"in ee&&_(me(void 0,I),ee)}):me(_,I,!0),Ze=_=>v.state.subscribe({next:I=>{XS(_.name,I.name,_.exact)&&ZS(I,_.formState||x,U,_.reRenderRoot)&&_.callback({values:{...m},...o,...I,defaultValues:f})}}).unsubscribe,Ue=_=>(c.mount=!0,A={...A,..._.formState},Ze({..._,formState:{...S,..._.formState}})),b=(_,I={})=>{for(const ee of _?Bn(_):h.mount)h.mount.delete(ee),h.array.delete(ee),I.keepValue||(Qt(s,ee),Qt(m,ee)),!I.keepError&&Qt(o.errors,ee),!I.keepDirty&&Qt(o.dirtyFields,ee),!I.keepTouched&&Qt(o.touchedFields,ee),!I.keepIsValidating&&Qt(o.validatingFields,ee),!r.shouldUnregister&&!I.keepDefaultValue&&Qt(f,ee);v.state.next({values:Mt(m)}),v.state.next({...o,...I.keepDirty?{isDirty:ne()}:{}}),!I.keepIsValid&&O()},E=({disabled:_,name:I})=>{if(Hn(_)&&c.mount||_||h.disabled.has(I)){const De=h.disabled.has(I)!==!!_;_?h.disabled.add(I):h.disabled.delete(I),De&&c.mount&&!c.action&&O()}},L=(_,I={})=>{let ee=Be(s,_);const Ee=Hn(I.disabled)||Hn(r.disabled),De=!h.registerName.has(_)&&ee&&!ee._f.mount;return _t(s,_,{...ee||{},_f:{...ee&&ee._f?ee._f:{ref:{name:_}},name:_,mount:!0,...I}}),h.mount.add(_),ee&&!De?E({disabled:Hn(I.disabled)?I.disabled:r.disabled,name:_}):T(_,!0,I.value),{...Ee?{disabled:I.disabled||r.disabled}:{},...r.progressive?{required:!!I.required,min:as(I.min),max:as(I.max),minLength:as(I.minLength),maxLength:as(I.maxLength),pattern:as(I.pattern)}:{},name:_,onChange:be,onBlur:be,ref:Ce=>{if(Ce){h.registerName.add(_),L(_,I),h.registerName.delete(_),ee=Be(s,_);const Te=Tt(Ce.value)&&Ce.querySelectorAll&&Ce.querySelectorAll("input,select,textarea")[0]||Ce,Ye=IS(Te),ve=ee._f.refs||[];if(Ye?ve.find(qe=>qe===Te):Te===ee._f.ref)return;_t(s,_,{_f:{...ee._f,...Ye?{refs:[...ve.filter(Zd),Te,...Array.isArray(Be(f,_))?[{}]:[]],ref:{type:Te.type,name:_}}:{ref:Te}}}),T(_,!1,void 0,Te)}else ee=Be(s,_,{}),ee._f&&(ee._f.mount=!1),(r.shouldUnregister||I.shouldUnregister)&&!(H0(h.array,_)&&c.action)&&h.unMount.add(_)}}},ie=()=>r.shouldFocusError&&oo(s,Me,h.mount),W=_=>{Hn(_)&&(v.state.next({disabled:_}),oo(s,(I,ee)=>{const Ee=Be(s,ee);Ee&&(I.disabled=Ee._f.disabled||_,Array.isArray(Ee._f.refs)&&Ee._f.refs.forEach(De=>{De.disabled=Ee._f.disabled||_}))},0,!1))},te=(_,I)=>async ee=>{let Ee;ee&&(ee.preventDefault&&ee.preventDefault(),ee.persist&&ee.persist());let De=Mt(m);if(v.state.next({isSubmitting:!0}),r.resolver){const{errors:Ce,values:Te}=await z();k(),o.errors=Ce,De=Mt(Te)}else await Q({fields:s,eventType:Ni.SUBMIT});if(h.disabled.size)for(const Ce of h.disabled)Qt(De,Ce);if(Qt(o.errors,Y0),yn(o.errors)){v.state.next({errors:{}});try{await _(De,ee)}catch(Ce){Ee=Ce}}else I&&await I({...o.errors},ee),ie(),setTimeout(ie);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:yn(o.errors)&&!Ee,submitCount:o.submitCount+1,errors:o.errors}),Ee)throw Ee},ce=(_,I={})=>{Be(s,_)&&(Tt(I.defaultValue)?ae(_,Mt(Be(f,_))):(ae(_,I.defaultValue),_t(f,_,Mt(I.defaultValue))),I.keepTouched||Qt(o.touchedFields,_),I.keepDirty||(Qt(o.dirtyFields,_),o.isDirty=I.defaultValue?ne(_,Mt(Be(f,_))):ne()),I.keepError||(Qt(o.errors,_),x.isValid&&O()),v.state.next({...o}))},J=(_,I={})=>{const ee=_?Mt(_):f,Ee=Mt(ee),De=yn(_),Ce=De?f:Ee;if(I.keepDefaultValues||(f=ee),!I.keepValues){if(I.keepDirtyValues){const Te=new Set([...h.mount,...Object.keys(rs(f,m))]);for(const Ye of Array.from(Te)){const ve=Be(o.dirtyFields,Ye),qe=Be(m,Ye),Oe=Be(Ce,Ye);ve&&!Tt(qe)?_t(Ce,Ye,qe):!ve&&!Tt(Oe)&&ae(Ye,Oe)}}else{if(Gf&&Tt(_))for(const Te of h.mount){const Ye=Be(s,Te);if(Ye&&Ye._f){const ve=Array.isArray(Ye._f.refs)?Ye._f.refs[0]:Ye._f.ref;if(Gl(ve)){const qe=ve.closest("form");if(qe){qe.reset();break}}}}if(I.keepFieldsRef)for(const Te of h.mount)ae(Te,Be(Ce,Te));else s={}}m=r.shouldUnregister?I.keepDefaultValues?Mt(f):{}:Mt(Ce),v.array.next({values:{...Ce}}),v.state.next({values:{...Ce}})}h={mount:I.keepDirtyValues?h.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!x.isValid||!!I.keepIsValid||!!I.keepDirtyValues||!r.shouldUnregister&&!yn(Ce),c.watch=!!r.shouldUnregister,c.keepIsValid=!!I.keepIsValid,c.action=!1,I.keepErrors||(o.errors={}),v.state.next({submitCount:I.keepSubmitCount?o.submitCount:0,isDirty:De?!1:I.keepDirty?o.isDirty:!!(I.keepDefaultValues&&!xa(_,f)),isSubmitted:I.keepIsSubmitted?o.isSubmitted:!1,dirtyFields:De?{}:I.keepDirtyValues?I.keepDefaultValues&&m?rs(f,m):o.dirtyFields:I.keepDefaultValues&&_?rs(f,_):I.keepDirty?o.dirtyFields:{},touchedFields:I.keepTouched?o.touchedFields:{},errors:I.keepErrors?o.errors:{},isSubmitSuccessful:I.keepIsSubmitSuccessful?o.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:f})},H=(_,I)=>J(xn(_)?_(m):_,{...r.resetOptions,...I}),M=(_,I={})=>{const ee=Be(s,_),Ee=ee&&ee._f;if(Ee){const De=Ee.refs?Ee.refs[0]:Ee.ref;De.focus&&setTimeout(()=>{De.focus(),I.shouldSelect&&xn(De.select)&&De.select()})}},U=_=>{o={...o,..._}},je={control:{register:L,unregister:b,getFieldState:ue,handleSubmit:te,setError:Pe,_subscribe:Ze,_runSchema:z,_updateIsValidating:k,_focusError:ie,_getWatch:me,_getDirty:ne,_setValid:O,_setFieldArray:j,_setDisabledField:E,_setErrors:G,_getFieldArray:P,_reset:J,_resetDefaultValues:()=>xn(r.defaultValues)&&r.defaultValues().then(_=>{H(_,r.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:Z,_disableForm:W,_subjects:v,_proxyFormState:x,get _fields(){return s},get _formValues(){return m},get _state(){return c},set _state(_){c=_},get _defaultValues(){return f},get _names(){return h},set _names(_){h=_},get _formState(){return o},get _options(){return r},set _options(_){r={...r,..._}}},subscribe:Ue,trigger:Fe,register:L,handleSubmit:te,watch:Xe,setValue:ae,getValues:Ae,reset:H,resetField:ce,clearErrors:$e,unregister:b,setError:Pe,setFocus:M,getFieldState:ue};return{...je,formControl:je}}var ji=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const a=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const o=(Math.random()*16+a)%16|0;return(r=="x"?o:o&3|8).toString(16)})},Xd=(a,r,o={})=>o.shouldFocus||Tt(o.shouldFocus)?o.focusName||`${a}.${Tt(o.focusIndex)?r:o.focusIndex}.`:"",Wd=(a,r)=>[...a,...Bn(r)],Jd=a=>Array.isArray(a)?a.map(()=>{}):void 0;function ef(a,r,o){return[...a.slice(0,r),...Bn(o),...a.slice(r)]}var tf=(a,r,o)=>Array.isArray(a)?(Tt(a[o])&&(a[o]=void 0),a.splice(o,0,a.splice(r,1)[0]),a):[],nf=(a,r)=>[...Bn(r),...Bn(a)];function n_(a,r){let o=0;const s=[...a];for(const f of r)s.splice(f-o,1),o++;return ou(s).length?s:[]}var af=(a,r)=>Tt(r)?[]:n_(a,Bn(r).sort((o,s)=>o-s)),rf=(a,r,o)=>{[a[r],a[o]]=[a[o],a[r]]},qg=(a,r,o)=>(a[r]=o,a);function Cw(a){const r=su(),{control:o=r,name:s,keyName:f="id",shouldUnregister:m,rules:c}=a,[h,g]=Ne.useState(o._getFieldArray(s)),y=Ne.useRef(o._getFieldArray(s).map(ji)),S=Ne.useRef(!1);o._names.array.add(s),Ne.useMemo(()=>c&&h.length>=0&&o.register(s,c),[o,s,h.length,c]),lu(()=>o._subjects.array.subscribe({next:({values:w,name:G})=>{if(G===s||!G){const T=Be(w,s);Array.isArray(T)&&(g(T),y.current=T.map(ji))}}}).unsubscribe,[o,s]);const x=Ne.useCallback(w=>{S.current=!0,o._setFieldArray(s,w)},[o,s]),A=(w,G)=>{const T=Bn(Mt(w)),R=Wd(o._getFieldArray(s),T);o._names.focus=Xd(s,R.length-1,G),y.current=Wd(y.current,T.map(ji)),x(R),g(R),o._setFieldArray(s,R,Wd,{argA:Jd(w)})},v=(w,G)=>{const T=Bn(Mt(w)),R=nf(o._getFieldArray(s),T);o._names.focus=Xd(s,0,G),y.current=nf(y.current,T.map(ji)),x(R),g(R),o._setFieldArray(s,R,nf,{argA:Jd(w)})},N=w=>{const G=af(o._getFieldArray(s),w);y.current=af(y.current,w),x(G),g(G),!Array.isArray(Be(o._fields,s))&&_t(o._fields,s,void 0),o._setFieldArray(s,G,af,{argA:w})},B=(w,G,T)=>{const R=Bn(Mt(G)),q=ef(o._getFieldArray(s),w,R);o._names.focus=Xd(s,w,T),y.current=ef(y.current,w,R.map(ji)),x(q),g(q),o._setFieldArray(s,q,ef,{argA:w,argB:Jd(G)})},O=(w,G)=>{const T=o._getFieldArray(s);rf(T,w,G),rf(y.current,w,G),x(T),g(T),o._setFieldArray(s,T,rf,{argA:w,argB:G},!1)},k=(w,G)=>{const T=o._getFieldArray(s);tf(T,w,G),tf(y.current,w,G),x(T),g(T),o._setFieldArray(s,T,tf,{argA:w,argB:G},!1)},K=(w,G)=>{const T=Mt(G),R=qg(o._getFieldArray(s),w,T);y.current=[...R].map((q,z)=>!q||z===w?ji():y.current[z]),x(R),g([...R]),o._setFieldArray(s,R,qg,{argA:w,argB:T},!0,!1)},j=w=>{const G=Bn(Mt(w));y.current=G.map(ji),x([...G]),g([...G]),o._setFieldArray(s,[...G],T=>T,{},!0,!1)};return Ne.useEffect(()=>{if(o._state.action=!1,Cf(s,o._names)&&o._subjects.state.next({...o._formState}),S.current&&(!io(o._options.mode).isOnSubmit||o._formState.isSubmitted)&&!io(o._options.reValidateMode).isOnSubmit)if(o._options.resolver)o._runSchema([s]).then(w=>{o._updateIsValidating([s]);const G=Be(w.errors,s),T=Be(o._formState.errors,s);(T?!G&&T.type||G&&(T.type!==G.type||T.message!==G.message):G&&G.type)&&(G?_t(o._formState.errors,s,G):Qt(o._formState.errors,s),o._subjects.state.next({errors:o._formState.errors}))});else{const w=Be(o._fields,s);w&&w._f&&!(io(o._options.reValidateMode).isOnSubmit&&io(o._options.mode).isOnSubmit)&&Sf(w,o._names.disabled,o._formValues,o._options.criteriaMode===da.all,o._options.shouldUseNativeValidation,!0).then(G=>!yn(G)&&o._subjects.state.next({errors:tD(o._formState.errors,G,s)}))}o._subjects.state.next({name:s,values:Mt(o._formValues)}),o._names.focus&&oo(o._fields,(w,G)=>{if(o._names.focus&&G.startsWith(o._names.focus)&&w.focus)return w.focus(),1}),o._names.focus="",o._setValid(),S.current=!1},[h,s,o]),Ne.useEffect(()=>(!Be(o._formValues,s)&&o._setFieldArray(s),()=>{const w=(G,T)=>{const R=Be(o._fields,G);R&&R._f&&(R._f.mount=T)};o._options.shouldUnregister||m?o.unregister(s):w(s,!1)}),[s,o,f,m]),{swap:Ne.useCallback(O,[x,s,o]),move:Ne.useCallback(k,[x,s,o]),prepend:Ne.useCallback(v,[x,s,o]),append:Ne.useCallback(A,[x,s,o]),remove:Ne.useCallback(N,[x,s,o]),insert:Ne.useCallback(B,[x,s,o]),update:Ne.useCallback(K,[x,s,o]),replace:Ne.useCallback(j,[x,s,o]),fields:Ne.useMemo(()=>h.map((w,G)=>({...w,[f]:y.current[G]||ji()})),[h,f])}}function nD(a={}){const r=Ne.useRef(void 0),o=Ne.useRef(void 0),[s,f]=Ne.useState({isDirty:!1,isValidating:!1,isLoading:xn(a.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:a.errors||{},disabled:a.disabled||!1,isReady:!1,defaultValues:xn(a.defaultValues)?void 0:a.defaultValues});if(!r.current)if(a.formControl)r.current={...a.formControl,formState:s},a.defaultValues&&!xn(a.defaultValues)&&a.formControl.reset(a.defaultValues,a.resetOptions);else{const{formControl:c,...h}=t_(a);r.current={...h,formState:s}}const m=r.current.control;return m._options=a,lu(()=>{const c=m._subscribe({formState:m._proxyFormState,callback:()=>f({...m._formState}),reRenderRoot:!0});return f(h=>({...h,isReady:!0})),m._formState.isReady=!0,c},[m]),Ne.useEffect(()=>m._disableForm(a.disabled),[m,a.disabled]),Ne.useEffect(()=>{a.mode&&(m._options.mode=a.mode),a.reValidateMode&&(m._options.reValidateMode=a.reValidateMode)},[m,a.mode,a.reValidateMode]),Ne.useEffect(()=>{a.errors&&(m._setErrors(a.errors),m._focusError())},[m,a.errors]),Ne.useEffect(()=>{a.shouldUnregister&&m._subjects.state.next({values:m._getWatch()})},[m,a.shouldUnregister]),Ne.useEffect(()=>{if(m._proxyFormState.isDirty){const c=m._getDirty();c!==s.isDirty&&m._subjects.state.next({isDirty:c})}},[m,s.isDirty]),Ne.useEffect(()=>{var c;a.values&&!xa(a.values,o.current)?(m._reset(a.values,{keepFieldsRef:!0,...m._options.resetOptions}),!((c=m._options.resetOptions)===null||c===void 0)&&c.keepIsValid||m._setValid(),o.current=a.values,f(h=>({...h}))):m._resetDefaultValues()},[m,a.values]),Ne.useEffect(()=>{m._state.mount||(m._setValid(),m._state.mount=!0),m._state.watch&&(m._state.watch=!1,m._subjects.state.next({...m._formState})),m._removeUnmounted()}),r.current.formState=Ne.useMemo(()=>G0(s,m),[m,s]),r.current}let os=[];const a_=(a,r)=>{if(a!=null&&r!=null)return os=[...os,[a,r]],()=>{os=os.filter(o=>o[1]!==r)}},aD=a=>{let{type:r}=a;typeof a=="string"&&(r=a);const o=[];typeof a=="string"?o.push({type:r}):o.push(a),os.forEach(([s,f])=>{typeof s=="string"&&s!==r||Array.isArray(s)&&!s.includes(r)||s instanceof RegExp&&!s.test(r)||typeof s=="function"&&!s(...o)||f(...o)})},iD=(a,r,o=[])=>(V.useEffect(()=>a_(a,r),o),aD);class ro{constructor(){this.cacheMap=new Map}static getInstance(){return ro.instance||(ro.instance=new ro),ro.instance}get(r){return this.cacheMap.get(r)}set(r,o){this.cacheMap.set(r,o)}delete(r){this.cacheMap.delete(r)}}const Fl=ro.getInstance();class rD{constructor(r,o,s={}){this.cacheKey=r,this.fetchData=o,this.options={strategy:"session",ttl:0,...s}}getCache(){const{strategy:r}=this.options;switch(r){case"local":return localStorage;case"memory":return Fl;default:return sessionStorage}}getCachedData(){const r=this.getCache(),o=this.options.strategy==="memory"?r.get(this.cacheKey):r.getItem(this.cacheKey);if(!o)return null;const s=JSON.parse(o);return this.options.ttl&&s.timestamp&&Date.now()-s.timestamp>this.options.ttl?(this.clearCache(),null):s.data}setCachedData(r){const o=this.getCache(),s=JSON.stringify({data:r,timestamp:Date.now()});this.options.strategy==="memory"?o.set(this.cacheKey,s):o.setItem(this.cacheKey,s)}clearCache(){const r=this.getCache();this.options.strategy==="memory"?r.delete(this.cacheKey):r.removeItem(this.cacheKey)}fetch(r=!1){const o=!r&&this.getCachedData();if(o)return Promise.resolve(o);const s=Fl.get(this.cacheKey);if(s?.promise)return s.promise;const f=this.fetchData().then(({data:m})=>(this.setCachedData(m),m)).finally(()=>{Fl.delete(this.cacheKey)});return Fl.set(this.cacheKey,{promise:f}),f}}const i_=a=>a?{...a,paymentMethods:a.paymentMethods||[],baseCurrency:a.baseCurrency||{}}:{paymentMethods:[],baseCurrency:{}},oD=V.createContext({api:ot}),{Provider:r_,Consumer:Sw}=oD,o_=(a=!1)=>{const r=localStorage.getItem("livemode")!=="false",o=`payment-settings-${window.location.pathname}-${r}`;return new rD(o,()=>ot.get("/api/settings",{params:{livemode:r}})).fetch(a)},s_=(a,r)=>r.reduce((s,f)=>s.concat(f.payment_currencies),[]).find(s=>s.id===a),l_=(a,r)=>r.find(o=>o.id===a);function sD({session:a,connect:r,children:o,baseUrl:s=void 0,authToken:f=void 0}){const[m,c]=V.useState(!1);f?window.__PAYMENT_KIT_AUTH_TOKEN=f:window.__PAYMENT_KIT_AUTH_TOKEN="",V.useEffect(()=>{(async()=>{if(!s){window.__PAYMENT_KIT_BASE_URL="",c(!1);return}const w=new URL(s);if(w.origin===window.location.origin){window.__PAYMENT_KIT_BASE_URL="",c(!1);return}c(!0);try{const G=Dt(w.origin,"__blocklet__.js?type=json"),T=`cross-origin-blocklet-${w.origin}`,q=await new rD(T,()=>Px.get(G).then($=>({data:$.data})),{strategy:"session",ttl:600*1e3}).fetch();if((q?.componentId||"").split("/").pop()===us)window.__PAYMENT_KIT_BASE_URL=Dt(w.origin,q.prefix||"/");else{const $=(q?.componentMountPoints||[]).find(re=>re?.did===us);window.__PAYMENT_KIT_BASE_URL=$?Dt(w.origin,$.mountPoint):s}}catch(G){console.warn(`Failed to fetch blocklet json from ${s}:`,G),window.__PAYMENT_KIT_BASE_URL=s}finally{c(!1)}})()},[s]);const[h,g]=zx("livemode",{defaultValue:!0}),{data:y={paymentMethods:[],baseCurrency:{}},error:S,run:x,loading:A}=Pi(o_,{refreshDeps:[h]});iD(["paymentMethod.created","paymentMethod.updated","paymentCurrency.added","paymentCurrency.updated"],()=>x(!0),[x]);const v=Qn(),[N,B]=V.useState(!0),[O,k]=V.useState({paying:!1,stripePaying:!1}),K=j=>{k(w=>({...w,...j}))};return S?u.jsx(mr,{severity:"error",children:S.message}):A||m?null:u.jsx(r_,{value:{session:a,connect:r,prefix:v,livemode:!!h,settings:i_(y),getCurrency:j=>s_(j,y?.paymentMethods||[]),getMethod:j=>l_(j,y?.paymentMethods||[]),refresh:x,setLivemode:g,api:ot,payable:N,setPayable:B,paymentState:O,setPaymentState:K},children:o})}function _n(){return V.useContext(oD)}function u_(a){return a==="standalone"?{height:"100vh",maxHeight:"100%"}:{height:"auto",minHeight:200}}function so({title:a,description:r,button:o="Back",mode:s="standalone"}){const f=u_(s);return u.jsx(ge,{sx:[{alignItems:"center",justifyContent:"center"},...Array.isArray(f)?f:[f]],children:u.jsxs(ge,{direction:"column",sx:{alignItems:"center",justifyContent:"center",width:"280px"},children:[u.jsx(oe,{variant:"h5",sx:{mb:2},children:a}),u.jsx(oe,{variant:"body1",sx:{mb:2,textAlign:"center"},children:r}),typeof o=="string"?u.jsx(pt,{variant:"text",size:"small",sx:{color:"text.link"},component:cr,href:window.blocklet?.appUrl,children:o}):o]})})}function Lg(a){return u.jsxs(oe,{...a,sx:[{color:"text.lighter",fontSize:12},...Array.isArray(a.sx)?a.sx:[a.sx]],children:["Powered by"," ",u.jsx(oe,{component:"span",sx:{fontWeight:"bold",fontSize:12},children:"ArcBlock"})]})}var jl={exports:{}},Ig;function c_(){if(Ig)return jl.exports;Ig=1;const a=qx(),r=async(o,s)=>{s={interval:20,timeout:1/0,leadingCheck:!0,...s};let f;const m=new Promise((c,h)=>{const g=async()=>{try{const y=await o();if(typeof y!="boolean")throw new TypeError("Expected condition to return a boolean");y===!0?c():f=setTimeout(g,s.interval)}catch(y){h(y)}};s.leadingCheck?g():f=setTimeout(g,s.interval)});if(s.timeout!==1/0)try{return await a(m,s.timeout)}catch(c){throw f&&clearTimeout(f),c}return m};return jl.exports=r,jl.exports.default=r,jl.exports}var d_=c_();const lD=ri(d_);function uu(a){if(a==null)throw new TypeError("Expected a string but received a ".concat(a));if(a.constructor.name!=="String")throw new TypeError("Expected a string but received a ".concat(a.constructor.name))}function f_(a){return Object.prototype.toString.call(a)==="[object RegExp]"}function $g(a,r){for(var o=0;o<r.length;o++){var s=r[o];if(a===s||f_(s)&&s.test(a))return!0}return!1}function _f(a){"@babel/helpers - typeof";return _f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_f(a)}function of(a,r){uu(a);var o,s;_f(r)==="object"?(o=r.min||0,s=r.max):(o=arguments[1],s=arguments[2]);var f=encodeURI(a).split(/%..|./).length-1;return f>=o&&(typeof s>"u"||f<=s)}function Af(a){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Af(a)}function uD(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;(Af(a)!=="object"||a===null)&&(a={});for(var o in r)typeof a[o]>"u"&&(a[o]=r[o]);return a}var m_={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function p_(a,r){uu(a),r=uD(r,m_),r.allow_trailing_dot&&a[a.length-1]==="."&&(a=a.substring(0,a.length-1)),r.allow_wildcard===!0&&a.indexOf("*.")===0&&(a=a.substring(2));var o=a.split("."),s=o[o.length-1];return r.require_tld&&(o.length<2||!r.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(s)||/\s/.test(s))||!r.allow_numeric_tld&&/^\d+$/.test(s)?!1:o.every(function(f){return!(f.length>63&&!r.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(f)||/[\uff01-\uff5e]/.test(f)||/^-|-$/.test(f)||!r.allow_underscores&&/_/.test(f))})}function Ef(a){"@babel/helpers - typeof";return Ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ef(a)}var Vg="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",Mi="(".concat(Vg,"[.]){3}").concat(Vg),h_=new RegExp("^".concat(Mi,"$")),nn="(?:[0-9a-fA-F]{1,4})",y_=new RegExp("^("+"(?:".concat(nn,":){7}(?:").concat(nn,"|:)|")+"(?:".concat(nn,":){6}(?:").concat(Mi,"|:").concat(nn,"|:)|")+"(?:".concat(nn,":){5}(?::").concat(Mi,"|(:").concat(nn,"){1,2}|:)|")+"(?:".concat(nn,":){4}(?:(:").concat(nn,"){0,1}:").concat(Mi,"|(:").concat(nn,"){1,3}|:)|")+"(?:".concat(nn,":){3}(?:(:").concat(nn,"){0,2}:").concat(Mi,"|(:").concat(nn,"){1,4}|:)|")+"(?:".concat(nn,":){2}(?:(:").concat(nn,"){0,3}:").concat(Mi,"|(:").concat(nn,"){1,5}|:)|")+"(?:".concat(nn,":){1}(?:(:").concat(nn,"){0,4}:").concat(Mi,"|(:").concat(nn,"){1,6}|:)|")+"(?::((?::".concat(nn,"){0,5}:").concat(Mi,"|(?::").concat(nn,"){1,7}|:))")+")(%[0-9a-zA-Z.]{1,})?$");function Ql(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};uu(a);var o=(Ef(r)==="object"?r.version:arguments[1])||"";return o?o.toString()==="4"?h_.test(a):o.toString()==="6"?y_.test(a):!1:Ql(a,{version:4})||Ql(a,{version:6})}var g_={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},D_=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,v_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,b_=/^[a-z\d]+$/,x_=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,C_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,S_=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,__=254;function A_(a){var r=a.replace(/^"(.+)"$/,"$1");if(!r.trim())return!1;var o=/[\.";<>]/.test(r);if(o){if(r===a)return!1;var s=r.split('"').length===r.split('\\"').length;if(!s)return!1}return!0}function Hg(a,r){if(uu(a),r=uD(r,g_),r.require_display_name||r.allow_display_name){var o=a.match(D_);if(o){var s=o[1];if(a=a.replace(s,"").replace(/(^<|>$)/g,""),s.endsWith(" ")&&(s=s.slice(0,-1)),!A_(s))return!1}else if(r.require_display_name)return!1}if(!r.ignore_max_length&&a.length>__)return!1;var f=a.split("@"),m=f.pop(),c=m.toLowerCase();if(r.host_blacklist.length>0&&$g(c,r.host_blacklist)||r.host_whitelist.length>0&&!$g(c,r.host_whitelist))return!1;var h=f.join("@");if(r.domain_specific_validation&&(c==="gmail.com"||c==="googlemail.com")){h=h.toLowerCase();var g=h.split("+")[0];if(!of(g.replace(/\./g,""),{min:6,max:30}))return!1;for(var y=g.split("."),S=0;S<y.length;S++)if(!b_.test(y[S]))return!1}if(r.ignore_max_length===!1&&(!of(h,{max:64})||!of(m,{max:254})))return!1;if(!p_(m,{require_tld:r.require_tld,ignore_max_length:r.ignore_max_length,allow_underscores:r.allow_underscores})){if(!r.allow_ip_domain)return!1;if(!Ql(m)){if(!m.startsWith("[")||!m.endsWith("]"))return!1;var x=m.slice(1,-1);if(x.length===0||!Ql(x))return!1}}if(r.blacklisted_chars&&h.search(new RegExp("[".concat(r.blacklisted_chars,"]+"),"g"))!==-1)return!1;if(h[0]==='"'&&h[h.length-1]==='"')return h=h.slice(1,h.length-1),r.allow_utf8_local_part?S_.test(h):x_.test(h);for(var A=r.allow_utf8_local_part?C_:v_,v=h.split("."),N=0;N<v.length;N++)if(!A.test(v[N]))return!1;return!0}function Nn({children:a,required:r=!1,tooltip:o="",description:s="",boxSx:f={},...m}){return u.jsxs(Se,{sx:{mb:1,width:"100%",...f},children:[u.jsxs(Lb,{...m,sx:{display:"flex",alignItems:"center",gap:.5,fontSize:"0.875rem",fontWeight:500,color:"text.primary","&.MuiFormLabel-root":{display:"flex",alignItems:"center",gap:.5,fontWeight:500,color:"text.primary"},...m.sx||{}},children:[a,r&&u.jsx(oe,{component:"span",color:"error",children:"*"}),o&&(typeof o=="string"?u.jsx(Un,{title:o,children:u.jsx(i0,{fontSize:"small",sx:{opacity:.7,fontSize:"1rem"}})}):o)]}),s&&u.jsx(oe,{variant:"caption",sx:{color:"text.secondary"},children:s})]})}function E_({error:a}){return u.jsx(ls,{position:"end",children:u.jsx(oe,{component:"span",color:"error",children:a})})}function Xa({ref:a=void 0,name:r,label:o="",placeholder:s="",rules:f={},errorPosition:m="bottom",wrapperStyle:c={},inputProps:h={},required:g=!1,tooltip:y="",description:S="",layout:x="vertical",slotProps:A,...v}){const{control:N,formState:B}=hs(),O=cs(),k=jf(O.breakpoints.down("sm")),K=V.useRef(null);V.useImperativeHandle(a,()=>K.current);const j=yf(B.errors,r)?.message,w=x==="horizontal"&&!k,G={htmlInput:{...h,...A?.htmlInput},input:Object.assign(v.InputProps||{},A?.input||{},m==="right"&&j?{endAdornment:u.jsx(E_,{error:j})}:{})},T=()=>o?u.jsx(Nn,{required:g,tooltip:y,description:S,boxSx:w?{width:"fit-content",whiteSpace:"nowrap",minWidth:"fit-content"}:void 0,children:o}):null;return u.jsx(Yl,{name:r,control:N,rules:f,render:({field:R})=>u.jsx(Se,{sx:{width:"100%",...c},children:w?u.jsxs(ge,{direction:"row",spacing:2,sx:{alignItems:"center",justifyContent:"space-between"},children:[T(),u.jsx(Yn,{fullWidth:!1,error:!!j,helperText:m==="bottom"&&j?j:"",placeholder:s,size:"small",...R,...v,inputRef:K,slotProps:G,sx:{flex:1,...v.sx}})]}):u.jsxs(u.Fragment,{children:[T(),u.jsx(Yn,{fullWidth:!0,error:!!j,helperText:m==="bottom"&&j?j:"",placeholder:s,size:"small",...R,...v,inputRef:K,slotProps:G})]})})})}const w_="/.well-known/service/relay",cD=()=>yf(window,"blocklet.appPid")||yf(window,"blocklet.appId")||"",sf=a=>`relay:${cD()}:${a}`,T_=()=>window.location.protocol==="https:"?"wss:":"ws:",k_=()=>new URL(window.location.href).host;function cu(a){const r=V.useRef(null),o=V.useRef(null);return V.useEffect(()=>(cD()&&(!r.current||r.current.isConnected()===!1)&&(r.current=new Lx(`${T_()}//${k_()}${w_}`,{longpollerTimeout:5e3,heartbeatIntervalMs:30*1e3}),r.current.connect()),()=>{r.current&&(r.current.disconnect(),r.current=null)}),[]),V.useEffect(()=>{{let s=!1;o.current?o.current.channel!==a&&(r.current?.unsubscribe(sf(o.current.channel)),s=!0):s=!0,s&&r.current&&(o.current=r.current.subscribe(sf(a)),o.current.channel=a)}return()=>{o.current&&(r.current?.unsubscribe(sf(o.current.channel)),o.current=null)}},[a]),o.current}const F_="md";function qi(a=F_){const r=cs();return{isMobile:jf(r.breakpoints.down(a)),mobileSize:`${r.breakpoints.values[a]}px`}}function j_(){try{return hs()}catch{return null}}function R_({ref:a,...r}){return u.jsx($b,{direction:"up",ref:a,timeout:200,...r})}function wf({ref:a=void 0,value:r,onChange:o,name:s="",sx:f={},showDialCode:m=!1,label:c="",bordered:h=!1,allowClear:g=!1,disabled:y=!1}){const S=j_(),[x,A]=V.useState(!1),[v,N]=V.useState(""),B=V.useRef(null),O=V.useRef(null),k=V.useRef(null),[K,j]=V.useState(-1),w=V.useRef(40),{isMobile:G}=qi(),T=V.useRef(!1);V.useEffect(()=>{if(!x)return()=>{};const D=()=>{T.current=!1};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[x]);const R=()=>{k.current&&(k.current.scrollTop=0)},q=()=>{if(!k.current||!x)return;const D=k.current.querySelectorAll(".MuiMenuItem-root");if(D.length>0){const F=D[0];F.offsetHeight>0&&(w.current=F.offsetHeight)}},z=D=>{if(!k.current)return;x&&!T.current&&(q(),T.current=!0);const F=k.current.clientHeight,ae=D*w.current;if(D<2)k.current.scrollTop=0;else if(D>$.length-3)k.current.scrollTop=k.current.scrollHeight-F;else{const be=ae-F/2+w.current/2;k.current.scrollTop=Math.max(0,be)}};V.useEffect(()=>{let D=null;return x?D=setTimeout(()=>{R(),!G&&B.current&&B.current.focus()},100):(N(""),j(-1)),()=>{D&&clearTimeout(D)}},[x,G]);const $=V.useMemo(()=>v?Bi.filter(D=>{const F=Wa(D);return F.name.toLowerCase().includes(v.toLowerCase())||F.iso2.toLowerCase().includes(v.toLowerCase())||`+${F.dialCode}`.includes(v)}):Bi,[v]);V.useEffect(()=>{R(),j(-1)},[v]),V.useEffect(()=>{let D=null;return K>=0&&(D=setTimeout(()=>{z(K)},10)),()=>{D&&clearTimeout(D)}},[K,$.length]);const re=V.useMemo(()=>{const D=Bi.find(F=>F[1]===r);return r&&D?Wa(D):{name:""}},[r]),Q=D=>{o(D),S&&s&&S.setValue(s,D),A(!1)},Z=D=>{D.preventDefault(),D.stopPropagation(),o(""),S&&s&&S.setValue(s,"")},ne=D=>{D.stopPropagation(),N(D.target.value)},me=D=>{if(D.stopPropagation(),D.key==="Escape"){A(!1);return}const F=ae=>{D.preventDefault(),j(be=>ae==="next"?be===-1||be>=$.length-1?0:be+1:be===-1||be<=0?$.length-1:be-1)};if(D.key==="Tab"){F(D.shiftKey?"prev":"next");return}if(D.key==="ArrowDown"){F("next");return}if(D.key==="ArrowUp"){F("prev");return}if(D.key==="Enter"&&K>=0&&K<$.length){D.preventDefault();const ae=Wa($[K]);Q(ae.iso2)}},P=u.jsxs(u.Fragment,{children:[u.jsx(Se,{sx:{position:"sticky",top:0,zIndex:1,bgcolor:"background.paper",p:1},onClick:D=>{D.stopPropagation()},children:u.jsx(Yn,{inputRef:B,autoFocus:!G,fullWidth:!0,placeholder:c||"Search country...",value:v,onChange:ne,onKeyDown:me,onClick:D=>D.stopPropagation(),size:"small",variant:"outlined",disabled:y})}),u.jsx(Se,{ref:k,sx:{flex:1,overflowY:"auto",overflowX:"hidden",maxHeight:G?"calc(60vh - 80px)":"calc(300px - 65px)",scrollBehavior:"smooth"},children:$.length>0?$.map((D,F)=>{const ae=Wa(D),be=F===K;return u.jsxs(Hy,{value:ae.iso2,selected:ae.iso2===r,onClick:()=>Q(ae.iso2),sx:{display:"flex",alignItems:"center","&.Mui-selected":{backgroundColor:"primary.lighter"},"&:hover":{backgroundColor:"grey.100"},...be?{backgroundColor:"grey.100",outline:"none"}:{}},children:[u.jsx(Nl,{iso2:ae.iso2,style:{marginRight:"8px"}}),u.jsx(oe,{children:ae.name}),m&&u.jsx(oe,{sx:{color:"text.secondary",ml:1},children:`+${ae.dialCode}`})]},ae.iso2)}):u.jsx(Hy,{disabled:!0,children:u.jsx(oe,{sx:{color:"text.secondary"},children:"No countries found"})})})]});return G?u.jsxs(Se,{ref:a,sx:{...f},children:[u.jsxs(Se,{onClick:()=>{y||A(!0)},sx:{display:"flex",alignItems:"center",flexWrap:"nowrap",gap:.5,cursor:"pointer",padding:"8px",paddingRight:"24px",position:"relative",...h?{}:{border:"none"},"-webkit-tap-highlight-color":"transparent",userSelect:"none",background:"none","&:hover, &:focus, &:active":{backgroundColor:"transparent",outline:"none"},...y?{backgroundColor:"grey.100",cursor:"not-allowed",color:"text.disabled","&:hover, &:focus, &:active":{backgroundColor:"grey.100",color:"text.disabled"}}:{},touchAction:"manipulation"},children:[r?u.jsxs(u.Fragment,{children:[u.jsx(Nl,{iso2:r,style:{display:"flex"}}),u.jsx(oe,{sx:{flex:1},children:re?.name}),g&&u.jsx(Se,{component:"button",type:"button",onClick:Z,onMouseDown:D=>{D.stopPropagation(),D.preventDefault()},onTouchStart:D=>{D.stopPropagation()},sx:{display:"flex",alignItems:"center",cursor:"pointer",p:.5,mr:1,borderRadius:"50%",border:"none",background:"transparent","&:hover":{backgroundColor:"action.hover"}},children:u.jsx(mf,{fontSize:"small"})})]}):u.jsx(oe,{sx:{color:"text.secondary",flex:1},children:c||"Select country..."}),u.jsx(Se,{sx:{position:"absolute",right:"8px",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"5px solid currentColor"}})]}),u.jsxs(lo,{open:x,onClose:()=>A(!1),fullWidth:!0,maxWidth:"xs",slotProps:{paper:{sx:{position:"absolute",bottom:0,m:0,p:0,borderBottomLeftRadius:0,borderBottomRightRadius:0,width:"100%"}}},slots:{transition:R_},children:[u.jsxs(Se,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[u.jsx(oe,{variant:"h6",children:"Select Country"}),u.jsx(ei,{edge:"end",onClick:()=>A(!1),sx:{"-webkit-tap-highlight-color":"transparent"},children:"✕"})]}),u.jsx(uo,{sx:{"&.MuiDialogContent-root":{p:0}},children:P})]})]}):u.jsx(Ib,{ref:a,open:x,onOpen:()=>A(!0),onClose:()=>A(!1),MenuProps:{style:{maxHeight:"300px",top:"10px"},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{ref:O,sx:{display:"flex","& .MuiList-root":{pt:0,display:"flex",flexDirection:"column",overflowY:"hidden",width:"100%"}}}},sx:{width:"100%",minWidth:"60px",fieldset:{display:"none"},'&.Mui-focused:has(div[aria-expanded="false"])':{fieldset:{display:"block"}},".MuiSelect-select":{padding:"8px",paddingRight:g&&r?"48px !important":"24px !important"},svg:{right:0},".MuiMenuItem-root":{justifyContent:"flex-start"},...f},value:r,onChange:D=>{o(D.target.value),S&&s&&S.setValue(s,D.target.value)},disabled:y,renderValue:D=>u.jsx(Se,{sx:{display:"flex",alignItems:"center",flexWrap:"nowrap",gap:.5,cursor:"pointer",width:"100%"},children:D?u.jsxs(ge,{direction:"row",sx:{alignItems:"center",gap:.5,justifyContent:"space-between",width:"100%"},children:[u.jsxs(ge,{direction:"row",sx:{alignItems:"center",gap:.5},children:[u.jsx(Nl,{iso2:D,style:{display:"flex"}}),u.jsx(oe,{sx:{flex:1},children:re?.name})]}),g&&r&&u.jsx(Se,{onClick:Z,onMouseDown:F=>{F.stopPropagation(),F.preventDefault()},onTouchStart:F=>{F.stopPropagation()},sx:{display:"flex",alignItems:"center",cursor:"pointer",p:0,borderRadius:"50%",border:"none",background:"transparent",zIndex:2,marginRight:"-28px","&:hover":{backgroundColor:"action.hover"}},children:u.jsx(mf,{fontSize:"small"})})]}):u.jsx(oe,{sx:{color:"text.secondary",flex:1},children:c||"Select country..."})}),children:P})}const to=/^\d{3}$/,xt=/^\d{4}$/,bt=/^\d{5}$/,ca=/^\d{6}$/,Yg={GB:/^GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\d{1,4}$/i,JE:/^JE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/i,GG:/^GY\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/i,IM:/^IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/i,US:/^\d{5}([ -]\d{4})?$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ ]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,DE:/^\d{5}$/,JP:/^\d{3}-?\d{4}$/,FR:/^\d{2}[ ]?\d{3}$/,AU:xt,IT:/^\d{5}$/,CH:xt,AT:xt,ES:/^\d{5}$/,NL:/^\d{4}[ ]?[A-Z]{2}$/i,BE:xt,DK:xt,SE:/^\d{3}[ ]?\d{2}$/,NO:xt,BR:/^\d{5}-?\d{3}$/,PT:/^\d{4}(-\d{3})?$/,FI:bt,AX:/^22\d{3}$/,KR:/^\d{5}$/,CN:/^\d{6}$/,TW:/^\d{3}(\d{2})?$/,SG:ca,DZ:bt,AD:/^AD\d{3}$/,AR:/^([A-HJ-NP-Z])?\d{4}([A-Z]{3})?$/i,AM:/^(37)?\d{4}$/,AZ:/^\d{4}$/,BH:/^((1[0-2]|[2-9])\d{2})?$/,BD:xt,BB:/^(BB\d{5})?$/i,BY:ca,BM:/^[A-Z]{2}[ ]?[A-Z0-9]{2}$/i,BA:/^\d{5}$/,IO:/^BBND 1ZZ$/i,BN:/^[A-Z]{2}[ ]?\d{4}$/i,BG:xt,KH:bt,CV:xt,CL:/^\d{7}$/,CR:/^\d{4,5}|\d{3}-\d{4}$/,HR:/^\d{5}$/,CY:xt,CZ:/^\d{3}[ ]?\d{2}$/,DO:bt,EC:/^([A-Z]\d{4}[A-Z]|(?:[A-Z]{2})?\d{6})?$/i,EG:bt,EE:bt,FO:to,GE:xt,GR:/^\d{3}[ ]?\d{2}$/,GL:/^39\d{2}$/,GT:bt,HT:/^\d{4}$/,HN:/^(?:\d{5})?$/,HU:xt,IS:to,IN:/^[1-9]\d{5}$/,ID:bt,IL:bt,JO:bt,KZ:ca,KE:bt,KW:bt,LA:bt,LV:xt,LB:/^(\d{4}([ ]?\d{4})?)?$/,LI:/^(948[5-9])|(949[0-7])$/,LT:bt,LU:xt,MK:xt,MY:bt,MV:bt,MT:/^[A-Z]{3}[ ]?\d{2,4}$/i,MU:/^(\d{3}[A-Z]{2}\d{3})?$/i,MX:bt,MD:xt,MC:/^980\d{2}$/,MA:bt,NP:bt,NZ:xt,NI:/^((\d{4}-)?\d{3}-\d{3}(-\d{1})?)?$/,NG:/^(\d{6})?$/,OM:/^(PC )?\d{3}$/i,PK:bt,PY:xt,PH:xt,PL:/^\d{2}-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,RO:ca,RU:ca,SM:/^4789\d$/,SA:bt,SN:bt,SK:/^\d{3}[ ]?\d{2}$/,SI:xt,ZA:xt,LK:bt,TJ:ca,TH:bt,TN:xt,TR:bt,TM:ca,UA:bt,UY:bt,UZ:ca,VA:/^00120$/,VE:xt,ZM:bt,AS:/^96799$/,CC:/^6799$/,CK:xt,RS:ca,ME:/^8\d{4}$/,CS:/^\d{5}$/,YU:/^\d{5}$/,CX:/^6798$/,ET:xt,FK:/^FIQQ 1ZZ$/i,NF:/^2899$/,FM:/^(9694[1-4])([ -]\d{4})?$/,GF:/^9[78]3\d{2}$/,GN:to,GP:/^9[78][01]\d{2}$/,GS:/^SIQQ 1ZZ$/i,GU:/^969[123]\d([ -]\d{4})?$/,GW:xt,HM:xt,IQ:bt,KG:ca,LR:xt,LS:to,MG:to,MH:/^969[67]\d([ -]\d{4})?$/,MN:ca,MP:/^9695[012]([ -]\d{4})?$/,MQ:/^9[78]2\d{2}$/,NC:/^988\d{2}$/,NE:xt,VI:/^008(([0-4]\d)|(5[01]))([ -]\d{4})?$/,VN:ca,PF:/^987\d{2}$/,PG:to,PM:/^9[78]5\d{2}$/,PN:/^PCRN 1ZZ$/i,PW:/^96940$/,RE:/^9[78]4\d{2}$/,SH:/^(ASCN|STHL) 1ZZ$/i,SJ:xt,SO:bt,SZ:/^[HLMS]\d{3}$/i,TC:/^TKCA 1ZZ$/i,WF:/^986\d{2}$/,XK:bt,YT:/^976\d{2}$/};function Tf(a,r){if(!a)return!0;try{const o=r?.toUpperCase();return o?!Yg[o]||Yg[o].test(a):!1}catch(o){return console.error(o),!1}}function gn(a,r,o="en"){if(!r||!r[a])return{};const s=r[a],f={};return s.pattern&&(f.pattern={value:new RegExp(s.pattern),message:s.pattern_message?.[o]||Ie("payment.checkout.invalid",o)}),f}function M_({mode:a,sx:r={},fieldValidation:o={},errorPosition:s="right"}){const{t:f,locale:m}=ft(),{control:c}=hs(),h=ba({control:c,name:"billing_address.country"});return a==="required"?u.jsx(Gn,{in:!0,children:u.jsx(ge,{className:"cko-payment-address cko-payment-form",sx:r,children:u.jsxs(ge,{direction:"column",className:"cko-payment-form",spacing:0,children:[u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.line1")}),u.jsx(Xa,{name:"billing_address.line1",rules:{required:f("payment.checkout.required"),...gn("billing_address.line1",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.line1")}),u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.city")}),u.jsx(Xa,{name:"billing_address.city",rules:{required:f("payment.checkout.required"),...gn("billing_address.city",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.city")}),u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.state")}),u.jsx(Xa,{name:"billing_address.state",rules:{required:f("payment.checkout.required"),...gn("billing_address.state",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.state")}),u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.postal_code")}),u.jsx(Xa,{name:"billing_address.postal_code",rules:{required:f("payment.checkout.required"),validate:g=>Tf(g,h)?!0:f("payment.checkout.invalid"),...gn("billing_address.postal_code",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.postal_code"),InputProps:{startAdornment:u.jsx(ls,{position:"start",style:{marginRight:"2px",marginLeft:"-8px"},children:u.jsx(Yl,{name:"billing_address.country",control:c,render:({field:g})=>u.jsx(wf,{...g,ref:g.ref,sx:{"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"}}})})})}})]})})}):u.jsx(Gn,{in:!0,children:u.jsx(ge,{className:"cko-payment-address cko-payment-form",sx:r,children:u.jsxs(ge,{direction:"column",className:"cko-payment-form",spacing:0,children:[u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.state")}),u.jsx(Xa,{name:"billing_address.state",rules:{required:f("payment.checkout.required"),...gn("billing_address.state",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.state")}),u.jsx(Nn,{className:"base-label",children:f("payment.checkout.billing.postal_code")}),u.jsx(ge,{direction:"row",spacing:0,children:u.jsx(Xa,{name:"billing_address.postal_code",rules:{required:f("payment.checkout.required"),validate:g=>Tf(g,h)?!0:f("payment.checkout.invalid"),...gn("billing_address.postal_code",o,m)},errorPosition:s,variant:"outlined",placeholder:f("payment.checkout.billing.postal_code"),InputProps:{startAdornment:u.jsx(ls,{position:"start",style:{marginRight:"2px",marginLeft:"-8px"},children:u.jsx(Yl,{name:"billing_address.country",control:c,render:({field:g})=>u.jsx(wf,{...g,ref:g.ref,sx:{".MuiOutlinedInput-notchedOutline":{borderColor:"transparent !important"}}})})})}})})]})})})}function N_({value:a,currencies:r,onChange:o}){return u.jsx(B_,{className:"cko-currency-selector",count:r.length,style:{display:r.length>1?"grid":"block",width:"100%",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))"},children:r.map(s=>{const f=s.id===a;return u.jsx(pf,{variant:"outlined",onClick:()=>o(s.id,s.method?.id),className:f?"cko-payment-card":"cko-payment-card-unselect",children:u.jsxs(ge,{direction:"row",sx:{alignItems:"center",position:"relative"},children:[u.jsx(pr,{src:s.logo,alt:s.name,sx:{width:40,height:40,marginRight:"12px"}}),u.jsxs("div",{children:[u.jsx(oe,{variant:"h5",component:"div",sx:{fontSize:"16px",color:"text.primary",fontWeight:"500"},children:s.symbol}),u.jsx(oe,{gutterBottom:!0,sx:{color:"text.lighter",fontSize:14},children:s.method.name})]}),u.jsx(Vb,{checked:f,sx:{position:"absolute",right:0}})]})},s.id)})})}const B_=Zn("section")`
28
28
  .cko-payment-card {
29
29
  position: relative;
30
30
  border: 1px solid;
@@ -41,7 +41,7 @@ function print() { __p += __j.call(arguments, '') }
41
41
  cursor: pointer;
42
42
  background: ${({theme:a})=>a.palette.grey[50]};
43
43
  }
44
- `;let lf=null;const dD=async()=>{if(!lf){const a=await Ht(()=>import("./libphonenumber-CyphiuxQ.js").then(o=>o.l),[]),r=(a.default||a)?.PhoneNumberUtil;if(!r)throw new Error("PhoneNumberUtil not found");lf=r.getInstance()}return lf},B_=async a=>{if(!a)return!0;try{let r=null;try{r=await dD()}catch{return/^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/im.test(a)}const o=r.parseAndKeepRawInput(a);return r.isValidNumber(o)}catch(r){return console.error("Phone validation error:",r),!1}},Jf=(a,r="US")=>{if(!a||a.trim()==="")return"";const o=a.replace(/[^\d+]/g,"");if(o.startsWith("+"))return o;const s={US:"1",CA:"1",CN:"86",HK:"852",IN:"91",UK:"44",GB:"44",JP:"81",KR:"82",AU:"61",DE:"49",FR:"33",IT:"39",ES:"34",BR:"55",RU:"7",MX:"52",SG:"65",AE:"971"},f=[[/^1[3-9]\d{9}$/,"86"],[/^\d{10}$/,"1"],[/^[6-9]\d{9}$/,"91"],[/^0[1-9]\d{8,9}$/,"81"],[/^07\d{9}$/,"44"],[/^04\d{8}$/,"61"],[/^01[0-9]\d{7,8}$/,"82"],[/^[0-9]\d{8}$/,"86"]];let m=o;m.startsWith("0")&&(m=m.substring(1));for(const[h,g]of f)if(h.test(o))return o.startsWith("0")&&!["1","86"].includes(g)?`+${g}${o.substring(1)}`:`+${g}${o}`;return`+${s[r.toUpperCase()]||r}${m}`};function U_({...a}){const r=a.countryFieldName||"billing_address.country",{control:o,getValues:s,setValue:f,trigger:m}=hs(),c=s(),h=V.useRef(!1),g=V.useCallback(k=>{if(!h.current)try{h.current=!0,k()}finally{requestAnimationFrame(()=>{h.current=!1})}},[]),{phone:y,handlePhoneValueChange:S,inputRef:x,country:A,setCountry:v}=W1({defaultCountry:Vf(c[r])?c[r]:"us",value:c[a.name]||"",countries:Bi,onChange:k=>{g(()=>{f(a.name,k.phone),f(r,k.country)})}}),N=ba({control:o,name:r});V.useEffect(()=>{!N||N===A||g(()=>{v(N)})},[N,A,v,g]),b0(()=>{dD().catch(k=>{console.error("Failed to preload phone validator:",k)})});const B=V.useCallback(k=>{g(()=>{v(k)})},[v,g]),O=V.useCallback(()=>{m(a.name)},[a.name]);return u.jsx(Xa,{value:y,onChange:S,type:"tel",inputRef:x,onBlur:O,InputProps:{startAdornment:u.jsx(ls,{position:"start",style:{marginRight:"2px",marginLeft:"-8px"},children:u.jsx(wf,{value:A,onChange:B,name:r,sx:{"&.MuiOutlinedInput-notchedOutline":{borderColor:"transparent !important"}},showDialCode:!0})})},...D0(a,["countryFieldName"])})}function O_(a,r={}){let o=null;const{LoadingComponent:s=()=>u.jsx(x0,{children:u.jsx(gr,{})}),ErrorComponent:f=({error:c})=>u.jsxs("div",{children:["Error: ",c.message]})}=r,m=async()=>{if(o)return o;try{return o=a().then(c=>"default"in c?c.default:c),await o}catch(c){throw o=null,c}};return function(h){const[g,y]=V.useState(null),[S,x]=V.useState(null);return V.useEffect(()=>{m().then(A=>{y(()=>A)}).catch(A=>{x(A),console.error("Failed to load component:",A)})},[]),S?u.jsx(f,{error:S}):g?u.jsx(g,{...h}):u.jsx(s,{})}}const fD=O_(async()=>{const[a,r]=await Promise.all([Ht(()=>import("./react-stripe.esm-BZIKAsrR.js"),[]),Ht(()=>import("./stripe.esm-BCCu7gPj.js"),[])]);window.__STRIPE_COMPONENTS__={Elements:a.Elements,PaymentElement:a.PaymentElement,useElements:a.useElements,useStripe:a.useStripe,loadStripe:r.loadStripe,LinkAuthenticationElement:a.LinkAuthenticationElement};const{default:o}=await Ht(async()=>{const{default:s}=await import("./form-CKfKLGXP.js");return{default:s}},[]);return o});function hr({ref:a=void 0,children:r,loading:o=!1,loadingPosition:s="start",loadingIndicator:f=void 0,loadingProps:m={},loadingOnly:c=!1,onClick:h,sx:g,...y}){const S=N=>{o||h?.(N)},x=N=>({color:"inherit",...N==="start"&&{mr:1},...N==="end"&&{ml:1},...N==="center"&&{position:"absolute",left:"50%",transform:"translateY(-50%) translateX(-50%)",top:"50%"},display:"inline-flex",alignItems:"center"}),A=u.jsx(gr,{size:16,...m,sx:{color:"inherit",...m?.sx||{}}}),v=u.jsx(oe,{sx:x(s),children:f||A});return u.jsxs(pt,{ref:a,disabled:y.disabled||o,onClick:S,sx:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",...g},...y,children:[o&&s==="start"&&v,u.jsx(oe,{sx:{visibility:o&&c?"hidden":"visible"},children:r}),o&&s==="center"&&v,o&&s==="end"&&v]})}hr.displayName="LoadingButton";function em(a){const{invoice:r,invoiceIds:o,subscriptionId:s,customerId:f,currencyId:m,paymentMethod:c,autoTrigger:h=!1,onExternalPayment:g,onSuccess:y,onError:S,onClose:x,children:A}=a,{t:v}=ft(),[N,B]=ni({paying:!1,confirmDialog:!1,stripeDialog:!1,clientSecret:null,publishableKey:null,customer:null}),O=V.useRef(!1);V.useEffect(()=>{h&&!O.current&&(O.current=!0,k())},[h]);const k=async()=>{if(N.paying)return;const T=!!(s||r?.subscription_id),R=c||r?.paymentMethod;if(T&&R?.type==="stripe"){B({confirmDialog:!0});return}await K()},K=async()=>{B({paying:!0,confirmDialog:!1});const T=m||r?.currency_id||r?.paymentCurrency?.id;if((c||r?.paymentMethod)?.type==="stripe"&&T){const z={};o&&o.length>0?z.invoice_ids=o:r?z.invoice_ids=[r.id]:s?z.subscription_id=s:f&&(z.customer_id=f),T&&(z.currency_id=T);try{const{data:$}=await ot.post("/api/invoices/pay-stripe",z);B({paying:!1,stripeDialog:!0,clientSecret:$.client_secret,publishableKey:$.publishable_key,customer:$.customer||null});return}catch($){const re=Pt($);rt.error(re),B({paying:!1}),S?.(re);return}}if(B({paying:!1}),g){g(r?.id);return}rt.error(v("payment.customer.invoice.payError")),S?.(new Error("EXTERNAL_PAYMENT_HANDLER_NOT_PROVIDED"))},j=()=>{B({confirmDialog:!1,paying:!1}),x?.()},w=()=>{rt.success(v("payment.customer.invoice.payProcessing")),B({paying:!1,stripeDialog:!1,clientSecret:null,publishableKey:null,customer:null}),setTimeout(()=>{y?.()},2e3)},G=()=>{B({paying:!1,stripeDialog:!1,clientSecret:null,publishableKey:null,customer:null}),x?.()};return u.jsxs(u.Fragment,{children:[A?.(k,N.paying),N.confirmDialog&&u.jsx(C0,{open:N.confirmDialog,title:v("payment.customer.invoice.paymentConfirmTitle"),onClose:j,maxWidth:"sm",PaperProps:{style:{minHeight:0}},actions:[u.jsx(pt,{variant:"outlined",onClick:j,children:v("common.cancel")},"cancel"),u.jsx(pt,{variant:"contained",onClick:K,children:v("payment.customer.invoice.continue")},"continue")],children:u.jsx(oe,{variant:"body1",sx:{color:"text.secondary",mt:-2},children:v("payment.customer.invoice.paymentConfirmDescription")})}),N.stripeDialog&&N.clientSecret&&N.publishableKey&&N.customer&&u.jsx(fD,{clientSecret:N.clientSecret,intentType:"setup_intent",publicKey:N.publishableKey,customer:N.customer,mode:"setup",title:v("payment.customer.invoice.pay"),submitButtonText:v("common.submit"),onConfirm:w,onCancel:G,returnUrl:window.location.href})]})}const uf=async a=>{if(!a.subscriptionId&&!a.customerId)throw new Error("Either subscriptionId or customerId must be provided");let r;return a.subscriptionId?r=`/api/subscriptions/${a.subscriptionId}/overdue/invoices`:r=`/api/customers/${a.customerId}/overdue/invoices`,(await ot.get(a.authToken?Dt(r,`?authToken=${a.authToken}`):r)).data};function Gg({subscriptionId:a=void 0,customerId:r=void 0,mode:o="default",dialogProps:s={open:!0},children:f=void 0,onPaid:m=()=>{},detailLinkOptions:c={enabled:!0},successToast:h=!0,alertMessage:g="",authToken:y=void 0}){const{t:S,locale:x}=ft(),v=S0()?.arcSphere,N=cs(),{connect:B,session:O}=_n(),[k,K]=V.useState(""),[j,w]=V.useState(!1),[G,T]=V.useState(s.open||!1),[R,q]=V.useState({}),[z,$]=V.useState({}),[re,Q]=V.useState({}),Z=V.useRef(re),ne=a?"subscription":"customer",me=r||O?.user?.did,P=a||me,D=V.useRef(me);V.useEffect(()=>{Z.current=re},[re]);const{data:F={summary:{},invoices:[]},error:ae,loading:be,runAsync:Me}=Pi(()=>uf({subscriptionId:a,customerId:me,authToken:y}),{ready:!!a||!!me,onSuccess:H=>{H.customer?.id&&H.customer?.id!==D.current&&(D.current=H.customer?.id)}}),Fe=V.useMemo(()=>a?Dt(Qn(),`/customer/subscription/${a}`):me?Dt(Qn(),"/customer/invoice/past-due"):"",[a,me]),Ae=V.useMemo(()=>F?.summary?Object.values(F.summary):[],[F?.summary]),ue=async H=>{if(Z.current[H])try{if((await uf({subscriptionId:a,customerId:me,authToken:y})).invoices?.some(je=>je.currency_id===H))return;Q(je=>{const _={...je};return delete _[H],_}),$(je=>({...je,[H]:"success"}))}catch(U){console.error("Error checking Stripe payment completion:",U);return}h&&(rt.close(),rt.success(S("payment.customer.invoice.paySuccess"))),w(!1),(await Me()).invoices?.length===0&&(T(!1),m(P,H,ne))},$e=Bf(H=>ue(H),1e3,{leading:!1,trailing:!0,maxWait:5e3}),Pe=Lf(),Xe=cu("events"),Ze=async H=>{let M=!1;return await lD(async()=>(M=!(await uf({subscriptionId:a,customerId:me,authToken:y})).invoices?.some(je=>je.currency_id===H),M),{interval:2e3,timeout:180*1e3}),M},Ue=async(H,M=!1)=>{if(Pe||v)try{if(await Ze(H)){$(je=>({...je,[H]:"success"}));const se=await Me();h&&(rt.close(),rt.success(S("payment.customer.invoice.paySuccess"))),se.invoices?.length===0&&(T(!1),m(P,H,ne))}}catch(U){console.error("Check payment status failed:",U),$(se=>({...se,[H]:"error"}))}finally{w(!1)}else M&&(Q(U=>({...U,[H]:!0})),$(U=>({...U,[H]:"processing"})))};V.useEffect(()=>{if(!Xe||Pe||v)return;const H=({response:M})=>{const se=`${a||M.customer_id}-${M.currency_id}`;(a&&M.subscription_id===a||me&&me===M.customer_id||D.current&&D.current===M.customer_id)&&(R[se]||(q(je=>({...je,[se]:1})),$e(M.currency_id)))};return Xe.on("invoice.paid",H),()=>{Xe.off("invoice.paid",H)}},[Xe,a,me]);const b=H=>{const{currency:M,method:U}=H;if(U.type==="stripe"){rt.error(S("payment.subscription.overdue.notSupport"));return}if(!j&&(K(M.id),w(!0),$(se=>({...se,[M.id]:"idle"})),["arcblock","ethereum","base"].includes(U.type))){const se={currencyId:M.id};a?se.subscriptionId=a:me&&(se.customerId=me),B.open({locale:x,containerEl:void 0,saveConnect:!1,action:"collect-batch",prefix:Dt(Qn(),"/api/did"),useSocket:!Pe,extraParams:se,messages:{scan:S("common.connect.defaultScan"),title:S("payment.customer.invoice.payBatch"),confirm:S("common.connect.confirm")},onSuccess:()=>{B.close(),Ue(M.id),w(!1),$(je=>({...je,[M.id]:"success"}))},onClose:()=>{B.close(),w(!1)},onError:je=>{rt.error(Pt(je)),$(_=>({..._,[M.id]:"error"})),w(!1)}})}},E=()=>{T(!1),s.onClose?.()},L=H=>{c.onClick?(H.preventDefault(),c.onClick(H)):c.enabled||(H.preventDefault(),E())};if(be)return null;const ie=()=>c.title?c.title:S(a?"payment.subscription.overdue.view":"payment.customer.pastDue.view"),W=(H,M=!0,U={variant:"contained"})=>{const{currency:se}=H,je=j&&k===se.id,_=z[se.id]||"idle",I=(U?.variant||"contained")==="contained"?{color:ee=>Yf(ee)}:{};if(_==="success")return u.jsx(pt,{variant:U?.variant||"contained",size:"small",onClick:()=>ue(se.id),sx:I,...M?{}:{color:"success",startIcon:u.jsx(r0,{})},children:S("payment.subscription.overdue.paid")});if(H.method.type==="stripe"){let ee=S("payment.subscription.overdue.payNow");return _==="error"?ee=S("payment.subscription.overdue.retry"):_==="processing"&&(ee=S("payment.subscription.overdue.processing")),u.jsx(em,{subscriptionId:a,customerId:a?void 0:me,currencyId:se.id,paymentMethod:H.method,onSuccess:()=>{Ue(se.id,!0)},onError:()=>{$(Ee=>({...Ee,[se.id]:"error"})),Q(Ee=>({...Ee,[se.id]:!1}))},children:(Ee,De)=>u.jsx(hr,{variant:U?.variant||"contained",size:"small",disabled:De||_==="processing",loading:De||_==="processing",onClick:Ee,sx:{...I,...U?.sx||{}},children:ee})})}return u.jsx(hr,{variant:U?.variant||"contained",size:"small",disabled:je,loading:je,onClick:()=>b(H),sx:{...I,...U?.sx||{}},children:S(_==="error"?"payment.subscription.overdue.retry":"payment.subscription.overdue.payNow")})},te=H=>H.name&&H.type!=="arcblock"?` (${H.name})`:"",ce=()=>{if(a&&F.subscription)return Ae.length===1?S("payment.subscription.overdue.title",{name:F.subscription?.description,count:F.invoices?.length,total:Ca(Ae[0]?.amount,Ae[0]?.currency?.decimal),symbol:Ae[0]?.currency?.symbol,method:te(Ae[0]?.method)}):S("payment.subscription.overdue.simpleTitle",{name:F.subscription?.description,count:F.invoices?.length});if(me){let H="";return Ae.length===1?H=S("payment.customer.overdue.title",{subscriptionCount:F.subscriptionCount||0,count:F.invoices?.length,total:Ca(Ae[0]?.amount,Ae[0]?.currency?.decimal),symbol:Ae[0]?.currency?.symbol,method:te(Ae[0]?.method)}):H=S("payment.customer.overdue.simpleTitle",{subscriptionCount:F.subscriptionCount||0,count:F.invoices?.length}),g?`${H}${g}`:`${H}${S("payment.customer.overdue.defaultAlert")}`}return""},J=()=>a&&F.subscription?S("payment.subscription.overdue.empty",{name:F.subscription?.description}):S("payment.customer.overdue.empty");return o==="custom"&&f&&typeof f=="function"?u.jsx(ge,{children:f(b,{subscription:F?.subscription,summary:F?.summary,invoices:F?.invoices,subscriptionCount:F?.subscriptionCount,detailUrl:Fe})}):u.jsx(C0,{PaperProps:{style:{minHeight:"auto"}},...s||{},open:G,title:s?.title||S("payment.subscription.overdue.pastDue"),sx:{"& .MuiDialogContent-root":{pt:0}},onClose:E,children:ae?u.jsx(mr,{severity:"error",children:ae.message}):u.jsxs(ge,{sx:{gap:1},children:[Ae.length===0&&u.jsxs(u.Fragment,{children:[u.jsx(mr,{severity:"success",children:J()}),u.jsx(ge,{direction:"row",sx:{justifyContent:"flex-end",mt:2},children:u.jsx(pt,{variant:"outlined",color:"primary",onClick:E,sx:{width:"fit-content"},children:S("common.know")})})]}),Ae.length===1&&u.jsxs(u.Fragment,{children:[u.jsxs(oe,{variant:"body1",sx:{color:"text.secondary"},children:[ce(),c.enabled&&u.jsxs(u.Fragment,{children:[u.jsx("br",{}),S("payment.subscription.overdue.description"),u.jsx("a",{href:Fe,target:"_blank",onClick:L,rel:"noreferrer",style:{color:N.palette.text.link},children:ie()})]})]}),u.jsxs(ge,{direction:"row",sx:{justifyContent:"flex-end",gap:2,mt:2},children:[u.jsx(pt,{variant:"outlined",color:"primary",onClick:E,children:S("common.cancel")}),W(Ae[0])]})]}),Ae.length>1&&u.jsxs(u.Fragment,{children:[u.jsxs(oe,{variant:"body1",sx:{color:"text.secondary"},children:[ce(),c.enabled&&u.jsxs(u.Fragment,{children:[u.jsx("br",{}),S("payment.subscription.overdue.description"),u.jsx("a",{href:Fe,target:"_blank",rel:"noreferrer",onClick:L,style:{color:N.palette.text.link},children:ie()})]})]}),u.jsx(oe,{variant:"body1",sx:{color:"text.secondary"},children:S("payment.subscription.overdue.list")}),u.jsx(ge,{children:Ae.map(H=>u.jsxs(ge,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",py:1,px:.5,borderBottom:"1px solid",borderColor:"divider","&:hover":{backgroundColor:()=>N.palette.grey[100]},mt:0},children:[u.jsx(oe,{children:S("payment.subscription.overdue.total",{total:Ca(H?.amount,H?.currency?.decimal),currency:H?.currency?.symbol,method:te(H?.method)})}),W(H,!1,{variant:"text",sx:{color:"text.link"}})]},H?.currency?.id))})]})]})})}const mD="payment-currency-preference",pD=(a,r)=>r?`${a}:${r}`:a,z_=(a,r)=>{try{localStorage.setItem(pD(mD,r),a)}catch(o){console.warn("Failed to save currency preference",o)}},P_=(a,r)=>{try{const o=localStorage.getItem(pD(mD,a));if(o&&(!r||r.includes(o)))return o}catch(o){console.warn("Failed to access localStorage",o)}return null};function Ul({onConfirm:a,onCancel:r,title:o,message:s,confirm:f="",color:m="error",cancel:c="",loading:h=!1}){const{t:g}=ft();return u.jsx(Lx,{open:!0,title:o,onConfirm:a,onCancel:r,confirmButton:{text:f||g("common.confirm"),props:{color:m,size:"small",variant:"contained",disabled:!!h}},cancelButton:{text:c||g("common.cancel"),props:{color:"inherit",size:"small"}},showCancelButton:typeof c!="boolean"||!!c,children:u.jsx(Se,{children:s})})}function Kg({open:a,onClose:r}){const{t:o}=ft();return u.jsx(lo,{open:a,onClose:r,slotProps:{paper:{sx:{borderRadius:3,maxWidth:400,mx:"auto",overflow:"hidden"}}},children:u.jsxs(uo,{sx:{p:0},children:[u.jsxs(ge,{alignItems:"center",sx:{pt:4,pb:3,px:4,textAlign:"center"},children:[u.jsx(Se,{sx:{width:64,height:64,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:s=>Yb(s.palette.warning.main,.1),mb:2.5},children:u.jsx(Hb,{sx:{fontSize:36,color:"warning.main"}})}),u.jsx(oe,{sx:{fontWeight:700,fontSize:18,mb:1,color:"text.primary"},children:o("payment.checkout.stopAcceptingOrders.title")}),u.jsx(oe,{sx:{color:"text.secondary",fontSize:14,lineHeight:1.6},children:o("payment.checkout.stopAcceptingOrders.description")})]}),u.jsx(Se,{sx:{px:4,pb:3},children:u.jsx(pt,{fullWidth:!0,variant:"contained",disableElevation:!0,onClick:r,sx:{borderRadius:2,textTransform:"none",fontWeight:600,py:1},children:o("common.know")})})]})})}function Qg({open:a,previewRate:r=void 0,submitRate:o=void 0,changePercent:s,onConfirm:f,onCancel:m,loading:c=!1}){const{t:h}=ft(),g=s>0?"increased":"decreased",y=Math.abs(s);return u.jsxs(lo,{open:a,onClose:c?void 0:m,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[u.jsxs(Zl,{sx:{display:"flex",alignItems:"center",gap:1,pb:1},children:[u.jsx(Gb,{color:"warning"}),u.jsx(oe,{variant:"h6",component:"span",children:h("payment.checkout.priceChange.title",{fallback:"Price Changed"})})]}),u.jsx(uo,{children:u.jsxs(ge,{spacing:2,children:[u.jsx(oe,{variant:"body1",color:"text.secondary",children:h("payment.checkout.priceChange.description",{fallback:`The exchange rate has ${g} by ${y.toFixed(2)}% since you started this checkout.`,direction:g,percent:y.toFixed(2)})}),(r||o)&&u.jsx(Se,{sx:{bgcolor:"action.hover",borderRadius:1,p:2},children:u.jsxs(ge,{spacing:1,children:[r&&u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between"},children:[u.jsxs(oe,{variant:"body2",color:"text.secondary",children:[h("payment.checkout.priceChange.previewRate",{fallback:"Preview Rate"}),":"]}),u.jsx(oe,{variant:"body2",fontFamily:"monospace",children:r})]}),o&&u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between"},children:[u.jsxs(oe,{variant:"body2",color:"text.secondary",children:[h("payment.checkout.priceChange.currentRate",{fallback:"Current Rate"}),":"]}),u.jsx(oe,{variant:"body2",fontFamily:"monospace",children:o})]}),u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between"},children:[u.jsxs(oe,{variant:"body2",color:"text.secondary",children:[h("payment.checkout.priceChange.change",{fallback:"Change"}),":"]}),u.jsxs(oe,{variant:"body2",fontWeight:"bold",color:s>0?"error.main":"success.main",children:[s>0?"+":"",s.toFixed(2),"%"]})]})]})}),u.jsx(oe,{variant:"body2",color:"text.secondary",children:h("payment.checkout.priceChange.confirm",{fallback:"Do you want to continue with the new price?"})})]})}),u.jsxs(o0,{sx:{px:3,pb:2},children:[u.jsx(pt,{onClick:m,disabled:c,variant:"outlined",color:"inherit",children:h("payment.checkout.priceChange.cancel",{fallback:"Cancel"})}),u.jsx(pt,{onClick:f,disabled:c,variant:"contained",color:"primary",autoFocus:!0,children:c?h("payment.checkout.priceChange.confirming",{fallback:"Confirming..."}):h("payment.checkout.priceChange.accept",{fallback:"Accept & Continue"})})]})]})}const q_=(a,r)=>`${a}-${r}-${Date.now()}-${Math.random().toString(36).substring(2,10)}`,L_=async a=>{let r;return await lD(async()=>{const{data:o}=await ot.get(`/api/checkout-sessions/retrieve/${a}`);if(o.paymentIntent&&o.paymentIntent.status==="requires_action"&&o.paymentIntent.last_payment_error)throw new Error(o.paymentIntent.last_payment_error.message);return r=o,o.checkoutSession?.status==="complete"&&["paid","no_payment_required"].includes(o.checkoutSession?.payment_status)},{interval:2e3,timeout:180*1e3}),r},I_=a=>(a?.connectedAccounts||a?.extraConfigs?.connectedAccounts||[]).some(o=>o.provider==="wallet"),cf=(a,r,o,s={})=>{const{preferExisting:f=!0,shouldValidate:m=!1}=s,c={customer_name:a.name||a.fullName,customer_email:a.email,customer_phone:Jf(a.phone)},h={"billing_address.state":a.address?.state||a.address?.province,"billing_address.line1":a.address?.line1,"billing_address.line2":a.address?.line2,"billing_address.city":a.address?.city,"billing_address.postal_code":a.address?.postal_code||a.address?.postalCode,"billing_address.country":a.address?.country||"us"};s.showPhone&&(h["billing_address.country"]=a.metadata?.phone?.country||a.address?.country);const g={...h,...c},y={...r,billing_address:{...r.billing_address}};return Object.entries(g).forEach(([S,x])=>{if(!f||!r[S.split(".")[0]])if(o(S,x,{shouldValidate:m}),S.startsWith("billing_address.")){const A=S.replace("billing_address.","");y.billing_address[A]=x}else y[S]=x}),y};function hD({checkoutSession:a,paymentMethods:r,paymentIntent:o,paymentLink:s,customer:f,onPaid:m,onError:c,onQuoteUpdated:h=void 0,onPaymentIntentUpdate:g=void 0,action:y,onlyShowBtn:S=!1,isDonation:x=!1,rateUnavailable:A=!1}){const{t:v,locale:N}=ft(),{isMobile:B}=qi(),{session:O,connect:k,payable:K,setPaymentState:j}=_n(),w=cu("events"),G="bottom",{control:T,getValues:R,setValue:q,handleSubmit:z,formState:{errors:$},trigger:re}=hs(),Q=V.useRef(null),Z=V.useRef(!1),ne=V.useRef(""),me=V.useRef(""),P=V.useMemo(()=>{let pe=!0;for(const ke of a.line_items)if(Df(ke.price,ke.quantity)){pe=!1;break}return pe},[a]),[D,F]=ni({submitting:!1,paying:!1,paid:!1,paymentIntent:o,stripeContext:void 0,customer:f,customerLimited:!1,serviceSuspended:!1,stripePaying:!1,fastCheckoutInfo:null,creditInsufficientInfo:null,showEditForm:!1,priceChangeConfirm:null}),ae=jS(r),be=Hf(window.location.href),Me=Fi(async({response:pe})=>{pe.id===a.id&&D.paid===!1&&await ve()});V.useEffect(()=>{w&&w.on("checkout.session.completed",Me)},[w]),V.useEffect(()=>{j({paying:D.submitting||D.paying,stripePaying:D.stripePaying})},[D.submitting,D.paying,D.stripePaying]);const Fe=(pe,ke)=>({...ke||{},name:pe?.name||pe?.fullName||ke?.name||ke?.fullName,fullName:pe?.name||pe?.fullName||ke?.name||ke?.fullName,email:pe?.email||ke?.email,phone:pe?.phone||ke?.phone,address:{...ke?.address||{},...pe?.address||{},country:pe?.address?.country||ke?.address?.country,state:pe?.address?.state||ke?.address?.province,line1:pe?.address?.line1||ke?.address?.line1,line2:pe?.address?.line2||ke?.address?.line2,city:pe?.address?.city||ke?.address?.city,postal_code:pe?.address?.postal_code||ke?.address?.postalCode},metadata:{...ke?.metadata||{},phone:{country:pe?.address?.country||ke?.metadata?.phone?.country,phoneNumber:pe?.phone||ke?.metadata?.phone?.phoneNumber}}});V.useEffect(()=>{const pe=async()=>{if(O?.user){const ke=R();let Re=O.user;try{const{data:it}=await ot.get("/api/customers/me?skipSummary=1&fallback=1");Re=Fe(it,Re)}catch(it){Re=Fe(f||{},Re),console.error(it)}const Je=cf(Re,ke,q,{preferExisting:!1,showPhone:a.phone_number_collection?.enabled}),tt=ee(Je);F({showEditForm:!tt})}else cf({name:"",email:"",phone:"",address:{state:"",line1:"",line2:"",city:"",postal_code:""}},{},q,{preferExisting:!1,showPhone:a.phone_number_collection?.enabled})};D.submitting||pe()},[O?.user,a.phone_number_collection?.enabled]);const Ae=ba({control:T,name:"payment_method"}),ue=ba({control:T,name:"payment_currency"}),$e=Fi(()=>{z(zt,Dn)()}),Pe=tu(a.line_items);let Xe="";s?.donation_settings?y?Xe=y:Xe=v("payment.checkout.donate"):Xe=v(`payment.checkout.${a.mode}`),Xe=O?.user||x?Xe:v("payment.checkout.connect",{action:Xe});const Ze=r.find(pe=>pe.id===Ae),Ue=ae.find(pe=>pe.id===ue),b=Ze.type==="arcblock"&&!a.subscription_data?.no_stake,L=V.useMemo(()=>(a.line_items||[]).some(pe=>{const ke=pe.upsell_price||pe.price;return ke&&ke?.pricing_type==="dynamic"}),[a.line_items])&&A,ie=K&&!L,W=a?.submit_type==="donate"&&x,[te,ce]=ni({open:!1,total:"",usd:null,hasQuotes:!1,baseCurrency:"USD",oldTotal:"",reason:"recalculated"}),J=Fi(pe=>{if(!pe)return null;const ke=Number(pe);return Number.isFinite(ke)?ke.toFixed(8):null}),H=Fi(pe=>{if(!pe?.line_items?.length)return null;for(const ke of pe.line_items){const Re=ke?.exchange_rate;if(Re)return Re}return null}),M=V.useRef(!1),U=V.useRef(""),se=Fi(pe=>pe?.line_items?.length?pe.line_items.map(ke=>{const Re=ke.price_id||ke.price?.id||"",Je=ke?.quote_id||"",tt=ke?.quoted_amount||"",it=ke?.exchange_rate||"";return`${Re}:${Je}:${tt}:${it}`}).join("|"):""),je=Fi(pe=>{if(!Ue)return{total:"",usd:null,hasQuotes:!1,baseCurrency:"USD",totalUnit:null};const ke=pe.line_items||[];let Re="USD";for(const ht of ke){const hn=(ht.upsell_price||ht.price)?.base_currency;if(hn){Re=hn;break}}const Je=ke.some(ht=>ht?.quoted_amount&&ht?.exchange_rate);if(!Je)return{total:"",usd:null,hasQuotes:!1,baseCurrency:Re,totalUnit:null};let tt=Number(pe?.subscription_data?.trial_period_days||0);const it=(pe?.subscription_data?.trial_currency||"").split(",").map(_0).filter(Boolean);it.length>0&&ue&&it.includes(ue)===!1&&(tt=0);const{total:Wn}=Hl(ke,Ue,tt>0),Xt=new ze(pe.total_details?.amount_discount||"0"),st=new ze(Wn).sub(Xt),Rt=st.isNeg()?new ze(0):st,Jn=`${Ja(qt(Rt.toString(),Ue.decimal),6)} ${Ue.symbol}`,Ii=ke.map(ht=>{const hn=(ht.upsell_price||ht.price)?.base_amount;if(hn!=null)return q0(hn,ht.quantity||0);const oi=ht?.exchange_rate,ja=ht?.quoted_amount;return!oi||!ja?null:If(new ze(ja),Ue.decimal,oi)}).filter(ht=>!!ht);if(!Ii.length)return{total:Jn,usd:null,hasQuotes:Je,baseCurrency:Re,totalUnit:Rt};const vr=Ii.reduce((ht,On)=>ht.add(new ze(Kn(On,8))),new ze(0)),co=qt(vr.toString(),8);return{total:Jn,usd:zi(co,N),hasQuotes:Je,baseCurrency:Re,totalUnit:Rt}}),_=Fi((pe,ke)=>{const Re=je(pe),Je=je(ke);if(!Re.totalUnit||!Je.totalUnit)return{changed:!1,prev:Re,next:Je};const tt=Je.totalUnit.sub(Re.totalUnit).abs(),it=new ze(1);return{changed:tt.gt(it),prev:Re,next:Je}}),I=Fi((pe,ke={})=>{if(!pe?.checkoutSession)return;h?.({checkoutSession:pe.checkoutSession,quotes:pe.quotes,rateUnavailable:pe.rateUnavailable,rateError:pe.rateError});const{changed:Re,prev:Je,next:tt}=_(a,pe.checkoutSession),it=J(H(a)),Wn=J(H(pe.checkoutSession)),Xt=!!(it&&Wn&&it!==Wn);if((ke.forceConfirm||Re)&&tt.hasQuotes){ce({open:!0,total:tt.total,usd:tt.usd,hasQuotes:tt.hasQuotes,baseCurrency:tt.baseCurrency,oldTotal:Je.total,reason:ke.reason||(Xt?"rateChanged":"recalculated")});return}ce({open:!1});const Rt=se(pe.checkoutSession);Rt&&Rt!==U.current&&(U.current=Rt,M.current=!0)}),ee=pe=>{if(!pe)return!1;const ke=a.metadata?.page_info?.field_validation,Re=pe.customer_name;if(!Re||Re.trim()==="")return!1;const Je=pe.customer_email;if(!Je||!Hg(Je))return!1;const tt=gn("customer_name",ke,N);if(tt.pattern&&!tt.pattern.value.test(Re))return!1;const it=gn("customer_email",ke,N);if(it.pattern&&!it.pattern.value.test(Je))return!1;const Wn=pe.billing_address||{},{postal_code:Xt,country:st,state:Rt,line1:Jn,city:Li}=Wn;if(!Xt||!Tf(Xt,st))return!1;const Ii=gn("billing_address.postal_code",ke,N);if(Ii.pattern&&!Ii.pattern.value.test(Xt)||!Rt)return!1;const vr=gn("billing_address.state",ke,N);if(vr.pattern&&!vr.pattern.value.test(Rt))return!1;if(a.phone_number_collection?.enabled){const ht=pe.customer_phone;if(!ht||ht.trim()==="")return!1;const On=gn("customer_phone",ke,N);if(On.pattern&&!On.pattern.value.test(ht))return!1}if(a.billing_address_collection==="required"){if(!st||!Rt||!Jn||!Li||!Xt)return!1;const ht=gn("billing_address.line1",ke,N);if(ht.pattern&&!ht.pattern.value.test(Jn))return!1;const On=gn("billing_address.city",ke,N);if(On.pattern&&!On.pattern.value.test(Li))return!1}return!0},Ee=ba({control:T,name:"customer_name"}),De=ba({control:T,name:"customer_email"}),Ce=ba({control:T,name:"customer_phone"}),Te=ba({control:T,name:"billing_address"}),Ye=O?.user?D.showEditForm:!1;V.useEffect(()=>{M.current&&(D.submitting||D.paying||(M.current=!1,an()))},[D.submitting,D.paying]);const ve=async()=>{if(!Z.current){Z.current=!0,F({paying:!0});try{const pe=await L_(a.id);D.paid===!1&&(F({paid:!0,paying:!1}),m(pe))}catch(pe){const ke=Pt(pe),Re={action:"payFailed",mode:a.mode,errorMessage:ke,success:!1};Ix.event(Re.action,Re),rt.error(ke)}finally{F({paying:!1}),Z.current=!1}}};V.useEffect(()=>{Q.current&&!vd($)&&B&&Q.current.scrollIntoView({behavior:"smooth"})},[$,B]);const qe=async()=>{const{data:pe}=await ot.get("/api/customers/me?fallback=1&skipSummary=1");if(pe){const ke=R(),Re=Fe(pe,O?.user),Je=cf(Re,ke,q,{preferExisting:!1,showPhone:a.phone_number_collection?.enabled,shouldValidate:!0}),tt=ee(Je);F({showEditForm:!tt}),await re()}},Oe=async()=>{if(D.fastCheckoutInfo){F({fastCheckoutInfo:{...D.fastCheckoutInfo,loading:!0}});try{const pe=await ot.post(`/api/checkout-sessions/${a.id}/fast-checkout-confirm`,{});pe.data.paymentIntent&&g?.(pe.data.paymentIntent),pe.data.fastPaid?(F({fastCheckoutInfo:null,paying:!0}),await ve()):(rt.error(v("payment.checkout.fastPay.failed")),F({fastCheckoutInfo:null,paying:!0}),kt())}catch(pe){console.error(pe);const ke=pe?.response?.data?.code;if(["QUOTE_LOCK_EXPIRED","QUOTE_AMOUNT_MISMATCH","QUOTE_EXPIRED_OR_USED","QUOTE_NOT_FOUND","QUOTE_REQUIRED"].includes(ke)){try{const{data:Re}=await ot.get(`/api/checkout-sessions/retrieve/${a.id}`,{params:{forceRefresh:"1"}});Re?.checkoutSession&&(I(Re,{reason:"rateChanged"}),rt.info(v("payment.checkout.quote.updated.pleaseRetry")||"Price updated, please resubmit"))}catch(Re){console.error(Re),rt.error(Pt(Re))}finally{F({fastCheckoutInfo:null})}return}if(ke==="QUOTE_UPDATED"){const Re=pe?.response?.data;Re?.checkoutSession&&I(Re),F({fastCheckoutInfo:null});return}if(ke==="RATE_UNAVAILABLE"){const Re=pe?.response?.data;Re?.checkoutSession&&h?.({checkoutSession:Re.checkoutSession,quotes:Re.quotes,rateUnavailable:Re.rateUnavailable,rateError:Re.rateError}),F({fastCheckoutInfo:null});return}rt.error(Pt(pe)),F({fastCheckoutInfo:null})}}},Ve=()=>{F({fastCheckoutInfo:null})},Ge=()=>{F({creditInsufficientInfo:null})},Ke=()=>{ce({open:!1}),M.current=!0},et=()=>{ce({open:!1})},Lt=()=>{const pe=D.priceChangeConfirm?.formData;F({priceChangeConfirm:null}),pe&&zt(pe)},It=()=>{F({priceChangeConfirm:null})},kt=()=>{try{if(!["arcblock","ethereum","base"].includes(Ze.type))return;F({paying:!0}),k.open({locale:N,containerEl:void 0,action:a.mode,prefix:Dt(Qn(),"/api/did"),saveConnect:!1,useSocket:Lf()===!1,extraParams:{checkoutSessionId:a.id,sessionUserDid:O?.user?.did},onSuccess:async()=>{k.close(),await ve()},onClose:()=>{k.close(),F({submitting:!1,paying:!1})},onError:pe=>{console.error(pe),F({submitting:!1,paying:!1}),c(pe)},messages:{title:v("payment.checkout.connectModal.title",{action:Xe}),scan:v("payment.checkout.connectModal.scan"),confirm:v("payment.checkout.connectModal.confirm"),cancel:v("payment.checkout.connectModal.cancel")}})}catch(pe){rt.error(Pt(pe))}},zt=async pe=>{if(D.submitting)return;if(!O.user.sourceAppPid&&a.line_items?.some(Je=>!!Je?.price?.product?.vendor_config?.length)){rt.error(v("payment.checkout.vendor.accountRequired"));return}F({submitting:!0});try{let Re;const Je=a.line_items?.find(st=>st?.exchange_rate)?.exchange_rate||void 0,it=(a.line_items||[]).map(st=>`${st.upsell_price_id||st.price_id}:${st.quantity}`).join("|"),Wn=`${a.id}-${Ue?.id}-${it}`;(Wn!==me.current||!ne.current)&&(me.current=Wn,ne.current=q_(a.id,Ue?.id||""));const Xt={...pe,idempotency_key:ne.current,preview_rate:Je||void 0,price_confirmed:D.priceChangeConfirm?.formData?!0:void 0};if(W?Re=await ot.put(`/api/checkout-sessions/${a.id}/donate-submit`,Xt):Re=await ot.put(`/api/checkout-sessions/${a.id}/submit`,Xt),F({paymentIntent:Re.data.paymentIntent,stripeContext:Re.data.stripeContext,customer:Re.data.customer,submitting:!1,customerLimited:!1}),Re.data.paymentIntent&&g?.(Re.data.paymentIntent),["arcblock","ethereum","base"].includes(Ze.type)){if(Re.data.noPaymentRequired){try{const st=await ot.post(`/api/checkout-sessions/${a.id}/fast-checkout-confirm`,{});st.data.paymentIntent&&g?.(st.data.paymentIntent),st.data.fastPaid||st.data.checkoutSession?.status==="complete"?(F({paying:!0}),await ve()):kt()}catch(st){console.error("noPaymentRequired confirm failed",st),kt()}return}Ue?.type==="credit"?Re.data.creditSufficient===!0?F({fastCheckoutInfo:{open:!0,loading:!1,sourceType:"credit",amount:Re.data.fastPayInfo?.amount||"0",payer:Re.data.fastPayInfo?.payer,availableCredit:Re.data.fastPayInfo?.amount||"0",balance:Re.data.fastPayInfo?.token?.balance||"0"}}):F({creditInsufficientInfo:{open:!0}}):(Re.data.balance?.sufficient||Re.data.delegation?.sufficient)&&!W&&Re.data.fastPayInfo?F({fastCheckoutInfo:{open:!0,loading:!1,sourceType:Re.data.fastPayInfo.type,amount:Re.data.fastPayInfo.amount,payer:Re.data.fastPayInfo.payer}}):kt()}["stripe"].includes(Ze.type)&&(Re.data.stripeContext?.status==="succeeded"?F({paying:!0}):setTimeout(()=>{F({stripePaying:!0})},200))}catch(Re){console.error(Re);let Je=!0;const tt=Re.response?.data?.code;if(tt){if(["QUOTE_UPDATED","RATE_UNAVAILABLE","QUOTE_LOCK_EXPIRED","QUOTE_AMOUNT_MISMATCH","QUOTE_EXPIRED_OR_USED","QUOTE_NOT_FOUND","QUOTE_REQUIRED","QUOTE_MAX_PAYABLE_EXCEEDED"].includes(tt)||aD(`error.${tt}`),["QUOTE_LOCK_EXPIRED","QUOTE_AMOUNT_MISMATCH","QUOTE_EXPIRED_OR_USED","QUOTE_NOT_FOUND","QUOTE_REQUIRED","QUOTE_MAX_PAYABLE_EXCEEDED","quote_validation_failed"].includes(tt)){Je=!1;try{const{data:it}=await ot.get(`/api/checkout-sessions/retrieve/${a.id}`,{params:{forceRefresh:"1"}});it?.checkoutSession&&(I(it,{reason:"rateChanged"}),rt.info(v("payment.checkout.quote.updated.pleaseRetry")||"Price updated, please resubmit"))}catch(it){console.error(it),rt.error(Pt(it))}}if(tt==="QUOTE_UPDATED"){Je=!1;const it=Re.response?.data;it?.checkoutSession&&I(it)}if(tt==="RATE_UNAVAILABLE"){Je=!1;const it=Re.response?.data;it?.checkoutSession&&h?.({checkoutSession:it.checkoutSession,quotes:it.quotes,rateUnavailable:it.rateUnavailable,rateError:it.rateError})}if(tt==="PRICE_UNAVAILABLE"&&(Je=!1,rt.error(v("payment.checkout.priceChange.unavailable",{fallback:"Unable to fetch exchange rate. Please try again later."}))),tt==="PRICE_UNSTABLE"&&(Je=!1,rt.error(v("payment.checkout.priceChange.unstable",{fallback:"Price is volatile. Please try again later."}))),tt==="PRICE_CHANGED"){Je=!1;const it=Re.response?.data;F({priceChangeConfirm:{open:!0,changePercent:it?.change_percent||0,formData:pe}})}tt==="UNIFIED_APP_REQUIRED"&&(Je=!1,rt.error(v("payment.checkout.vendor.accountRequired"))),tt==="CUSTOMER_LIMITED"&&(Je=!1,F({customerLimited:!0})),tt==="STOP_ACCEPTING_ORDERS"&&(Je=!1,F({serviceSuspended:!0}))}Je&&rt.error(Pt(Re))}finally{F({submitting:!1})}},Dn=pe=>{pe&&console.error(pe),F({submitting:!1})},an=()=>{if(!(D.submitting||D.paying||!ie))if(Q.current&&!vd($)&&B&&Q.current.scrollIntoView({behavior:"smooth"}),O?.user)z(zt,Dn)();else{if(W){z(zt,Dn)();return}O?.login(()=>{F({submitting:!0}),qe().then($e).catch(pe=>{console.error(pe),F({submitting:!1})})})}},An=async()=>{F({stripePaying:!1,paying:!0}),await ve()},Sa=async()=>{try{await ot.post(`/api/checkout-sessions/${a.id}/abort-stripe`)}catch(pe){console.error(pe),rt.error(Pt(pe))}finally{F({stripePaying:!1})}};V.useEffect(()=>{const pe=ke=>{ke.key==="Enter"&&!D.submitting&&!D.paying&&!D.stripePaying&&P&&ie&&an()};return window.addEventListener("keydown",pe),()=>{window.removeEventListener("keydown",pe)}},[D.submitting,D.paying,D.stripePaying,P,ie]);const fa=NS(Ze,D.fastCheckoutInfo?.payer||""),Xn=D.fastCheckoutInfo&&u.jsx(Ul,{onConfirm:Oe,onCancel:Ve,title:D.fastCheckoutInfo.sourceType==="credit"?v("payment.checkout.fastPay.credit.title"):v("payment.checkout.fastPay.title"),message:D.fastCheckoutInfo.sourceType==="credit"?u.jsx(oe,{children:v("payment.checkout.fastPay.credit.meteringSubscriptionMessage",{available:`${Ca(D.fastCheckoutInfo?.balance||"0",Ue?.decimal||18)} ${Ue?.symbol}`})}):u.jsxs(ge,{children:[u.jsx(oe,{children:v("payment.checkout.fastPay.autoPaymentReason")}),u.jsx(ti,{sx:{mt:1.5,mb:1.5}}),u.jsxs(ge,{spacing:1,children:[u.jsxs(ge,{sx:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[u.jsx(oe,{sx:{color:"text.primary",whiteSpace:"nowrap"},children:v("payment.checkout.fastPay.payer")}),u.jsxs(Se,{sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(A0,{did:D.fastCheckoutInfo.payer||"",compact:!0,responsive:!1}),fa&&u.jsx(Un,{title:v("payment.checkout.fastPay.balanceLink"),placement:"top",children:u.jsx(Ol,{sx:{color:"text.lighter",fontSize:"0.85rem",cursor:"pointer","&:hover":{color:"text.primary"}},onClick:()=>{window.open(fa,"_blank")}})})]})]}),u.jsxs(ge,{sx:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[u.jsx(oe,{sx:{color:"text.primary"},children:v("payment.checkout.fastPay.amount")}),u.jsxs(oe,{children:[Ca(D.fastCheckoutInfo.amount,Ue?.decimal||18)," ",Ue?.symbol]})]})]})]}),loading:D.fastCheckoutInfo.loading,color:"primary"}),Fa=D.creditInsufficientInfo&&u.jsx(Ul,{onConfirm:Ge,onCancel:Ge,title:v("payment.checkout.fastPay.credit.insufficientTitle"),message:u.jsx(oe,{children:v("payment.checkout.fastPay.credit.insufficientMessage")}),confirm:v("common.confirm")}),_a=te.open&&u.jsx(Ul,{onConfirm:Ke,onCancel:et,title:v("payment.checkout.quote.priceUpdatedTitle"),message:u.jsxs(ge,{spacing:1,children:[u.jsx(oe,{children:v(te.reason==="rateChanged"?"payment.checkout.quote.priceUpdatedDescriptionRate":"payment.checkout.quote.priceUpdatedDescriptionRecalc")}),te.hasQuotes&&u.jsxs(ge,{spacing:.25,children:[u.jsx(oe,{sx:{color:"text.secondary",fontSize:"0.7875rem"},children:v("payment.checkout.quote.priceUpdatedNewTotalLabel")}),u.jsx(oe,{sx:{fontWeight:600},children:te.total}),te.usd&&u.jsxs(oe,{sx:{color:"text.secondary"},children:["≈ ",te.usd," ",te.baseCurrency]}),te.oldTotal&&u.jsx(oe,{sx:{color:"text.secondary",fontSize:"0.75rem"},children:v("payment.checkout.quote.priceUpdatedOldTotal",{total:te.oldTotal})})]})]}),confirm:v("payment.checkout.quote.priceUpdatedConfirm"),cancel:v("common.cancel"),color:"primary"}),Dr=()=>{if(be.redirect)return decodeURIComponent(be.redirect);if(a.success_url)return a.success_url;if(s?.after_completion?.redirect?.url)return s.after_completion.redirect.url};return S?u.jsxs(u.Fragment,{children:[u.jsx(Se,{className:"cko-payment-submit-btn",children:u.jsxs(pt,{variant:"contained",color:"primary",size:"large",className:"cko-submit-button",onClick:()=>{D.submitting||D.paying||!ie||an()},fullWidth:!0,disabled:D.stripePaying||!P||!ie,children:[(D.submitting||D.paying)&&u.jsx(gr,{size:16,sx:{mr:.5,color:"primary.contrastText"}}),D.submitting||D.paying?v("payment.checkout.processing"):Xe]})}),D.customerLimited&&u.jsx(Gg,{customerId:f?.id||O?.user?.did,onPaid:()=>{F({customerLimited:!1}),an()},alertMessage:v("payment.customer.pastDue.alert.customMessage"),detailLinkOptions:{enabled:!0,onClick:()=>{F({customerLimited:!1}),window.open(Dt(Qn(),`/customer/invoice/past-due?referer=${encodeURIComponent(window.location.href)}`),"_self")}},dialogProps:{open:D.customerLimited,onClose:()=>F({customerLimited:!1}),title:v("payment.customer.pastDue.alert.title")}}),D.serviceSuspended&&u.jsx(Kg,{open:!0,onClose:()=>F({serviceSuspended:!1})}),Xn,Fa,_a,D.priceChangeConfirm?.open&&u.jsx(Qg,{open:!0,changePercent:D.priceChangeConfirm.changePercent,onConfirm:Lt,onCancel:It,loading:D.submitting})]}):u.jsxs(u.Fragment,{children:[u.jsx(Gn,{in:!0,children:u.jsxs(ge,{className:"cko-payment-contact",children:[u.jsx(oe,{title:v("payment.checkout.paymentDetails"),sx:{color:"text.primary",fontSize:{xs:"18px",md:"24px"},fontWeight:"700",lineHeight:"32px",mb:2.5},children:v("payment.checkout.paymentDetails")}),u.jsx(Gn,{in:!0,children:u.jsxs(ge,{direction:"column",className:"cko-payment-methods",sx:{alignItems:"flex-start"},children:[u.jsx(ge,{direction:"row",sx:{width:"100%"},children:u.jsx(Yl,{name:"payment_currency",control:T,render:({field:pe})=>u.jsx(M_,{value:pe.value,currencies:ae,onChange:async(ke,Re)=>{const Je=pe.value;if(pe.onChange(ke),q("payment_method",Re),z_(ke,O?.user?.did),Je&&Je!==ke)try{const{data:tt}=await ot.put(`/api/checkout-sessions/${a.id}/switch-currency`,{currency_id:ke,payment_method_id:Re});tt.currency_changed&&h&&h({checkoutSession:tt,quotes:tt.quotes})}catch(tt){console.error("Failed to switch currency:",tt)}}})})}),D.stripePaying&&D.stripeContext&&u.jsx(fD,{clientSecret:D.stripeContext.client_secret,intentType:D.stripeContext.intent_type,publicKey:Ze.settings.stripe?.publishable_key,customer:D.customer,mode:a.mode,onConfirm:An,onCancel:Sa,returnUrl:Dr()})]})}),!Ye&&O?.user&&u.jsxs(ge,{spacing:1.25,sx:{mt:2,p:2,pt:1,backgroundColor:"background.paper",borderRadius:1,border:"1px solid",borderColor:"divider"},children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:.25},children:[u.jsx(oe,{variant:"subtitle2",sx:{color:"text.primary",fontSize:"0.875rem"},children:v("payment.checkout.customerInfo")}),u.jsx(pt,{size:"small",variant:"text",onClick:()=>F({showEditForm:!0}),sx:{minWidth:0},children:v("common.edit")})]}),u.jsxs(ge,{spacing:.5,children:[u.jsx(oe,{variant:"body2",sx:{color:"text.primary",fontWeight:600,fontSize:"0.9375rem"},children:Ee}),u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",fontSize:"0.8125rem"},children:De}),a.phone_number_collection?.enabled&&Ce&&u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",fontSize:"0.8125rem"},children:Ce}),Te&&u.jsxs(ge,{direction:"row",alignItems:"center",spacing:.75,children:[Te.country&&u.jsx(Nl,{iso2:Te.country.toLowerCase(),style:{width:18,height:14}}),u.jsxs(oe,{variant:"body2",sx:{color:"text.secondary",fontSize:"0.8125rem"},children:[a.billing_address_collection==="required"?[Te.line1,Te.city,Te.state].filter(Boolean).join(", "):Te.state||"",Te.postal_code&&` [ ${v("payment.checkout.billing.postal_code")}: ${Te.postal_code} ]`]})]})]})]}),Ye&&u.jsxs(ge,{direction:"column",className:"cko-payment-form",id:"cko-payment-form",spacing:0,ref:vd($)?void 0:Q,sx:{flex:1,overflow:"auto",py:1},children:[u.jsx(Nn,{className:"base-label",children:v("payment.checkout.customer.name")}),u.jsx(Xa,{name:"customer_name",variant:"outlined",errorPosition:G,rules:{required:v("payment.checkout.required"),...gn("customer_name",a.metadata?.page_info?.field_validation,N)}}),u.jsx(Nn,{className:"base-label",children:v("payment.checkout.customer.email")}),u.jsx(Xa,{name:"customer_email",variant:"outlined",errorPosition:G,rules:{required:v("payment.checkout.required"),validate:pe=>Hg(pe)?!0:v("payment.checkout.invalid"),...gn("customer_email",a.metadata?.page_info?.field_validation,N)}}),a.phone_number_collection?.enabled&&u.jsxs(u.Fragment,{children:[u.jsx(Nn,{className:"base-label",children:v("payment.checkout.customer.phone")}),u.jsx(U_,{name:"customer_phone",variant:"outlined",errorPosition:G,placeholder:"Phone number",rules:{required:v("payment.checkout.required"),validate:async pe=>await B_(pe)?!0:v("payment.checkout.invalid"),...gn("customer_phone",a.metadata?.page_info?.field_validation,N)}})]}),u.jsx(R_,{mode:a.billing_address_collection,sx:{marginTop:"0 !important"},fieldValidation:a.metadata?.page_info?.field_validation,errorPosition:G})]})]})}),u.jsx(ti,{sx:{mt:2.5,mb:2.5}}),u.jsx(Gn,{in:!0,children:u.jsxs(ge,{className:"cko-payment-submit",children:[u.jsx(Se,{className:"cko-payment-submit-btn",children:u.jsx(hr,{variant:"contained",color:"primary",size:"large",className:"cko-submit-button",onClick:()=>{an()},fullWidth:!0,loading:D.submitting||D.paying,disabled:D.stripePaying||!P||!ie,children:D.submitting||D.paying?v("payment.checkout.processing"):Xe})}),["subscription","setup"].includes(a.mode)&&u.jsx(oe,{sx:{mt:2.5,color:"text.lighter",fontSize:"0.7875rem",lineHeight:"0.9625rem"},children:b?v("payment.checkout.confirm.withStake",{payee:Pe}):v("payment.checkout.confirm.withoutStake",{payee:Pe})}),a.metadata?.page_info?.form_purpose_description&&u.jsxs(Se,{sx:{mt:1,display:"flex",alignItems:"center",gap:.5},children:[u.jsx(hf,{sx:{color:"text.lighter",fontSize:"0.75rem"}}),u.jsx(oe,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.lighter"},children:N==="zh"?a.metadata.page_info.form_purpose_description.zh:a.metadata.page_info.form_purpose_description.en})]})]})}),D.customerLimited&&u.jsx(Gg,{customerId:f?.id||O?.user?.did,onPaid:()=>{F({customerLimited:!1}),an()},alertMessage:v("payment.customer.pastDue.alert.customMessage"),detailLinkOptions:{enabled:!0,onClick:()=>{F({customerLimited:!1}),window.open(Dt(Qn(),`/customer/invoice/past-due?referer=${encodeURIComponent(window.location.href)}`),"_self")}},dialogProps:{open:D.customerLimited,onClose:()=>F({customerLimited:!1}),title:v("payment.customer.pastDue.alert.title")}}),D.serviceSuspended&&u.jsx(Kg,{open:!0,onClose:()=>F({serviceSuspended:!1})}),Xn,Fa,_a,D.priceChangeConfirm?.open&&u.jsx(Qg,{open:!0,changePercent:D.priceChangeConfirm.changePercent,onConfirm:Lt,onCancel:It,loading:D.submitting})]})}function $_(){return u.jsx(Gn,{in:!0,children:u.jsxs(ge,{direction:"column",children:[u.jsx(ge,{direction:"row",spacing:2,sx:{alignItems:"center"},children:u.jsx(Ot,{variant:"text",sx:{fontSize:"1.75rem",width:"40%"}})}),u.jsx(Ot,{sx:{mt:2},variant:"rounded",height:100}),u.jsx(oe,{component:"div",variant:"h4",sx:{mt:2},children:u.jsx(Ot,{})}),u.jsx(oe,{component:"div",variant:"h2",children:u.jsx(Ot,{})})]})})}function V_(){return u.jsx(Gn,{in:!0,children:u.jsxs(ge,{direction:"column",children:[u.jsx(Ot,{variant:"text",sx:{fontSize:"1.75rem",width:"40%"}}),u.jsx(Ot,{sx:{mt:2},variant:"rounded",height:68}),u.jsxs(Se,{sx:{mt:1},children:[u.jsx(oe,{component:"div",variant:"h4",sx:{mb:-1},children:u.jsx(Ot,{})}),u.jsx(oe,{component:"div",children:u.jsx(Ot,{height:60})})]}),u.jsxs(Se,{children:[u.jsx(oe,{component:"div",variant:"h4",sx:{mb:-1},children:u.jsx(Ot,{})}),u.jsx(oe,{component:"div",children:u.jsx(Ot,{height:60})})]}),u.jsx(Se,{children:u.jsx(Ot,{height:60})})]})})}function yD(){return u.jsxs(Se,{sx:{mb:2},children:[u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[u.jsx(Ot,{variant:"rounded",height:16,width:150}),u.jsx(Ot,{variant:"rounded",height:16,width:50})]}),u.jsx(Ot,{variant:"rounded",height:8,width:"100%"})]})}const H_=(a,r,o)=>{const s=a.name||a.title,f=a.status==="delivered";return a.vendorType==="didnames"?r?o("payment.checkout.vendor.didnames.failed",{name:s}):f?o("payment.checkout.vendor.didnames.completed",{name:s}):o("payment.checkout.vendor.didnames.processing",{name:s}):r?o("payment.checkout.vendor.launcher.failed",{name:s}):f?o("payment.checkout.vendor.launcher.completed",{name:s}):o("payment.checkout.vendor.launcher.processing",{name:s})};function Y_({vendor:a}){const{t:r}=ft(),[o,s]=V.useState(0),f=V.useRef(),m=V.useCallback(()=>{const y=a.progress||0;let S,x;const A=v=>{S||(S=v,x=o);const N=v-S;let B;if(y===100)B=100;else if(y===0)B=Math.min(x+N/1e3,99);else if(y>x){const k=Math.min(N/1e3,1);B=x+(y-x)*k}else B=Math.min(x+N/1e3,99);B=Math.round(B),s(O=>Math.min(O>B?O:B,100)),y!==100&&B<99&&y<100&&(f.current=requestAnimationFrame(A))};f.current&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame(A)},[a.progress,o]);V.useEffect(()=>(m(),()=>{f.current&&cancelAnimationFrame(f.current)}),[m]);const c=o>=100,h=a.status==="failed",g=H_(a,h,r);return h?u.jsxs(Se,{sx:{mb:2},children:[u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[u.jsx(oe,{variant:"body2",sx:{color:"text.secondary"},children:g}),u.jsx(oe,{variant:"body2",sx:{color:"error.main",fontWeight:500},children:r("payment.checkout.vendor.progress",{progress:0})})]}),u.jsx(zl,{variant:"determinate",value:100,sx:{height:8,borderRadius:4,backgroundColor:"grey.200","& .MuiLinearProgress-bar":{borderRadius:4,backgroundColor:"error.main"}}})]}):!a.name&&!a.title?u.jsx(yD,{}):u.jsxs(Se,{sx:{mb:2},children:[u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[u.jsxs(oe,{variant:"body2",sx:{color:"text.secondary",display:"flex",alignItems:"center"},children:[g," ",c?u.jsx(s0,{sx:{color:"success.main",ml:.5},fontSize:"small"}):null]}),c?null:u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",fontWeight:500},children:r("payment.checkout.vendor.progress",{progress:o})})]}),u.jsx(zl,{variant:"determinate",value:o||0,sx:{height:8,borderRadius:4,backgroundColor:"grey.200","& .MuiLinearProgress-bar":{borderRadius:4,backgroundColor:c?"success.main":"primary.main",transition:"background-color 0.3s linear"}}})]})}function gD({mode:a,pageInfo:r={},vendorCount:o=0,sessionId:s="",message:f,action:m,payee:c,invoiceId:h="",subscriptionId:g="",subscriptions:y=[]}){const{t:S,locale:x}=ft(),{prefix:A,api:v}=_n(),[N,B]=V.useState(null),[O,k]=V.useState(!1),[K,j]=V.useState(!1),w=V.useRef(Date.now()),T=S0()?.arcSphere;let R=null;V.useEffect(()=>{if(o===0||!s)return;const re=async Z=>{try{const ne=await v.get(Dt(A,`/api/vendors/order/${s}/status`),{}),me=Date.now()-w.current>6*1e3,P=ne.data?.vendors?.every(F=>F.progress>=100),D=ne.data?.vendors?.some(F=>F.status==="failed"||me&&!!F.error&&!!F.error_message);(D||P)&&clearInterval(Z),j(D),k(!D&&P),B(ne.data)}catch(ne){console.error("Failed to fetch vendor status:",ne)}};re();const Q=setInterval(()=>{re(Q)},5e3);return()=>clearInterval(Q)},[o,v,A,s]),V.useEffect(()=>{if(T&&O)try{Ky?.call?.("arc__toast",{text:S("payment.checkout.vendor.arcSphereToast")});const re=setTimeout(()=>{Ky?.call?.("arcClosePage")},3e3);return()=>clearTimeout(re)}catch{}},[O,S,x,T]);const q=()=>{const re=[];for(let Q=0;Q<o;Q++)re.push(u.jsx(yD,{},`placeholder-${Q}`));return re},z=()=>N?N.vendors?.map((re,Q)=>u.jsx(Y_,{vendor:re},re.title||`vendor-${Q}`)):q(),$=()=>o===0?null:u.jsxs(Yy,{elevation:0,sx:{p:3,backgroundColor:"grey.50",borderRadius:2,width:"100%",mt:2,display:"flex",flexDirection:"column",gap:2},children:[z(),K?u.jsx(oe,{variant:"h6",sx:{color:"warning.main",mb:1},children:S("payment.checkout.vendor.failedMsg")}):null,r?.success_message?.[x]&&O?u.jsx(oe,{variant:"h6",sx:{color:"text.primary",mb:1},children:r?.success_message?.[x]}):null]});return["subscription","setup"].includes(m)?y&&y.length>1?R=u.jsx(Yy,{elevation:0,sx:{p:3,backgroundColor:"grey.50",borderRadius:2,width:"100%",mt:2,display:"flex",flexDirection:"column",gap:2},children:y.map(re=>u.jsxs(Se,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",fontWeight:500},children:re.description}),u.jsx(Se,{sx:{flex:1,borderBottom:"1px dashed",borderColor:"grey.300",mx:2}}),u.jsx(Qy,{variant:"text",color:"primary",size:"small",children:u.jsx(cr,{href:Dt(A,`/customer/subscription/${re.id}`),sx:{color:"text.secondary"},children:S("payment.checkout.next.view")})})]},re.id))}):g&&(R=u.jsx(Qy,{variant:"outlined",color:"primary",sx:{mt:2},children:u.jsx(cr,{href:Dt(A,`/customer/subscription/${g}`),children:S("payment.checkout.next.subscription",{payee:c})})})):h&&(R=u.jsx(oe,{sx:{textAlign:"center",mt:2},children:u.jsx(cr,{href:Dt(A,`/customer/invoice/${h}`),children:S("payment.checkout.next.invoice",{payee:c})})})),u.jsx(u0,{in:!0,children:u.jsxs(ge,{direction:"column",sx:{alignItems:"center",justifyContent:a==="standalone"?"center":"flex-start",height:a==="standalone"?"fit-content":300},children:[u.jsx(G_,{children:u.jsxs("div",{className:"check-icon",children:[u.jsx("span",{className:"icon-line line-tip"}),u.jsx("span",{className:"icon-line line-long"}),u.jsx("div",{className:"icon-circle"}),u.jsx("div",{className:"icon-fix"})]})}),u.jsx(oe,{variant:"h5",sx:{color:"text.primary",mb:3},children:f}),u.jsx(oe,{variant:"body1",sx:{color:"text.secondary",textAlign:"center",fontSize:"14px"},children:S("payment.checkout.completed.tip",{payee:c})}),$(),R]})})}const G_=l0("div")`
44
+ `;let lf=null;const dD=async()=>{if(!lf){const a=await Ht(()=>import("./libphonenumber-Qs8PCdM-.js").then(o=>o.l),[]),r=(a.default||a)?.PhoneNumberUtil;if(!r)throw new Error("PhoneNumberUtil not found");lf=r.getInstance()}return lf},U_=async a=>{if(!a)return!0;try{let r=null;try{r=await dD()}catch{return/^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/im.test(a)}const o=r.parseAndKeepRawInput(a);return r.isValidNumber(o)}catch(r){return console.error("Phone validation error:",r),!1}},Jf=(a,r="US")=>{if(!a||a.trim()==="")return"";const o=a.replace(/[^\d+]/g,"");if(o.startsWith("+"))return o;const s={US:"1",CA:"1",CN:"86",HK:"852",IN:"91",UK:"44",GB:"44",JP:"81",KR:"82",AU:"61",DE:"49",FR:"33",IT:"39",ES:"34",BR:"55",RU:"7",MX:"52",SG:"65",AE:"971"},f=[[/^1[3-9]\d{9}$/,"86"],[/^\d{10}$/,"1"],[/^[6-9]\d{9}$/,"91"],[/^0[1-9]\d{8,9}$/,"81"],[/^07\d{9}$/,"44"],[/^04\d{8}$/,"61"],[/^01[0-9]\d{7,8}$/,"82"],[/^[0-9]\d{8}$/,"86"]];let m=o;m.startsWith("0")&&(m=m.substring(1));for(const[h,g]of f)if(h.test(o))return o.startsWith("0")&&!["1","86"].includes(g)?`+${g}${o.substring(1)}`:`+${g}${o}`;return`+${s[r.toUpperCase()]||r}${m}`};function O_({...a}){const r=a.countryFieldName||"billing_address.country",{control:o,getValues:s,setValue:f,trigger:m}=hs(),c=s(),h=V.useRef(!1),g=V.useCallback(k=>{if(!h.current)try{h.current=!0,k()}finally{requestAnimationFrame(()=>{h.current=!1})}},[]),{phone:y,handlePhoneValueChange:S,inputRef:x,country:A,setCountry:v}=J1({defaultCountry:Vf(c[r])?c[r]:"us",value:c[a.name]||"",countries:Bi,onChange:k=>{g(()=>{f(a.name,k.phone),f(r,k.country)})}}),N=ba({control:o,name:r});V.useEffect(()=>{!N||N===A||g(()=>{v(N)})},[N,A,v,g]),b0(()=>{dD().catch(k=>{console.error("Failed to preload phone validator:",k)})});const B=V.useCallback(k=>{g(()=>{v(k)})},[v,g]),O=V.useCallback(()=>{m(a.name)},[a.name]);return u.jsx(Xa,{value:y,onChange:S,type:"tel",inputRef:x,onBlur:O,InputProps:{startAdornment:u.jsx(ls,{position:"start",style:{marginRight:"2px",marginLeft:"-8px"},children:u.jsx(wf,{value:A,onChange:B,name:r,sx:{"&.MuiOutlinedInput-notchedOutline":{borderColor:"transparent !important"}},showDialCode:!0})})},...D0(a,["countryFieldName"])})}function z_(a,r={}){let o=null;const{LoadingComponent:s=()=>u.jsx(x0,{children:u.jsx(gr,{})}),ErrorComponent:f=({error:c})=>u.jsxs("div",{children:["Error: ",c.message]})}=r,m=async()=>{if(o)return o;try{return o=a().then(c=>"default"in c?c.default:c),await o}catch(c){throw o=null,c}};return function(h){const[g,y]=V.useState(null),[S,x]=V.useState(null);return V.useEffect(()=>{m().then(A=>{y(()=>A)}).catch(A=>{x(A),console.error("Failed to load component:",A)})},[]),S?u.jsx(f,{error:S}):g?u.jsx(g,{...h}):u.jsx(s,{})}}const fD=z_(async()=>{const[a,r]=await Promise.all([Ht(()=>import("./react-stripe.esm-BZIKAsrR.js"),[]),Ht(()=>import("./stripe.esm-BCCu7gPj.js"),[])]);window.__STRIPE_COMPONENTS__={Elements:a.Elements,PaymentElement:a.PaymentElement,useElements:a.useElements,useStripe:a.useStripe,loadStripe:r.loadStripe,LinkAuthenticationElement:a.LinkAuthenticationElement};const{default:o}=await Ht(async()=>{const{default:s}=await import("./form-DD-EiA7W.js");return{default:s}},[]);return o});function hr({ref:a=void 0,children:r,loading:o=!1,loadingPosition:s="start",loadingIndicator:f=void 0,loadingProps:m={},loadingOnly:c=!1,onClick:h,sx:g,...y}){const S=N=>{o||h?.(N)},x=N=>({color:"inherit",...N==="start"&&{mr:1},...N==="end"&&{ml:1},...N==="center"&&{position:"absolute",left:"50%",transform:"translateY(-50%) translateX(-50%)",top:"50%"},display:"inline-flex",alignItems:"center"}),A=u.jsx(gr,{size:16,...m,sx:{color:"inherit",...m?.sx||{}}}),v=u.jsx(oe,{sx:x(s),children:f||A});return u.jsxs(pt,{ref:a,disabled:y.disabled||o,onClick:S,sx:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",...g},...y,children:[o&&s==="start"&&v,u.jsx(oe,{sx:{visibility:o&&c?"hidden":"visible"},children:r}),o&&s==="center"&&v,o&&s==="end"&&v]})}hr.displayName="LoadingButton";function em(a){const{invoice:r,invoiceIds:o,subscriptionId:s,customerId:f,currencyId:m,paymentMethod:c,autoTrigger:h=!1,onExternalPayment:g,onSuccess:y,onError:S,onClose:x,children:A}=a,{t:v}=ft(),[N,B]=ni({paying:!1,confirmDialog:!1,stripeDialog:!1,clientSecret:null,publishableKey:null,customer:null}),O=V.useRef(!1);V.useEffect(()=>{h&&!O.current&&(O.current=!0,k())},[h]);const k=async()=>{if(N.paying)return;const T=!!(s||r?.subscription_id),R=c||r?.paymentMethod;if(T&&R?.type==="stripe"){B({confirmDialog:!0});return}await K()},K=async()=>{B({paying:!0,confirmDialog:!1});const T=m||r?.currency_id||r?.paymentCurrency?.id;if((c||r?.paymentMethod)?.type==="stripe"&&T){const z={};o&&o.length>0?z.invoice_ids=o:r?z.invoice_ids=[r.id]:s?z.subscription_id=s:f&&(z.customer_id=f),T&&(z.currency_id=T);try{const{data:$}=await ot.post("/api/invoices/pay-stripe",z);B({paying:!1,stripeDialog:!0,clientSecret:$.client_secret,publishableKey:$.publishable_key,customer:$.customer||null});return}catch($){const re=Pt($);rt.error(re),B({paying:!1}),S?.(re);return}}if(B({paying:!1}),g){g(r?.id);return}rt.error(v("payment.customer.invoice.payError")),S?.(new Error("EXTERNAL_PAYMENT_HANDLER_NOT_PROVIDED"))},j=()=>{B({confirmDialog:!1,paying:!1}),x?.()},w=()=>{rt.success(v("payment.customer.invoice.payProcessing")),B({paying:!1,stripeDialog:!1,clientSecret:null,publishableKey:null,customer:null}),setTimeout(()=>{y?.()},2e3)},G=()=>{B({paying:!1,stripeDialog:!1,clientSecret:null,publishableKey:null,customer:null}),x?.()};return u.jsxs(u.Fragment,{children:[A?.(k,N.paying),N.confirmDialog&&u.jsx(C0,{open:N.confirmDialog,title:v("payment.customer.invoice.paymentConfirmTitle"),onClose:j,maxWidth:"sm",PaperProps:{style:{minHeight:0}},actions:[u.jsx(pt,{variant:"outlined",onClick:j,children:v("common.cancel")},"cancel"),u.jsx(pt,{variant:"contained",onClick:K,children:v("payment.customer.invoice.continue")},"continue")],children:u.jsx(oe,{variant:"body1",sx:{color:"text.secondary",mt:-2},children:v("payment.customer.invoice.paymentConfirmDescription")})}),N.stripeDialog&&N.clientSecret&&N.publishableKey&&N.customer&&u.jsx(fD,{clientSecret:N.clientSecret,intentType:"setup_intent",publicKey:N.publishableKey,customer:N.customer,mode:"setup",title:v("payment.customer.invoice.pay"),submitButtonText:v("common.submit"),onConfirm:w,onCancel:G,returnUrl:window.location.href})]})}const uf=async a=>{if(!a.subscriptionId&&!a.customerId)throw new Error("Either subscriptionId or customerId must be provided");let r;return a.subscriptionId?r=`/api/subscriptions/${a.subscriptionId}/overdue/invoices`:r=`/api/customers/${a.customerId}/overdue/invoices`,(await ot.get(a.authToken?Dt(r,`?authToken=${a.authToken}`):r)).data};function Gg({subscriptionId:a=void 0,customerId:r=void 0,mode:o="default",dialogProps:s={open:!0},children:f=void 0,onPaid:m=()=>{},detailLinkOptions:c={enabled:!0},successToast:h=!0,alertMessage:g="",authToken:y=void 0}){const{t:S,locale:x}=ft(),v=S0()?.arcSphere,N=cs(),{connect:B,session:O}=_n(),[k,K]=V.useState(""),[j,w]=V.useState(!1),[G,T]=V.useState(s.open||!1),[R,q]=V.useState({}),[z,$]=V.useState({}),[re,Q]=V.useState({}),Z=V.useRef(re),ne=a?"subscription":"customer",me=r||O?.user?.did,P=a||me,D=V.useRef(me);V.useEffect(()=>{Z.current=re},[re]);const{data:F={summary:{},invoices:[]},error:ae,loading:be,runAsync:Me}=Pi(()=>uf({subscriptionId:a,customerId:me,authToken:y}),{ready:!!a||!!me,onSuccess:H=>{H.customer?.id&&H.customer?.id!==D.current&&(D.current=H.customer?.id)}}),Fe=V.useMemo(()=>a?Dt(Qn(),`/customer/subscription/${a}`):me?Dt(Qn(),"/customer/invoice/past-due"):"",[a,me]),Ae=V.useMemo(()=>F?.summary?Object.values(F.summary):[],[F?.summary]),ue=async H=>{if(Z.current[H])try{if((await uf({subscriptionId:a,customerId:me,authToken:y})).invoices?.some(je=>je.currency_id===H))return;Q(je=>{const _={...je};return delete _[H],_}),$(je=>({...je,[H]:"success"}))}catch(U){console.error("Error checking Stripe payment completion:",U);return}h&&(rt.close(),rt.success(S("payment.customer.invoice.paySuccess"))),w(!1),(await Me()).invoices?.length===0&&(T(!1),m(P,H,ne))},$e=Bf(H=>ue(H),1e3,{leading:!1,trailing:!0,maxWait:5e3}),Pe=Lf(),Xe=cu("events"),Ze=async H=>{let M=!1;return await lD(async()=>(M=!(await uf({subscriptionId:a,customerId:me,authToken:y})).invoices?.some(je=>je.currency_id===H),M),{interval:2e3,timeout:180*1e3}),M},Ue=async(H,M=!1)=>{if(Pe||v)try{if(await Ze(H)){$(je=>({...je,[H]:"success"}));const se=await Me();h&&(rt.close(),rt.success(S("payment.customer.invoice.paySuccess"))),se.invoices?.length===0&&(T(!1),m(P,H,ne))}}catch(U){console.error("Check payment status failed:",U),$(se=>({...se,[H]:"error"}))}finally{w(!1)}else M&&(Q(U=>({...U,[H]:!0})),$(U=>({...U,[H]:"processing"})))};V.useEffect(()=>{if(!Xe||Pe||v)return;const H=({response:M})=>{const se=`${a||M.customer_id}-${M.currency_id}`;(a&&M.subscription_id===a||me&&me===M.customer_id||D.current&&D.current===M.customer_id)&&(R[se]||(q(je=>({...je,[se]:1})),$e(M.currency_id)))};return Xe.on("invoice.paid",H),()=>{Xe.off("invoice.paid",H)}},[Xe,a,me]);const b=H=>{const{currency:M,method:U}=H;if(U.type==="stripe"){rt.error(S("payment.subscription.overdue.notSupport"));return}if(!j&&(K(M.id),w(!0),$(se=>({...se,[M.id]:"idle"})),["arcblock","ethereum","base"].includes(U.type))){const se={currencyId:M.id};a?se.subscriptionId=a:me&&(se.customerId=me),B.open({locale:x,containerEl:void 0,saveConnect:!1,action:"collect-batch",prefix:Dt(Qn(),"/api/did"),useSocket:!Pe,extraParams:se,messages:{scan:S("common.connect.defaultScan"),title:S("payment.customer.invoice.payBatch"),confirm:S("common.connect.confirm")},onSuccess:()=>{B.close(),Ue(M.id),w(!1),$(je=>({...je,[M.id]:"success"}))},onClose:()=>{B.close(),w(!1)},onError:je=>{rt.error(Pt(je)),$(_=>({..._,[M.id]:"error"})),w(!1)}})}},E=()=>{T(!1),s.onClose?.()},L=H=>{c.onClick?(H.preventDefault(),c.onClick(H)):c.enabled||(H.preventDefault(),E())};if(be)return null;const ie=()=>c.title?c.title:S(a?"payment.subscription.overdue.view":"payment.customer.pastDue.view"),W=(H,M=!0,U={variant:"contained"})=>{const{currency:se}=H,je=j&&k===se.id,_=z[se.id]||"idle",I=(U?.variant||"contained")==="contained"?{color:ee=>Yf(ee)}:{};if(_==="success")return u.jsx(pt,{variant:U?.variant||"contained",size:"small",onClick:()=>ue(se.id),sx:I,...M?{}:{color:"success",startIcon:u.jsx(r0,{})},children:S("payment.subscription.overdue.paid")});if(H.method.type==="stripe"){let ee=S("payment.subscription.overdue.payNow");return _==="error"?ee=S("payment.subscription.overdue.retry"):_==="processing"&&(ee=S("payment.subscription.overdue.processing")),u.jsx(em,{subscriptionId:a,customerId:a?void 0:me,currencyId:se.id,paymentMethod:H.method,onSuccess:()=>{Ue(se.id,!0)},onError:()=>{$(Ee=>({...Ee,[se.id]:"error"})),Q(Ee=>({...Ee,[se.id]:!1}))},children:(Ee,De)=>u.jsx(hr,{variant:U?.variant||"contained",size:"small",disabled:De||_==="processing",loading:De||_==="processing",onClick:Ee,sx:{...I,...U?.sx||{}},children:ee})})}return u.jsx(hr,{variant:U?.variant||"contained",size:"small",disabled:je,loading:je,onClick:()=>b(H),sx:{...I,...U?.sx||{}},children:S(_==="error"?"payment.subscription.overdue.retry":"payment.subscription.overdue.payNow")})},te=H=>H.name&&H.type!=="arcblock"?` (${H.name})`:"",ce=()=>{if(a&&F.subscription)return Ae.length===1?S("payment.subscription.overdue.title",{name:F.subscription?.description,count:F.invoices?.length,total:Ca(Ae[0]?.amount,Ae[0]?.currency?.decimal),symbol:Ae[0]?.currency?.symbol,method:te(Ae[0]?.method)}):S("payment.subscription.overdue.simpleTitle",{name:F.subscription?.description,count:F.invoices?.length});if(me){let H="";return Ae.length===1?H=S("payment.customer.overdue.title",{subscriptionCount:F.subscriptionCount||0,count:F.invoices?.length,total:Ca(Ae[0]?.amount,Ae[0]?.currency?.decimal),symbol:Ae[0]?.currency?.symbol,method:te(Ae[0]?.method)}):H=S("payment.customer.overdue.simpleTitle",{subscriptionCount:F.subscriptionCount||0,count:F.invoices?.length}),g?`${H}${g}`:`${H}${S("payment.customer.overdue.defaultAlert")}`}return""},J=()=>a&&F.subscription?S("payment.subscription.overdue.empty",{name:F.subscription?.description}):S("payment.customer.overdue.empty");return o==="custom"&&f&&typeof f=="function"?u.jsx(ge,{children:f(b,{subscription:F?.subscription,summary:F?.summary,invoices:F?.invoices,subscriptionCount:F?.subscriptionCount,detailUrl:Fe})}):u.jsx(C0,{PaperProps:{style:{minHeight:"auto"}},...s||{},open:G,title:s?.title||S("payment.subscription.overdue.pastDue"),sx:{"& .MuiDialogContent-root":{pt:0}},onClose:E,children:ae?u.jsx(mr,{severity:"error",children:ae.message}):u.jsxs(ge,{sx:{gap:1},children:[Ae.length===0&&u.jsxs(u.Fragment,{children:[u.jsx(mr,{severity:"success",children:J()}),u.jsx(ge,{direction:"row",sx:{justifyContent:"flex-end",mt:2},children:u.jsx(pt,{variant:"outlined",color:"primary",onClick:E,sx:{width:"fit-content"},children:S("common.know")})})]}),Ae.length===1&&u.jsxs(u.Fragment,{children:[u.jsxs(oe,{variant:"body1",sx:{color:"text.secondary"},children:[ce(),c.enabled&&u.jsxs(u.Fragment,{children:[u.jsx("br",{}),S("payment.subscription.overdue.description"),u.jsx("a",{href:Fe,target:"_blank",onClick:L,rel:"noreferrer",style:{color:N.palette.text.link},children:ie()})]})]}),u.jsxs(ge,{direction:"row",sx:{justifyContent:"flex-end",gap:2,mt:2},children:[u.jsx(pt,{variant:"outlined",color:"primary",onClick:E,children:S("common.cancel")}),W(Ae[0])]})]}),Ae.length>1&&u.jsxs(u.Fragment,{children:[u.jsxs(oe,{variant:"body1",sx:{color:"text.secondary"},children:[ce(),c.enabled&&u.jsxs(u.Fragment,{children:[u.jsx("br",{}),S("payment.subscription.overdue.description"),u.jsx("a",{href:Fe,target:"_blank",rel:"noreferrer",onClick:L,style:{color:N.palette.text.link},children:ie()})]})]}),u.jsx(oe,{variant:"body1",sx:{color:"text.secondary"},children:S("payment.subscription.overdue.list")}),u.jsx(ge,{children:Ae.map(H=>u.jsxs(ge,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",py:1,px:.5,borderBottom:"1px solid",borderColor:"divider","&:hover":{backgroundColor:()=>N.palette.grey[100]},mt:0},children:[u.jsx(oe,{children:S("payment.subscription.overdue.total",{total:Ca(H?.amount,H?.currency?.decimal),currency:H?.currency?.symbol,method:te(H?.method)})}),W(H,!1,{variant:"text",sx:{color:"text.link"}})]},H?.currency?.id))})]})]})})}const mD="payment-currency-preference",pD=(a,r)=>r?`${a}:${r}`:a,P_=(a,r)=>{try{localStorage.setItem(pD(mD,r),a)}catch(o){console.warn("Failed to save currency preference",o)}},q_=(a,r)=>{try{const o=localStorage.getItem(pD(mD,a));if(o&&(!r||r.includes(o)))return o}catch(o){console.warn("Failed to access localStorage",o)}return null};function Ul({onConfirm:a,onCancel:r,title:o,message:s,confirm:f="",color:m="error",cancel:c="",loading:h=!1}){const{t:g}=ft();return u.jsx(Ix,{open:!0,title:o,onConfirm:a,onCancel:r,confirmButton:{text:f||g("common.confirm"),props:{color:m,size:"small",variant:"contained",disabled:!!h}},cancelButton:{text:c||g("common.cancel"),props:{color:"inherit",size:"small"}},showCancelButton:typeof c!="boolean"||!!c,children:u.jsx(Se,{children:s})})}function Kg({open:a,onClose:r}){const{t:o}=ft();return u.jsx(lo,{open:a,onClose:r,slotProps:{paper:{sx:{borderRadius:3,maxWidth:400,mx:"auto",overflow:"hidden"}}},children:u.jsxs(uo,{sx:{p:0},children:[u.jsxs(ge,{alignItems:"center",sx:{pt:4,pb:3,px:4,textAlign:"center"},children:[u.jsx(Se,{sx:{width:64,height:64,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:s=>Yb(s.palette.warning.main,.1),mb:2.5},children:u.jsx(Hb,{sx:{fontSize:36,color:"warning.main"}})}),u.jsx(oe,{sx:{fontWeight:700,fontSize:18,mb:1,color:"text.primary"},children:o("payment.checkout.stopAcceptingOrders.title")}),u.jsx(oe,{sx:{color:"text.secondary",fontSize:14,lineHeight:1.6},children:o("payment.checkout.stopAcceptingOrders.description")})]}),u.jsx(Se,{sx:{px:4,pb:3},children:u.jsx(pt,{fullWidth:!0,variant:"contained",disableElevation:!0,onClick:r,sx:{borderRadius:2,textTransform:"none",fontWeight:600,py:1},children:o("common.know")})})]})})}function Qg({open:a,previewRate:r=void 0,submitRate:o=void 0,changePercent:s,onConfirm:f,onCancel:m,loading:c=!1}){const{t:h}=ft(),g=s>0?"increased":"decreased",y=Math.abs(s);return u.jsxs(lo,{open:a,onClose:c?void 0:m,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[u.jsxs(Zl,{sx:{display:"flex",alignItems:"center",gap:1,pb:1},children:[u.jsx(Gb,{color:"warning"}),u.jsx(oe,{variant:"h6",component:"span",children:h("payment.checkout.priceChange.title",{fallback:"Price Changed"})})]}),u.jsx(uo,{children:u.jsxs(ge,{spacing:2,children:[u.jsx(oe,{variant:"body1",color:"text.secondary",children:h("payment.checkout.priceChange.description",{fallback:`The exchange rate has ${g} by ${y.toFixed(2)}% since you started this checkout.`,direction:g,percent:y.toFixed(2)})}),(r||o)&&u.jsx(Se,{sx:{bgcolor:"action.hover",borderRadius:1,p:2},children:u.jsxs(ge,{spacing:1,children:[r&&u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between"},children:[u.jsxs(oe,{variant:"body2",color:"text.secondary",children:[h("payment.checkout.priceChange.previewRate",{fallback:"Preview Rate"}),":"]}),u.jsx(oe,{variant:"body2",fontFamily:"monospace",children:r})]}),o&&u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between"},children:[u.jsxs(oe,{variant:"body2",color:"text.secondary",children:[h("payment.checkout.priceChange.currentRate",{fallback:"Current Rate"}),":"]}),u.jsx(oe,{variant:"body2",fontFamily:"monospace",children:o})]}),u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between"},children:[u.jsxs(oe,{variant:"body2",color:"text.secondary",children:[h("payment.checkout.priceChange.change",{fallback:"Change"}),":"]}),u.jsxs(oe,{variant:"body2",fontWeight:"bold",color:s>0?"error.main":"success.main",children:[s>0?"+":"",s.toFixed(2),"%"]})]})]})}),u.jsx(oe,{variant:"body2",color:"text.secondary",children:h("payment.checkout.priceChange.confirm",{fallback:"Do you want to continue with the new price?"})})]})}),u.jsxs(o0,{sx:{px:3,pb:2},children:[u.jsx(pt,{onClick:m,disabled:c,variant:"outlined",color:"inherit",children:h("payment.checkout.priceChange.cancel",{fallback:"Cancel"})}),u.jsx(pt,{onClick:f,disabled:c,variant:"contained",color:"primary",autoFocus:!0,children:c?h("payment.checkout.priceChange.confirming",{fallback:"Confirming..."}):h("payment.checkout.priceChange.accept",{fallback:"Accept & Continue"})})]})]})}const L_=(a,r)=>`${a}-${r}-${Date.now()}-${Math.random().toString(36).substring(2,10)}`,I_=async a=>{let r;return await lD(async()=>{const{data:o}=await ot.get(`/api/checkout-sessions/retrieve/${a}`);if(o.paymentIntent&&o.paymentIntent.status==="requires_action"&&o.paymentIntent.last_payment_error)throw new Error(o.paymentIntent.last_payment_error.message);return r=o,o.checkoutSession?.status==="complete"&&["paid","no_payment_required"].includes(o.checkoutSession?.payment_status)},{interval:2e3,timeout:180*1e3}),r},$_=a=>(a?.connectedAccounts||a?.extraConfigs?.connectedAccounts||[]).some(o=>o.provider==="wallet"),cf=(a,r,o,s={})=>{const{preferExisting:f=!0,shouldValidate:m=!1}=s,c={customer_name:a.name||a.fullName,customer_email:a.email,customer_phone:Jf(a.phone)},h={"billing_address.state":a.address?.state||a.address?.province,"billing_address.line1":a.address?.line1,"billing_address.line2":a.address?.line2,"billing_address.city":a.address?.city,"billing_address.postal_code":a.address?.postal_code||a.address?.postalCode,"billing_address.country":a.address?.country||"us"};s.showPhone&&(h["billing_address.country"]=a.metadata?.phone?.country||a.address?.country);const g={...h,...c},y={...r,billing_address:{...r.billing_address}};return Object.entries(g).forEach(([S,x])=>{if(!f||!r[S.split(".")[0]])if(o(S,x,{shouldValidate:m}),S.startsWith("billing_address.")){const A=S.replace("billing_address.","");y.billing_address[A]=x}else y[S]=x}),y};function hD({checkoutSession:a,paymentMethods:r,paymentIntent:o,paymentLink:s,customer:f,onPaid:m,onError:c,onQuoteUpdated:h=void 0,onPaymentIntentUpdate:g=void 0,action:y,onlyShowBtn:S=!1,isDonation:x=!1,rateUnavailable:A=!1}){const{t:v,locale:N}=ft(),{isMobile:B}=qi(),{session:O,connect:k,payable:K,setPaymentState:j}=_n(),w=cu("events"),G="bottom",{control:T,getValues:R,setValue:q,handleSubmit:z,formState:{errors:$},trigger:re}=hs(),Q=V.useRef(null),Z=V.useRef(!1),ne=V.useRef(""),me=V.useRef(""),P=V.useMemo(()=>{let pe=!0;for(const ke of a.line_items)if(Df(ke.price,ke.quantity)){pe=!1;break}return pe},[a]),[D,F]=ni({submitting:!1,paying:!1,paid:!1,paymentIntent:o,stripeContext:void 0,customer:f,customerLimited:!1,serviceSuspended:!1,stripePaying:!1,fastCheckoutInfo:null,creditInsufficientInfo:null,showEditForm:!1,priceChangeConfirm:null}),ae=RS(r),be=Hf(window.location.href),Me=Fi(async({response:pe})=>{pe.id===a.id&&D.paid===!1&&await ve()});V.useEffect(()=>{w&&w.on("checkout.session.completed",Me)},[w]),V.useEffect(()=>{j({paying:D.submitting||D.paying,stripePaying:D.stripePaying})},[D.submitting,D.paying,D.stripePaying]);const Fe=(pe,ke)=>({...ke||{},name:pe?.name||pe?.fullName||ke?.name||ke?.fullName,fullName:pe?.name||pe?.fullName||ke?.name||ke?.fullName,email:pe?.email||ke?.email,phone:pe?.phone||ke?.phone,address:{...ke?.address||{},...pe?.address||{},country:pe?.address?.country||ke?.address?.country,state:pe?.address?.state||ke?.address?.province,line1:pe?.address?.line1||ke?.address?.line1,line2:pe?.address?.line2||ke?.address?.line2,city:pe?.address?.city||ke?.address?.city,postal_code:pe?.address?.postal_code||ke?.address?.postalCode},metadata:{...ke?.metadata||{},phone:{country:pe?.address?.country||ke?.metadata?.phone?.country,phoneNumber:pe?.phone||ke?.metadata?.phone?.phoneNumber}}});V.useEffect(()=>{const pe=async()=>{if(O?.user){const ke=R();let Re=O.user;try{const{data:it}=await ot.get("/api/customers/me?skipSummary=1&fallback=1");Re=Fe(it,Re)}catch(it){Re=Fe(f||{},Re),console.error(it)}const Je=cf(Re,ke,q,{preferExisting:!1,showPhone:a.phone_number_collection?.enabled}),tt=ee(Je);F({showEditForm:!tt})}else cf({name:"",email:"",phone:"",address:{state:"",line1:"",line2:"",city:"",postal_code:""}},{},q,{preferExisting:!1,showPhone:a.phone_number_collection?.enabled})};D.submitting||pe()},[O?.user,a.phone_number_collection?.enabled]);const Ae=ba({control:T,name:"payment_method"}),ue=ba({control:T,name:"payment_currency"}),$e=Fi(()=>{z(zt,Dn)()}),Pe=tu(a.line_items);let Xe="";s?.donation_settings?y?Xe=y:Xe=v("payment.checkout.donate"):Xe=v(`payment.checkout.${a.mode}`),Xe=O?.user||x?Xe:v("payment.checkout.connect",{action:Xe});const Ze=r.find(pe=>pe.id===Ae),Ue=ae.find(pe=>pe.id===ue),b=Ze.type==="arcblock"&&!a.subscription_data?.no_stake,L=V.useMemo(()=>(a.line_items||[]).some(pe=>{const ke=pe.upsell_price||pe.price;return ke&&ke?.pricing_type==="dynamic"}),[a.line_items])&&A,ie=K&&!L,W=a?.submit_type==="donate"&&x,[te,ce]=ni({open:!1,total:"",usd:null,hasQuotes:!1,baseCurrency:"USD",oldTotal:"",reason:"recalculated"}),J=Fi(pe=>{if(!pe)return null;const ke=Number(pe);return Number.isFinite(ke)?ke.toFixed(8):null}),H=Fi(pe=>{if(!pe?.line_items?.length)return null;for(const ke of pe.line_items){const Re=ke?.exchange_rate;if(Re)return Re}return null}),M=V.useRef(!1),U=V.useRef(""),se=Fi(pe=>pe?.line_items?.length?pe.line_items.map(ke=>{const Re=ke.price_id||ke.price?.id||"",Je=ke?.quote_id||"",tt=ke?.quoted_amount||"",it=ke?.exchange_rate||"";return`${Re}:${Je}:${tt}:${it}`}).join("|"):""),je=Fi(pe=>{if(!Ue)return{total:"",usd:null,hasQuotes:!1,baseCurrency:"USD",totalUnit:null};const ke=pe.line_items||[];let Re="USD";for(const ht of ke){const hn=(ht.upsell_price||ht.price)?.base_currency;if(hn){Re=hn;break}}const Je=ke.some(ht=>ht?.quoted_amount&&ht?.exchange_rate);if(!Je)return{total:"",usd:null,hasQuotes:!1,baseCurrency:Re,totalUnit:null};let tt=Number(pe?.subscription_data?.trial_period_days||0);const it=(pe?.subscription_data?.trial_currency||"").split(",").map(_0).filter(Boolean);it.length>0&&ue&&it.includes(ue)===!1&&(tt=0);const{total:Wn}=Hl(ke,Ue,tt>0),Xt=new ze(pe.total_details?.amount_discount||"0"),st=new ze(Wn).sub(Xt),Rt=st.isNeg()?new ze(0):st,Jn=`${Ja(qt(Rt.toString(),Ue.decimal),6)} ${Ue.symbol}`,Ii=ke.map(ht=>{const hn=(ht.upsell_price||ht.price)?.base_amount;if(hn!=null)return q0(hn,ht.quantity||0);const oi=ht?.exchange_rate,ja=ht?.quoted_amount;return!oi||!ja?null:If(new ze(ja),Ue.decimal,oi)}).filter(ht=>!!ht);if(!Ii.length)return{total:Jn,usd:null,hasQuotes:Je,baseCurrency:Re,totalUnit:Rt};const vr=Ii.reduce((ht,On)=>ht.add(new ze(Kn(On,8))),new ze(0)),co=qt(vr.toString(),8);return{total:Jn,usd:zi(co,N),hasQuotes:Je,baseCurrency:Re,totalUnit:Rt}}),_=Fi((pe,ke)=>{const Re=je(pe),Je=je(ke);if(!Re.totalUnit||!Je.totalUnit)return{changed:!1,prev:Re,next:Je};const tt=Je.totalUnit.sub(Re.totalUnit).abs(),it=new ze(1);return{changed:tt.gt(it),prev:Re,next:Je}}),I=Fi((pe,ke={})=>{if(!pe?.checkoutSession)return;h?.({checkoutSession:pe.checkoutSession,quotes:pe.quotes,rateUnavailable:pe.rateUnavailable,rateError:pe.rateError});const{changed:Re,prev:Je,next:tt}=_(a,pe.checkoutSession),it=J(H(a)),Wn=J(H(pe.checkoutSession)),Xt=!!(it&&Wn&&it!==Wn);if((ke.forceConfirm||Re)&&tt.hasQuotes){ce({open:!0,total:tt.total,usd:tt.usd,hasQuotes:tt.hasQuotes,baseCurrency:tt.baseCurrency,oldTotal:Je.total,reason:ke.reason||(Xt?"rateChanged":"recalculated")});return}ce({open:!1});const Rt=se(pe.checkoutSession);Rt&&Rt!==U.current&&(U.current=Rt,M.current=!0)}),ee=pe=>{if(!pe)return!1;const ke=a.metadata?.page_info?.field_validation,Re=pe.customer_name;if(!Re||Re.trim()==="")return!1;const Je=pe.customer_email;if(!Je||!Hg(Je))return!1;const tt=gn("customer_name",ke,N);if(tt.pattern&&!tt.pattern.value.test(Re))return!1;const it=gn("customer_email",ke,N);if(it.pattern&&!it.pattern.value.test(Je))return!1;const Wn=pe.billing_address||{},{postal_code:Xt,country:st,state:Rt,line1:Jn,city:Li}=Wn;if(!Xt||!Tf(Xt,st))return!1;const Ii=gn("billing_address.postal_code",ke,N);if(Ii.pattern&&!Ii.pattern.value.test(Xt)||!Rt)return!1;const vr=gn("billing_address.state",ke,N);if(vr.pattern&&!vr.pattern.value.test(Rt))return!1;if(a.phone_number_collection?.enabled){const ht=pe.customer_phone;if(!ht||ht.trim()==="")return!1;const On=gn("customer_phone",ke,N);if(On.pattern&&!On.pattern.value.test(ht))return!1}if(a.billing_address_collection==="required"){if(!st||!Rt||!Jn||!Li||!Xt)return!1;const ht=gn("billing_address.line1",ke,N);if(ht.pattern&&!ht.pattern.value.test(Jn))return!1;const On=gn("billing_address.city",ke,N);if(On.pattern&&!On.pattern.value.test(Li))return!1}return!0},Ee=ba({control:T,name:"customer_name"}),De=ba({control:T,name:"customer_email"}),Ce=ba({control:T,name:"customer_phone"}),Te=ba({control:T,name:"billing_address"}),Ye=O?.user?D.showEditForm:!1;V.useEffect(()=>{M.current&&(D.submitting||D.paying||(M.current=!1,an()))},[D.submitting,D.paying]);const ve=async()=>{if(!Z.current){Z.current=!0,F({paying:!0});try{const pe=await I_(a.id);D.paid===!1&&(F({paid:!0,paying:!1}),m(pe))}catch(pe){const ke=Pt(pe),Re={action:"payFailed",mode:a.mode,errorMessage:ke,success:!1};$x.event(Re.action,Re),rt.error(ke)}finally{F({paying:!1}),Z.current=!1}}};V.useEffect(()=>{Q.current&&!vd($)&&B&&Q.current.scrollIntoView({behavior:"smooth"})},[$,B]);const qe=async()=>{const{data:pe}=await ot.get("/api/customers/me?fallback=1&skipSummary=1");if(pe){const ke=R(),Re=Fe(pe,O?.user),Je=cf(Re,ke,q,{preferExisting:!1,showPhone:a.phone_number_collection?.enabled,shouldValidate:!0}),tt=ee(Je);F({showEditForm:!tt}),await re()}},Oe=async()=>{if(D.fastCheckoutInfo){F({fastCheckoutInfo:{...D.fastCheckoutInfo,loading:!0}});try{const pe=await ot.post(`/api/checkout-sessions/${a.id}/fast-checkout-confirm`,{});pe.data.paymentIntent&&g?.(pe.data.paymentIntent),pe.data.fastPaid?(F({fastCheckoutInfo:null,paying:!0}),await ve()):(rt.error(v("payment.checkout.fastPay.failed")),F({fastCheckoutInfo:null,paying:!0}),kt())}catch(pe){console.error(pe);const ke=pe?.response?.data?.code;if(["QUOTE_LOCK_EXPIRED","QUOTE_AMOUNT_MISMATCH","QUOTE_EXPIRED_OR_USED","QUOTE_NOT_FOUND","QUOTE_REQUIRED"].includes(ke)){try{const{data:Re}=await ot.get(`/api/checkout-sessions/retrieve/${a.id}`,{params:{forceRefresh:"1"}});Re?.checkoutSession&&(I(Re,{reason:"rateChanged"}),rt.info(v("payment.checkout.quote.updated.pleaseRetry")||"Price updated, please resubmit"))}catch(Re){console.error(Re),rt.error(Pt(Re))}finally{F({fastCheckoutInfo:null})}return}if(ke==="QUOTE_UPDATED"){const Re=pe?.response?.data;Re?.checkoutSession&&I(Re),F({fastCheckoutInfo:null});return}if(ke==="RATE_UNAVAILABLE"){const Re=pe?.response?.data;Re?.checkoutSession&&h?.({checkoutSession:Re.checkoutSession,quotes:Re.quotes,rateUnavailable:Re.rateUnavailable,rateError:Re.rateError}),F({fastCheckoutInfo:null});return}rt.error(Pt(pe)),F({fastCheckoutInfo:null})}}},Ve=()=>{F({fastCheckoutInfo:null})},Ge=()=>{F({creditInsufficientInfo:null})},Ke=()=>{ce({open:!1}),M.current=!0},et=()=>{ce({open:!1})},Lt=()=>{const pe=D.priceChangeConfirm?.formData;F({priceChangeConfirm:null}),pe&&zt(pe)},It=()=>{F({priceChangeConfirm:null})},kt=()=>{try{if(!["arcblock","ethereum","base"].includes(Ze.type))return;F({paying:!0}),k.open({locale:N,containerEl:void 0,action:a.mode,prefix:Dt(Qn(),"/api/did"),saveConnect:!1,useSocket:Lf()===!1,extraParams:{checkoutSessionId:a.id,sessionUserDid:O?.user?.did},onSuccess:async()=>{k.close(),await ve()},onClose:()=>{k.close(),F({submitting:!1,paying:!1})},onError:pe=>{console.error(pe),F({submitting:!1,paying:!1}),c(pe)},messages:{title:v("payment.checkout.connectModal.title",{action:Xe}),scan:v("payment.checkout.connectModal.scan"),confirm:v("payment.checkout.connectModal.confirm"),cancel:v("payment.checkout.connectModal.cancel")}})}catch(pe){rt.error(Pt(pe))}},zt=async pe=>{if(D.submitting)return;if(!O.user.sourceAppPid&&a.line_items?.some(Je=>!!Je?.price?.product?.vendor_config?.length)){rt.error(v("payment.checkout.vendor.accountRequired"));return}F({submitting:!0});try{let Re;const Je=a.line_items?.find(st=>st?.exchange_rate)?.exchange_rate||void 0,it=(a.line_items||[]).map(st=>`${st.upsell_price_id||st.price_id}:${st.quantity}`).join("|"),Wn=`${a.id}-${Ue?.id}-${it}`;(Wn!==me.current||!ne.current)&&(me.current=Wn,ne.current=L_(a.id,Ue?.id||""));const Xt={...pe,idempotency_key:ne.current,preview_rate:Je||void 0,price_confirmed:D.priceChangeConfirm?.formData?!0:void 0};if(W?Re=await ot.put(`/api/checkout-sessions/${a.id}/donate-submit`,Xt):Re=await ot.put(`/api/checkout-sessions/${a.id}/submit`,Xt),F({paymentIntent:Re.data.paymentIntent,stripeContext:Re.data.stripeContext,customer:Re.data.customer,submitting:!1,customerLimited:!1}),Re.data.paymentIntent&&g?.(Re.data.paymentIntent),["arcblock","ethereum","base"].includes(Ze.type)){if(Re.data.noPaymentRequired){try{const st=await ot.post(`/api/checkout-sessions/${a.id}/fast-checkout-confirm`,{});st.data.paymentIntent&&g?.(st.data.paymentIntent),st.data.fastPaid||st.data.checkoutSession?.status==="complete"?(F({paying:!0}),await ve()):kt()}catch(st){console.error("noPaymentRequired confirm failed",st),kt()}return}Ue?.type==="credit"?Re.data.creditSufficient===!0?F({fastCheckoutInfo:{open:!0,loading:!1,sourceType:"credit",amount:Re.data.fastPayInfo?.amount||"0",payer:Re.data.fastPayInfo?.payer,availableCredit:Re.data.fastPayInfo?.amount||"0",balance:Re.data.fastPayInfo?.token?.balance||"0"}}):F({creditInsufficientInfo:{open:!0}}):(Re.data.balance?.sufficient||Re.data.delegation?.sufficient)&&!W&&Re.data.fastPayInfo?F({fastCheckoutInfo:{open:!0,loading:!1,sourceType:Re.data.fastPayInfo.type,amount:Re.data.fastPayInfo.amount,payer:Re.data.fastPayInfo.payer}}):kt()}["stripe"].includes(Ze.type)&&(Re.data.stripeContext?.status==="succeeded"?F({paying:!0}):setTimeout(()=>{F({stripePaying:!0})},200))}catch(Re){console.error(Re);let Je=!0;const tt=Re.response?.data?.code;if(tt){if(["QUOTE_UPDATED","RATE_UNAVAILABLE","QUOTE_LOCK_EXPIRED","QUOTE_AMOUNT_MISMATCH","QUOTE_EXPIRED_OR_USED","QUOTE_NOT_FOUND","QUOTE_REQUIRED","QUOTE_MAX_PAYABLE_EXCEEDED"].includes(tt)||aD(`error.${tt}`),["QUOTE_LOCK_EXPIRED","QUOTE_AMOUNT_MISMATCH","QUOTE_EXPIRED_OR_USED","QUOTE_NOT_FOUND","QUOTE_REQUIRED","QUOTE_MAX_PAYABLE_EXCEEDED","quote_validation_failed"].includes(tt)){Je=!1;try{const{data:it}=await ot.get(`/api/checkout-sessions/retrieve/${a.id}`,{params:{forceRefresh:"1"}});it?.checkoutSession&&(I(it,{reason:"rateChanged"}),rt.info(v("payment.checkout.quote.updated.pleaseRetry")||"Price updated, please resubmit"))}catch(it){console.error(it),rt.error(Pt(it))}}if(tt==="QUOTE_UPDATED"){Je=!1;const it=Re.response?.data;it?.checkoutSession&&I(it)}if(tt==="RATE_UNAVAILABLE"){Je=!1;const it=Re.response?.data;it?.checkoutSession&&h?.({checkoutSession:it.checkoutSession,quotes:it.quotes,rateUnavailable:it.rateUnavailable,rateError:it.rateError})}if(tt==="PRICE_UNAVAILABLE"&&(Je=!1,rt.error(v("payment.checkout.priceChange.unavailable",{fallback:"Unable to fetch exchange rate. Please try again later."}))),tt==="PRICE_UNSTABLE"&&(Je=!1,rt.error(v("payment.checkout.priceChange.unstable",{fallback:"Price is volatile. Please try again later."}))),tt==="PRICE_CHANGED"){Je=!1;const it=Re.response?.data;F({priceChangeConfirm:{open:!0,changePercent:it?.change_percent||0,formData:pe}})}tt==="UNIFIED_APP_REQUIRED"&&(Je=!1,rt.error(v("payment.checkout.vendor.accountRequired"))),tt==="CUSTOMER_LIMITED"&&(Je=!1,F({customerLimited:!0})),tt==="STOP_ACCEPTING_ORDERS"&&(Je=!1,F({serviceSuspended:!0}))}Je&&rt.error(Pt(Re))}finally{F({submitting:!1})}},Dn=pe=>{pe&&console.error(pe),F({submitting:!1})},an=()=>{if(!(D.submitting||D.paying||!ie))if(Q.current&&!vd($)&&B&&Q.current.scrollIntoView({behavior:"smooth"}),O?.user)z(zt,Dn)();else{if(W){z(zt,Dn)();return}O?.login(()=>{F({submitting:!0}),qe().then($e).catch(pe=>{console.error(pe),F({submitting:!1})})})}},An=async()=>{F({stripePaying:!1,paying:!0}),await ve()},Sa=async()=>{try{await ot.post(`/api/checkout-sessions/${a.id}/abort-stripe`)}catch(pe){console.error(pe),rt.error(Pt(pe))}finally{F({stripePaying:!1})}};V.useEffect(()=>{const pe=ke=>{ke.key==="Enter"&&!D.submitting&&!D.paying&&!D.stripePaying&&P&&ie&&an()};return window.addEventListener("keydown",pe),()=>{window.removeEventListener("keydown",pe)}},[D.submitting,D.paying,D.stripePaying,P,ie]);const fa=BS(Ze,D.fastCheckoutInfo?.payer||""),Xn=D.fastCheckoutInfo&&u.jsx(Ul,{onConfirm:Oe,onCancel:Ve,title:D.fastCheckoutInfo.sourceType==="credit"?v("payment.checkout.fastPay.credit.title"):v("payment.checkout.fastPay.title"),message:D.fastCheckoutInfo.sourceType==="credit"?u.jsx(oe,{children:v("payment.checkout.fastPay.credit.meteringSubscriptionMessage",{available:`${Ca(D.fastCheckoutInfo?.balance||"0",Ue?.decimal||18)} ${Ue?.symbol}`})}):u.jsxs(ge,{children:[u.jsx(oe,{children:v("payment.checkout.fastPay.autoPaymentReason")}),u.jsx(ti,{sx:{mt:1.5,mb:1.5}}),u.jsxs(ge,{spacing:1,children:[u.jsxs(ge,{sx:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[u.jsx(oe,{sx:{color:"text.primary",whiteSpace:"nowrap"},children:v("payment.checkout.fastPay.payer")}),u.jsxs(Se,{sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(A0,{did:D.fastCheckoutInfo.payer||"",compact:!0,responsive:!1}),fa&&u.jsx(Un,{title:v("payment.checkout.fastPay.balanceLink"),placement:"top",children:u.jsx(Ol,{sx:{color:"text.lighter",fontSize:"0.85rem",cursor:"pointer","&:hover":{color:"text.primary"}},onClick:()=>{window.open(fa,"_blank")}})})]})]}),u.jsxs(ge,{sx:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[u.jsx(oe,{sx:{color:"text.primary"},children:v("payment.checkout.fastPay.amount")}),u.jsxs(oe,{children:[Ca(D.fastCheckoutInfo.amount,Ue?.decimal||18)," ",Ue?.symbol]})]})]})]}),loading:D.fastCheckoutInfo.loading,color:"primary"}),Fa=D.creditInsufficientInfo&&u.jsx(Ul,{onConfirm:Ge,onCancel:Ge,title:v("payment.checkout.fastPay.credit.insufficientTitle"),message:u.jsx(oe,{children:v("payment.checkout.fastPay.credit.insufficientMessage")}),confirm:v("common.confirm")}),_a=te.open&&u.jsx(Ul,{onConfirm:Ke,onCancel:et,title:v("payment.checkout.quote.priceUpdatedTitle"),message:u.jsxs(ge,{spacing:1,children:[u.jsx(oe,{children:v(te.reason==="rateChanged"?"payment.checkout.quote.priceUpdatedDescriptionRate":"payment.checkout.quote.priceUpdatedDescriptionRecalc")}),te.hasQuotes&&u.jsxs(ge,{spacing:.25,children:[u.jsx(oe,{sx:{color:"text.secondary",fontSize:"0.7875rem"},children:v("payment.checkout.quote.priceUpdatedNewTotalLabel")}),u.jsx(oe,{sx:{fontWeight:600},children:te.total}),te.usd&&u.jsxs(oe,{sx:{color:"text.secondary"},children:["≈ ",te.usd," ",te.baseCurrency]}),te.oldTotal&&u.jsx(oe,{sx:{color:"text.secondary",fontSize:"0.75rem"},children:v("payment.checkout.quote.priceUpdatedOldTotal",{total:te.oldTotal})})]})]}),confirm:v("payment.checkout.quote.priceUpdatedConfirm"),cancel:v("common.cancel"),color:"primary"}),Dr=()=>{if(be.redirect)return decodeURIComponent(be.redirect);if(a.success_url)return a.success_url;if(s?.after_completion?.redirect?.url)return s.after_completion.redirect.url};return S?u.jsxs(u.Fragment,{children:[u.jsx(Se,{className:"cko-payment-submit-btn",children:u.jsxs(pt,{variant:"contained",color:"primary",size:"large",className:"cko-submit-button",onClick:()=>{D.submitting||D.paying||!ie||an()},fullWidth:!0,disabled:D.stripePaying||!P||!ie,children:[(D.submitting||D.paying)&&u.jsx(gr,{size:16,sx:{mr:.5,color:"primary.contrastText"}}),D.submitting||D.paying?v("payment.checkout.processing"):Xe]})}),D.customerLimited&&u.jsx(Gg,{customerId:f?.id||O?.user?.did,onPaid:()=>{F({customerLimited:!1}),an()},alertMessage:v("payment.customer.pastDue.alert.customMessage"),detailLinkOptions:{enabled:!0,onClick:()=>{F({customerLimited:!1}),window.open(Dt(Qn(),`/customer/invoice/past-due?referer=${encodeURIComponent(window.location.href)}`),"_self")}},dialogProps:{open:D.customerLimited,onClose:()=>F({customerLimited:!1}),title:v("payment.customer.pastDue.alert.title")}}),D.serviceSuspended&&u.jsx(Kg,{open:!0,onClose:()=>F({serviceSuspended:!1})}),Xn,Fa,_a,D.priceChangeConfirm?.open&&u.jsx(Qg,{open:!0,changePercent:D.priceChangeConfirm.changePercent,onConfirm:Lt,onCancel:It,loading:D.submitting})]}):u.jsxs(u.Fragment,{children:[u.jsx(Gn,{in:!0,children:u.jsxs(ge,{className:"cko-payment-contact",children:[u.jsx(oe,{title:v("payment.checkout.paymentDetails"),sx:{color:"text.primary",fontSize:{xs:"18px",md:"24px"},fontWeight:"700",lineHeight:"32px",mb:2.5},children:v("payment.checkout.paymentDetails")}),u.jsx(Gn,{in:!0,children:u.jsxs(ge,{direction:"column",className:"cko-payment-methods",sx:{alignItems:"flex-start"},children:[u.jsx(ge,{direction:"row",sx:{width:"100%"},children:u.jsx(Yl,{name:"payment_currency",control:T,render:({field:pe})=>u.jsx(N_,{value:pe.value,currencies:ae,onChange:async(ke,Re)=>{const Je=pe.value;if(pe.onChange(ke),q("payment_method",Re),P_(ke,O?.user?.did),Je&&Je!==ke)try{const{data:tt}=await ot.put(`/api/checkout-sessions/${a.id}/switch-currency`,{currency_id:ke,payment_method_id:Re});tt.currency_changed&&h&&h({checkoutSession:tt,quotes:tt.quotes})}catch(tt){console.error("Failed to switch currency:",tt)}}})})}),D.stripePaying&&D.stripeContext&&u.jsx(fD,{clientSecret:D.stripeContext.client_secret,intentType:D.stripeContext.intent_type,publicKey:Ze.settings.stripe?.publishable_key,customer:D.customer,mode:a.mode,onConfirm:An,onCancel:Sa,returnUrl:Dr()})]})}),!Ye&&O?.user&&u.jsxs(ge,{spacing:1.25,sx:{mt:2,p:2,pt:1,backgroundColor:"background.paper",borderRadius:1,border:"1px solid",borderColor:"divider"},children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:.25},children:[u.jsx(oe,{variant:"subtitle2",sx:{color:"text.primary",fontSize:"0.875rem"},children:v("payment.checkout.customerInfo")}),u.jsx(pt,{size:"small",variant:"text",onClick:()=>F({showEditForm:!0}),sx:{minWidth:0},children:v("common.edit")})]}),u.jsxs(ge,{spacing:.5,children:[u.jsx(oe,{variant:"body2",sx:{color:"text.primary",fontWeight:600,fontSize:"0.9375rem"},children:Ee}),u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",fontSize:"0.8125rem"},children:De}),a.phone_number_collection?.enabled&&Ce&&u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",fontSize:"0.8125rem"},children:Ce}),Te&&u.jsxs(ge,{direction:"row",alignItems:"center",spacing:.75,children:[Te.country&&u.jsx(Nl,{iso2:Te.country.toLowerCase(),style:{width:18,height:14}}),u.jsxs(oe,{variant:"body2",sx:{color:"text.secondary",fontSize:"0.8125rem"},children:[a.billing_address_collection==="required"?[Te.line1,Te.city,Te.state].filter(Boolean).join(", "):Te.state||"",Te.postal_code&&` [ ${v("payment.checkout.billing.postal_code")}: ${Te.postal_code} ]`]})]})]})]}),Ye&&u.jsxs(ge,{direction:"column",className:"cko-payment-form",id:"cko-payment-form",spacing:0,ref:vd($)?void 0:Q,sx:{flex:1,overflow:"auto",py:1},children:[u.jsx(Nn,{className:"base-label",children:v("payment.checkout.customer.name")}),u.jsx(Xa,{name:"customer_name",variant:"outlined",errorPosition:G,rules:{required:v("payment.checkout.required"),...gn("customer_name",a.metadata?.page_info?.field_validation,N)}}),u.jsx(Nn,{className:"base-label",children:v("payment.checkout.customer.email")}),u.jsx(Xa,{name:"customer_email",variant:"outlined",errorPosition:G,rules:{required:v("payment.checkout.required"),validate:pe=>Hg(pe)?!0:v("payment.checkout.invalid"),...gn("customer_email",a.metadata?.page_info?.field_validation,N)}}),a.phone_number_collection?.enabled&&u.jsxs(u.Fragment,{children:[u.jsx(Nn,{className:"base-label",children:v("payment.checkout.customer.phone")}),u.jsx(O_,{name:"customer_phone",variant:"outlined",errorPosition:G,placeholder:"Phone number",rules:{required:v("payment.checkout.required"),validate:async pe=>await U_(pe)?!0:v("payment.checkout.invalid"),...gn("customer_phone",a.metadata?.page_info?.field_validation,N)}})]}),u.jsx(M_,{mode:a.billing_address_collection,sx:{marginTop:"0 !important"},fieldValidation:a.metadata?.page_info?.field_validation,errorPosition:G})]})]})}),u.jsx(ti,{sx:{mt:2.5,mb:2.5}}),u.jsx(Gn,{in:!0,children:u.jsxs(ge,{className:"cko-payment-submit",children:[u.jsx(Se,{className:"cko-payment-submit-btn",children:u.jsx(hr,{variant:"contained",color:"primary",size:"large",className:"cko-submit-button",onClick:()=>{an()},fullWidth:!0,loading:D.submitting||D.paying,disabled:D.stripePaying||!P||!ie,children:D.submitting||D.paying?v("payment.checkout.processing"):Xe})}),["subscription","setup"].includes(a.mode)&&u.jsx(oe,{sx:{mt:2.5,color:"text.lighter",fontSize:"0.7875rem",lineHeight:"0.9625rem"},children:b?v("payment.checkout.confirm.withStake",{payee:Pe}):v("payment.checkout.confirm.withoutStake",{payee:Pe})}),a.metadata?.page_info?.form_purpose_description&&u.jsxs(Se,{sx:{mt:1,display:"flex",alignItems:"center",gap:.5},children:[u.jsx(hf,{sx:{color:"text.lighter",fontSize:"0.75rem"}}),u.jsx(oe,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.lighter"},children:N==="zh"?a.metadata.page_info.form_purpose_description.zh:a.metadata.page_info.form_purpose_description.en})]})]})}),D.customerLimited&&u.jsx(Gg,{customerId:f?.id||O?.user?.did,onPaid:()=>{F({customerLimited:!1}),an()},alertMessage:v("payment.customer.pastDue.alert.customMessage"),detailLinkOptions:{enabled:!0,onClick:()=>{F({customerLimited:!1}),window.open(Dt(Qn(),`/customer/invoice/past-due?referer=${encodeURIComponent(window.location.href)}`),"_self")}},dialogProps:{open:D.customerLimited,onClose:()=>F({customerLimited:!1}),title:v("payment.customer.pastDue.alert.title")}}),D.serviceSuspended&&u.jsx(Kg,{open:!0,onClose:()=>F({serviceSuspended:!1})}),Xn,Fa,_a,D.priceChangeConfirm?.open&&u.jsx(Qg,{open:!0,changePercent:D.priceChangeConfirm.changePercent,onConfirm:Lt,onCancel:It,loading:D.submitting})]})}function V_(){return u.jsx(Gn,{in:!0,children:u.jsxs(ge,{direction:"column",children:[u.jsx(ge,{direction:"row",spacing:2,sx:{alignItems:"center"},children:u.jsx(Ot,{variant:"text",sx:{fontSize:"1.75rem",width:"40%"}})}),u.jsx(Ot,{sx:{mt:2},variant:"rounded",height:100}),u.jsx(oe,{component:"div",variant:"h4",sx:{mt:2},children:u.jsx(Ot,{})}),u.jsx(oe,{component:"div",variant:"h2",children:u.jsx(Ot,{})})]})})}function H_(){return u.jsx(Gn,{in:!0,children:u.jsxs(ge,{direction:"column",children:[u.jsx(Ot,{variant:"text",sx:{fontSize:"1.75rem",width:"40%"}}),u.jsx(Ot,{sx:{mt:2},variant:"rounded",height:68}),u.jsxs(Se,{sx:{mt:1},children:[u.jsx(oe,{component:"div",variant:"h4",sx:{mb:-1},children:u.jsx(Ot,{})}),u.jsx(oe,{component:"div",children:u.jsx(Ot,{height:60})})]}),u.jsxs(Se,{children:[u.jsx(oe,{component:"div",variant:"h4",sx:{mb:-1},children:u.jsx(Ot,{})}),u.jsx(oe,{component:"div",children:u.jsx(Ot,{height:60})})]}),u.jsx(Se,{children:u.jsx(Ot,{height:60})})]})})}function yD(){return u.jsxs(Se,{sx:{mb:2},children:[u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[u.jsx(Ot,{variant:"rounded",height:16,width:150}),u.jsx(Ot,{variant:"rounded",height:16,width:50})]}),u.jsx(Ot,{variant:"rounded",height:8,width:"100%"})]})}const Y_=(a,r,o)=>{const s=a.name||a.title,f=a.status==="delivered";return a.vendorType==="didnames"?r?o("payment.checkout.vendor.didnames.failed",{name:s}):f?o("payment.checkout.vendor.didnames.completed",{name:s}):o("payment.checkout.vendor.didnames.processing",{name:s}):r?o("payment.checkout.vendor.launcher.failed",{name:s}):f?o("payment.checkout.vendor.launcher.completed",{name:s}):o("payment.checkout.vendor.launcher.processing",{name:s})};function G_({vendor:a}){const{t:r}=ft(),[o,s]=V.useState(0),f=V.useRef(),m=V.useCallback(()=>{const y=a.progress||0;let S,x;const A=v=>{S||(S=v,x=o);const N=v-S;let B;if(y===100)B=100;else if(y===0)B=Math.min(x+N/1e3,99);else if(y>x){const k=Math.min(N/1e3,1);B=x+(y-x)*k}else B=Math.min(x+N/1e3,99);B=Math.round(B),s(O=>Math.min(O>B?O:B,100)),y!==100&&B<99&&y<100&&(f.current=requestAnimationFrame(A))};f.current&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame(A)},[a.progress,o]);V.useEffect(()=>(m(),()=>{f.current&&cancelAnimationFrame(f.current)}),[m]);const c=o>=100,h=a.status==="failed",g=Y_(a,h,r);return h?u.jsxs(Se,{sx:{mb:2},children:[u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[u.jsx(oe,{variant:"body2",sx:{color:"text.secondary"},children:g}),u.jsx(oe,{variant:"body2",sx:{color:"error.main",fontWeight:500},children:r("payment.checkout.vendor.progress",{progress:0})})]}),u.jsx(zl,{variant:"determinate",value:100,sx:{height:8,borderRadius:4,backgroundColor:"grey.200","& .MuiLinearProgress-bar":{borderRadius:4,backgroundColor:"error.main"}}})]}):!a.name&&!a.title?u.jsx(yD,{}):u.jsxs(Se,{sx:{mb:2},children:[u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[u.jsxs(oe,{variant:"body2",sx:{color:"text.secondary",display:"flex",alignItems:"center"},children:[g," ",c?u.jsx(s0,{sx:{color:"success.main",ml:.5},fontSize:"small"}):null]}),c?null:u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",fontWeight:500},children:r("payment.checkout.vendor.progress",{progress:o})})]}),u.jsx(zl,{variant:"determinate",value:o||0,sx:{height:8,borderRadius:4,backgroundColor:"grey.200","& .MuiLinearProgress-bar":{borderRadius:4,backgroundColor:c?"success.main":"primary.main",transition:"background-color 0.3s linear"}}})]})}function gD({mode:a,pageInfo:r={},vendorCount:o=0,sessionId:s="",message:f,action:m,payee:c,invoiceId:h="",subscriptionId:g="",subscriptions:y=[]}){const{t:S,locale:x}=ft(),{prefix:A,api:v}=_n(),[N,B]=V.useState(null),[O,k]=V.useState(!1),[K,j]=V.useState(!1),w=V.useRef(Date.now()),T=S0()?.arcSphere;let R=null;V.useEffect(()=>{if(o===0||!s)return;const re=async Z=>{try{const ne=await v.get(Dt(A,`/api/vendors/order/${s}/status`),{}),me=Date.now()-w.current>6*1e3,P=ne.data?.vendors?.every(F=>F.progress>=100),D=ne.data?.vendors?.some(F=>F.status==="failed"||me&&!!F.error&&!!F.error_message);(D||P)&&clearInterval(Z),j(D),k(!D&&P),B(ne.data)}catch(ne){console.error("Failed to fetch vendor status:",ne)}};re();const Q=setInterval(()=>{re(Q)},5e3);return()=>clearInterval(Q)},[o,v,A,s]),V.useEffect(()=>{if(T&&O)try{Ky?.call?.("arc__toast",{text:S("payment.checkout.vendor.arcSphereToast")});const re=setTimeout(()=>{Ky?.call?.("arcClosePage")},3e3);return()=>clearTimeout(re)}catch{}},[O,S,x,T]);const q=()=>{const re=[];for(let Q=0;Q<o;Q++)re.push(u.jsx(yD,{},`placeholder-${Q}`));return re},z=()=>N?N.vendors?.map((re,Q)=>u.jsx(G_,{vendor:re},re.title||`vendor-${Q}`)):q(),$=()=>o===0?null:u.jsxs(Yy,{elevation:0,sx:{p:3,backgroundColor:"grey.50",borderRadius:2,width:"100%",mt:2,display:"flex",flexDirection:"column",gap:2},children:[z(),K?u.jsx(oe,{variant:"h6",sx:{color:"warning.main",mb:1},children:S("payment.checkout.vendor.failedMsg")}):null,r?.success_message?.[x]&&O?u.jsx(oe,{variant:"h6",sx:{color:"text.primary",mb:1},children:r?.success_message?.[x]}):null]});return["subscription","setup"].includes(m)?y&&y.length>1?R=u.jsx(Yy,{elevation:0,sx:{p:3,backgroundColor:"grey.50",borderRadius:2,width:"100%",mt:2,display:"flex",flexDirection:"column",gap:2},children:y.map(re=>u.jsxs(Se,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",fontWeight:500},children:re.description}),u.jsx(Se,{sx:{flex:1,borderBottom:"1px dashed",borderColor:"grey.300",mx:2}}),u.jsx(Qy,{variant:"text",color:"primary",size:"small",children:u.jsx(cr,{href:Dt(A,`/customer/subscription/${re.id}`),sx:{color:"text.secondary"},children:S("payment.checkout.next.view")})})]},re.id))}):g&&(R=u.jsx(Qy,{variant:"outlined",color:"primary",sx:{mt:2},children:u.jsx(cr,{href:Dt(A,`/customer/subscription/${g}`),children:S("payment.checkout.next.subscription",{payee:c})})})):h&&(R=u.jsx(oe,{sx:{textAlign:"center",mt:2},children:u.jsx(cr,{href:Dt(A,`/customer/invoice/${h}`),children:S("payment.checkout.next.invoice",{payee:c})})})),u.jsx(u0,{in:!0,children:u.jsxs(ge,{direction:"column",sx:{alignItems:"center",justifyContent:a==="standalone"?"center":"flex-start",height:a==="standalone"?"fit-content":300},children:[u.jsx(K_,{children:u.jsxs("div",{className:"check-icon",children:[u.jsx("span",{className:"icon-line line-tip"}),u.jsx("span",{className:"icon-line line-long"}),u.jsx("div",{className:"icon-circle"}),u.jsx("div",{className:"icon-fix"})]})}),u.jsx(oe,{variant:"h5",sx:{color:"text.primary",mb:3},children:f}),u.jsx(oe,{variant:"body1",sx:{color:"text.secondary",textAlign:"center",fontSize:"14px"},children:S("payment.checkout.completed.tip",{payee:c})}),$(),R]})})}const K_=l0("div")`
45
45
  width: 80px;
46
46
  height: 115px;
47
47
 
@@ -183,7 +183,7 @@ function print() { __p += __j.call(arguments, '') }
183
183
  top: 38px;
184
184
  }
185
185
  }
186
- `;function Oi(a){return u.jsx(Xl,{size:"small",variant:"filled",...a,sx:{...a.sx||{},height:20,textTransform:"capitalize"}})}function DD(){V.useEffect(()=>{const a=r=>{document.activeElement?.type==="number"&&r.preventDefault()};return window.addEventListener("wheel",a,{passive:!1}),()=>{window.removeEventListener("wheel",a)}},[])}const K_=(a,r,o)=>{const{valueType:s="value",includeCustom:f=!1,currentValue:m,isCustomSelected:c=!1,compareValue:h=(k,K)=>k===K,enabled:g=!0,selector:y=".tab-navigable-card button",containerRef:S}=o||{},x=V.useRef(!1),A=V.useCallback(()=>S?.current?S.current.querySelectorAll(y):document.querySelectorAll(y),[S,y]),v=V.useCallback(()=>{if((f?[...a,"custom"]:a).length===0)return-1;if(x.current){const K=document.activeElement,j=A();for(let w=0;w<j.length;w++)if(j[w]===K)return w;if(f&&j.length>0)return j.length-1}else{if(c&&f)return a.length;if(m!==void 0)return s==="index"&&typeof m=="number"?m>=0&&m<a.length?m:-1:a.findIndex(K=>h(K,m))}return-1},[a,f,c,m,s,h,A]),N=V.useCallback((k,K)=>{const j=f?a.length+1:a.length;return k===-1?0:K?k===0?j-1:k-1:k===j-1?0:k+1},[a,f]),B=V.useCallback(k=>{if(!g||k.key!=="Tab")return;k.preventDefault(),k.stopPropagation();const K=v(),j=N(K,k.shiftKey);x.current=!0;const w=j===a.length?"custom":a[j];r(w,j),setTimeout(()=>{const G=A();G[j]&&G[j].focus()},0)},[a,r,g,v,N,A]),O=V.useCallback(()=>{x.current=!1},[]);return{handleKeyDown:B,resetTabNavigation:O,isTabNavigationActive:x.current}},df="payment-donation-preset",ff="payment-donation-custom-amount",bn=a=>{const r=String(a);if(!r||r==="0")return r;const o=parseFloat(r);return Number.isNaN(o)?r:o.toString()};function vD({item:a,settings:r,onChange:o,currency:s}){const{t:f,locale:m}=ft(),{setPayable:c,session:h}=_n();DD();const g=(r?.amount?.presets||[]).map(bn),y=z=>{const $=h?.user?.did;return $?`${z}:${$}`:z},S=()=>{try{const z=localStorage.getItem(y(ff))||"";return z?bn(z):""}catch(z){return console.warn("Failed to access localStorage",z),""}},x=()=>{try{const z=localStorage.getItem(y(df));if(z){if(g.includes(bn(z)))return bn(z);if(z==="custom"&&v)return"custom"}}catch(z){console.warn("Failed to access localStorage",z)}if(g.length>0){const z=Math.floor(g.length/2);return g[z]}return"0"},A=g.length>0,v=!!r?.amount?.custom,N=x(),B=N==="custom"?S():"",[O,k]=ni({selected:N==="custom"?"":N,input:B,custom:!A||N==="custom",error:"",animating:!1}),K=V.useRef(null),j=V.useRef(null),w=z=>{c(!0),k({selected:bn(z),custom:!1,error:""}),o({priceId:a.price_id,amount:bn(z)}),localStorage.setItem(y(df),bn(z))},G=()=>{k({custom:!0,selected:"",animating:!0});const z=g.length>0;let $=[];z&&($=[...g].map(Ae=>parseFloat(Ae)).sort((Ae,ue)=>Ae-ue));const re=z?$[$.length-1]:1;let Q=z?$[$.length-1]*5:100;const Z=r.amount.maximum?parseFloat(r.amount.maximum):1/0;Q=Math.min(Q,Z);const me=(()=>{let Ae=2;return!z||g.every($e=>{const Pe=parseFloat($e);return Pe===Math.floor(Pe)})?0:(g.forEach($e=>{const Pe=$e.toString().split(".")[1];Pe&&(Ae=Math.max(Ae,Pe.length))}),Ae)})();let P;me===0?P=(Math.round(Math.random()*(Q-re)+re)||1).toString():P=(Math.random()*(Q-re)+re).toFixed(me);const D=O.input?parseFloat(O.input):0,ae=parseFloat(P)-D,be=Date.now(),Me=800,Fe=()=>{const ue=Date.now()-be;if(ue<Me){const $e=ue/Me,Pe=D+ae*$e,Xe=me===0?Math.floor(Pe).toString():Pe.toFixed(me);k({input:Xe}),requestAnimationFrame(Fe)}else k({input:P,animating:!1,error:""}),o({priceId:a.price_id,amount:bn(P)}),c(!0),localStorage.setItem(y(ff),bn(P)),setTimeout(()=>{K.current?.focus()},200)};requestAnimationFrame(Fe),localStorage.setItem(y(df),"custom")},T=z=>{z==="custom"?G():w(z)},{handleKeyDown:R}=K_(g,T,{includeCustom:v,currentValue:O.custom?void 0:O.selected,isCustomSelected:O.custom,enabled:!0,selector:".tab-navigable-card button",containerRef:j});V.useEffect(()=>{const z=x(),$=z==="custom";k({selected:$?"":z,custom:!A||z==="custom",input:B,error:""}),$?B?(o({priceId:a.price_id,amount:B}),c(!0)):c(!1):(o({priceId:a.price_id,amount:z}),c(!0))},[r.amount.preset,r.amount.presets,A]),V.useEffect(()=>{j.current&&j.current.focus(),O.custom&&setTimeout(()=>{K.current?.focus()},0)},[O.custom]);const q=z=>{const{value:$}=z.target,re=parseFloat(r.amount.minimum||"0"),Q=r.amount.maximum?parseFloat(r.amount.maximum):1/0,Z=s?.maximum_precision||6;if(jg($,m)){k({input:$,error:jg($,m,Z)}),c(!1);return}if($<re||$>Q){k({input:$,error:f("payment.checkout.donation.between",{min:re,max:Q})}),c(!1);return}c(!0),k({error:"",input:$}),o({priceId:a.price_id,amount:bn($)}),localStorage.setItem(y(ff),bn($))};return u.jsxs(Se,{ref:j,onKeyDown:R,tabIndex:0,sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:1.5,outline:"none"},children:[A&&u.jsxs(ss,{container:!0,spacing:2,children:[g.map(z=>u.jsx(ss,{size:{xs:6,sm:3},children:u.jsx(pf,{variant:"outlined",className:"tab-navigable-card",sx:{minWidth:115,textAlign:"center",transition:"all 0.3s",cursor:"pointer","&:hover":{transform:"translateY(-4px)",boxShadow:3},".MuiCardActionArea-focusHighlight":{backgroundColor:"transparent"},height:"42px",...bn(O.selected)===bn(z)&&!O.custom?{borderColor:"primary.main",borderWidth:1}:{}},children:u.jsx(Gy,{onClick:()=>w(z),tabIndex:0,"aria-selected":bn(O.selected)===bn(z)&&!O.custom,children:u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center",justifyContent:"center",py:1.5,px:1.5},children:[u.jsx(pr,{src:s?.logo,sx:{width:16,height:16,mr:.5},alt:s?.symbol}),u.jsx(oe,{component:"strong",variant:"h3",sx:{lineHeight:1,fontVariantNumeric:"tabular-nums",fontWeight:400},children:z}),u.jsx(oe,{sx:{lineHeight:1,fontSize:14,color:"text.secondary"},children:s?.symbol})]})})})},z)),v&&u.jsx(ss,{size:{xs:6,sm:3},children:u.jsx(pf,{variant:"outlined",className:"tab-navigable-card",sx:{textAlign:"center",transition:"all 0.3s",cursor:"pointer","&:hover":{transform:"translateY(-4px)",boxShadow:3},".MuiCardActionArea-focusHighlight":{backgroundColor:"transparent"},height:"42px",...O.custom?{borderColor:"primary.main",borderWidth:1}:{}},children:u.jsx(Gy,{onClick:G,tabIndex:0,"aria-selected":O.custom,children:u.jsx(ge,{direction:"row",spacing:.5,sx:{alignItems:"center",justifyContent:"center",py:1.5,px:1.5},children:u.jsx(oe,{variant:"h3",sx:{lineHeight:1,fontWeight:400},children:f("common.custom")})})})})},"custom")]}),O.custom&&u.jsx(Yn,{type:"number",value:O.input,onChange:q,margin:"none",fullWidth:!0,error:!!O.error,helperText:O.error,inputRef:K,sx:{mt:N!=="0"?0:1,"& .MuiInputBase-root":{transition:"all 0.3s ease"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"& input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},"& input":{transition:"all 0.25s ease"}},slotProps:{input:{endAdornment:u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center",ml:1},children:[u.jsx(ei,{size:"small",onClick:G,disabled:O.animating,sx:{mr:.5,opacity:O.animating?.5:1,transition:"all 0.2s ease","&:hover":{transform:"scale(1.2)",transition:"transform 0.3s ease"}},"aria-label":f("common.random"),children:u.jsx(Kb,{fontSize:"small"})}),u.jsx(pr,{src:s?.logo,sx:{width:16,height:16},alt:s?.symbol}),u.jsx(oe,{children:s?.symbol})]}),autoComplete:"off"}},autoComplete:"off"})]})}function Q_({value:a,loading:r=!1,skeletonWidth:o=80,height:s=24,sx:f={},animateValueChange:m=!1,transitionDuration:c=300}){const[h,g]=V.useState(a),[y,S]=V.useState(!1),x=V.useRef(a);return V.useEffect(()=>{if(a!==x.current){if(x.current=a,m&&!r){S(!0);const A=setTimeout(()=>{g(a),S(!1)},c/2);return()=>clearTimeout(A)}g(a)}},[a,r,m,c]),r?u.jsx(Ot,{variant:"text",width:o,height:s}):u.jsx(oe,{component:"span",sx:{...f,opacity:y?0:1,transition:m?`opacity ${c/2}ms ease-in-out`:void 0},children:h})}const Zg=Zn(Qb)(({variant:a="success",theme:r})=>({width:28,height:16,padding:0,display:"inline-flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .MuiSwitch-switchBase":{padding:2,"&.Mui-checked":{transform:"translateX(12px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:r.palette[a]?.light}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",width:12,height:12,borderRadius:6,transition:r.transitions?.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:16/2,opacity:1,backgroundColor:r.palette.mode==="dark"?"rgba(255,255,255,.35)":"rgba(0,0,0,.25)",boxSizing:"border-box"}}));function Z_({size:a=48,variant:r="rounded",name:o,logo:s="",description:f="",extra:m=void 0}){const c={width:a,height:a};return u.jsxs(ge,{direction:"row",spacing:1,sx:{alignItems:"center",flex:2,width:"100%"},children:[s?u.jsx(pr,{src:s,alt:o,variant:r,sx:c}):u.jsx(pr,{variant:r,sx:c,children:(o||"?").slice(0,1)}),u.jsxs(ge,{direction:"column",sx:{alignItems:"flex-start",justifyContent:"space-around",flexShrink:1,overflow:"hidden"},children:[u.jsx(oe,{className:"cko-ellipsis",variant:"body1",title:o,sx:{color:"text.primary",fontWeight:500,mb:.5,lineHeight:1.2,fontSize:16},children:o}),f&&u.jsx(oe,{variant:"body1",title:f,sx:{color:"text.lighter",fontSize:"0.74375rem",mb:.5,lineHeight:1.2,textAlign:"left"},children:f}),m&&u.jsx(Se,{sx:{color:"text.lighter",fontSize:"0.74375rem"},children:m})]})]})}const X_=a=>{try{const r=new URLSearchParams(window.location.search),o=r.get(`qty_${a}`)||r.get("qty");return o?Math.max(1,parseInt(o,10)):void 0}catch{return}},W_=(a,r)=>{try{const o=`quantity_preference_${a}_${r}`,s=localStorage.getItem(o);return s?Math.max(1,parseInt(s,10)):void 0}catch{return}},J_=(a,r,o)=>{try{const s=`quantity_preference_${a}_${r}`;localStorage.setItem(s,o.toString())}catch{}};function Xg({item:a,items:r,trialInDays:o,trialEnd:s=0,currency:f,mode:m="normal",children:c=null,onUpsell:h,onDownsell:g,completed:y=!1,adjustableQuantity:S={enabled:!1},onQuantityChange:x=()=>{},showFeatures:A=!1,exchangeRate:v=null,isStripePayment:N=!1,isPriceLocked:B=!1,isRateLoading:O=!1,discounts:k=[],calculatedDiscountAmount:K=null}){const{t:j,locale:w}=ft(),{settings:G,setPayable:T,session:R,api:q}=_n(),z=a.upsell_price||a.price,$=z?.pricing_type==="dynamic",re=wS(a,f,{trialEnd:s,trialInDays:o,exchangeRate:v},w),Q=TS(r,f),Z=a.price?.recurring?.usage_type==="metered"?j("common.metered"):"",ne=m==="normal"&&r.length===1,me=o>0||s>Sn().unix(),P=a.price.product?.type==="credit"&&a.price.metadata?.credit_config,D=P&&a.price.metadata?.credit_config?.credit_amount?Number(a.price.metadata.credit_config.credit_amount):0,F=P&&a.price.metadata?.credit_config?.currency_id?au(G.paymentMethods,a.price.metadata.credit_config.currency_id):null,ae=a.price.metadata?.credit_config?.valid_duration_value,be=a.price.metadata?.credit_config?.valid_duration_unit||"days",Me=a.price.metadata?.credit_config?.schedule,Fe=Me?.enabled&&Me?.delivery_mode&&Me.delivery_mode!=="invoice",Ae=R?.user?.did,{data:ue}=Pi(async()=>{if(!P||!Ae)return null;try{const{data:ve}=await q.get("/api/meter-events/pending-amount",{params:{customer_id:Ae,currency_id:F?.id}});return ve?.[F?.id||""]}catch(ve){return console.warn("Failed to fetch pending amount:",ve),null}},{refreshDeps:[P,Ae,F?.id]}),$e=S.enabled&&m==="normal",Pe=Math.max(S.minimum||1,1),Xe=Math.min(a.price?.quantity_limit_per_checkout??1/0,a.price?.quantity_available??1/0),Ze=Xe?Math.min(S.maximum||1/0,Xe):S.maximum||1/0,Ue=V.useMemo(()=>{if(!P||!ue)return null;const ve=new ze(ue||"0");if(!ve.gt(new ze(0))||!D||D<=0)return null;const qe=Kn(D,F?.decimal||2);return!qe||qe.isZero()?null:Math.ceil(ve.mul(new ze(100)).div(qe).toNumber()/100)},[P,ue,D,F?.decimal]),b=V.useMemo(()=>{const ve=X_(a.price.id);if(ve&&ve>0)return $e&&Ue?Math.max(ve,Ue,Pe):ve;if(Ae){const Oe=W_(Ae,a.price.id);if(Oe&&Oe>0)return $e&&Ue?Math.max(Oe,Ue,Pe):Oe}let qe=a.quantity;return $e&&Ue&&(qe=Math.max(qe,Ue,Pe)),qe},[a.quantity,a.price.id,Ae,Ue,$e,Pe]),[E,L]=V.useState(b),ie=E||0;V.useEffect(()=>{b&&b>0&&(b!==E&&L(b),b!==a.quantity&&x(a.price_id,b),T(P&&ue&&Ue?b>=Ue:!0))},[b,P,ue,Ue]);const W=ve=>{if(!ve){L(void 0),T(!1);return}if(ve>=Pe&&ve<=Ze){if(Df(a.price,ve,w))return;if(P&&ue&&Ue&&ve<Ue){T(!1),L(ve),x(a.price_id,ve);return}T(!0),L(ve),x(a.price_id,ve),Ae&&ve>0&&J_(Ae,a.price?.id,ve)}},te=()=>{ie<Ze&&W(ie+1)},ce=()=>{ie>Pe&&W(ie-1)},J=ve=>{const qe=parseInt(ve.target.value||"0",10);Number.isNaN(qe)||W(qe)},H=()=>{if(!P)return null;const ve=Ja(D*(E||0)),qe=F?.symbol||"Credits",Oe=kl(ve,qe,w),Ve=ue&&new ze(ue||"0").gt(new ze(0)),Ge=a.price?.type==="recurring",Ke=ae&&ae>0,et=()=>({amount:Oe,...Ke&&{duration:ae,unit:j(`common.${be}`)},...Ge&&{period:Rn(a.price?.recurring,!0,"per",w)}}),Lt=(fa,Xn)=>({amount:kl(Ui(fa.toString(),F?.decimal||2),qe,w),totalAmount:Oe,...Xn&&{availableAmount:kl(Ui(Xn,F?.decimal||2),qe,w)},...Ke&&{duration:ae,unit:j(`common.${be}`)},...Ge&&{period:Rn(a.price?.recurring,!0,"per",w)}}),It=(fa,Xn)=>`payment.checkout.credit.${fa}.${Xn}${Ke?"WithExpiry":""}`;if(!Ve)return j(It("normal",Ge?"recurring":"oneTime"),et());const kt=new ze(ue||"0"),zt=Kn(D,F?.decimal||2),Dn=Ue||0,An=zt.mul(new ze(E||0)).sub(kt).toString();return new ze(An).gt(new ze(0))?j(It("pending",Ge?"recurringEnough":"oneTimeEnough"),Lt(kt,An)):j("payment.checkout.credit.pending.notEnough",{amount:kl(Ui(kt.toString(),F?.decimal||2),qe,w),quantity:Ja(Dn)})},M=Number.isFinite(E)?Number(E):a.quantity||0,U=V.useMemo(()=>{if(N||!f)return null;const ve=z?.base_amount,qe=z?.unit_amount;if($&&ve!==void 0&&ve!==null){if(B){const et=a?.quoted_amount;if(et){const Lt=new ze(et),It=qt(Lt,f.decimal);return`${un(It,!0,6)} ${f.symbol}`}}if(!v)return null;const Oe=Number(v);if(Oe<=0||Number.isNaN(Oe))return null;const Ke=Number(ve)/Oe*(M||1);return`${un(Ke,!0,6)} ${f.symbol}`}if(!$&&v&&qe){const Oe=Number(v);if(Oe<=0||Number.isNaN(Oe))return null;const Ke=Number(qe)/100/Oe*(M||1);return`${un(Ke,!0,6)} ${f.symbol}`}return null},[N,$,f,z,a,v,M,B]),se=()=>{if(!Fe||!Me)return null;const ve=D*(E||0),qe=F?.symbol||"Credits",Oe=Me.interval_unit,Ve=Me.interval_value;let Ge;if(Me.amount_per_grant)Ge=Number(Me.amount_per_grant)*(E||1);else{const It=a.price.recurring?.interval||"month",kt=a.price.recurring?.interval_count||1,zt={hour:1,day:24,week:168,month:720},Dn=zt[It]*kt,an=zt[Oe]*Ve,An=Math.floor(Dn/an);Ge=An>0?ve/An:ve}const Ke=dr(Ja(Ge),qe),et=Ve===1?j(`common.${Oe}`):` ${Ve} ${j(`common.${Oe}s`)} `;return Me.expire_with_next_grant?j("payment.checkout.credit.schedule.withRefresh",{amount:Ke,interval:et}):j("payment.checkout.credit.schedule.periodic",{amount:Ke,interval:et})},je=V.useMemo(()=>{const ve=a.upsell_price||a.price||{},qe=ve?.type==="recurring"&&ve?.recurring;if(me)return re.primary;let Oe;if(!N&&U)Oe=U;else if($&&!N){const Ve=z?.base_amount;Ve!=null?Oe=`≈ $${Number(Ve).toFixed(2)}`:Oe=re.primary}else Oe=re.primary;return qe&&ve?.recurring?.usage_type!=="metered"?`${Oe} ${ve.recurring?Rn(ve.recurring,!1,"slash",w):""}`:Oe},[me,re,a,w,U,$,z,N]),_=V.useMemo(()=>{if(!f||!$||N)return null;const ve=z?.base_amount;return ve!=null?q0(ve,M):null},[f,z,M,$,N]),I=V.useMemo(()=>zi(_,w),[_,w]),ee=V.useMemo(()=>{const ve=a.price?.upsell?.upsells_to;if(!ve)return null;if(N&&f){const Lt=ve?.base_amount,It=ve?.unit_amount;let kt;if(Lt!=null)kt=Number(Lt);else if(It)kt=Number(It)/100;else return null;const zt=ve?.recurring?` ${Rn(ve.recurring,!1,"slash",w)}`:"";return`${kt} ${f.symbol}${zt}`}if(!f||!v)return null;const qe=Number(v);if(qe<=0||Number.isNaN(qe))return null;const Oe=ve?.base_amount,Ve=ve?.unit_amount;let Ge;if(Oe!=null)Ge=Number(Oe);else if(Ve)Ge=Number(Ve)/100;else return null;const Ke=Ge/qe,et=ve?.recurring?` ${Rn(ve.recurring,!1,"slash",w)}`:"";return`${un(Ke,!0,6)} ${f.symbol}${et}`},[N,f,v,a.price?.upsell?.upsells_to,w]),Ee=V.useMemo(()=>{if(!a.upsell_price_id||!a.price)return null;const ve=a.price;if(N&&f){const Lt=ve?.base_amount,It=ve?.unit_amount;let kt;if(Lt!=null)kt=Number(Lt);else if(It)kt=Number(It)/100;else return null;const zt=ve?.recurring?` ${Rn(ve.recurring,!1,"slash",w)}`:"";return`${kt} ${f.symbol}${zt}`}if(!f||!v)return null;const qe=Number(v);if(qe<=0||Number.isNaN(qe))return null;const Oe=ve?.base_amount,Ve=ve?.unit_amount;let Ge;if(Oe!=null)Ge=Number(Oe);else if(Ve)Ge=Number(Ve)/100;else return null;const Ke=Ge/qe,et=ve?.recurring?` ${Rn(ve.recurring,!1,"slash",w)}`:"";return`${un(Ke,!0,6)} ${f.symbol}${et}`},[N,f,v,a.price,a.upsell_price_id,w]),De=V.useMemo(()=>{if(me&&a.price?.type==="recurring"||a.price?.recurring?.usage_type==="metered"||!k?.length)return null;const ve=k[0]?.coupon_details;if(N&&ve){if(!a.discountable)return null;const qe=z?.pricing_type==="dynamic",Oe=z?.base_amount,Ve=z?.unit_amount;let Ge;if(qe&&Oe!==void 0&&Oe!==null)Ge=Number(Oe)*100;else if(Ve)Ge=Number(Ve);else return null;const Ke=E||a.quantity||1,et=Ge*Ke;return ve.percent_off&&ve.percent_off>0?Math.round(et*ve.percent_off/100).toString():ve.amount_off&&r.length===1&&K?K:null}if($&&v&&ve){const qe=Number(v);if(qe<=0||!a.discountable)return null;const Oe=z?.base_amount;if(!Oe)return null;const Ve=E||a.quantity||1,Ge=Number(Oe)*Ve/qe;if(ve.percent_off&&ve.percent_off>0){const Ke=Ge*ve.percent_off/100;return Kn(Ke.toFixed(f.decimal||8),f.decimal||8).toString()}if(ve.amount_off&&r.length===1&&K)return K}return r.length===1&&K?K:null},[me,k,N,$,v,a,z,E,f.decimal,r.length,K]),Ce=V.useMemo(()=>{if(!k?.length)return null;const ve=k[0];return ve.promotion_code_details?.code||ve.verification_data?.code||"DISCOUNT"},[k]),Te=Df(a.price,ie,w),Ye=a.price?.product?.features||[];return u.jsxs(ge,{direction:"column",spacing:1,className:"product-item",sx:{alignItems:"flex-start",width:"100%"},children:[u.jsxs(ge,{direction:"column",className:"product-item-content",sx:{alignItems:"flex-start",width:"100%"},children:[u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center",flexWrap:"wrap",justifyContent:"space-between",width:"100%"},children:[u.jsx(Z_,{logo:a.price?.product?.images[0],name:a.price?.product?.name,extra:u.jsx(Se,{sx:{display:"flex",alignItems:"center"},children:a.price?.type==="recurring"&&a.price?.recurring?[re.quantity,j("common.billed",{rule:`${Rn(a.upsell_price?.recurring||a.price?.recurring,!0,"per",w)} ${Z}`})].filter(Boolean).join(", "):re.quantity})}),u.jsxs(ge,{direction:"column",sx:{alignItems:"flex-end",flex:1},children:[u.jsx(Q_,{value:je,loading:O,skeletonWidth:80,height:20,sx:{color:"text.primary",fontWeight:500}}),$&&!N&&!me&&I&&u.jsxs(oe,{sx:{fontSize:"0.74375rem",color:"text.lighter"},children:["≈ $",I]}),re.secondary&&!me&&u.jsx(oe,{sx:{fontSize:"0.74375rem",color:"text.lighter"},children:re.secondary})]})]}),!(me&&a.price?.type==="recurring"||a.price?.recurring?.usage_type==="metered")&&(De||a.discount_amounts&&a.discount_amounts.length>0)&&u.jsx(ge,{direction:"row",spacing:1,sx:{mt:1,alignItems:"center",opacity:O?0:1,transition:"opacity 300ms ease-in-out"},children:u.jsx(Xl,{icon:u.jsx(c0,{sx:{fontSize:"0.8rem !important"}}),label:u.jsxs(Se,{sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(oe,{component:"span",sx:{fontSize:"0.75rem",fontWeight:"medium"},children:Ce||"DISCOUNT"}),u.jsxs(oe,{component:"span",sx:{fontSize:"0.75rem"},children:["(-",Ca(De||a.discount_amounts?.[0]?.amount||"0",f.decimal)," ",f.symbol,")"]})]}),size:"small",variant:"filled",sx:{height:20,"& .MuiChip-icon":{color:"warning.main"},"& .MuiChip-label":{px:1}}})}),A&&Ye.length>0&&u.jsx(Se,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",flexWrap:"wrap",gap:1.5,width:"100%",mt:1.5},children:Ye.map(ve=>u.jsxs(Se,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,px:1,py:.5,bgcolor:"action.hover",borderRadius:1,border:"1px solid",borderColor:"divider"},children:[u.jsx(Se,{sx:{bgcolor:"success.main",width:4,height:4,borderRadius:"50%"}}),u.jsx(oe,{component:"span",variant:"caption",sx:{color:"text.primary",fontSize:"0.75rem",fontWeight:500,textTransform:"capitalize",whiteSpace:"nowrap"},children:ve.name})]},ve.name))}),Te?u.jsx(Oi,{label:Te,variant:"outlined",sx:{mt:1,borderColor:"chip.error.border",backgroundColor:"chip.error.background",color:"chip.error.text"}}):null,$e&&!y&&u.jsx(Se,{sx:{mt:1,p:1},children:u.jsxs(ge,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[u.jsxs(oe,{variant:"body2",sx:{color:"text.secondary",minWidth:"fit-content"},children:[j("common.quantity"),":"]}),u.jsx(ei,{size:"small",onClick:ce,disabled:ie<=Pe,sx:{minWidth:32,width:32,height:32},children:u.jsx(Zb,{fontSize:"small"})}),u.jsx(Yn,{size:"small",value:E,onChange:J,type:"number",slotProps:{htmlInput:{min:Pe,max:Ze,style:{textAlign:"center",padding:"4px",minWidth:80}}}}),u.jsx(ei,{size:"small",onClick:te,disabled:ie>=Ze,sx:{minWidth:32,width:32,height:32},children:u.jsx(d0,{fontSize:"small"})})]})}),P&&u.jsx(mr,{severity:"info",sx:{mt:1,fontSize:"0.875rem"},icon:!1,children:Fe?u.jsx(oe,{component:"span",sx:{fontSize:"inherit"},children:se()}):u.jsx(oe,{component:"span",sx:{fontSize:"inherit"},children:H()})}),c]}),ne&&!a.upsell_price_id&&a.price?.upsell?.upsells_to&&u.jsxs(ge,{direction:"row",className:"product-item-upsell",sx:{alignItems:"center",justifyContent:"space-between",width:"100%"},children:[u.jsxs(oe,{component:"label",htmlFor:"upsell-switch",sx:{fontSize:12,cursor:"pointer",color:"text.secondary"},children:[u.jsx(Zg,{id:"upsell-switch",sx:{mr:1},variant:"success",checked:!1,onChange:()=>h(a.price_id,a.price?.upsell?.upsells_to_id)}),j("payment.checkout.upsell.save",{recurring:Rn(a.price?.upsell?.upsells_to?.recurring,!0,"per",w)}),u.jsx(Oi,{label:j("payment.checkout.upsell.off",{saving:Q}),variant:"outlined",sx:{ml:1,borderColor:"chip.warning.border",backgroundColor:"chip.warning.background",color:"chip.warning.text"}})]}),u.jsx(oe,{component:"span",sx:{fontSize:12},children:ee||kg(a.price?.upsell?.upsells_to,f,a.price?.product?.unit_label,1,!0,w)})]}),ne&&a.upsell_price_id&&u.jsxs(ge,{direction:"row",className:"product-item-upsell",sx:{alignItems:"center",justifyContent:"space-between",width:"100%"},children:[u.jsxs(oe,{component:"label",htmlFor:"upsell-switch",sx:{fontSize:12,cursor:"pointer",color:"text.secondary"},children:[u.jsx(Zg,{id:"upsell-switch",sx:{mr:1},variant:"success",checked:!0,onChange:()=>g(a.upsell_price_id)}),j("payment.checkout.upsell.revert",{recurring:j(`common.${Rn(a.price?.recurring)}`)})]}),u.jsx(oe,{component:"span",sx:{fontSize:12},children:Ee||kg(a.price,f,a.price?.product?.unit_label,1,!0,w)})]})]})}function eA({color:a="#bb5504",backgroundColor:r="#ffde92",sx:o}){const{t:s}=ft();return u.jsx(Xl,{label:s("common.livemode"),size:"small",color:"warning",sx:{ml:2,height:"18px",lineHeight:"18px",textTransform:"uppercase",fontSize:"0.7rem",fontWeight:"bold",borderRadius:"4px",backgroundColor:r,color:a,...o}})}function tA(a){if(!a?.length)return null;let r=null,o=null,s=null,f=null,m=null,c=null,h=null;return a.forEach(g=>{const y=g.upsell_price||g.price,S=g?.exchange_rate;!r&&S&&(r=S);const x=y?.base_currency;!o&&x&&(o=x);const A=g?.expires_at;A&&(s=s===null?A:Math.min(s,A));const v=g?.rate_provider_name;!f&&v&&(f=v);const N=g?.rate_provider_id;!m&&N&&(m=N);const B=g?.rate_timestamp_ms;!c&&Number.isFinite(Number(B))&&(c=Number(B));const O=g?.slippage_percent;h===null&&Number.isFinite(Number(O))&&(h=Number(O))}),{exchangeRate:r,baseCurrency:o||"USD",expiresAt:s,providerName:f,providerId:m,rateTimestampMs:c,slippagePercent:h}}function nA(a,r,o,s=!1){const f=a.reduce((g,y)=>{const S=y.upsell_price||y.price;if(s&&S?.type==="recurring"||S?.type==="recurring"&&S?.recurring?.usage_type==="metered")return g;const x=S?.base_amount;if(x){const A=y.quantity||1;return g+Number(x)*A}return g},0);if(f<=0)return null;const m=Number(r);if(m<=0)return null;const c=f/m;return Kn(c.toFixed(o||8),o||8).toString()}function aA(a,r){if(a?.quote_locked_at){const s=new Date(a.quote_locked_at).getTime();if(Number.isFinite(s))return Math.floor(s/1e3)}const o=r?.metadata?.quote_locked_at;if(typeof o=="number")return o;if(typeof o=="string"){const s=Number(o);if(Number.isFinite(s))return s}return null}function iA(a){const{items:r,currency:o,liveRate:s,liveQuoteSnapshot:f,checkoutSession:m,paymentIntent:c,locale:h="en",isStripePayment:g=!1,isSubscription:y=m?.mode==="subscription"||m?.mode==="setup",slippageConfig:S,trialInDays:x=0,trialEnd:A=0,discounts:v}=a,N=Math.floor(Date.now()/1e3),B=x>0||A>N,O=V.useMemo(()=>r.some(ne=>(ne.upsell_price||ne.price)?.pricing_type==="dynamic"),[r]),k=V.useMemo(()=>O?tA(r):null,[r,O]),K=V.useMemo(()=>({exchangeRate:g?null:s?.rate||k?.exchangeRate||null,baseCurrency:s?.base_currency||k?.baseCurrency||"USD",providerName:g?null:s?.provider_name||k?.providerName||null,providerId:g?null:s?.provider_id||k?.providerId||null,timestampMs:g?null:s?.timestamp_ms||k?.rateTimestampMs||null,fetchedAt:g?null:s?.fetched_at||null}),[s,k,g]),j=V.useMemo(()=>g||!O||!s?.rate?null:nA(r,s.rate,o.decimal,B),[O,s?.rate,r,o.decimal,g,B]),w=V.useMemo(()=>{if(!v?.length)return null;const ne=v[0]?.coupon_details;if(!ne)return null;if(g){const D=r.reduce((F,ae)=>{if(!ae.discountable)return F;const be=ae.upsell_price||ae.price;if(B&&be?.type==="recurring"||be?.type==="recurring"&&be?.recurring?.usage_type==="metered")return F;const Me=be?.pricing_type==="dynamic",Fe=be?.base_amount;let Ae;if(Me&&Fe!==void 0&&Fe!==null)Ae=Number(Fe)*100;else{const $e=be?.unit_amount;if(!$e)return F;Ae=Number($e)}const ue=ae.quantity||1;return F+Ae*ue},0);if(D<=0)return null;if(ne.percent_off&&ne.percent_off>0)return Math.round(D*ne.percent_off/100).toString();if(ne.amount_off){const F=Number(ne.amount_off);if(Number.isFinite(F)&&F>0)return Math.min(F,D).toString()}return null}if(!O||!s?.rate)return null;const me=Number(s.rate);if(me<=0)return null;const P=r.reduce((D,F)=>{if(!F.discountable)return D;const ae=F.upsell_price||F.price;if(B&&ae?.type==="recurring"||ae?.type==="recurring"&&ae?.recurring?.usage_type==="metered")return D;const be=ae?.base_amount;if(!be)return D;const Me=F.quantity||1,Fe=Number(be)*Me/me;return D+Fe},0);if(P<=0)return null;if(ne.percent_off&&ne.percent_off>0){const D=P*ne.percent_off/100;return Kn(D.toFixed(o.decimal||8),o.decimal||8).toString()}if(ne.amount_off){const D=ne.currency_id===o.id?ne.amount_off:ne.currency_options?.[o.id]?.amount_off;if(!D)return null;const F=Kn(P.toFixed(o.decimal||8),o.decimal||8),ae=new ze(D),be=new ze(F);return ze.min(ae,be).toString()}return null},[g,O,s?.rate,v,r,B,o.decimal,o.id]),G=V.useMemo(()=>{if(!K.exchangeRate)return null;const ne=Il(K.exchangeRate);return ne?K.baseCurrency==="USD"?`$${ne}`:`${ne} ${K.baseCurrency}`:null},[K]),T=V.useMemo(()=>aA(c,m),[c,m]),R=V.useMemo(()=>{if(!T)return!1;const ne=Math.floor(Date.now()/1e3);return T+180-ne>0},[T]),q=V.useMemo(()=>{if(!T)return!1;const ne=Math.floor(Date.now()/1e3);return T+180-ne<=0},[T]),z=V.useMemo(()=>{let ne=k?.slippagePercent;return ne==null&&(ne=S?.percent??m?.metadata?.slippage?.percent??m?.slippage_percent),ne==null&&(ne=.5),ne},[k?.slippagePercent,S?.percent,m]),$=V.useMemo(()=>s?.provider_display?s.provider_display:!K.providerName&&!K.providerId?"—":K.providerName||K.providerId||"—",[s?.provider_display,K.providerName,K.providerId]);return{hasDynamicPricing:O,isPriceLocked:R,lockExpired:q,quoteMeta:k,rateInfo:K,quoteLockedAt:T,calculatedTokenAmount:j,calculatedDiscountAmount:w,currentSlippagePercent:z,rateDisplay:G,providerDisplay:$,formatTotalDisplay:(ne,me="—")=>{if(O&&j){const D=qt(j,o.decimal),F=Number(D);if(Number.isFinite(F))return un(D,!0,6)}if(O&&f?.quoted_amount){const D=qt(f.quoted_amount,o.decimal),F=Number(D);if(Number.isFinite(F))return un(D,!0,6)}if(ne==null||ne==="")return me;const P=Number(ne);return Number.isFinite(P)?un(ne,O,6):me},calculateUsdDisplay:ne=>{if(!O||!ne||ne==="—")return null;const P=Number(ne);if(!Number.isFinite(P)||P<0)return null;if(P===0)return zi("0",h);const{exchangeRate:D}=K;if(!D)return null;const F=Kn(ne,o.decimal),ae=If(new ze(F),o.decimal,D);return ae?zi(ae,h):null},buildQuoteDetailRows:ne=>{if(!O)return[];const me=[],P="—";if(G){const D=K.fetchedAt||K.timestampMs,F=D?SS(D):P;me.push({label:ne("payment.checkout.quote.detailProvider"),value:$},{label:ne("payment.checkout.quote.detailUpdatedAt"),value:F})}if(y){let D=`${z}%`;if(S?.mode==="rate"&&S.min_acceptable_rate){const ae=Il(S.min_acceptable_rate)||S.min_acceptable_rate,be=S.base_currency||K.baseCurrency||"USD";D=`${be==="USD"?`$${ae}`:`${ae} ${be}`}`}me.push({label:ne("payment.checkout.quote.detailSlippage"),value:D,isSlippage:!0,tooltip:ne("payment.checkout.quote.slippage.tooltip")})}return me}}}function rA({error:a=void 0,onRetry:r=void 0,showRetry:o=!0,sx:s=void 0}){const{t:f}=ft(),[m,c]=V.useState(!1);a&&console.error("[Dynamic Pricing Error]",a);const h=async()=>{if(!(!r||m)){c(!0);try{await r()}finally{c(!1)}}};return u.jsx(mr,{severity:"warning",icon:u.jsx(f0,{}),sx:{borderRadius:2,"& .MuiAlert-message":{width:"100%"},...s},children:u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",width:"100%"},children:[u.jsxs(Se,{children:[u.jsx(Xb,{sx:{fontWeight:600},children:f("payment.dynamicPricing.unavailable.title")}),u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",mt:.5},children:f("payment.dynamicPricing.unavailable.message")})]}),o&&r&&u.jsx(pt,{size:"small",variant:"outlined",onClick:h,disabled:m,startIcon:m?u.jsx(gr,{size:16}):u.jsx(Wb,{}),sx:{ml:2,flexShrink:0},children:f("payment.dynamicPricing.unavailable.retry")})]})})}function oA({checkoutSessionId:a,initialAppliedCodes:r=[],disabled:o=!1,className:s="",placeholder:f="",onUpdate:m=void 0,currencyId:c}){const{t:h}=ft(),[g,y]=V.useState(!1),[S,x]=V.useState(""),[A,v]=V.useState(""),[N,B]=V.useState(!1),[O,k]=V.useState(r),{session:K,paymentState:j}=_n(),w=()=>{K.user?G():K?.login(()=>{G()})},G=async()=>{if(S.trim()&&!(j.paying||j.stripePaying)){B(!0),v("");try{const $=((await ot.post(`/api/checkout-sessions/${a}/apply-promotion`,{promotion_code:S.trim(),currency_id:c})).data.discounts||[])[0];if($){const re={id:$.promotion_code||$.coupon,code:S.trim(),discount_amount:$.discount_amount};k([re]),x(""),y(!1),m?.({appliedCodes:[re],discountAmount:$.discount_amount})}}catch(q){const z=q.response?.data?.error||q.message;v(z)}finally{B(!1)}}},T=q=>{q.key==="Enter"&&!N&&S.trim()&&w()},R=j.paying||j.stripePaying;return u.jsx(Se,{className:s,children:O.length===0&&!o&&!R&&(g?u.jsxs(Se,{onBlur:()=>{S.trim()||y(!1)},children:[u.jsx(Yn,{fullWidth:!0,value:S,onChange:q=>x(q.target.value),onKeyPress:T,placeholder:f||h("payment.checkout.promotion.placeholder"),variant:"outlined",size:"small",disabled:N,autoFocus:!0,slotProps:{input:{endAdornment:u.jsx(ls,{position:"end",children:u.jsx(hr,{size:"small",onClick:w,loading:N,disabled:!S.trim(),variant:"text",sx:{color:"primary.main",fontSize:"small"},children:h("payment.checkout.promotion.apply")})})}},sx:{"& .MuiOutlinedInput-root":{pr:1}}}),A&&u.jsx(mr,{severity:"error",sx:{my:1},children:A})]}):u.jsx(pt,{onClick:()=>y(!0),startIcon:u.jsx(d0,{fontSize:"small"}),variant:"text",sx:{fontWeight:"normal",textTransform:"none",justifyContent:"flex-start",p:0,"&:hover":{backgroundColor:"transparent",textDecoration:"underline"}},children:h("payment.checkout.promotion.add_code")}))})}function sA({checkoutSessionId:a,currency:r,currencyId:o,discounts:s,allowPromotionCodes:f,completed:m=!1,disabled:c=!1,onPromotionUpdate:h,onRemovePromotion:g,calculatedDiscountAmount:y=null,isRateLoading:S=!1}){const{t:x,locale:A}=ft(),v=s?.length>0,N=()=>s?.length?s.filter(B=>B.promotion_code||B.coupon).map(B=>({id:B.promotion_code||B.coupon,code:B.verification_data?.code||"APPLIED",discount_amount:B.discount_amount})):[];return f&&!v?u.jsx(Se,{sx:{mt:1},children:u.jsx(oA,{checkoutSessionId:a,initialAppliedCodes:N(),disabled:m,onUpdate:h,currencyId:o})}):v?u.jsx(Se,{children:s.map(B=>{const O=B.promotion_code_details,k=B.coupon_details,K=k?bS(k,r,A):"",j=K===x("payment.checkout.coupon.noDiscount");return u.jsxs(ge,{children:[u.jsxs(ge,{direction:"row",spacing:1,sx:{justifyContent:"space-between",alignItems:"center"},children:[u.jsxs(ge,{direction:"row",spacing:1,sx:{alignItems:"center",backgroundColor:"grey.100",width:"fit-content",px:1,py:1,borderRadius:1},children:[u.jsxs(oe,{sx:{fontWeight:"medium",display:"flex",alignItems:"center",gap:.5},children:[u.jsx(c0,{sx:{color:"warning.main",fontSize:"small"}}),O?.code||B.verification_data?.code||x("payment.checkout.discount")]}),!m&&u.jsx(pt,{size:"small",disabled:c,onClick:()=>g(a),sx:{minWidth:"auto",width:16,height:16,color:"text.secondary","&.Mui-disabled":{color:"text.disabled"}},children:u.jsx(m0,{sx:{fontSize:14}})})]}),u.jsxs(oe,{sx:{color:"text.secondary",opacity:S?0:1,transition:"opacity 300ms ease-in-out"},children:["-",Ca(y||"0",r.decimal)," ",r.symbol]})]}),K&&u.jsx(oe,{sx:{fontSize:"small",color:j?"error.main":"text.secondary",mt:.5},children:K})]},B.promotion_code||B.coupon||`discount-${B.discount_amount}`)})}):null}function lA({amount:a,sx:r={}}){return u.jsx(oe,{component:"div",sx:{my:.5,fontWeight:600,fontSize:"2.1875rem",letterSpacing:"-0.03rem",fontVariantNumeric:"tabular-nums",...r},children:a})}const uA=[.5,1,3,5,10];function bD({value:a,onChange:r,config:o=void 0,onConfigChange:s=void 0,exchangeRate:f=null,baseCurrency:m="USD",disabled:c=!1,sx:h={},onCancel:g=void 0,onSave:y=void 0}){const{t:S}=ft(),[x,A]=V.useState(""),[v,N]=V.useState(o?.mode||"percent"),[B,O]=V.useState(null),[k,K]=V.useState(!1),j=o?.percent??a,w=V.useMemo(()=>{if(!f)return null;const Z=Number(f);return Number.isNaN(Z)||Z<=0?null:Math.round(Z*100)/100},[f]),G=Z=>{if(!w)return"";const ne=1+Z/100;return(w/ne).toFixed(2)};V.useEffect(()=>{o?.mode&&o.mode!==v&&N(o.mode)},[o?.mode,v]),V.useEffect(()=>{if(k)return;if(v==="percent"){A(j.toFixed(2));return}if(o?.min_acceptable_rate){A(String(o.min_acceptable_rate));return}const Z=G(j);A(Z)},[j,v,f,o?.min_acceptable_rate,k]);const T=Z=>{if(c)return;A(Z.toFixed(2)),N("percent"),O(null),r(Z);const ne=G(Z);s?.({mode:"percent",percent:Z,...ne?{min_acceptable_rate:ne}:{}})},R=Z=>{A(Z),O(null);const ne=Number(Z);if(!Z||Number.isNaN(ne)){O(S("payment.checkout.quote.slippage.invalid"));return}if(ne<=0){O(S("payment.checkout.quote.slippage.invalidPositive"));return}if(v==="percent"){r(ne);const me=G(ne);s?.({mode:"percent",percent:ne,...me?{min_acceptable_rate:me}:{}})}else{if(!w){O(S("payment.checkout.quote.slippage.rateRequired"));return}const me=(w-ne)/ne*100;r(Math.max(0,me)),s?.({mode:"rate",percent:Math.max(0,me),min_acceptable_rate:Z})}},q=(Z,ne)=>{if(!(c||!ne))if(N(ne),O(null),ne==="rate"){if(!w){O(S("payment.checkout.quote.slippage.rateRequired"));return}const me=o?.min_acceptable_rate||G(j);A(me),s?.({mode:"rate",percent:j,min_acceptable_rate:me})}else{A(j.toFixed(2));const me=G(j);s?.({mode:"percent",percent:j,...me?{min_acceptable_rate:me}:{}})}},z=V.useMemo(()=>{if(!w)return null;const Z=1+j/100;return(w/Z).toFixed(2)},[w,j]),$=V.useMemo(()=>w?w.toFixed(2):"—",[w]),re=()=>{g?.()},Q=()=>{y?.()};return u.jsxs(ge,{spacing:2.5,sx:h,children:[u.jsx(oe,{variant:"body2",color:"text.secondary",children:S("payment.checkout.quote.slippageLimit.description")}),u.jsxs(Jb,{value:v,exclusive:!0,onChange:q,size:"small",fullWidth:!0,disabled:c,children:[u.jsx(Dd,{value:"percent",children:S("payment.checkout.quote.slippageLimit.configTogglePercent")}),u.jsx(Dd,{value:"rate",disabled:!w,children:S("payment.checkout.quote.slippageLimit.configToggleRate")})]}),v==="percent"&&u.jsxs(ge,{spacing:1.5,children:[u.jsx(ge,{direction:"row",spacing:1,children:uA.map(Z=>u.jsx(Dd,{value:Z,selected:Math.abs(j-Z)<.01,onClick:()=>T(Z),size:"small",disabled:c,sx:{flex:1,py:1,borderRadius:1,border:"1px solid",borderColor:"divider","&.Mui-selected":{bgcolor:"primary.main",color:"primary.contrastText",borderColor:"primary.main","&:hover":{bgcolor:"primary.dark"}}},children:u.jsxs(oe,{variant:"body2",children:[Z,"%"]})},Z))}),u.jsx(Yn,{size:"small",fullWidth:!0,value:x,onChange:Z=>R(Z.target.value),onFocus:()=>K(!0),onBlur:()=>K(!1),error:!!B,helperText:B,disabled:c,label:S("common.custom"),InputProps:{endAdornment:u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",mr:1},children:"%"})},placeholder:"0.50"})]}),v==="rate"&&u.jsx(ge,{spacing:1.5,children:u.jsx(Yn,{size:"small",fullWidth:!0,value:x,onChange:Z=>R(Z.target.value),onFocus:()=>K(!0),onBlur:()=>K(!1),error:!!B,helperText:B,disabled:c||!w,label:S("payment.checkout.quote.slippage.rateInputLabel",{currency:m}),InputProps:{endAdornment:u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",mr:1},children:m})},placeholder:w?.toFixed(2)||"0.00"})}),w&&u.jsx(Se,{sx:{borderRadius:1,p:1.5,bgcolor:"action.hover"},children:u.jsxs(ge,{spacing:.5,children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[u.jsx(oe,{variant:"body2",color:"text.secondary",children:S("payment.checkout.quote.slippageLimit.derivedCurrentRate")}),u.jsxs(oe,{variant:"body2",fontWeight:500,children:[$," ",m]})]}),u.jsxs(ge,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[u.jsx(oe,{variant:"body2",color:"text.secondary",children:S("payment.checkout.quote.slippageLimit.derivedMinRate")}),u.jsxs(oe,{variant:"body2",fontWeight:500,color:"primary.main",children:[v==="rate"?x:z||"—"," ",m]})]})]})}),u.jsxs(ge,{direction:"row",spacing:1,justifyContent:"flex-end",children:[u.jsx(pt,{onClick:re,disabled:c,color:"inherit",children:S("common.cancel")}),u.jsx(pt,{variant:"contained",onClick:Q,disabled:c||!!B,children:S("common.save")})]})]})}function cA({rateLine:a,rows:r,isSubscription:o=!1,slippageValue:s=.5,onSlippageChange:f=void 0,slippageConfig:m=void 0,exchangeRate:c=null,baseCurrency:h="USD",disabled:g=!1}){const{t:y}=ft(),[S,x]=V.useState(!1),[A,v]=V.useState(!0),[N,B]=V.useState(!1),[O,k]=V.useState(null),[K,j]=V.useState(!1),w=r.length>0,G=V.useCallback(()=>{k(m||{mode:"percent",percent:s}),B(!0)},[s,m]),T=()=>{B(!1),k(null)},R=Q=>{k(Z=>Z?{...Z,percent:Q}:{mode:"percent",percent:Q})},q=Q=>{k(Q)},z=async()=>{if(!(!O||!f)){j(!0);try{const Q={...O,...h?{base_currency:h}:{}};await f(Q),B(!1),k(null)}catch(Q){console.error("Failed to update slippage",Q)}finally{j(!1)}}};V.useEffect(()=>{if(!a)return;v(!1);const Q=setTimeout(()=>{v(!0)},150);return()=>clearTimeout(Q)},[a]);const $=V.useMemo(()=>r.map(Q=>{const Z=Q.isSlippage&&o&&f;return u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[u.jsxs(ge,{direction:"row",spacing:.5,alignItems:"center",children:[u.jsx(oe,{sx:{fontSize:"0.75rem",color:"text.secondary"},children:Q.label}),Q.tooltip&&u.jsx(Un,{title:Q.tooltip,placement:"top",children:u.jsx(i0,{sx:{fontSize:"0.75rem",color:"text.lighter"}})})]}),u.jsxs(ge,{direction:"row",alignItems:"center",spacing:.5,children:[u.jsx(oe,{sx:{fontSize:"0.75rem",color:"text.primary"},children:Q.value}),Z&&!g&&u.jsx(ei,{size:"small",onClick:G,sx:{p:.25},children:u.jsx(ex,{sx:{fontSize:"0.875rem",color:"text.secondary"}})})]})]},Q.label)}),[r,o,f,g,G]),re=!a&&o&&f&&r.some(Q=>Q.isSlippage);return!a&&!re?null:u.jsxs(u.Fragment,{children:[u.jsxs(Se,{sx:{width:"100%",mt:.5},children:[u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",gap:1},children:[a?u.jsx(Gn,{in:A,timeout:300,children:u.jsx(oe,{sx:{fontSize:"0.7875rem",color:"text.lighter"},children:a})}):u.jsx(Se,{}),w&&u.jsx(ei,{size:"small",onClick:()=>x(Q=>!Q),"aria-label":S?"collapse":"expand",children:u.jsx(p0,{sx:{fontSize:"1rem",transition:"transform 0.2s ease",transform:S?"rotate(180deg)":"rotate(0deg)"}})})]}),w&&u.jsx(h0,{in:S,timeout:"auto",unmountOnExit:!0,children:u.jsx(Gn,{in:A,timeout:300,children:u.jsx(ge,{sx:{mt:1,p:1.25,borderRadius:1,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},spacing:1,children:$})})})]}),u.jsxs(lo,{open:N,onClose:T,maxWidth:"sm",fullWidth:!0,children:[u.jsx(Zl,{children:y("payment.checkout.quote.slippage.title")}),u.jsx(uo,{children:u.jsx(bD,{value:O?.percent??s,onChange:R,config:O||m,onConfigChange:q,exchangeRate:c,baseCurrency:h,disabled:g||K,sx:{mt:1},onCancel:T,onSave:z})})]})]})}function dA({totalAmountText:a,totalUsdDisplay:r,currency:o,hasDynamicPricing:s,rateDisplay:f,rateInfo:m,quoteDetailRows:c,currentSlippagePercent:h,slippageConfig:g=void 0,isPriceLocked:y,isSubscription:S,completed:x=!1,onSlippageChange:A=void 0,isStripePayment:v=!1,thenInfo:N="",isRateLoading:B=!1}){const{t:O}=ft();return u.jsxs(u.Fragment,{children:[u.jsxs(ge,{sx:{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"flex-start",width:"100%"},children:[u.jsx(Se,{className:"base-label",children:O("common.total")}),u.jsxs(ge,{sx:{alignItems:"flex-end"},children:[B?u.jsx(Ot,{variant:"text",width:100,height:24}):u.jsx(lA,{amount:a,sx:{fontSize:"16px"}}),s&&!v&&!B&&(r?u.jsxs(oe,{sx:{fontSize:"0.7875rem",color:"text.lighter"},children:["≈ $",r]}):u.jsx(Un,{title:O("payment.checkout.quote.referenceUnavailable"),placement:"top",children:u.jsx(Se,{component:"span",children:u.jsx(oe,{sx:{fontSize:"0.7875rem",color:"text.lighter"},children:"≈ —"})})})),s&&!v&&u.jsx(cA,{rateLine:f?O("payment.checkout.quote.rateLine",{symbol:o.symbol,rate:f}):"",rows:c,isSubscription:S,slippageValue:h,slippageConfig:g,onSlippageChange:!x&&A?A:void 0,exchangeRate:m.exchangeRate,baseCurrency:m.baseCurrency,disabled:y})]})]}),N&&u.jsxs(ge,{sx:{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"flex-start",width:"100%",borderTop:"1px solid",borderColor:"divider",pt:1,mt:1},children:[u.jsx(Se,{className:"base-label",children:O("common.nextCharge")}),u.jsx(oe,{sx:{fontSize:"16px",color:"text.secondary"},children:N})]})]})}const fA=l0(a=>{const{expand:r,...o}=a;return u.jsx(ei,{...o})})(({theme:a,expand:r})=>({transform:r?"rotate(180deg)":"rotate(0deg)",marginLeft:"auto",transition:a.transitions.create("transform",{duration:a.transitions.duration.shortest})}));async function mA(a,r=!0){try{const{data:o}=await ot.get(`/api/checkout-sessions/${a}/cross-sell?skipError=${r}`);return o.error?null:o}catch{return null}}function pA(a,r,o=0){const s={licensed:new ze(0),metered:new ze(0)};return a.map(m=>m.upsell_price||m.price).filter(m=>m.type==="recurring"&&m.recurring).length>0?+o?Kn(o,r.decimal).toString():(a.forEach(m=>{const c=m.upsell_price||m.price,h=nu(c,r),g=new ze(h).mul(new ze(m.quantity));c.type==="recurring"&&c.recurring&&(c.recurring.usage_type==="licensed"&&(s.licensed=s.licensed.add(g)),c.recurring.usage_type==="metered"&&(s.metered=s.metered.add(g)))}),s.licensed.add(s.metered).toString()):"0"}function hA({items:a,currency:r,trialInDays:o,billingThreshold:s,onUpsell:f=Za,onDownsell:m=Za,onQuantityChange:c=Za,onApplyCrossSell:h=Za,onCancelCrossSell:g=Za,onChangeAmount:y=Za,checkoutSessionId:S="",crossSellBehavior:x="",showStaking:A=!1,donationSettings:v=void 0,action:N="",trialEnd:B=0,completed:O=!1,checkoutSession:k=void 0,paymentIntent:K=void 0,paymentMethods:j=[],onPromotionUpdate:w=Za,showFeatures:G=!1,rateUnavailable:T=!1,isRateLoading:R=!1,rateError:q=void 0,onQuoteExpired:z=void 0,onRefreshRate:$=void 0,onSlippageChange:re=void 0,slippageConfig:Q=void 0,liveRate:Z=void 0,liveQuoteSnapshot:ne=void 0,isStripePayment:me=!1,isSubscription:P=void 0,...D}){const{t:F,locale:ae}=ft(),{isMobile:be}=qi(),{paymentState:Me,...Fe}=_n(),[Ae,ue]=ni({loading:!1,shake:!1,expanded:a?.length<3}),{data:$e,runAsync:Pe}=Pi(pe=>S?mA(S,pe):Promise.resolve(null)),Xe=k?.discounts||[],Ze=!!k?.allow_promotion_codes,Ue=Xe?.length>0,b=j&&k?au(j,Ue&&k?.currency_id||r.id)||Fe.settings?.baseCurrency:r,E=Q??k?.metadata?.slippage,{hasDynamicPricing:L,isPriceLocked:ie,quoteMeta:W,rateInfo:te,quoteLockedAt:ce,currentSlippagePercent:J,rateDisplay:H,calculatedTokenAmount:M,calculatedDiscountAmount:U,calculateUsdDisplay:se,buildQuoteDetailRows:je}=iA({items:a,currency:b,liveRate:Z,liveQuoteSnapshot:ne,checkoutSession:k,paymentIntent:K,locale:ae,isStripePayment:me,isSubscription:P,slippageConfig:E,trialInDays:o,trialEnd:B,discounts:Xe}),_=FS(a,b,{trialEnd:B,trialInDays:o},ae,{exchangeRate:te.exchangeRate}),I=A?pA(a,b,s):"0",ee=L&&!me,Ee=a.some(pe=>(pe.upsell_price||pe.price)?.type==="recurring"),De=_.actualAmount==="0"&&Ee,Ce=V.useMemo(()=>{if(!ee||De||!_.amount.includes(b.symbol))return _.amount;if(M){const ke=qt(M,b?.decimal);return`${un(ke,!0,6)} ${b.symbol}`}return`${un(_.actualAmount,!0,6)} ${b.symbol}`},[_.amount,_.actualAmount,b.symbol,b?.decimal,ee,M,De]),Te=V.useMemo(()=>new ze(k?.total_details?.amount_discount||"0"),[k?.total_details?.amount_discount]),Ye=new ze(Kn(_.actualAmount,b?.decimal)).add(new ze(I)).toString(),ve=qt(Ye,b?.decimal),qe=new ze(Ye).sub(Te).toString(),Oe=qt(qe,b?.decimal),Ve=V.useMemo(()=>{if(ee&&M&&!De){const pe=new ze(M).add(new ze(I)).toString(),ke=qt(pe,b?.decimal);return un(ke,!0,6)}return un(ve,ee,6)},[ee,M,I,b?.decimal,ve,De]),Ge=V.useMemo(()=>{if(ee&&M&&!De){const pe=U?new ze(U):Te,ke=new ze(M).add(new ze(I)).sub(pe).toString(),Re=qt(ke,b?.decimal),Je=Number(Re);if(Number.isFinite(Je)&&Je>=0)return un(Re,!0,6)}if(me&&U&&!De){const pe=new ze(U),ke=new ze(Ye).sub(pe).toString(),Re=qt(ke,b?.decimal),Je=Number(Re);if(Number.isFinite(Je)&&Je>=0)return un(Re,!1,6)}return un(Oe,ee,6)},[ee,M,I,Te,U,b?.decimal,Oe,De,me,Ye]),Ke=Ge==="—"?"—":`${Ge} ${b.symbol}`,et=V.useMemo(()=>{if(ee&&M&&!De){const pe=U?new ze(U):Te,ke=new ze(M).add(new ze(I)).sub(pe).toString(),Re=qt(ke,b?.decimal);return se(Re)}return se(Oe)},[ee,M,I,Te,U,b?.decimal,Oe,se,De]),Lt=je(F),It=P??(k?.mode==="subscription"||k?.mode==="setup"),kt=()=>{w?.()},zt=async pe=>{if(!(Me.paying||Me.stripePaying))try{await ot.delete(`/api/checkout-sessions/${pe}/remove-promotion`),w?.()}catch(ke){console.error("Failed to remove promotion code:",ke)}},Dn=V.useRef(!1);V.useEffect(()=>{if(O||Dn.current||!ne?.expires_at&&!W?.expiresAt)return;const pe=Math.floor(Date.now()/1e3),ke=ne?.expires_at??W?.expiresAt,Re=ke?Math.max(0,ke-pe):0,Je=ce?Math.max(0,ce+180-pe):0,tt=!!ke,it=Je>0;tt&&!it&&Re<=0&&(Dn.current=!0,z?.())},[ne?.expires_at,W?.expiresAt,ce,O,z]);const an=async pe=>{if(re){if(!S){re(pe);return}try{await ot.put(`/api/checkout-sessions/${S}/slippage`,{slippage_config:pe}),re(pe),z&&await z(!0)}catch(ke){console.error("Failed to update slippage",ke),rt.error(ke.response?.data?.error||Pt(ke))}}};iD("error.REQUIRE_CROSS_SELL",()=>{ue({shake:!0}),setTimeout(()=>{ue({shake:!1})},1e3)},[]);const An=async(pe,ke)=>{await f(pe,ke),Pe(!1)},Sa=async(pe,ke)=>{await c(pe,ke),Pe(!1)},fa=async pe=>{await m(pe),Pe(!1)},Xn=async()=>{if($e)try{ue({loading:!0}),await h($e.id)}catch(pe){console.error(pe)}finally{ue({loading:!1})}},Fa=async()=>{try{ue({loading:!0}),await g()}catch(pe){console.error(pe)}finally{ue({loading:!1})}},_a=+I>0||Ze,Dr=u.jsxs(ge,{className:"cko-product-list",sx:{flex:"0 1 auto",overflow:"auto"},children:[u.jsx(ge,{spacing:{xs:1,sm:2},children:a.map(pe=>pe.price?.custom_unit_amount&&y&&v?u.jsx(vD,{item:pe,settings:v,onChange:y,currency:b},`${pe.price_id}-${b.id}`):u.jsx(Xg,{item:pe,items:a,trialInDays:o,trialEnd:B,currency:b,exchangeRate:te.exchangeRate,isStripePayment:me,isPriceLocked:ie,isRateLoading:R,onUpsell:An,onDownsell:fa,adjustableQuantity:pe.adjustable_quantity,completed:O,showFeatures:G,onQuantityChange:Sa,discounts:Xe,calculatedDiscountAmount:U||(me?Te.toString():null),children:pe.cross_sell&&u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",width:1},children:[u.jsx(oe,{}),u.jsx(hr,{size:"small",loadingPosition:"end",endIcon:null,color:"error",variant:"text",loading:Ae.loading,onClick:Fa,children:F("payment.checkout.cross_sell.remove")})]})},`${pe.price_id}-${b.id}`))}),$e&&a.some(pe=>pe.price_id===$e.id)===!1&&u.jsx(u0,{in:!0,children:u.jsx(ge,{sx:{mt:1},children:u.jsx(Xg,{item:{quantity:1,price:$e,price_id:$e.id,cross_sell:!0},items:a,trialInDays:o,currency:b,trialEnd:B,exchangeRate:te.exchangeRate,isStripePayment:me,isPriceLocked:ie,isRateLoading:R,onUpsell:Za,onDownsell:Za,children:u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",width:1},children:[u.jsx(oe,{children:x==="required"&&u.jsx(Oi,{label:F("payment.checkout.required"),color:"info",variant:"outlined",sx:{mr:1}})}),u.jsx(hr,{size:"small",loadingPosition:"end",endIcon:null,color:"info",variant:"text",loading:Ae.loading,onClick:Xn,children:F("payment.checkout.cross_sell.add")})]})})})})]});return!b||!a?.length?null:u.jsx(Gn,{in:!0,children:u.jsxs(ge,{className:"cko-product",direction:"column",...D,children:[u.jsxs(Se,{sx:{display:"flex",alignItems:"center",mb:2.5},children:[u.jsx(oe,{title:F("payment.checkout.orderSummary"),sx:{color:"text.primary",fontSize:{xs:"18px",md:"24px"},fontWeight:"700",lineHeight:"32px"},children:N||F("payment.checkout.orderSummary")}),!Fe.livemode&&u.jsx(eA,{})]}),ee&&T&&u.jsx(rA,{sx:{mb:2},onRetry:$}),be&&!v?u.jsxs(u.Fragment,{children:[u.jsxs(ge,{onClick:()=>ue({expanded:!Ae.expanded}),sx:{justifyContent:"space-between",flexDirection:"row",alignItems:"center",mb:1.5},children:[u.jsx(oe,{children:F("payment.checkout.productListTotal",{total:a.length})}),u.jsx(fA,{expand:Ae.expanded,"aria-expanded":Ae.expanded,"aria-label":"show more",children:u.jsx(p0,{})})]}),u.jsx(h0,{in:Ae.expanded||!be,timeout:"auto",unmountOnExit:!0,children:Dr})]}):Dr,u.jsx(ti,{sx:{mt:2.5,mb:2.5}}),+I>0&&u.jsxs(ge,{spacing:1,children:[u.jsxs(ge,{direction:"row",spacing:1,sx:{justifyContent:"space-between",alignItems:"center"},children:[u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center"},children:[u.jsx(oe,{sx:{color:"text.secondary"},children:F("payment.checkout.paymentRequired")}),u.jsx(Un,{title:F("payment.checkout.stakingConfirm"),placement:"top",sx:{maxWidth:"150px"},children:u.jsx(hf,{fontSize:"small",sx:{color:"text.lighter"}})})]}),u.jsx(oe,{children:Ce})]}),u.jsxs(ge,{direction:"row",spacing:1,sx:{justifyContent:"space-between",alignItems:"center"},children:[u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center"},children:[u.jsx(oe,{sx:{color:"text.secondary"},children:F("payment.checkout.staking.title")}),u.jsx(Un,{title:F("payment.checkout.staking.tooltip"),placement:"top",sx:{maxWidth:"150px"},children:u.jsx(hf,{fontSize:"small",sx:{color:"text.lighter"}})})]}),u.jsxs(oe,{children:[Ca(I,b.decimal)," ",b.symbol]})]})]}),(Ze||Ue)&&u.jsxs(ge,{direction:"row",spacing:1,sx:{justifyContent:"space-between",alignItems:"center",...+I>0&&{borderTop:"1px solid",borderColor:"divider",pt:1,mt:1}},children:[u.jsx(oe,{className:"base-label",children:F("common.subtotal")}),u.jsxs(oe,{children:[Ve," ",b.symbol]})]}),u.jsx(sA,{checkoutSessionId:k?.id||S,currency:b,currencyId:r.id,discounts:Xe,allowPromotionCodes:Ze,completed:O,disabled:Me.paying||Me.stripePaying,onPromotionUpdate:kt,onRemovePromotion:zt,calculatedDiscountAmount:U||(me?Te.toString():null),isRateLoading:R}),_a&&u.jsx(ti,{sx:{my:1}}),u.jsx(dA,{totalAmountText:Ke,totalUsdDisplay:et,currency:b,hasDynamicPricing:L,rateDisplay:H,rateInfo:te,quoteDetailRows:Lt,currentSlippagePercent:J,slippageConfig:E,isPriceLocked:ie,isSubscription:It,completed:O,onSlippageChange:re?an:void 0,isStripePayment:me,isRateLoading:R,thenInfo:_.thenValue&&_.showThen?_.thenValue:void 0})]})})}function yA({checkoutSession:a,paymentMethods:r,paymentLink:o,paymentIntent:s,customer:f,completed:m=!1,mode:c,onPaid:h,onError:g,onChange:y,action:S,showCheckoutSummary:x=!0,quotes:A,rateUnavailable:v,rateError:N}){const{t:B}=ft(),{settings:O,session:k}=_n(),{isMobile:K}=qi(),[j,w]=ni({checkoutSession:a,quotes:A,rateUnavailable:v,rateError:N,paymentIntent:s,liveRateInfo:void 0,liveQuoteSnapshot:void 0,liveRateUnavailable:!1,liveRateError:void 0,isRateLoading:!1}),G=V.useRef(!1),T=V.useRef(null),R=Hf(window.location.href),q=V.useMemo(()=>{const M=new Set;return r.forEach(U=>{U.payment_currencies.forEach(se=>{se.active&&M.add(se.id)})}),Array.from(M)},[r]),z=V.useMemo(()=>{if(!!j.checkoutSession?.discounts?.length&&j.checkoutSession.currency_id&&q.includes(j.checkoutSession.currency_id))return j.checkoutSession.currency_id;if(R.currencyId&&q.includes(R.currencyId))return R.currencyId;if(k?.user&&!I_(k.user)){const se=r.find(je=>je.type==="stripe")?.payment_currencies.find(je=>je.active)?.id;if(se)return se}const U=P_(k?.user?.did,q);return U||(j.checkoutSession.currency_id&&q.includes(j.checkoutSession.currency_id)?j.checkoutSession.currency_id:q?.[0])},[R.currencyId,q,k?.user,j.checkoutSession,r]),$=r.find(M=>M.payment_currencies.some(U=>U.id===z))?.id,re=c.endsWith("-minimal")||!x,Q=nD({defaultValues:{customer_name:f?.name||k?.user?.fullName||"",customer_email:f?.email||k?.user?.email||"",customer_phone:Jf(f?.phone||k?.user?.phone||""),payment_method:$,payment_currency:z,billing_address:Object.assign({country:k?.user?.address?.country||"",state:k?.user?.address?.province||"",city:k?.user?.address?.city||"",line1:k?.user?.address?.line1||"",line2:k?.user?.address?.line2||"",postal_code:k?.user?.address?.postalCode||""},f?.address||{},{country:Vf(f?.address?.country||k?.user?.address?.country||"")?f?.address?.country:"us"})}});V.useEffect(()=>{const M=!!j.checkoutSession?.discounts?.length,U=Q.getValues("payment_currency"),se=Q.getValues("payment_method");z&&(!M||!U)&&Q.setValue("payment_currency",z),$&&(!M||!se)&&Q.setValue("payment_method",$)},[z,$,j.checkoutSession.discounts]),V.useEffect(()=>{if(!iu())return()=>{};let M=0;const U=()=>{M=window.scrollY},se=()=>{window.scrollTo(0,M)};return document.body.addEventListener("focusin",U),document.body.addEventListener("focusout",se),()=>{document.body.removeEventListener("focusin",U),document.body.removeEventListener("focusout",se)}},[]);const Z=ba({control:Q.control,name:"payment_currency",defaultValue:z}),ne=au(r,Z)||O.baseCurrency,me=r.find(M=>M.id===ne.payment_method_id),P=V.useMemo(()=>j.checkoutSession.line_items.some(M=>(M.upsell_price||M.price)?.pricing_type==="dynamic"),[j.checkoutSession.line_items]),D=me?.type==="stripe",F=P&&!D,ae=F&&(j.rateUnavailable||j.liveRateUnavailable);(j.liveRateError||j.rateError)&&console.error("[Rate Error]",{liveRateError:j.liveRateError,rateError:j.rateError});const be=V.useRef(null);V.useEffect(()=>{if(!Z)return;const M=T.current!==null&&T.current!==Z;T.current=Z,M&&(G.current=!0,w({isRateLoading:!0})),F?(w({liveRateInfo:void 0,liveQuoteSnapshot:void 0,liveRateUnavailable:!1,liveRateError:void 0}),ie.current=!1,be.current?.()):(w({liveRateInfo:void 0,liveQuoteSnapshot:void 0,liveRateUnavailable:!1,liveRateError:void 0}),ie.current=!1,M&&!j.checkoutSession?.discounts?.length&&(w({isRateLoading:!1}),G.current=!1))},[Z,F]),V.useEffect(()=>{if(!j.checkoutSession?.id||m||!F)return;let M=!1,U=0;const se=3e4,je=300*1e3,_=1e3,I=2;let ee=se,Ee=null;const De=()=>{Ee&&clearInterval(Ee),Ee=window.setInterval(()=>{Ce(!1)},ee)},Ce=async(Ye=!1)=>{if(document.hidden&&!Ye||typeof navigator<"u"&&!navigator.onLine||ie.current)return;ie.current=!0;let ve=0,qe=null;try{for(;ve<=I;)try{const{data:Ge}=await ot.get(`/api/checkout-sessions/${j.checkoutSession.id}/exchange-rate`,{params:Z?{currency_id:Z}:void 0});if(M)return;U=0,ee=se,w({liveRateInfo:Ge,liveQuoteSnapshot:void 0,liveRateUnavailable:!1,liveRateError:void 0}),G.current&&!j.checkoutSession?.discounts?.length&&(w({isRateLoading:!1}),G.current=!1),De();return}catch(Ge){qe=Ge,ve++,ve<=I&&!M&&(console.log(`[Exchange Rate] Quick retry ${ve}/${I} after ${_}ms`),await new Promise(Ke=>{setTimeout(Ke,_)}))}if(M)return;U++;const Oe=qe?.response?.data?.error||Pt(qe);console.error("[Exchange Rate Fetch Error]",{error:Oe,consecutiveFailures:U,sessionId:j.checkoutSession?.id,currencyId:Z}),w({liveRateUnavailable:!0,liveRateError:void 0}),U>=3&&console.warn("Exchange rate fetch failed multiple times",{consecutiveFailures:U,technicalError:Oe}),ee=Math.min(se*2**(U-1),je),De()}finally{ie.current=!1}};be.current=async()=>{ie.current=!1,await Ce(!0)},Ce(!1);const Te=()=>{document.hidden||Ce(!1)};return document.addEventListener("visibilitychange",Te),()=>{M=!0,be.current=null,Ee&&clearInterval(Ee),document.removeEventListener("visibilitychange",Te)}},[j.checkoutSession?.id,Z,m,F]);const Me=async()=>{if(j.checkoutSession?.discounts?.length)try{await ot.post(`/api/checkout-sessions/${j.checkoutSession.id}/recalculate-promotion`,{currency_id:Z}),await Ze()}catch(M){console.error("[recalculatePromotion] Error:",M)}finally{G.current&&(w({isRateLoading:!1}),G.current=!1)}else G.current&&(w({isRateLoading:!1}),G.current=!1)};V.useEffect(()=>{y&&y(Q.getValues()),Me()},[Z]);const Fe=async(M,U)=>{try{const{data:se}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/upsell`,{from:M,to:U});if(se.discounts?.length){Me();return}w({checkoutSession:se})}catch(se){console.error(se),rt.error(Pt(se))}},Ae=async M=>{try{const{data:U}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/downsell`,{from:M});if(U.discounts?.length){Me();return}w({checkoutSession:U})}catch(U){console.error(U),rt.error(Pt(U))}},ue=async M=>{try{const{data:U}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/cross-sell`,{to:M});if(U.discounts?.length){Me();return}w({checkoutSession:U})}catch(U){console.error(U),rt.error(Pt(U))}},$e=async(M,U)=>{try{const{data:se}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/adjust-quantity`,{itemId:M,quantity:U,currency_id:Z});if(se.discounts?.length){Me();return}w({checkoutSession:se,...se.rateUnavailable!==void 0&&{rateUnavailable:se.rateUnavailable},...se.rateError!==void 0&&{rateError:se.rateError},...se.quotes!==void 0&&{quotes:se.quotes}})}catch(se){console.error(se),rt.error(Pt(se))}},Pe=async()=>{try{const{data:M}=await ot.delete(`/api/checkout-sessions/${j.checkoutSession.id}/cross-sell`);if(M.discounts?.length){Me();return}w({checkoutSession:M})}catch(M){console.error(M),rt.error(Pt(M))}},Xe=async({priceId:M,amount:U})=>{try{const{data:se}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/amount`,{priceId:M,amount:Kn(U,ne.decimal).toString()});if(se.discounts?.length){Me();return}w({checkoutSession:se})}catch(se){console.error(se),rt.error(Pt(se))}},Ze=async()=>{try{const{data:M}=await ot.get(`/api/checkout-sessions/retrieve/${j.checkoutSession.id}`);w({checkoutSession:M.checkoutSession})}catch(M){console.error(M),rt.error(Pt(M))}},Ue=M=>{w({checkoutSession:M.checkoutSession}),h(M)},b=M=>{w({checkoutSession:M.checkoutSession,...M.quotes!==void 0&&{quotes:M.quotes},...M.rateUnavailable!==void 0&&{rateUnavailable:M.rateUnavailable},...M.rateError!==void 0&&{rateError:M.rateError},...M.paymentIntent!==void 0&&{paymentIntent:M.paymentIntent}})},E=M=>{w({paymentIntent:M})},L=V.useRef(!1),ie=V.useRef(!1),W=async(M=!1)=>{if(!L.current){L.current=!0;try{const{data:U}=await ot.get(`/api/checkout-sessions/retrieve/${j.checkoutSession.id}`,{params:M?{forceRefresh:"1"}:void 0});b({checkoutSession:U.checkoutSession,quotes:U.quotes,rateUnavailable:U.rateUnavailable,rateError:U.rateError,paymentIntent:U.paymentIntent})}catch(U){console.error(U),rt.error(Pt(U))}finally{L.current=!1}}};let te=Number(j.checkoutSession?.subscription_data?.trial_period_days||0),ce=Number(j.checkoutSession?.subscription_data?.trial_end||0);const J=(j.checkoutSession?.subscription_data?.trial_currency||"").split(",").map(_0).filter(Boolean);J.length>0&&J.includes(Z)===!1&&(te=0,ce=0);const H=`${o?.metadata?.show_product_features}`=="true";return u.jsx(K0,{...Q,children:u.jsxs(ge,{className:"cko-container",sx:{gap:{sm:c==="standalone"?0:c==="inline"?4:8}},children:[!re&&u.jsx(Gn,{in:!0,children:u.jsxs(ge,{className:"base-card cko-overview",direction:"column",children:[u.jsx(hA,{items:j.checkoutSession.line_items,trialInDays:te,trialEnd:ce,billingThreshold:Math.max(j.checkoutSession.subscription_data?.billing_threshold_amount||0,j.checkoutSession.subscription_data?.min_stake_amount||0),showStaking:BS(me,ne,!!j.checkoutSession.subscription_data?.no_stake),currency:ne,paymentIntent:j.paymentIntent||s,onUpsell:Fe,onDownsell:Ae,onQuantityChange:$e,onApplyCrossSell:ue,onCancelCrossSell:Pe,onChangeAmount:Xe,checkoutSessionId:j.checkoutSession.id,crossSellBehavior:j.checkoutSession.cross_sell_behavior,donationSettings:o?.donation_settings,action:S,completed:m,checkoutSession:j.checkoutSession,onPromotionUpdate:Ze,paymentMethods:r,showFeatures:H,rateUnavailable:ae,isRateLoading:j.isRateLoading,liveRate:j.liveRateInfo,liveQuoteSnapshot:j.liveQuoteSnapshot,onQuoteExpired:W,onRefreshRate:be.current||void 0,isStripePayment:D,onSlippageChange:async M=>{try{const{data:U}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/slippage`,{slippage_config:M});b({checkoutSession:U.checkoutSession||j.checkoutSession,quotes:U.quotes,rateUnavailable:U.rateUnavailable,rateError:U.rateError})}catch(U){console.error("Failed to update slippage",U)}}}),c==="standalone"&&!K&&u.jsx(Lg,{className:"cko-footer",sx:{color:"text.lighter"}})]})}),u.jsxs(ge,{className:"base-card cko-payment",direction:"column",spacing:{xs:2,sm:3},children:[m&&u.jsx(gD,{mode:c,pageInfo:j.checkoutSession.metadata?.page_info,vendorCount:j.checkoutSession.line_items.reduce((M,U)=>M+(U.price?.product?.vendor_config?.length||0),0),sessionId:j.checkoutSession.id,payee:tu(j.checkoutSession.line_items),action:j.checkoutSession.mode,invoiceId:j.checkoutSession.invoice_id,subscriptionId:j.checkoutSession.subscription_id,subscriptions:j.checkoutSession.subscriptions,message:o?.after_completion?.hosted_confirmation?.custom_message||B(`payment.checkout.completed.${j.checkoutSession.submit_type==="donate"?"donate":j.checkoutSession.mode}`)}),!m&&u.jsx(hD,{currencyId:Z,checkoutSession:j.checkoutSession,paymentMethods:r,paymentIntent:j.paymentIntent||s,paymentLink:o,customer:f,onPaid:Ue,onError:g,onQuoteUpdated:b,onPaymentIntentUpdate:E,mode:c,action:S,rateUnavailable:ae})]}),c==="standalone"&&K&&u.jsx(Lg,{className:"cko-footer",sx:{color:"text.lighter"}})]})})}function Sw({checkoutSession:a,paymentMethods:r,paymentIntent:o,paymentLink:s,customer:f,completed:m=!1,error:c=null,mode:h,onPaid:g,onError:y,onChange:S,goBack:x,action:A,showCheckoutSummary:v=!0,quotes:N,rateUnavailable:B,rateError:O}){const{t:k}=ft(),{refresh:K,livemode:j,setLivemode:w}=_n(),[G,T]=V.useState(!1),{isMobile:R}=qi(),q=h.endsWith("-minimal")||!v,z=iu();V.useEffect(()=>{setTimeout(()=>{T(!0)},500)},[]),V.useEffect(()=>{a&&j!==a.livemode&&w(a.livemode)},[a,j,w,K]);const $=()=>c?u.jsx(so,{mode:h,title:"Oops",description:Pt(c)}):!a||!G?u.jsxs(ge,{className:"cko-container",sx:{gap:{sm:h==="standalone"?0:h==="inline"?4:8}},children:[!q&&u.jsx(ge,{className:"base-card cko-overview",children:u.jsx(Se,{className:"cko-product",children:u.jsx($_,{})})}),u.jsx(ge,{className:"base-card cko-payment",children:u.jsx(V_,{})})]}):a.expires_at<=Math.round(Date.now()/1e3)?u.jsx(so,{mode:h,title:k("payment.checkout.expired.title"),description:k("payment.checkout.expired.description")}):a.line_items.length?u.jsx(yA,{checkoutSession:a,paymentMethods:r,paymentLink:s,paymentIntent:o,completed:m||a.status==="complete",customer:f,onPaid:g,onError:y,onChange:S,goBack:x,mode:h,action:A,showCheckoutSummary:v,quotes:N,rateUnavailable:B,rateError:O}):u.jsx(so,{mode:h,title:k("payment.checkout.emptyItems.title"),description:k("payment.checkout.emptyItems.description")});return u.jsxs(ge,{sx:{display:"flex",flexDirection:"column",height:h==="standalone"?"100vh":"auto",overflow:z?"visible":"hidden"},children:[h==="standalone"?u.jsx(Uf,{meta:void 0,addons:void 0,sessionManagerProps:void 0,homeLink:void 0,theme:void 0,hideNavMenu:void 0,maxWidth:!1,sx:{borderBottom:"1px solid",borderColor:"divider"}}):null,u.jsxs(gA,{mode:h,sx:{flex:1,overflow:{xs:z?"visible":"auto",md:"hidden"},...R&&h==="standalone"?{".cko-payment-submit-btn":{position:"fixed",bottom:20,left:0,right:0,zIndex:999,backgroundColor:"background.paper",padding:"10px",textAlign:"center",button:{maxWidth:542}},".cko-footer":{position:"fixed",bottom:0,left:0,right:0,zIndex:999,backgroundColor:"background.paper",marginBottom:0},".cko-payment":{paddingBottom:"100px"}}:{}},children:[x&&u.jsx(Rf,{sx:{mr:.5,color:"text.secondary",alignSelf:"flex-start",margin:"16px 0",cursor:"pointer"},onClick:x,fontSize:"medium"}),u.jsx(ge,{className:"cko-container",sx:{gap:{sm:h==="standalone"?0:h==="inline"?4:8}},children:$()})]})]})}const gA=Zn(Se)`
186
+ `;function Oi(a){return u.jsx(Xl,{size:"small",variant:"filled",...a,sx:{...a.sx||{},height:20,textTransform:"capitalize"}})}function DD(){V.useEffect(()=>{const a=r=>{document.activeElement?.type==="number"&&r.preventDefault()};return window.addEventListener("wheel",a,{passive:!1}),()=>{window.removeEventListener("wheel",a)}},[])}const Q_=(a,r,o)=>{const{valueType:s="value",includeCustom:f=!1,currentValue:m,isCustomSelected:c=!1,compareValue:h=(k,K)=>k===K,enabled:g=!0,selector:y=".tab-navigable-card button",containerRef:S}=o||{},x=V.useRef(!1),A=V.useCallback(()=>S?.current?S.current.querySelectorAll(y):document.querySelectorAll(y),[S,y]),v=V.useCallback(()=>{if((f?[...a,"custom"]:a).length===0)return-1;if(x.current){const K=document.activeElement,j=A();for(let w=0;w<j.length;w++)if(j[w]===K)return w;if(f&&j.length>0)return j.length-1}else{if(c&&f)return a.length;if(m!==void 0)return s==="index"&&typeof m=="number"?m>=0&&m<a.length?m:-1:a.findIndex(K=>h(K,m))}return-1},[a,f,c,m,s,h,A]),N=V.useCallback((k,K)=>{const j=f?a.length+1:a.length;return k===-1?0:K?k===0?j-1:k-1:k===j-1?0:k+1},[a,f]),B=V.useCallback(k=>{if(!g||k.key!=="Tab")return;k.preventDefault(),k.stopPropagation();const K=v(),j=N(K,k.shiftKey);x.current=!0;const w=j===a.length?"custom":a[j];r(w,j),setTimeout(()=>{const G=A();G[j]&&G[j].focus()},0)},[a,r,g,v,N,A]),O=V.useCallback(()=>{x.current=!1},[]);return{handleKeyDown:B,resetTabNavigation:O,isTabNavigationActive:x.current}},df="payment-donation-preset",ff="payment-donation-custom-amount",bn=a=>{const r=String(a);if(!r||r==="0")return r;const o=parseFloat(r);return Number.isNaN(o)?r:o.toString()};function vD({item:a,settings:r,onChange:o,currency:s}){const{t:f,locale:m}=ft(),{setPayable:c,session:h}=_n();DD();const g=(r?.amount?.presets||[]).map(bn),y=z=>{const $=h?.user?.did;return $?`${z}:${$}`:z},S=()=>{try{const z=localStorage.getItem(y(ff))||"";return z?bn(z):""}catch(z){return console.warn("Failed to access localStorage",z),""}},x=()=>{try{const z=localStorage.getItem(y(df));if(z){if(g.includes(bn(z)))return bn(z);if(z==="custom"&&v)return"custom"}}catch(z){console.warn("Failed to access localStorage",z)}if(g.length>0){const z=Math.floor(g.length/2);return g[z]}return"0"},A=g.length>0,v=!!r?.amount?.custom,N=x(),B=N==="custom"?S():"",[O,k]=ni({selected:N==="custom"?"":N,input:B,custom:!A||N==="custom",error:"",animating:!1}),K=V.useRef(null),j=V.useRef(null),w=z=>{c(!0),k({selected:bn(z),custom:!1,error:""}),o({priceId:a.price_id,amount:bn(z)}),localStorage.setItem(y(df),bn(z))},G=()=>{k({custom:!0,selected:"",animating:!0});const z=g.length>0;let $=[];z&&($=[...g].map(Ae=>parseFloat(Ae)).sort((Ae,ue)=>Ae-ue));const re=z?$[$.length-1]:1;let Q=z?$[$.length-1]*5:100;const Z=r.amount.maximum?parseFloat(r.amount.maximum):1/0;Q=Math.min(Q,Z);const me=(()=>{let Ae=2;return!z||g.every($e=>{const Pe=parseFloat($e);return Pe===Math.floor(Pe)})?0:(g.forEach($e=>{const Pe=$e.toString().split(".")[1];Pe&&(Ae=Math.max(Ae,Pe.length))}),Ae)})();let P;me===0?P=(Math.round(Math.random()*(Q-re)+re)||1).toString():P=(Math.random()*(Q-re)+re).toFixed(me);const D=O.input?parseFloat(O.input):0,ae=parseFloat(P)-D,be=Date.now(),Me=800,Fe=()=>{const ue=Date.now()-be;if(ue<Me){const $e=ue/Me,Pe=D+ae*$e,Xe=me===0?Math.floor(Pe).toString():Pe.toFixed(me);k({input:Xe}),requestAnimationFrame(Fe)}else k({input:P,animating:!1,error:""}),o({priceId:a.price_id,amount:bn(P)}),c(!0),localStorage.setItem(y(ff),bn(P)),setTimeout(()=>{K.current?.focus()},200)};requestAnimationFrame(Fe),localStorage.setItem(y(df),"custom")},T=z=>{z==="custom"?G():w(z)},{handleKeyDown:R}=Q_(g,T,{includeCustom:v,currentValue:O.custom?void 0:O.selected,isCustomSelected:O.custom,enabled:!0,selector:".tab-navigable-card button",containerRef:j});V.useEffect(()=>{const z=x(),$=z==="custom";k({selected:$?"":z,custom:!A||z==="custom",input:B,error:""}),$?B?(o({priceId:a.price_id,amount:B}),c(!0)):c(!1):(o({priceId:a.price_id,amount:z}),c(!0))},[r.amount.preset,r.amount.presets,A]),V.useEffect(()=>{j.current&&j.current.focus(),O.custom&&setTimeout(()=>{K.current?.focus()},0)},[O.custom]);const q=z=>{const{value:$}=z.target,re=parseFloat(r.amount.minimum||"0"),Q=r.amount.maximum?parseFloat(r.amount.maximum):1/0,Z=s?.maximum_precision||6;if(jg($,m)){k({input:$,error:jg($,m,Z)}),c(!1);return}if($<re||$>Q){k({input:$,error:f("payment.checkout.donation.between",{min:re,max:Q})}),c(!1);return}c(!0),k({error:"",input:$}),o({priceId:a.price_id,amount:bn($)}),localStorage.setItem(y(ff),bn($))};return u.jsxs(Se,{ref:j,onKeyDown:R,tabIndex:0,sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:1.5,outline:"none"},children:[A&&u.jsxs(ss,{container:!0,spacing:2,children:[g.map(z=>u.jsx(ss,{size:{xs:6,sm:3},children:u.jsx(pf,{variant:"outlined",className:"tab-navigable-card",sx:{minWidth:115,textAlign:"center",transition:"all 0.3s",cursor:"pointer","&:hover":{transform:"translateY(-4px)",boxShadow:3},".MuiCardActionArea-focusHighlight":{backgroundColor:"transparent"},height:"42px",...bn(O.selected)===bn(z)&&!O.custom?{borderColor:"primary.main",borderWidth:1}:{}},children:u.jsx(Gy,{onClick:()=>w(z),tabIndex:0,"aria-selected":bn(O.selected)===bn(z)&&!O.custom,children:u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center",justifyContent:"center",py:1.5,px:1.5},children:[u.jsx(pr,{src:s?.logo,sx:{width:16,height:16,mr:.5},alt:s?.symbol}),u.jsx(oe,{component:"strong",variant:"h3",sx:{lineHeight:1,fontVariantNumeric:"tabular-nums",fontWeight:400},children:z}),u.jsx(oe,{sx:{lineHeight:1,fontSize:14,color:"text.secondary"},children:s?.symbol})]})})})},z)),v&&u.jsx(ss,{size:{xs:6,sm:3},children:u.jsx(pf,{variant:"outlined",className:"tab-navigable-card",sx:{textAlign:"center",transition:"all 0.3s",cursor:"pointer","&:hover":{transform:"translateY(-4px)",boxShadow:3},".MuiCardActionArea-focusHighlight":{backgroundColor:"transparent"},height:"42px",...O.custom?{borderColor:"primary.main",borderWidth:1}:{}},children:u.jsx(Gy,{onClick:G,tabIndex:0,"aria-selected":O.custom,children:u.jsx(ge,{direction:"row",spacing:.5,sx:{alignItems:"center",justifyContent:"center",py:1.5,px:1.5},children:u.jsx(oe,{variant:"h3",sx:{lineHeight:1,fontWeight:400},children:f("common.custom")})})})})},"custom")]}),O.custom&&u.jsx(Yn,{type:"number",value:O.input,onChange:q,margin:"none",fullWidth:!0,error:!!O.error,helperText:O.error,inputRef:K,sx:{mt:N!=="0"?0:1,"& .MuiInputBase-root":{transition:"all 0.3s ease"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"& input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},"& input":{transition:"all 0.25s ease"}},slotProps:{input:{endAdornment:u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center",ml:1},children:[u.jsx(ei,{size:"small",onClick:G,disabled:O.animating,sx:{mr:.5,opacity:O.animating?.5:1,transition:"all 0.2s ease","&:hover":{transform:"scale(1.2)",transition:"transform 0.3s ease"}},"aria-label":f("common.random"),children:u.jsx(Kb,{fontSize:"small"})}),u.jsx(pr,{src:s?.logo,sx:{width:16,height:16},alt:s?.symbol}),u.jsx(oe,{children:s?.symbol})]}),autoComplete:"off"}},autoComplete:"off"})]})}function Z_({value:a,loading:r=!1,skeletonWidth:o=80,height:s=24,sx:f={},animateValueChange:m=!1,transitionDuration:c=300}){const[h,g]=V.useState(a),[y,S]=V.useState(!1),x=V.useRef(a);return V.useEffect(()=>{if(a!==x.current){if(x.current=a,m&&!r){S(!0);const A=setTimeout(()=>{g(a),S(!1)},c/2);return()=>clearTimeout(A)}g(a)}},[a,r,m,c]),r?u.jsx(Ot,{variant:"text",width:o,height:s}):u.jsx(oe,{component:"span",sx:{...f,opacity:y?0:1,transition:m?`opacity ${c/2}ms ease-in-out`:void 0},children:h})}const Zg=Zn(Qb)(({variant:a="success",theme:r})=>({width:28,height:16,padding:0,display:"inline-flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .MuiSwitch-switchBase":{padding:2,"&.Mui-checked":{transform:"translateX(12px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:r.palette[a]?.light}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",width:12,height:12,borderRadius:6,transition:r.transitions?.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:16/2,opacity:1,backgroundColor:r.palette.mode==="dark"?"rgba(255,255,255,.35)":"rgba(0,0,0,.25)",boxSizing:"border-box"}}));function X_({size:a=48,variant:r="rounded",name:o,logo:s="",description:f="",extra:m=void 0}){const c={width:a,height:a};return u.jsxs(ge,{direction:"row",spacing:1,sx:{alignItems:"center",flex:2,width:"100%"},children:[s?u.jsx(pr,{src:s,alt:o,variant:r,sx:c}):u.jsx(pr,{variant:r,sx:c,children:(o||"?").slice(0,1)}),u.jsxs(ge,{direction:"column",sx:{alignItems:"flex-start",justifyContent:"space-around",flexShrink:1,overflow:"hidden"},children:[u.jsx(oe,{className:"cko-ellipsis",variant:"body1",title:o,sx:{color:"text.primary",fontWeight:500,mb:.5,lineHeight:1.2,fontSize:16},children:o}),f&&u.jsx(oe,{variant:"body1",title:f,sx:{color:"text.lighter",fontSize:"0.74375rem",mb:.5,lineHeight:1.2,textAlign:"left"},children:f}),m&&u.jsx(Se,{sx:{color:"text.lighter",fontSize:"0.74375rem"},children:m})]})]})}const W_=a=>{try{const r=new URLSearchParams(window.location.search),o=r.get(`qty_${a}`)||r.get("qty");return o?Math.max(1,parseInt(o,10)):void 0}catch{return}},J_=(a,r)=>{try{const o=`quantity_preference_${a}_${r}`,s=localStorage.getItem(o);return s?Math.max(1,parseInt(s,10)):void 0}catch{return}},eA=(a,r,o)=>{try{const s=`quantity_preference_${a}_${r}`;localStorage.setItem(s,o.toString())}catch{}};function Xg({item:a,items:r,trialInDays:o,trialEnd:s=0,currency:f,mode:m="normal",children:c=null,onUpsell:h,onDownsell:g,completed:y=!1,adjustableQuantity:S={enabled:!1},onQuantityChange:x=()=>{},showFeatures:A=!1,exchangeRate:v=null,isStripePayment:N=!1,isPriceLocked:B=!1,isRateLoading:O=!1,discounts:k=[],calculatedDiscountAmount:K=null}){const{t:j,locale:w}=ft(),{settings:G,setPayable:T,session:R,api:q}=_n(),z=a.upsell_price||a.price,$=z?.pricing_type==="dynamic",re=TS(a,f,{trialEnd:s,trialInDays:o,exchangeRate:v},w),Q=kS(r,f),Z=a.price?.recurring?.usage_type==="metered"?j("common.metered"):"",ne=m==="normal"&&r.length===1,me=o>0||s>Sn().unix(),P=a.price.product?.type==="credit"&&a.price.metadata?.credit_config,D=P&&a.price.metadata?.credit_config?.credit_amount?Number(a.price.metadata.credit_config.credit_amount):0,F=P&&a.price.metadata?.credit_config?.currency_id?au(G.paymentMethods,a.price.metadata.credit_config.currency_id):null,ae=a.price.metadata?.credit_config?.valid_duration_value,be=a.price.metadata?.credit_config?.valid_duration_unit||"days",Me=a.price.metadata?.credit_config?.schedule,Fe=Me?.enabled&&Me?.delivery_mode&&Me.delivery_mode!=="invoice",Ae=R?.user?.did,{data:ue}=Pi(async()=>{if(!P||!Ae)return null;try{const{data:ve}=await q.get("/api/meter-events/pending-amount",{params:{customer_id:Ae,currency_id:F?.id}});return ve?.[F?.id||""]}catch(ve){return console.warn("Failed to fetch pending amount:",ve),null}},{refreshDeps:[P,Ae,F?.id]}),$e=S.enabled&&m==="normal",Pe=Math.max(S.minimum||1,1),Xe=Math.min(a.price?.quantity_limit_per_checkout??1/0,a.price?.quantity_available??1/0),Ze=Xe?Math.min(S.maximum||1/0,Xe):S.maximum||1/0,Ue=V.useMemo(()=>{if(!P||!ue)return null;const ve=new ze(ue||"0");if(!ve.gt(new ze(0))||!D||D<=0)return null;const qe=Kn(D,F?.decimal||2);return!qe||qe.isZero()?null:Math.ceil(ve.mul(new ze(100)).div(qe).toNumber()/100)},[P,ue,D,F?.decimal]),b=V.useMemo(()=>{const ve=W_(a.price.id);if(ve&&ve>0)return $e&&Ue?Math.max(ve,Ue,Pe):ve;if(Ae){const Oe=J_(Ae,a.price.id);if(Oe&&Oe>0)return $e&&Ue?Math.max(Oe,Ue,Pe):Oe}let qe=a.quantity;return $e&&Ue&&(qe=Math.max(qe,Ue,Pe)),qe},[a.quantity,a.price.id,Ae,Ue,$e,Pe]),[E,L]=V.useState(b),ie=E||0;V.useEffect(()=>{b&&b>0&&(b!==E&&L(b),b!==a.quantity&&x(a.price_id,b),T(P&&ue&&Ue?b>=Ue:!0))},[b,P,ue,Ue]);const W=ve=>{if(!ve){L(void 0),T(!1);return}if(ve>=Pe&&ve<=Ze){if(Df(a.price,ve,w))return;if(P&&ue&&Ue&&ve<Ue){T(!1),L(ve),x(a.price_id,ve);return}T(!0),L(ve),x(a.price_id,ve),Ae&&ve>0&&eA(Ae,a.price?.id,ve)}},te=()=>{ie<Ze&&W(ie+1)},ce=()=>{ie>Pe&&W(ie-1)},J=ve=>{const qe=parseInt(ve.target.value||"0",10);Number.isNaN(qe)||W(qe)},H=()=>{if(!P)return null;const ve=Ja(D*(E||0)),qe=F?.symbol||"Credits",Oe=kl(ve,qe,w),Ve=ue&&new ze(ue||"0").gt(new ze(0)),Ge=a.price?.type==="recurring",Ke=ae&&ae>0,et=()=>({amount:Oe,...Ke&&{duration:ae,unit:j(`common.${be}`)},...Ge&&{period:Rn(a.price?.recurring,!0,"per",w)}}),Lt=(fa,Xn)=>({amount:kl(Ui(fa.toString(),F?.decimal||2),qe,w),totalAmount:Oe,...Xn&&{availableAmount:kl(Ui(Xn,F?.decimal||2),qe,w)},...Ke&&{duration:ae,unit:j(`common.${be}`)},...Ge&&{period:Rn(a.price?.recurring,!0,"per",w)}}),It=(fa,Xn)=>`payment.checkout.credit.${fa}.${Xn}${Ke?"WithExpiry":""}`;if(!Ve)return j(It("normal",Ge?"recurring":"oneTime"),et());const kt=new ze(ue||"0"),zt=Kn(D,F?.decimal||2),Dn=Ue||0,An=zt.mul(new ze(E||0)).sub(kt).toString();return new ze(An).gt(new ze(0))?j(It("pending",Ge?"recurringEnough":"oneTimeEnough"),Lt(kt,An)):j("payment.checkout.credit.pending.notEnough",{amount:kl(Ui(kt.toString(),F?.decimal||2),qe,w),quantity:Ja(Dn)})},M=Number.isFinite(E)?Number(E):a.quantity||0,U=V.useMemo(()=>{if(N||!f)return null;const ve=z?.base_amount,qe=z?.unit_amount;if($&&ve!==void 0&&ve!==null){if(B){const et=a?.quoted_amount;if(et){const Lt=new ze(et),It=qt(Lt,f.decimal);return`${un(It,!0,6)} ${f.symbol}`}}if(!v)return null;const Oe=Number(v);if(Oe<=0||Number.isNaN(Oe))return null;const Ke=Number(ve)/Oe*(M||1);return`${un(Ke,!0,6)} ${f.symbol}`}if(!$&&v&&qe){const Oe=Number(v);if(Oe<=0||Number.isNaN(Oe))return null;const Ke=Number(qe)/100/Oe*(M||1);return`${un(Ke,!0,6)} ${f.symbol}`}return null},[N,$,f,z,a,v,M,B]),se=()=>{if(!Fe||!Me)return null;const ve=D*(E||0),qe=F?.symbol||"Credits",Oe=Me.interval_unit,Ve=Me.interval_value;let Ge;if(Me.amount_per_grant)Ge=Number(Me.amount_per_grant)*(E||1);else{const It=a.price.recurring?.interval||"month",kt=a.price.recurring?.interval_count||1,zt={hour:1,day:24,week:168,month:720},Dn=zt[It]*kt,an=zt[Oe]*Ve,An=Math.floor(Dn/an);Ge=An>0?ve/An:ve}const Ke=dr(Ja(Ge),qe),et=Ve===1?j(`common.${Oe}`):` ${Ve} ${j(`common.${Oe}s`)} `;return Me.expire_with_next_grant?j("payment.checkout.credit.schedule.withRefresh",{amount:Ke,interval:et}):j("payment.checkout.credit.schedule.periodic",{amount:Ke,interval:et})},je=V.useMemo(()=>{const ve=a.upsell_price||a.price||{},qe=ve?.type==="recurring"&&ve?.recurring;if(me)return re.primary;let Oe;if(!N&&U)Oe=U;else if($&&!N){const Ve=z?.base_amount;Ve!=null?Oe=`≈ $${Number(Ve).toFixed(2)}`:Oe=re.primary}else Oe=re.primary;return qe&&ve?.recurring?.usage_type!=="metered"?`${Oe} ${ve.recurring?Rn(ve.recurring,!1,"slash",w):""}`:Oe},[me,re,a,w,U,$,z,N]),_=V.useMemo(()=>{if(!f||!$||N)return null;const ve=z?.base_amount;return ve!=null?q0(ve,M):null},[f,z,M,$,N]),I=V.useMemo(()=>zi(_,w),[_,w]),ee=V.useMemo(()=>{const ve=a.price?.upsell?.upsells_to;if(!ve)return null;if(N&&f){const Lt=ve?.base_amount,It=ve?.unit_amount;let kt;if(Lt!=null)kt=Number(Lt);else if(It)kt=Number(It)/100;else return null;const zt=ve?.recurring?` ${Rn(ve.recurring,!1,"slash",w)}`:"";return`${kt} ${f.symbol}${zt}`}if(!f||!v)return null;const qe=Number(v);if(qe<=0||Number.isNaN(qe))return null;const Oe=ve?.base_amount,Ve=ve?.unit_amount;let Ge;if(Oe!=null)Ge=Number(Oe);else if(Ve)Ge=Number(Ve)/100;else return null;const Ke=Ge/qe,et=ve?.recurring?` ${Rn(ve.recurring,!1,"slash",w)}`:"";return`${un(Ke,!0,6)} ${f.symbol}${et}`},[N,f,v,a.price?.upsell?.upsells_to,w]),Ee=V.useMemo(()=>{if(!a.upsell_price_id||!a.price)return null;const ve=a.price;if(N&&f){const Lt=ve?.base_amount,It=ve?.unit_amount;let kt;if(Lt!=null)kt=Number(Lt);else if(It)kt=Number(It)/100;else return null;const zt=ve?.recurring?` ${Rn(ve.recurring,!1,"slash",w)}`:"";return`${kt} ${f.symbol}${zt}`}if(!f||!v)return null;const qe=Number(v);if(qe<=0||Number.isNaN(qe))return null;const Oe=ve?.base_amount,Ve=ve?.unit_amount;let Ge;if(Oe!=null)Ge=Number(Oe);else if(Ve)Ge=Number(Ve)/100;else return null;const Ke=Ge/qe,et=ve?.recurring?` ${Rn(ve.recurring,!1,"slash",w)}`:"";return`${un(Ke,!0,6)} ${f.symbol}${et}`},[N,f,v,a.price,a.upsell_price_id,w]),De=V.useMemo(()=>{if(me&&a.price?.type==="recurring"||a.price?.recurring?.usage_type==="metered"||!k?.length)return null;const ve=k[0]?.coupon_details;if(N&&ve){if(!a.discountable)return null;const qe=z?.pricing_type==="dynamic",Oe=z?.base_amount,Ve=z?.unit_amount;let Ge;if(qe&&Oe!==void 0&&Oe!==null)Ge=Number(Oe)*100;else if(Ve)Ge=Number(Ve);else return null;const Ke=E||a.quantity||1,et=Ge*Ke;return ve.percent_off&&ve.percent_off>0?Math.round(et*ve.percent_off/100).toString():ve.amount_off&&r.length===1&&K?K:null}if($&&v&&ve){const qe=Number(v);if(qe<=0||!a.discountable)return null;const Oe=z?.base_amount;if(!Oe)return null;const Ve=E||a.quantity||1,Ge=Number(Oe)*Ve/qe;if(ve.percent_off&&ve.percent_off>0){const Ke=Ge*ve.percent_off/100;return Kn(Ke.toFixed(f.decimal||8),f.decimal||8).toString()}if(ve.amount_off&&r.length===1&&K)return K}return r.length===1&&K?K:null},[me,k,N,$,v,a,z,E,f.decimal,r.length,K]),Ce=V.useMemo(()=>{if(!k?.length)return null;const ve=k[0];return ve.promotion_code_details?.code||ve.verification_data?.code||"DISCOUNT"},[k]),Te=Df(a.price,ie,w),Ye=a.price?.product?.features||[];return u.jsxs(ge,{direction:"column",spacing:1,className:"product-item",sx:{alignItems:"flex-start",width:"100%"},children:[u.jsxs(ge,{direction:"column",className:"product-item-content",sx:{alignItems:"flex-start",width:"100%"},children:[u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center",flexWrap:"wrap",justifyContent:"space-between",width:"100%"},children:[u.jsx(X_,{logo:a.price?.product?.images[0],name:a.price?.product?.name,extra:u.jsx(Se,{sx:{display:"flex",alignItems:"center"},children:a.price?.type==="recurring"&&a.price?.recurring?[re.quantity,j("common.billed",{rule:`${Rn(a.upsell_price?.recurring||a.price?.recurring,!0,"per",w)} ${Z}`})].filter(Boolean).join(", "):re.quantity})}),u.jsxs(ge,{direction:"column",sx:{alignItems:"flex-end",flex:1},children:[u.jsx(Z_,{value:je,loading:O,skeletonWidth:80,height:20,sx:{color:"text.primary",fontWeight:500}}),$&&!N&&!me&&I&&u.jsxs(oe,{sx:{fontSize:"0.74375rem",color:"text.lighter"},children:["≈ $",I]}),re.secondary&&!me&&u.jsx(oe,{sx:{fontSize:"0.74375rem",color:"text.lighter"},children:re.secondary})]})]}),!(me&&a.price?.type==="recurring"||a.price?.recurring?.usage_type==="metered")&&(De||a.discount_amounts&&a.discount_amounts.length>0)&&u.jsx(ge,{direction:"row",spacing:1,sx:{mt:1,alignItems:"center",opacity:O?0:1,transition:"opacity 300ms ease-in-out"},children:u.jsx(Xl,{icon:u.jsx(c0,{sx:{fontSize:"0.8rem !important"}}),label:u.jsxs(Se,{sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(oe,{component:"span",sx:{fontSize:"0.75rem",fontWeight:"medium"},children:Ce||"DISCOUNT"}),u.jsxs(oe,{component:"span",sx:{fontSize:"0.75rem"},children:["(-",Ca(De||a.discount_amounts?.[0]?.amount||"0",f.decimal)," ",f.symbol,")"]})]}),size:"small",variant:"filled",sx:{height:20,"& .MuiChip-icon":{color:"warning.main"},"& .MuiChip-label":{px:1}}})}),A&&Ye.length>0&&u.jsx(Se,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",flexWrap:"wrap",gap:1.5,width:"100%",mt:1.5},children:Ye.map(ve=>u.jsxs(Se,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,px:1,py:.5,bgcolor:"action.hover",borderRadius:1,border:"1px solid",borderColor:"divider"},children:[u.jsx(Se,{sx:{bgcolor:"success.main",width:4,height:4,borderRadius:"50%"}}),u.jsx(oe,{component:"span",variant:"caption",sx:{color:"text.primary",fontSize:"0.75rem",fontWeight:500,textTransform:"capitalize",whiteSpace:"nowrap"},children:ve.name})]},ve.name))}),Te?u.jsx(Oi,{label:Te,variant:"outlined",sx:{mt:1,borderColor:"chip.error.border",backgroundColor:"chip.error.background",color:"chip.error.text"}}):null,$e&&!y&&u.jsx(Se,{sx:{mt:1,p:1},children:u.jsxs(ge,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[u.jsxs(oe,{variant:"body2",sx:{color:"text.secondary",minWidth:"fit-content"},children:[j("common.quantity"),":"]}),u.jsx(ei,{size:"small",onClick:ce,disabled:ie<=Pe,sx:{minWidth:32,width:32,height:32},children:u.jsx(Zb,{fontSize:"small"})}),u.jsx(Yn,{size:"small",value:E,onChange:J,type:"number",slotProps:{htmlInput:{min:Pe,max:Ze,style:{textAlign:"center",padding:"4px",minWidth:80}}}}),u.jsx(ei,{size:"small",onClick:te,disabled:ie>=Ze,sx:{minWidth:32,width:32,height:32},children:u.jsx(d0,{fontSize:"small"})})]})}),P&&u.jsx(mr,{severity:"info",sx:{mt:1,fontSize:"0.875rem"},icon:!1,children:Fe?u.jsx(oe,{component:"span",sx:{fontSize:"inherit"},children:se()}):u.jsx(oe,{component:"span",sx:{fontSize:"inherit"},children:H()})}),c]}),ne&&!a.upsell_price_id&&a.price?.upsell?.upsells_to&&u.jsxs(ge,{direction:"row",className:"product-item-upsell",sx:{alignItems:"center",justifyContent:"space-between",width:"100%"},children:[u.jsxs(oe,{component:"label",htmlFor:"upsell-switch",sx:{fontSize:12,cursor:"pointer",color:"text.secondary"},children:[u.jsx(Zg,{id:"upsell-switch",sx:{mr:1},variant:"success",checked:!1,onChange:()=>h(a.price_id,a.price?.upsell?.upsells_to_id)}),j("payment.checkout.upsell.save",{recurring:Rn(a.price?.upsell?.upsells_to?.recurring,!0,"per",w)}),u.jsx(Oi,{label:j("payment.checkout.upsell.off",{saving:Q}),variant:"outlined",sx:{ml:1,borderColor:"chip.warning.border",backgroundColor:"chip.warning.background",color:"chip.warning.text"}})]}),u.jsx(oe,{component:"span",sx:{fontSize:12},children:ee||kg(a.price?.upsell?.upsells_to,f,a.price?.product?.unit_label,1,!0,w)})]}),ne&&a.upsell_price_id&&u.jsxs(ge,{direction:"row",className:"product-item-upsell",sx:{alignItems:"center",justifyContent:"space-between",width:"100%"},children:[u.jsxs(oe,{component:"label",htmlFor:"upsell-switch",sx:{fontSize:12,cursor:"pointer",color:"text.secondary"},children:[u.jsx(Zg,{id:"upsell-switch",sx:{mr:1},variant:"success",checked:!0,onChange:()=>g(a.upsell_price_id)}),j("payment.checkout.upsell.revert",{recurring:j(`common.${Rn(a.price?.recurring)}`)})]}),u.jsx(oe,{component:"span",sx:{fontSize:12},children:Ee||kg(a.price,f,a.price?.product?.unit_label,1,!0,w)})]})]})}function tA({color:a="#bb5504",backgroundColor:r="#ffde92",sx:o}){const{t:s}=ft();return u.jsx(Xl,{label:s("common.livemode"),size:"small",color:"warning",sx:{ml:2,height:"18px",lineHeight:"18px",textTransform:"uppercase",fontSize:"0.7rem",fontWeight:"bold",borderRadius:"4px",backgroundColor:r,color:a,...o}})}function nA(a){if(!a?.length)return null;let r=null,o=null,s=null,f=null,m=null,c=null,h=null;return a.forEach(g=>{const y=g.upsell_price||g.price,S=g?.exchange_rate;!r&&S&&(r=S);const x=y?.base_currency;!o&&x&&(o=x);const A=g?.expires_at;A&&(s=s===null?A:Math.min(s,A));const v=g?.rate_provider_name;!f&&v&&(f=v);const N=g?.rate_provider_id;!m&&N&&(m=N);const B=g?.rate_timestamp_ms;!c&&Number.isFinite(Number(B))&&(c=Number(B));const O=g?.slippage_percent;h===null&&Number.isFinite(Number(O))&&(h=Number(O))}),{exchangeRate:r,baseCurrency:o||"USD",expiresAt:s,providerName:f,providerId:m,rateTimestampMs:c,slippagePercent:h}}function aA(a,r,o,s=!1){const f=a.reduce((g,y)=>{const S=y.upsell_price||y.price;if(s&&S?.type==="recurring"||S?.type==="recurring"&&S?.recurring?.usage_type==="metered")return g;const x=S?.base_amount;if(x){const A=y.quantity||1;return g+Number(x)*A}return g},0);if(f<=0)return null;const m=Number(r);if(m<=0)return null;const c=f/m;return Kn(c.toFixed(o||8),o||8).toString()}function iA(a,r){if(a?.quote_locked_at){const s=new Date(a.quote_locked_at).getTime();if(Number.isFinite(s))return Math.floor(s/1e3)}const o=r?.metadata?.quote_locked_at;if(typeof o=="number")return o;if(typeof o=="string"){const s=Number(o);if(Number.isFinite(s))return s}return null}function rA(a){const{items:r,currency:o,liveRate:s,liveQuoteSnapshot:f,checkoutSession:m,paymentIntent:c,locale:h="en",isStripePayment:g=!1,isSubscription:y=m?.mode==="subscription"||m?.mode==="setup",slippageConfig:S,trialInDays:x=0,trialEnd:A=0,discounts:v}=a,N=Math.floor(Date.now()/1e3),B=x>0||A>N,O=V.useMemo(()=>r.some(ne=>(ne.upsell_price||ne.price)?.pricing_type==="dynamic"),[r]),k=V.useMemo(()=>O?nA(r):null,[r,O]),K=V.useMemo(()=>({exchangeRate:g?null:s?.rate||k?.exchangeRate||null,baseCurrency:s?.base_currency||k?.baseCurrency||"USD",providerName:g?null:s?.provider_name||k?.providerName||null,providerId:g?null:s?.provider_id||k?.providerId||null,timestampMs:g?null:s?.timestamp_ms||k?.rateTimestampMs||null,fetchedAt:g?null:s?.fetched_at||null}),[s,k,g]),j=V.useMemo(()=>g||!O||!s?.rate?null:aA(r,s.rate,o.decimal,B),[O,s?.rate,r,o.decimal,g,B]),w=V.useMemo(()=>{if(!v?.length)return null;const ne=v[0]?.coupon_details;if(!ne)return null;if(g){const D=r.reduce((F,ae)=>{if(!ae.discountable)return F;const be=ae.upsell_price||ae.price;if(B&&be?.type==="recurring"||be?.type==="recurring"&&be?.recurring?.usage_type==="metered")return F;const Me=be?.pricing_type==="dynamic",Fe=be?.base_amount;let Ae;if(Me&&Fe!==void 0&&Fe!==null)Ae=Number(Fe)*100;else{const $e=be?.unit_amount;if(!$e)return F;Ae=Number($e)}const ue=ae.quantity||1;return F+Ae*ue},0);if(D<=0)return null;if(ne.percent_off&&ne.percent_off>0)return Math.round(D*ne.percent_off/100).toString();if(ne.amount_off){const F=Number(ne.amount_off);if(Number.isFinite(F)&&F>0)return Math.min(F,D).toString()}return null}if(!O||!s?.rate)return null;const me=Number(s.rate);if(me<=0)return null;const P=r.reduce((D,F)=>{if(!F.discountable)return D;const ae=F.upsell_price||F.price;if(B&&ae?.type==="recurring"||ae?.type==="recurring"&&ae?.recurring?.usage_type==="metered")return D;const be=ae?.base_amount;if(!be)return D;const Me=F.quantity||1,Fe=Number(be)*Me/me;return D+Fe},0);if(P<=0)return null;if(ne.percent_off&&ne.percent_off>0){const D=P*ne.percent_off/100;return Kn(D.toFixed(o.decimal||8),o.decimal||8).toString()}if(ne.amount_off){const D=ne.currency_id===o.id?ne.amount_off:ne.currency_options?.[o.id]?.amount_off;if(!D)return null;const F=Kn(P.toFixed(o.decimal||8),o.decimal||8),ae=new ze(D),be=new ze(F);return ze.min(ae,be).toString()}return null},[g,O,s?.rate,v,r,B,o.decimal,o.id]),G=V.useMemo(()=>{if(!K.exchangeRate)return null;const ne=Il(K.exchangeRate);return ne?K.baseCurrency==="USD"?`$${ne}`:`${ne} ${K.baseCurrency}`:null},[K]),T=V.useMemo(()=>iA(c,m),[c,m]),R=V.useMemo(()=>{if(!T)return!1;const ne=Math.floor(Date.now()/1e3);return T+180-ne>0},[T]),q=V.useMemo(()=>{if(!T)return!1;const ne=Math.floor(Date.now()/1e3);return T+180-ne<=0},[T]),z=V.useMemo(()=>{let ne=k?.slippagePercent;return ne==null&&(ne=S?.percent??m?.metadata?.slippage?.percent??m?.slippage_percent),ne==null&&(ne=.5),ne},[k?.slippagePercent,S?.percent,m]),$=V.useMemo(()=>s?.provider_display?s.provider_display:!K.providerName&&!K.providerId?"—":K.providerName||K.providerId||"—",[s?.provider_display,K.providerName,K.providerId]);return{hasDynamicPricing:O,isPriceLocked:R,lockExpired:q,quoteMeta:k,rateInfo:K,quoteLockedAt:T,calculatedTokenAmount:j,calculatedDiscountAmount:w,currentSlippagePercent:z,rateDisplay:G,providerDisplay:$,formatTotalDisplay:(ne,me="—")=>{if(O&&j){const D=qt(j,o.decimal),F=Number(D);if(Number.isFinite(F))return un(D,!0,6)}if(O&&f?.quoted_amount){const D=qt(f.quoted_amount,o.decimal),F=Number(D);if(Number.isFinite(F))return un(D,!0,6)}if(ne==null||ne==="")return me;const P=Number(ne);return Number.isFinite(P)?un(ne,O,6):me},calculateUsdDisplay:ne=>{if(!O||!ne||ne==="—")return null;const P=Number(ne);if(!Number.isFinite(P)||P<0)return null;if(P===0)return zi("0",h);const{exchangeRate:D}=K;if(!D)return null;const F=Kn(ne,o.decimal),ae=If(new ze(F),o.decimal,D);return ae?zi(ae,h):null},buildQuoteDetailRows:ne=>{if(!O)return[];const me=[],P="—";if(G){const D=K.fetchedAt||K.timestampMs,F=D?_S(D):P;me.push({label:ne("payment.checkout.quote.detailProvider"),value:$},{label:ne("payment.checkout.quote.detailUpdatedAt"),value:F})}if(y){let D=`${z}%`;if(S?.mode==="rate"&&S.min_acceptable_rate){const ae=Il(S.min_acceptable_rate)||S.min_acceptable_rate,be=S.base_currency||K.baseCurrency||"USD";D=`${be==="USD"?`$${ae}`:`${ae} ${be}`}`}me.push({label:ne("payment.checkout.quote.detailSlippage"),value:D,isSlippage:!0,tooltip:ne("payment.checkout.quote.slippage.tooltip")})}return me}}}function oA({error:a=void 0,onRetry:r=void 0,showRetry:o=!0,sx:s=void 0}){const{t:f}=ft(),[m,c]=V.useState(!1);a&&console.error("[Dynamic Pricing Error]",a);const h=async()=>{if(!(!r||m)){c(!0);try{await r()}finally{c(!1)}}};return u.jsx(mr,{severity:"warning",icon:u.jsx(f0,{}),sx:{borderRadius:2,"& .MuiAlert-message":{width:"100%"},...s},children:u.jsxs(Se,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",width:"100%"},children:[u.jsxs(Se,{children:[u.jsx(Xb,{sx:{fontWeight:600},children:f("payment.dynamicPricing.unavailable.title")}),u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",mt:.5},children:f("payment.dynamicPricing.unavailable.message")})]}),o&&r&&u.jsx(pt,{size:"small",variant:"outlined",onClick:h,disabled:m,startIcon:m?u.jsx(gr,{size:16}):u.jsx(Wb,{}),sx:{ml:2,flexShrink:0},children:f("payment.dynamicPricing.unavailable.retry")})]})})}function sA({checkoutSessionId:a,initialAppliedCodes:r=[],disabled:o=!1,className:s="",placeholder:f="",onUpdate:m=void 0,currencyId:c}){const{t:h}=ft(),[g,y]=V.useState(!1),[S,x]=V.useState(""),[A,v]=V.useState(""),[N,B]=V.useState(!1),[O,k]=V.useState(r),{session:K,paymentState:j}=_n(),w=()=>{K.user?G():K?.login(()=>{G()})},G=async()=>{if(S.trim()&&!(j.paying||j.stripePaying)){B(!0),v("");try{const $=((await ot.post(`/api/checkout-sessions/${a}/apply-promotion`,{promotion_code:S.trim(),currency_id:c})).data.discounts||[])[0];if($){const re={id:$.promotion_code||$.coupon,code:S.trim(),discount_amount:$.discount_amount};k([re]),x(""),y(!1),m?.({appliedCodes:[re],discountAmount:$.discount_amount})}}catch(q){const z=q.response?.data?.error||q.message;v(z)}finally{B(!1)}}},T=q=>{q.key==="Enter"&&!N&&S.trim()&&w()},R=j.paying||j.stripePaying;return u.jsx(Se,{className:s,children:O.length===0&&!o&&!R&&(g?u.jsxs(Se,{onBlur:()=>{S.trim()||y(!1)},children:[u.jsx(Yn,{fullWidth:!0,value:S,onChange:q=>x(q.target.value),onKeyPress:T,placeholder:f||h("payment.checkout.promotion.placeholder"),variant:"outlined",size:"small",disabled:N,autoFocus:!0,slotProps:{input:{endAdornment:u.jsx(ls,{position:"end",children:u.jsx(hr,{size:"small",onClick:w,loading:N,disabled:!S.trim(),variant:"text",sx:{color:"primary.main",fontSize:"small"},children:h("payment.checkout.promotion.apply")})})}},sx:{"& .MuiOutlinedInput-root":{pr:1}}}),A&&u.jsx(mr,{severity:"error",sx:{my:1},children:A})]}):u.jsx(pt,{onClick:()=>y(!0),startIcon:u.jsx(d0,{fontSize:"small"}),variant:"text",sx:{fontWeight:"normal",textTransform:"none",justifyContent:"flex-start",p:0,"&:hover":{backgroundColor:"transparent",textDecoration:"underline"}},children:h("payment.checkout.promotion.add_code")}))})}function lA({checkoutSessionId:a,currency:r,currencyId:o,discounts:s,allowPromotionCodes:f,completed:m=!1,disabled:c=!1,onPromotionUpdate:h,onRemovePromotion:g,calculatedDiscountAmount:y=null,isRateLoading:S=!1}){const{t:x,locale:A}=ft(),v=s?.length>0,N=()=>s?.length?s.filter(B=>B.promotion_code||B.coupon).map(B=>({id:B.promotion_code||B.coupon,code:B.verification_data?.code||"APPLIED",discount_amount:B.discount_amount})):[];return f&&!v?u.jsx(Se,{sx:{mt:1},children:u.jsx(sA,{checkoutSessionId:a,initialAppliedCodes:N(),disabled:m,onUpdate:h,currencyId:o})}):v?u.jsx(Se,{children:s.map(B=>{const O=B.promotion_code_details,k=B.coupon_details,K=k?xS(k,r,A):"",j=K===x("payment.checkout.coupon.noDiscount");return u.jsxs(ge,{children:[u.jsxs(ge,{direction:"row",spacing:1,sx:{justifyContent:"space-between",alignItems:"center"},children:[u.jsxs(ge,{direction:"row",spacing:1,sx:{alignItems:"center",backgroundColor:"grey.100",width:"fit-content",px:1,py:1,borderRadius:1},children:[u.jsxs(oe,{sx:{fontWeight:"medium",display:"flex",alignItems:"center",gap:.5},children:[u.jsx(c0,{sx:{color:"warning.main",fontSize:"small"}}),O?.code||B.verification_data?.code||x("payment.checkout.discount")]}),!m&&u.jsx(pt,{size:"small",disabled:c,onClick:()=>g(a),sx:{minWidth:"auto",width:16,height:16,color:"text.secondary","&.Mui-disabled":{color:"text.disabled"}},children:u.jsx(m0,{sx:{fontSize:14}})})]}),u.jsxs(oe,{sx:{color:"text.secondary",opacity:S?0:1,transition:"opacity 300ms ease-in-out"},children:["-",Ca(y||"0",r.decimal)," ",r.symbol]})]}),K&&u.jsx(oe,{sx:{fontSize:"small",color:j?"error.main":"text.secondary",mt:.5},children:K})]},B.promotion_code||B.coupon||`discount-${B.discount_amount}`)})}):null}function uA({amount:a,sx:r={}}){return u.jsx(oe,{component:"div",sx:{my:.5,fontWeight:600,fontSize:"2.1875rem",letterSpacing:"-0.03rem",fontVariantNumeric:"tabular-nums",...r},children:a})}const cA=[.5,1,3,5,10];function bD({value:a,onChange:r,config:o=void 0,onConfigChange:s=void 0,exchangeRate:f=null,baseCurrency:m="USD",disabled:c=!1,sx:h={},onCancel:g=void 0,onSave:y=void 0}){const{t:S}=ft(),[x,A]=V.useState(""),[v,N]=V.useState(o?.mode||"percent"),[B,O]=V.useState(null),[k,K]=V.useState(!1),j=o?.percent??a,w=V.useMemo(()=>{if(!f)return null;const Z=Number(f);return Number.isNaN(Z)||Z<=0?null:Math.round(Z*100)/100},[f]),G=Z=>{if(!w)return"";const ne=1+Z/100;return(w/ne).toFixed(2)};V.useEffect(()=>{o?.mode&&o.mode!==v&&N(o.mode)},[o?.mode,v]),V.useEffect(()=>{if(k)return;if(v==="percent"){A(j.toFixed(2));return}if(o?.min_acceptable_rate){A(String(o.min_acceptable_rate));return}const Z=G(j);A(Z)},[j,v,f,o?.min_acceptable_rate,k]);const T=Z=>{if(c)return;A(Z.toFixed(2)),N("percent"),O(null),r(Z);const ne=G(Z);s?.({mode:"percent",percent:Z,...ne?{min_acceptable_rate:ne}:{}})},R=Z=>{A(Z),O(null);const ne=Number(Z);if(!Z||Number.isNaN(ne)){O(S("payment.checkout.quote.slippage.invalid"));return}if(ne<=0){O(S("payment.checkout.quote.slippage.invalidPositive"));return}if(v==="percent"){r(ne);const me=G(ne);s?.({mode:"percent",percent:ne,...me?{min_acceptable_rate:me}:{}})}else{if(!w){O(S("payment.checkout.quote.slippage.rateRequired"));return}const me=(w-ne)/ne*100;r(Math.max(0,me)),s?.({mode:"rate",percent:Math.max(0,me),min_acceptable_rate:Z})}},q=(Z,ne)=>{if(!(c||!ne))if(N(ne),O(null),ne==="rate"){if(!w){O(S("payment.checkout.quote.slippage.rateRequired"));return}const me=o?.min_acceptable_rate||G(j);A(me),s?.({mode:"rate",percent:j,min_acceptable_rate:me})}else{A(j.toFixed(2));const me=G(j);s?.({mode:"percent",percent:j,...me?{min_acceptable_rate:me}:{}})}},z=V.useMemo(()=>{if(!w)return null;const Z=1+j/100;return(w/Z).toFixed(2)},[w,j]),$=V.useMemo(()=>w?w.toFixed(2):"—",[w]),re=()=>{g?.()},Q=()=>{y?.()};return u.jsxs(ge,{spacing:2.5,sx:h,children:[u.jsx(oe,{variant:"body2",color:"text.secondary",children:S("payment.checkout.quote.slippageLimit.description")}),u.jsxs(Jb,{value:v,exclusive:!0,onChange:q,size:"small",fullWidth:!0,disabled:c,children:[u.jsx(Dd,{value:"percent",children:S("payment.checkout.quote.slippageLimit.configTogglePercent")}),u.jsx(Dd,{value:"rate",disabled:!w,children:S("payment.checkout.quote.slippageLimit.configToggleRate")})]}),v==="percent"&&u.jsxs(ge,{spacing:1.5,children:[u.jsx(ge,{direction:"row",spacing:1,children:cA.map(Z=>u.jsx(Dd,{value:Z,selected:Math.abs(j-Z)<.01,onClick:()=>T(Z),size:"small",disabled:c,sx:{flex:1,py:1,borderRadius:1,border:"1px solid",borderColor:"divider","&.Mui-selected":{bgcolor:"primary.main",color:"primary.contrastText",borderColor:"primary.main","&:hover":{bgcolor:"primary.dark"}}},children:u.jsxs(oe,{variant:"body2",children:[Z,"%"]})},Z))}),u.jsx(Yn,{size:"small",fullWidth:!0,value:x,onChange:Z=>R(Z.target.value),onFocus:()=>K(!0),onBlur:()=>K(!1),error:!!B,helperText:B,disabled:c,label:S("common.custom"),InputProps:{endAdornment:u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",mr:1},children:"%"})},placeholder:"0.50"})]}),v==="rate"&&u.jsx(ge,{spacing:1.5,children:u.jsx(Yn,{size:"small",fullWidth:!0,value:x,onChange:Z=>R(Z.target.value),onFocus:()=>K(!0),onBlur:()=>K(!1),error:!!B,helperText:B,disabled:c||!w,label:S("payment.checkout.quote.slippage.rateInputLabel",{currency:m}),InputProps:{endAdornment:u.jsx(oe,{variant:"body2",sx:{color:"text.secondary",mr:1},children:m})},placeholder:w?.toFixed(2)||"0.00"})}),w&&u.jsx(Se,{sx:{borderRadius:1,p:1.5,bgcolor:"action.hover"},children:u.jsxs(ge,{spacing:.5,children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[u.jsx(oe,{variant:"body2",color:"text.secondary",children:S("payment.checkout.quote.slippageLimit.derivedCurrentRate")}),u.jsxs(oe,{variant:"body2",fontWeight:500,children:[$," ",m]})]}),u.jsxs(ge,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[u.jsx(oe,{variant:"body2",color:"text.secondary",children:S("payment.checkout.quote.slippageLimit.derivedMinRate")}),u.jsxs(oe,{variant:"body2",fontWeight:500,color:"primary.main",children:[v==="rate"?x:z||"—"," ",m]})]})]})}),u.jsxs(ge,{direction:"row",spacing:1,justifyContent:"flex-end",children:[u.jsx(pt,{onClick:re,disabled:c,color:"inherit",children:S("common.cancel")}),u.jsx(pt,{variant:"contained",onClick:Q,disabled:c||!!B,children:S("common.save")})]})]})}function dA({rateLine:a,rows:r,isSubscription:o=!1,slippageValue:s=.5,onSlippageChange:f=void 0,slippageConfig:m=void 0,exchangeRate:c=null,baseCurrency:h="USD",disabled:g=!1}){const{t:y}=ft(),[S,x]=V.useState(!1),[A,v]=V.useState(!0),[N,B]=V.useState(!1),[O,k]=V.useState(null),[K,j]=V.useState(!1),w=r.length>0,G=V.useCallback(()=>{k(m||{mode:"percent",percent:s}),B(!0)},[s,m]),T=()=>{B(!1),k(null)},R=Q=>{k(Z=>Z?{...Z,percent:Q}:{mode:"percent",percent:Q})},q=Q=>{k(Q)},z=async()=>{if(!(!O||!f)){j(!0);try{const Q={...O,...h?{base_currency:h}:{}};await f(Q),B(!1),k(null)}catch(Q){console.error("Failed to update slippage",Q)}finally{j(!1)}}};V.useEffect(()=>{if(!a)return;v(!1);const Q=setTimeout(()=>{v(!0)},150);return()=>clearTimeout(Q)},[a]);const $=V.useMemo(()=>r.map(Q=>{const Z=Q.isSlippage&&o&&f;return u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[u.jsxs(ge,{direction:"row",spacing:.5,alignItems:"center",children:[u.jsx(oe,{sx:{fontSize:"0.75rem",color:"text.secondary"},children:Q.label}),Q.tooltip&&u.jsx(Un,{title:Q.tooltip,placement:"top",children:u.jsx(i0,{sx:{fontSize:"0.75rem",color:"text.lighter"}})})]}),u.jsxs(ge,{direction:"row",alignItems:"center",spacing:.5,children:[u.jsx(oe,{sx:{fontSize:"0.75rem",color:"text.primary"},children:Q.value}),Z&&!g&&u.jsx(ei,{size:"small",onClick:G,sx:{p:.25},children:u.jsx(ex,{sx:{fontSize:"0.875rem",color:"text.secondary"}})})]})]},Q.label)}),[r,o,f,g,G]),re=!a&&o&&f&&r.some(Q=>Q.isSlippage);return!a&&!re?null:u.jsxs(u.Fragment,{children:[u.jsxs(Se,{sx:{width:"100%",mt:.5},children:[u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",gap:1},children:[a?u.jsx(Gn,{in:A,timeout:300,children:u.jsx(oe,{sx:{fontSize:"0.7875rem",color:"text.lighter"},children:a})}):u.jsx(Se,{}),w&&u.jsx(ei,{size:"small",onClick:()=>x(Q=>!Q),"aria-label":S?"collapse":"expand",children:u.jsx(p0,{sx:{fontSize:"1rem",transition:"transform 0.2s ease",transform:S?"rotate(180deg)":"rotate(0deg)"}})})]}),w&&u.jsx(h0,{in:S,timeout:"auto",unmountOnExit:!0,children:u.jsx(Gn,{in:A,timeout:300,children:u.jsx(ge,{sx:{mt:1,p:1.25,borderRadius:1,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},spacing:1,children:$})})})]}),u.jsxs(lo,{open:N,onClose:T,maxWidth:"sm",fullWidth:!0,children:[u.jsx(Zl,{children:y("payment.checkout.quote.slippage.title")}),u.jsx(uo,{children:u.jsx(bD,{value:O?.percent??s,onChange:R,config:O||m,onConfigChange:q,exchangeRate:c,baseCurrency:h,disabled:g||K,sx:{mt:1},onCancel:T,onSave:z})})]})]})}function fA({totalAmountText:a,totalUsdDisplay:r,currency:o,hasDynamicPricing:s,rateDisplay:f,rateInfo:m,quoteDetailRows:c,currentSlippagePercent:h,slippageConfig:g=void 0,isPriceLocked:y,isSubscription:S,completed:x=!1,onSlippageChange:A=void 0,isStripePayment:v=!1,thenInfo:N="",isRateLoading:B=!1}){const{t:O}=ft();return u.jsxs(u.Fragment,{children:[u.jsxs(ge,{sx:{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"flex-start",width:"100%"},children:[u.jsx(Se,{className:"base-label",children:O("common.total")}),u.jsxs(ge,{sx:{alignItems:"flex-end"},children:[B?u.jsx(Ot,{variant:"text",width:100,height:24}):u.jsx(uA,{amount:a,sx:{fontSize:"16px"}}),s&&!v&&!B&&(r?u.jsxs(oe,{sx:{fontSize:"0.7875rem",color:"text.lighter"},children:["≈ $",r]}):u.jsx(Un,{title:O("payment.checkout.quote.referenceUnavailable"),placement:"top",children:u.jsx(Se,{component:"span",children:u.jsx(oe,{sx:{fontSize:"0.7875rem",color:"text.lighter"},children:"≈ —"})})})),s&&!v&&u.jsx(dA,{rateLine:f?O("payment.checkout.quote.rateLine",{symbol:o.symbol,rate:f}):"",rows:c,isSubscription:S,slippageValue:h,slippageConfig:g,onSlippageChange:!x&&A?A:void 0,exchangeRate:m.exchangeRate,baseCurrency:m.baseCurrency,disabled:y})]})]}),N&&u.jsxs(ge,{sx:{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"flex-start",width:"100%",borderTop:"1px solid",borderColor:"divider",pt:1,mt:1},children:[u.jsx(Se,{className:"base-label",children:O("common.nextCharge")}),u.jsx(oe,{sx:{fontSize:"16px",color:"text.secondary"},children:N})]})]})}const mA=l0(a=>{const{expand:r,...o}=a;return u.jsx(ei,{...o})})(({theme:a,expand:r})=>({transform:r?"rotate(180deg)":"rotate(0deg)",marginLeft:"auto",transition:a.transitions.create("transform",{duration:a.transitions.duration.shortest})}));async function pA(a,r=!0){try{const{data:o}=await ot.get(`/api/checkout-sessions/${a}/cross-sell?skipError=${r}`);return o.error?null:o}catch{return null}}function hA(a,r,o=0){const s={licensed:new ze(0),metered:new ze(0)};return a.map(m=>m.upsell_price||m.price).filter(m=>m.type==="recurring"&&m.recurring).length>0?+o?Kn(o,r.decimal).toString():(a.forEach(m=>{const c=m.upsell_price||m.price,h=nu(c,r),g=new ze(h).mul(new ze(m.quantity));c.type==="recurring"&&c.recurring&&(c.recurring.usage_type==="licensed"&&(s.licensed=s.licensed.add(g)),c.recurring.usage_type==="metered"&&(s.metered=s.metered.add(g)))}),s.licensed.add(s.metered).toString()):"0"}function yA({items:a,currency:r,trialInDays:o,billingThreshold:s,onUpsell:f=Za,onDownsell:m=Za,onQuantityChange:c=Za,onApplyCrossSell:h=Za,onCancelCrossSell:g=Za,onChangeAmount:y=Za,checkoutSessionId:S="",crossSellBehavior:x="",showStaking:A=!1,donationSettings:v=void 0,action:N="",trialEnd:B=0,completed:O=!1,checkoutSession:k=void 0,paymentIntent:K=void 0,paymentMethods:j=[],onPromotionUpdate:w=Za,showFeatures:G=!1,rateUnavailable:T=!1,isRateLoading:R=!1,rateError:q=void 0,onQuoteExpired:z=void 0,onRefreshRate:$=void 0,onSlippageChange:re=void 0,slippageConfig:Q=void 0,liveRate:Z=void 0,liveQuoteSnapshot:ne=void 0,isStripePayment:me=!1,isSubscription:P=void 0,...D}){const{t:F,locale:ae}=ft(),{isMobile:be}=qi(),{paymentState:Me,...Fe}=_n(),[Ae,ue]=ni({loading:!1,shake:!1,expanded:a?.length<3}),{data:$e,runAsync:Pe}=Pi(pe=>S?pA(S,pe):Promise.resolve(null)),Xe=k?.discounts||[],Ze=!!k?.allow_promotion_codes,Ue=Xe?.length>0,b=j&&k?au(j,Ue&&k?.currency_id||r.id)||Fe.settings?.baseCurrency:r,E=Q??k?.metadata?.slippage,{hasDynamicPricing:L,isPriceLocked:ie,quoteMeta:W,rateInfo:te,quoteLockedAt:ce,currentSlippagePercent:J,rateDisplay:H,calculatedTokenAmount:M,calculatedDiscountAmount:U,calculateUsdDisplay:se,buildQuoteDetailRows:je}=rA({items:a,currency:b,liveRate:Z,liveQuoteSnapshot:ne,checkoutSession:k,paymentIntent:K,locale:ae,isStripePayment:me,isSubscription:P,slippageConfig:E,trialInDays:o,trialEnd:B,discounts:Xe}),_=jS(a,b,{trialEnd:B,trialInDays:o},ae,{exchangeRate:te.exchangeRate}),I=A?hA(a,b,s):"0",ee=L&&!me,Ee=a.some(pe=>(pe.upsell_price||pe.price)?.type==="recurring"),De=_.actualAmount==="0"&&Ee,Ce=V.useMemo(()=>{if(!ee||De||!_.amount.includes(b.symbol))return _.amount;if(M){const ke=qt(M,b?.decimal);return`${un(ke,!0,6)} ${b.symbol}`}return`${un(_.actualAmount,!0,6)} ${b.symbol}`},[_.amount,_.actualAmount,b.symbol,b?.decimal,ee,M,De]),Te=V.useMemo(()=>new ze(k?.total_details?.amount_discount||"0"),[k?.total_details?.amount_discount]),Ye=new ze(Kn(_.actualAmount,b?.decimal)).add(new ze(I)).toString(),ve=qt(Ye,b?.decimal),qe=new ze(Ye).sub(Te).toString(),Oe=qt(qe,b?.decimal),Ve=V.useMemo(()=>{if(ee&&M&&!De){const pe=new ze(M).add(new ze(I)).toString(),ke=qt(pe,b?.decimal);return un(ke,!0,6)}return un(ve,ee,6)},[ee,M,I,b?.decimal,ve,De]),Ge=V.useMemo(()=>{if(ee&&M&&!De){const pe=U?new ze(U):Te,ke=new ze(M).add(new ze(I)).sub(pe).toString(),Re=qt(ke,b?.decimal),Je=Number(Re);if(Number.isFinite(Je)&&Je>=0)return un(Re,!0,6)}if(me&&U&&!De){const pe=new ze(U),ke=new ze(Ye).sub(pe).toString(),Re=qt(ke,b?.decimal),Je=Number(Re);if(Number.isFinite(Je)&&Je>=0)return un(Re,!1,6)}return un(Oe,ee,6)},[ee,M,I,Te,U,b?.decimal,Oe,De,me,Ye]),Ke=Ge==="—"?"—":`${Ge} ${b.symbol}`,et=V.useMemo(()=>{if(ee&&M&&!De){const pe=U?new ze(U):Te,ke=new ze(M).add(new ze(I)).sub(pe).toString(),Re=qt(ke,b?.decimal);return se(Re)}return se(Oe)},[ee,M,I,Te,U,b?.decimal,Oe,se,De]),Lt=je(F),It=P??(k?.mode==="subscription"||k?.mode==="setup"),kt=()=>{w?.()},zt=async pe=>{if(!(Me.paying||Me.stripePaying))try{await ot.delete(`/api/checkout-sessions/${pe}/remove-promotion`),w?.()}catch(ke){console.error("Failed to remove promotion code:",ke)}},Dn=V.useRef(!1);V.useEffect(()=>{if(O||Dn.current||!ne?.expires_at&&!W?.expiresAt)return;const pe=Math.floor(Date.now()/1e3),ke=ne?.expires_at??W?.expiresAt,Re=ke?Math.max(0,ke-pe):0,Je=ce?Math.max(0,ce+180-pe):0,tt=!!ke,it=Je>0;tt&&!it&&Re<=0&&(Dn.current=!0,z?.())},[ne?.expires_at,W?.expiresAt,ce,O,z]);const an=async pe=>{if(re){if(!S){re(pe);return}try{await ot.put(`/api/checkout-sessions/${S}/slippage`,{slippage_config:pe}),re(pe),z&&await z(!0)}catch(ke){console.error("Failed to update slippage",ke),rt.error(ke.response?.data?.error||Pt(ke))}}};iD("error.REQUIRE_CROSS_SELL",()=>{ue({shake:!0}),setTimeout(()=>{ue({shake:!1})},1e3)},[]);const An=async(pe,ke)=>{await f(pe,ke),Pe(!1)},Sa=async(pe,ke)=>{await c(pe,ke),Pe(!1)},fa=async pe=>{await m(pe),Pe(!1)},Xn=async()=>{if($e)try{ue({loading:!0}),await h($e.id)}catch(pe){console.error(pe)}finally{ue({loading:!1})}},Fa=async()=>{try{ue({loading:!0}),await g()}catch(pe){console.error(pe)}finally{ue({loading:!1})}},_a=+I>0||Ze,Dr=u.jsxs(ge,{className:"cko-product-list",sx:{flex:"0 1 auto",overflow:"auto"},children:[u.jsx(ge,{spacing:{xs:1,sm:2},children:a.map(pe=>pe.price?.custom_unit_amount&&y&&v?u.jsx(vD,{item:pe,settings:v,onChange:y,currency:b},`${pe.price_id}-${b.id}`):u.jsx(Xg,{item:pe,items:a,trialInDays:o,trialEnd:B,currency:b,exchangeRate:te.exchangeRate,isStripePayment:me,isPriceLocked:ie,isRateLoading:R,onUpsell:An,onDownsell:fa,adjustableQuantity:pe.adjustable_quantity,completed:O,showFeatures:G,onQuantityChange:Sa,discounts:Xe,calculatedDiscountAmount:U||(me?Te.toString():null),children:pe.cross_sell&&u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",width:1},children:[u.jsx(oe,{}),u.jsx(hr,{size:"small",loadingPosition:"end",endIcon:null,color:"error",variant:"text",loading:Ae.loading,onClick:Fa,children:F("payment.checkout.cross_sell.remove")})]})},`${pe.price_id}-${b.id}`))}),$e&&a.some(pe=>pe.price_id===$e.id)===!1&&u.jsx(u0,{in:!0,children:u.jsx(ge,{sx:{mt:1},children:u.jsx(Xg,{item:{quantity:1,price:$e,price_id:$e.id,cross_sell:!0},items:a,trialInDays:o,currency:b,trialEnd:B,exchangeRate:te.exchangeRate,isStripePayment:me,isPriceLocked:ie,isRateLoading:R,onUpsell:Za,onDownsell:Za,children:u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",width:1},children:[u.jsx(oe,{children:x==="required"&&u.jsx(Oi,{label:F("payment.checkout.required"),color:"info",variant:"outlined",sx:{mr:1}})}),u.jsx(hr,{size:"small",loadingPosition:"end",endIcon:null,color:"info",variant:"text",loading:Ae.loading,onClick:Xn,children:F("payment.checkout.cross_sell.add")})]})})})})]});return!b||!a?.length?null:u.jsx(Gn,{in:!0,children:u.jsxs(ge,{className:"cko-product",direction:"column",...D,children:[u.jsxs(Se,{sx:{display:"flex",alignItems:"center",mb:2.5},children:[u.jsx(oe,{title:F("payment.checkout.orderSummary"),sx:{color:"text.primary",fontSize:{xs:"18px",md:"24px"},fontWeight:"700",lineHeight:"32px"},children:N||F("payment.checkout.orderSummary")}),!Fe.livemode&&u.jsx(tA,{})]}),ee&&T&&u.jsx(oA,{sx:{mb:2},onRetry:$}),be&&!v?u.jsxs(u.Fragment,{children:[u.jsxs(ge,{onClick:()=>ue({expanded:!Ae.expanded}),sx:{justifyContent:"space-between",flexDirection:"row",alignItems:"center",mb:1.5},children:[u.jsx(oe,{children:F("payment.checkout.productListTotal",{total:a.length})}),u.jsx(mA,{expand:Ae.expanded,"aria-expanded":Ae.expanded,"aria-label":"show more",children:u.jsx(p0,{})})]}),u.jsx(h0,{in:Ae.expanded||!be,timeout:"auto",unmountOnExit:!0,children:Dr})]}):Dr,u.jsx(ti,{sx:{mt:2.5,mb:2.5}}),+I>0&&u.jsxs(ge,{spacing:1,children:[u.jsxs(ge,{direction:"row",spacing:1,sx:{justifyContent:"space-between",alignItems:"center"},children:[u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center"},children:[u.jsx(oe,{sx:{color:"text.secondary"},children:F("payment.checkout.paymentRequired")}),u.jsx(Un,{title:F("payment.checkout.stakingConfirm"),placement:"top",sx:{maxWidth:"150px"},children:u.jsx(hf,{fontSize:"small",sx:{color:"text.lighter"}})})]}),u.jsx(oe,{children:Ce})]}),u.jsxs(ge,{direction:"row",spacing:1,sx:{justifyContent:"space-between",alignItems:"center"},children:[u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center"},children:[u.jsx(oe,{sx:{color:"text.secondary"},children:F("payment.checkout.staking.title")}),u.jsx(Un,{title:F("payment.checkout.staking.tooltip"),placement:"top",sx:{maxWidth:"150px"},children:u.jsx(hf,{fontSize:"small",sx:{color:"text.lighter"}})})]}),u.jsxs(oe,{children:[Ca(I,b.decimal)," ",b.symbol]})]})]}),(Ze||Ue)&&u.jsxs(ge,{direction:"row",spacing:1,sx:{justifyContent:"space-between",alignItems:"center",...+I>0&&{borderTop:"1px solid",borderColor:"divider",pt:1,mt:1}},children:[u.jsx(oe,{className:"base-label",children:F("common.subtotal")}),u.jsxs(oe,{children:[Ve," ",b.symbol]})]}),u.jsx(lA,{checkoutSessionId:k?.id||S,currency:b,currencyId:r.id,discounts:Xe,allowPromotionCodes:Ze,completed:O,disabled:Me.paying||Me.stripePaying,onPromotionUpdate:kt,onRemovePromotion:zt,calculatedDiscountAmount:U||(me?Te.toString():null),isRateLoading:R}),_a&&u.jsx(ti,{sx:{my:1}}),u.jsx(fA,{totalAmountText:Ke,totalUsdDisplay:et,currency:b,hasDynamicPricing:L,rateDisplay:H,rateInfo:te,quoteDetailRows:Lt,currentSlippagePercent:J,slippageConfig:E,isPriceLocked:ie,isSubscription:It,completed:O,onSlippageChange:re?an:void 0,isStripePayment:me,isRateLoading:R,thenInfo:_.thenValue&&_.showThen?_.thenValue:void 0})]})})}function gA({checkoutSession:a,paymentMethods:r,paymentLink:o,paymentIntent:s,customer:f,completed:m=!1,mode:c,onPaid:h,onError:g,onChange:y,action:S,showCheckoutSummary:x=!0,quotes:A,rateUnavailable:v,rateError:N}){const{t:B}=ft(),{settings:O,session:k}=_n(),{isMobile:K}=qi(),[j,w]=ni({checkoutSession:a,quotes:A,rateUnavailable:v,rateError:N,paymentIntent:s,liveRateInfo:void 0,liveQuoteSnapshot:void 0,liveRateUnavailable:!1,liveRateError:void 0,isRateLoading:!1}),G=V.useRef(!1),T=V.useRef(null),R=Hf(window.location.href),q=V.useMemo(()=>{const M=new Set;return r.forEach(U=>{U.payment_currencies.forEach(se=>{se.active&&M.add(se.id)})}),Array.from(M)},[r]),z=V.useMemo(()=>{if(!!j.checkoutSession?.discounts?.length&&j.checkoutSession.currency_id&&q.includes(j.checkoutSession.currency_id))return j.checkoutSession.currency_id;if(R.currencyId&&q.includes(R.currencyId))return R.currencyId;if(k?.user&&!$_(k.user)){const se=r.find(je=>je.type==="stripe")?.payment_currencies.find(je=>je.active)?.id;if(se)return se}const U=q_(k?.user?.did,q);return U||(j.checkoutSession.currency_id&&q.includes(j.checkoutSession.currency_id)?j.checkoutSession.currency_id:q?.[0])},[R.currencyId,q,k?.user,j.checkoutSession,r]),$=r.find(M=>M.payment_currencies.some(U=>U.id===z))?.id,re=c.endsWith("-minimal")||!x,Q=nD({defaultValues:{customer_name:f?.name||k?.user?.fullName||"",customer_email:f?.email||k?.user?.email||"",customer_phone:Jf(f?.phone||k?.user?.phone||""),payment_method:$,payment_currency:z,billing_address:Object.assign({country:k?.user?.address?.country||"",state:k?.user?.address?.province||"",city:k?.user?.address?.city||"",line1:k?.user?.address?.line1||"",line2:k?.user?.address?.line2||"",postal_code:k?.user?.address?.postalCode||""},f?.address||{},{country:Vf(f?.address?.country||k?.user?.address?.country||"")?f?.address?.country:"us"})}});V.useEffect(()=>{const M=!!j.checkoutSession?.discounts?.length,U=Q.getValues("payment_currency"),se=Q.getValues("payment_method");z&&(!M||!U)&&Q.setValue("payment_currency",z),$&&(!M||!se)&&Q.setValue("payment_method",$)},[z,$,j.checkoutSession.discounts]),V.useEffect(()=>{if(!iu())return()=>{};let M=0;const U=()=>{M=window.scrollY},se=()=>{window.scrollTo(0,M)};return document.body.addEventListener("focusin",U),document.body.addEventListener("focusout",se),()=>{document.body.removeEventListener("focusin",U),document.body.removeEventListener("focusout",se)}},[]);const Z=ba({control:Q.control,name:"payment_currency",defaultValue:z}),ne=au(r,Z)||O.baseCurrency,me=r.find(M=>M.id===ne.payment_method_id),P=V.useMemo(()=>j.checkoutSession.line_items.some(M=>(M.upsell_price||M.price)?.pricing_type==="dynamic"),[j.checkoutSession.line_items]),D=me?.type==="stripe",F=P&&!D,ae=F&&(j.rateUnavailable||j.liveRateUnavailable);(j.liveRateError||j.rateError)&&console.error("[Rate Error]",{liveRateError:j.liveRateError,rateError:j.rateError});const be=V.useRef(null);V.useEffect(()=>{if(!Z)return;const M=T.current!==null&&T.current!==Z;T.current=Z,M&&(G.current=!0,w({isRateLoading:!0})),F?(w({liveRateInfo:void 0,liveQuoteSnapshot:void 0,liveRateUnavailable:!1,liveRateError:void 0}),ie.current=!1,be.current?.()):(w({liveRateInfo:void 0,liveQuoteSnapshot:void 0,liveRateUnavailable:!1,liveRateError:void 0}),ie.current=!1,M&&!j.checkoutSession?.discounts?.length&&(w({isRateLoading:!1}),G.current=!1))},[Z,F]),V.useEffect(()=>{if(!j.checkoutSession?.id||m||!F)return;let M=!1,U=0;const se=3e4,je=300*1e3,_=1e3,I=2;let ee=se,Ee=null;const De=()=>{Ee&&clearInterval(Ee),Ee=window.setInterval(()=>{Ce(!1)},ee)},Ce=async(Ye=!1)=>{if(document.hidden&&!Ye||typeof navigator<"u"&&!navigator.onLine||ie.current)return;ie.current=!0;let ve=0,qe=null;try{for(;ve<=I;)try{const{data:Ge}=await ot.get(`/api/checkout-sessions/${j.checkoutSession.id}/exchange-rate`,{params:Z?{currency_id:Z}:void 0});if(M)return;U=0,ee=se,w({liveRateInfo:Ge,liveQuoteSnapshot:void 0,liveRateUnavailable:!1,liveRateError:void 0}),G.current&&!j.checkoutSession?.discounts?.length&&(w({isRateLoading:!1}),G.current=!1),De();return}catch(Ge){qe=Ge,ve++,ve<=I&&!M&&(console.log(`[Exchange Rate] Quick retry ${ve}/${I} after ${_}ms`),await new Promise(Ke=>{setTimeout(Ke,_)}))}if(M)return;U++;const Oe=qe?.response?.data?.error||Pt(qe);console.error("[Exchange Rate Fetch Error]",{error:Oe,consecutiveFailures:U,sessionId:j.checkoutSession?.id,currencyId:Z}),w({liveRateUnavailable:!0,liveRateError:void 0}),U>=3&&console.warn("Exchange rate fetch failed multiple times",{consecutiveFailures:U,technicalError:Oe}),ee=Math.min(se*2**(U-1),je),De()}finally{ie.current=!1}};be.current=async()=>{ie.current=!1,await Ce(!0)},Ce(!1);const Te=()=>{document.hidden||Ce(!1)};return document.addEventListener("visibilitychange",Te),()=>{M=!0,be.current=null,Ee&&clearInterval(Ee),document.removeEventListener("visibilitychange",Te)}},[j.checkoutSession?.id,Z,m,F]);const Me=async()=>{if(j.checkoutSession?.discounts?.length)try{await ot.post(`/api/checkout-sessions/${j.checkoutSession.id}/recalculate-promotion`,{currency_id:Z}),await Ze()}catch(M){console.error("[recalculatePromotion] Error:",M)}finally{G.current&&(w({isRateLoading:!1}),G.current=!1)}else G.current&&(w({isRateLoading:!1}),G.current=!1)};V.useEffect(()=>{y&&y(Q.getValues()),Me()},[Z]);const Fe=async(M,U)=>{try{const{data:se}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/upsell`,{from:M,to:U});if(se.discounts?.length){Me();return}w({checkoutSession:se})}catch(se){console.error(se),rt.error(Pt(se))}},Ae=async M=>{try{const{data:U}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/downsell`,{from:M});if(U.discounts?.length){Me();return}w({checkoutSession:U})}catch(U){console.error(U),rt.error(Pt(U))}},ue=async M=>{try{const{data:U}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/cross-sell`,{to:M});if(U.discounts?.length){Me();return}w({checkoutSession:U})}catch(U){console.error(U),rt.error(Pt(U))}},$e=async(M,U)=>{try{const{data:se}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/adjust-quantity`,{itemId:M,quantity:U,currency_id:Z});if(se.discounts?.length){Me();return}w({checkoutSession:se,...se.rateUnavailable!==void 0&&{rateUnavailable:se.rateUnavailable},...se.rateError!==void 0&&{rateError:se.rateError},...se.quotes!==void 0&&{quotes:se.quotes}})}catch(se){console.error(se),rt.error(Pt(se))}},Pe=async()=>{try{const{data:M}=await ot.delete(`/api/checkout-sessions/${j.checkoutSession.id}/cross-sell`);if(M.discounts?.length){Me();return}w({checkoutSession:M})}catch(M){console.error(M),rt.error(Pt(M))}},Xe=async({priceId:M,amount:U})=>{try{const{data:se}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/amount`,{priceId:M,amount:Kn(U,ne.decimal).toString()});if(se.discounts?.length){Me();return}w({checkoutSession:se})}catch(se){console.error(se),rt.error(Pt(se))}},Ze=async()=>{try{const{data:M}=await ot.get(`/api/checkout-sessions/retrieve/${j.checkoutSession.id}`);w({checkoutSession:M.checkoutSession})}catch(M){console.error(M),rt.error(Pt(M))}},Ue=M=>{w({checkoutSession:M.checkoutSession}),h(M)},b=M=>{w({checkoutSession:M.checkoutSession,...M.quotes!==void 0&&{quotes:M.quotes},...M.rateUnavailable!==void 0&&{rateUnavailable:M.rateUnavailable},...M.rateError!==void 0&&{rateError:M.rateError},...M.paymentIntent!==void 0&&{paymentIntent:M.paymentIntent}})},E=M=>{w({paymentIntent:M})},L=V.useRef(!1),ie=V.useRef(!1),W=async(M=!1)=>{if(!L.current){L.current=!0;try{const{data:U}=await ot.get(`/api/checkout-sessions/retrieve/${j.checkoutSession.id}`,{params:M?{forceRefresh:"1"}:void 0});b({checkoutSession:U.checkoutSession,quotes:U.quotes,rateUnavailable:U.rateUnavailable,rateError:U.rateError,paymentIntent:U.paymentIntent})}catch(U){console.error(U),rt.error(Pt(U))}finally{L.current=!1}}};let te=Number(j.checkoutSession?.subscription_data?.trial_period_days||0),ce=Number(j.checkoutSession?.subscription_data?.trial_end||0);const J=(j.checkoutSession?.subscription_data?.trial_currency||"").split(",").map(_0).filter(Boolean);J.length>0&&J.includes(Z)===!1&&(te=0,ce=0);const H=`${o?.metadata?.show_product_features}`=="true";return u.jsx(K0,{...Q,children:u.jsxs(ge,{className:"cko-container",sx:{gap:{sm:c==="standalone"?0:c==="inline"?4:8}},children:[!re&&u.jsx(Gn,{in:!0,children:u.jsxs(ge,{className:"base-card cko-overview",direction:"column",children:[u.jsx(yA,{items:j.checkoutSession.line_items,trialInDays:te,trialEnd:ce,billingThreshold:Math.max(j.checkoutSession.subscription_data?.billing_threshold_amount||0,j.checkoutSession.subscription_data?.min_stake_amount||0),showStaking:US(me,ne,!!j.checkoutSession.subscription_data?.no_stake),currency:ne,paymentIntent:j.paymentIntent||s,onUpsell:Fe,onDownsell:Ae,onQuantityChange:$e,onApplyCrossSell:ue,onCancelCrossSell:Pe,onChangeAmount:Xe,checkoutSessionId:j.checkoutSession.id,crossSellBehavior:j.checkoutSession.cross_sell_behavior,donationSettings:o?.donation_settings,action:S,completed:m,checkoutSession:j.checkoutSession,onPromotionUpdate:Ze,paymentMethods:r,showFeatures:H,rateUnavailable:ae,isRateLoading:j.isRateLoading,liveRate:j.liveRateInfo,liveQuoteSnapshot:j.liveQuoteSnapshot,onQuoteExpired:W,onRefreshRate:be.current||void 0,isStripePayment:D,onSlippageChange:async M=>{try{const{data:U}=await ot.put(`/api/checkout-sessions/${j.checkoutSession.id}/slippage`,{slippage_config:M});b({checkoutSession:U.checkoutSession||j.checkoutSession,quotes:U.quotes,rateUnavailable:U.rateUnavailable,rateError:U.rateError})}catch(U){console.error("Failed to update slippage",U)}}}),c==="standalone"&&!K&&u.jsx(Lg,{className:"cko-footer",sx:{color:"text.lighter"}})]})}),u.jsxs(ge,{className:"base-card cko-payment",direction:"column",spacing:{xs:2,sm:3},children:[m&&u.jsx(gD,{mode:c,pageInfo:j.checkoutSession.metadata?.page_info,vendorCount:j.checkoutSession.line_items.reduce((M,U)=>M+(U.price?.product?.vendor_config?.length||0),0),sessionId:j.checkoutSession.id,payee:tu(j.checkoutSession.line_items),action:j.checkoutSession.mode,invoiceId:j.checkoutSession.invoice_id,subscriptionId:j.checkoutSession.subscription_id,subscriptions:j.checkoutSession.subscriptions,message:o?.after_completion?.hosted_confirmation?.custom_message||B(`payment.checkout.completed.${j.checkoutSession.submit_type==="donate"?"donate":j.checkoutSession.mode}`)}),!m&&u.jsx(hD,{currencyId:Z,checkoutSession:j.checkoutSession,paymentMethods:r,paymentIntent:j.paymentIntent||s,paymentLink:o,customer:f,onPaid:Ue,onError:g,onQuoteUpdated:b,onPaymentIntentUpdate:E,mode:c,action:S,rateUnavailable:ae})]}),c==="standalone"&&K&&u.jsx(Lg,{className:"cko-footer",sx:{color:"text.lighter"}})]})})}function _w({checkoutSession:a,paymentMethods:r,paymentIntent:o,paymentLink:s,customer:f,completed:m=!1,error:c=null,mode:h,onPaid:g,onError:y,onChange:S,goBack:x,action:A,showCheckoutSummary:v=!0,quotes:N,rateUnavailable:B,rateError:O}){const{t:k}=ft(),{refresh:K,livemode:j,setLivemode:w}=_n(),[G,T]=V.useState(!1),{isMobile:R}=qi(),q=h.endsWith("-minimal")||!v,z=iu();V.useEffect(()=>{setTimeout(()=>{T(!0)},500)},[]),V.useEffect(()=>{a&&j!==a.livemode&&w(a.livemode)},[a,j,w,K]);const $=()=>c?u.jsx(so,{mode:h,title:"Oops",description:Pt(c)}):!a||!G?u.jsxs(ge,{className:"cko-container",sx:{gap:{sm:h==="standalone"?0:h==="inline"?4:8}},children:[!q&&u.jsx(ge,{className:"base-card cko-overview",children:u.jsx(Se,{className:"cko-product",children:u.jsx(V_,{})})}),u.jsx(ge,{className:"base-card cko-payment",children:u.jsx(H_,{})})]}):a.expires_at<=Math.round(Date.now()/1e3)?u.jsx(so,{mode:h,title:k("payment.checkout.expired.title"),description:k("payment.checkout.expired.description")}):a.line_items.length?u.jsx(gA,{checkoutSession:a,paymentMethods:r,paymentLink:s,paymentIntent:o,completed:m||a.status==="complete",customer:f,onPaid:g,onError:y,onChange:S,goBack:x,mode:h,action:A,showCheckoutSummary:v,quotes:N,rateUnavailable:B,rateError:O}):u.jsx(so,{mode:h,title:k("payment.checkout.emptyItems.title"),description:k("payment.checkout.emptyItems.description")});return u.jsxs(ge,{sx:{display:"flex",flexDirection:"column",height:h==="standalone"?"100vh":"auto",overflow:z?"visible":"hidden"},children:[h==="standalone"?u.jsx(Uf,{meta:void 0,addons:void 0,sessionManagerProps:void 0,homeLink:void 0,theme:void 0,hideNavMenu:void 0,maxWidth:!1,sx:{borderBottom:"1px solid",borderColor:"divider"}}):null,u.jsxs(DA,{mode:h,sx:{flex:1,overflow:{xs:z?"visible":"auto",md:"hidden"},...R&&h==="standalone"?{".cko-payment-submit-btn":{position:"fixed",bottom:20,left:0,right:0,zIndex:999,backgroundColor:"background.paper",padding:"10px",textAlign:"center",button:{maxWidth:542}},".cko-footer":{position:"fixed",bottom:0,left:0,right:0,zIndex:999,backgroundColor:"background.paper",marginBottom:0},".cko-payment":{paddingBottom:"100px"}}:{}},children:[x&&u.jsx(Rf,{sx:{mr:.5,color:"text.secondary",alignSelf:"flex-start",margin:"16px 0",cursor:"pointer"},onClick:x,fontSize:"medium"}),u.jsx(ge,{className:"cko-container",sx:{gap:{sm:h==="standalone"?0:h==="inline"?4:8}},children:$()})]})]})}const DA=Zn(Se)`
187
187
  box-sizing: border-box;
188
188
  display: flex;
189
189
  flex-direction: column;
@@ -369,7 +369,7 @@ function print() { __p += __j.call(arguments, '') }
369
369
  padding: 20px;
370
370
  }
371
371
  }
372
- `;function DA({children:a,theme:r={}}){const{sx:o={},...s}=r||{},f=cs(),m=V.useMemo(()=>{const c=f.themeName==="ArcBlock"?f:$x(),{mode:h}=c.palette;let g=Vx(c,{palette:{chip:{success:{text:h==="dark"?"#10b981":"#047857",background:h==="dark"?"#022c22":"#d1fae5",border:h==="dark"?"#064e3b":"#a7f3d0"},default:{text:h==="dark"?"#adb1b8":"#4b5563",background:h==="dark"?"#2e3035":"#f3f4f6",border:h==="dark"?"#3c3f44":"#e5e7eb"},secondary:{text:h==="dark"?"#8b5cf6":"#6d28d9",background:h==="dark"?"#2e1064":"#ede9fe",border:h==="dark"?"#3c3f44":"#ddd6fe"},error:{text:h==="dark"?"#ff6369":"#be123c",background:h==="dark"?"#4c0519":"#ffe4e6",border:h==="dark"?"#881337":"#fecdd3"},warning:{text:h==="dark"?"#f59e0b":"#b45309",background:h==="dark"?"#451a03":"#fef4c7",border:h==="dark"?"#78350f":"#fde68a"},info:{text:h==="dark"?"#3b82f6":"#1d4ed8",background:h==="dark"?"#172554":"#dbeafe",border:h==="dark"?"#1e3a8a":"#bfdbfe"}}}});const{palette:y,shape:{borderRadius:S},shadows:x}=g;return g=Hx([g,{palette:{text:{lighter:y.grey[400],link:y.secondary.main}}},{components:{MuiOutlinedInput:{styleOverrides:{root:{borderRadius:S,backgroundColor:y.grey[50],"&.Mui-disabled":{backgroundColor:y.grey[100]},".MuiInputBase-input":{fontSize:"14px",minHeight:"1.65em",lineHeight:"1.65em"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderWidth:"1px"}}}},MuiButton:{defaultProps:{size:"small"},styleOverrides:{root:{fontSize:"0.875rem",fontWeight:500,textTransform:"none",boxShadow:"none"},sizeSmall:{height:32},outlinedPrimary:{borderColor:y.divider,"&:hover":{borderColor:y.divider}}}},MuiIconButton:{defaultProps:{size:"small"},styleOverrides:{root:{textTransform:"none"},colorPrimary:{backgroundColor:y.background.default}}},MuiToggleButton:{styleOverrides:{root:{textTransform:"none"}}},MuiTab:{styleOverrides:{root:{textTransform:"none",fontSize:"0.875rem"}}},MuiTooltip:{defaultProps:{enterTouchDelay:3e3,leaveTouchDelay:100},styleOverrides:{tooltip:{fontSize:"0.875rem"}}},MuiPopover:{styleOverrides:{root:{zIndex:1200},paper:{border:`1px solid ${y.divider}`,boxShadow:x[2]}}},MuiCssBaseline:{styleOverrides:{".base-card":{padding:"20px",borderRadius:1.5*S,background:y.background.default,border:`1px solid ${y.divider}`,boxShadow:x[1]},".base-label":{color:y.grey.A700,fontSize:"16px",fontWeight:"500",lineHeight:"24px"},".base-dialog":{".MuiPaper-root>.MuiDialogContent-root":{paddingTop:"0"}},a:{textDecoration:"none !important"}}},MuiRadio:{styleOverrides:{root:{"&:hover":{background:"none"},"&.Mui-checked":{color:y.primary.main}}}},MuiCheckbox:{styleOverrides:{root:{color:y.primary.main,"&.Mui-checked":{color:y.primary.main}}}},MuiInputBase:{defaultProps:{size:"small"},styleOverrides:{root:{fontSize:"0.875rem",backgroundColor:y.grey[50]}}},MuiInputLabel:{defaultProps:{size:"small"},styleOverrides:{root:{fontSize:"0.875rem"}}},MuiChip:{styleOverrides:{root:{borderRadius:`${S*2}px`,border:"1px solid transparent","&.MuiChip-filledSuccess":{color:y.chip.success.text,backgroundColor:y.chip.success.background,borderColor:y.chip.success.border},"&.MuiChip-filledDefault":{color:y.chip.default.text,backgroundColor:y.chip.default.background,borderColor:y.chip.default.border},"&.MuiChip-filled.MuiChip-colorSecondary":{color:y.chip.secondary.text,backgroundColor:y.chip.secondary.background,borderColor:y.chip.secondary.border},"&.MuiChip-filledError":{color:y.chip.error.text,backgroundColor:y.chip.error.background,borderColor:y.chip.error.border},"&.MuiChip-filledWarning":{color:y.chip.warning.text,backgroundColor:y.chip.warning.background,borderColor:y.chip.warning.border},"&.MuiChip-filled.MuiChip-colorPrimary,&.MuiChip-filledInfo":{color:y.chip.info.text,backgroundColor:y.chip.info.background,borderColor:y.chip.info.border}}}},MuiDialog:{styleOverrides:{root:{zIndex:1200}}}}},s]),tx(g)},[f,s]);return u.jsxs(nx,{theme:m,children:[u.jsx(ax,{}),u.jsx(Se,{sx:{height:"100%",...o},children:a})]})}function vA({data:a,currency:r,totalAmount:o="0"}){const{t:s,locale:f}=ft();return u.jsxs(ge,{spacing:2,children:[u.jsx(oe,{variant:"subtitle2",sx:{color:"text.secondary"},children:s("benefits.title",{count:a.length})}),a.map(m=>{const c=m.amount||(o?new ze(o).mul(new ze(Number(m.percent))).div(new ze(100)).toString():"0");return u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",px:.5,borderRadius:1,bgcolor:"background.paper","&:hover":{bgcolor:"action.hover"}},children:[u.jsxs(ge,{direction:"row",spacing:1.5,sx:{alignItems:"center",width:{xs:"100%",sm:"auto"}},children:[u.jsx(pr,{src:m.avatar,alt:m.name,sx:{width:32,height:32},variant:m.type==="dapp"?"square":"circular"}),u.jsxs(Se,{children:[u.jsx(oe,{variant:"subtitle2",onClick:()=>{m.url&&window.open(US(m.url,f),"_blank")},sx:{cursor:m.url?"pointer":"default","&:hover":{color:m.url?"text.link":"inherit"}},children:m.name}),u.jsx(A0,{did:m.address,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap",fontSize:"0.875rem !important"},copyable:!1})]})]}),u.jsxs(ge,{sx:{alignItems:"flex-end",width:{xs:"100%",sm:"auto"},mt:{xs:1,sm:0}},children:[u.jsxs(oe,{variant:"subtitle2",children:[Ui(c,r.decimal,r?.maximum_precision??6)," ",r.symbol]}),u.jsxs(oe,{variant:"caption",sx:{color:"text.secondary",fontSize:"0.875rem"},children:[Number(m.percent),"%"]})]})]},m.address)})]})}function bA(){return u.jsx(Gn,{in:!0,children:u.jsxs(ge,{direction:"column",children:[u.jsx(Ot,{variant:"text",sx:{fontSize:"1.75rem",width:"40%"}}),u.jsx(Ot,{sx:{mt:2},variant:"rounded",height:40}),u.jsx(ti,{sx:{mt:{xs:"16px",md:"16px"},mb:{xs:"16px",md:"16px"}}}),u.jsxs(ge,{direction:"row",spacing:2,sx:{justifyContent:"space-between"},children:[u.jsx(Ot,{variant:"text",sx:{fontSize:"1.5rem",width:"40%"}}),u.jsxs(Se,{sx:{display:"flex",alignItems:"center",gap:2},children:[u.jsx(Se,{children:u.jsx(Ot,{height:60,width:80})}),u.jsx(Se,{children:u.jsx(Ot,{height:60,width:120})})]})]})]})})}const xA=async(a,r)=>{const{data:o}=await ot.get(`/api/payment-links/${a}/benefits?`);return o};function CA({checkoutSession:a,paymentMethods:r,paymentLink:o,paymentIntent:s,customer:f,completed:m=!1,mode:c,onPaid:h,onError:g,onChange:y,action:S,formRender:x={},benefits:A}){const{t:v}=ft(),{settings:N,session:B}=_n(),{isMobile:O}=qi(),[k,K]=ni({checkoutSession:a,submitting:!1,paying:!1,paid:!1,paymentIntent:s,stripeContext:void 0,customer:f,customerLimited:!1,stripePaying:!1}),j=Hf(window.location.href),w=j.currencyId||k.checkoutSession.currency_id||k.checkoutSession.line_items[0]?.price.currency_id,G=r.find(P=>P.payment_currencies.some(D=>D.id===w))?.id,T=k.checkoutSession.line_items,R=o?.donation_settings,[q,z]=ni({open:!1,amount:"0"}),$=nD({defaultValues:{customer_name:f?.name||B?.user?.fullName||"",customer_email:f?.email||B?.user?.email||"",customer_phone:Jf(f?.phone||B?.user?.phone||""),payment_method:G,payment_currency:w,billing_address:Object.assign({country:B?.user?.address?.country||"",state:B?.user?.address?.province||"",city:B?.user?.address?.city||"",line1:B?.user?.address?.line1||"",line2:B?.user?.address?.line2||"",postal_code:B?.user?.address?.postalCode||""},f?.address||{},{country:Vf(f?.address?.country||B?.user?.address?.country||"")?f?.address?.country:"us"})}});V.useEffect(()=>{if(!iu())return()=>{};let P=0;const D=()=>{P=window.scrollY},F=()=>{window.scrollTo(0,P)};return document.body.addEventListener("focusin",D),document.body.addEventListener("focusout",F),()=>{document.body.removeEventListener("focusin",D),document.body.removeEventListener("focusout",F)}},[]),V.useEffect(()=>{!$||j.currencyId||k.checkoutSession.currency_id!==w&&$.setValue("payment_currency",k.checkoutSession.currency_id)},[k.checkoutSession,w,j.currencyId]);const re=ba({control:$.control,name:"payment_currency",defaultValue:w}),Q=au(r,re)||N.baseCurrency;V.useEffect(()=>{y&&y($.getValues())},[re]);const Z=async({priceId:P,amount:D})=>{const F=Kn(D,Q.decimal).toString();z({amount:F});try{if(!F||Number(F)===0)return;const{data:ae}=await ot.put(`/api/checkout-sessions/${k.checkoutSession.id}/amount`,{priceId:P,amount:F});K({checkoutSession:ae})}catch(ae){console.error(ae),rt.error(Pt(ae))}},ne=P=>{K({checkoutSession:P.checkoutSession}),h(P)},me=()=>A?A.length===1?v("payment.checkout.donation.benefits.one",{name:A[0].name}):v("payment.checkout.donation.benefits.multiple",{count:A.length}):null;return u.jsx(K0,{...$,children:u.jsxs(ge,{className:"cko-container",sx:{gap:{sm:c==="standalone"?0:c==="inline"?4:8}},children:[m?u.jsxs(ge,{children:[u.jsx(gD,{mode:c,payee:tu(k.checkoutSession.line_items),action:k.checkoutSession.mode,invoiceId:k.checkoutSession.invoice_id,subscriptionId:k.checkoutSession.subscription_id,message:o?.after_completion?.hosted_confirmation?.custom_message||v("payment.checkout.completed.donate")}),u.jsx(ti,{sx:{mt:{xs:"16px",md:"-24px"},mb:{xs:"16px",md:"16px"}}}),u.jsx(ge,{direction:"row",sx:{justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap",gap:1},children:u.jsx(pt,{variant:"outlined",size:"large",onClick:x?.onCancel,sx:{width:"fit-content",minWidth:120},children:v("common.close")})})]}):u.jsxs(u.Fragment,{children:[q.open&&u.jsx(vA,{data:A,currency:Q,totalAmount:q.amount}),u.jsxs(ge,{sx:{display:q.open?"none":"block"},children:[u.jsxs(ge,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",mb:2},children:[u.jsx(oe,{title:v("payment.checkout.orderSummary"),sx:{color:"text.primary",fontSize:"18px",fontWeight:"500",lineHeight:"24px"},children:v("payment.checkout.donation.tipAmount")}),!O&&R?.amount?.presets&&R.amount.presets.length>0&&u.jsxs(oe,{sx:{color:"text.secondary",fontSize:"13px",display:"flex",alignItems:"center",gap:.5,opacity:.8},children:[u.jsx(Se,{component:"span",sx:{border:"1px solid",borderColor:"divider",borderRadius:.75,px:.75,py:.25,fontSize:"12px",lineHeight:1,color:"text.secondary",fontWeight:"400",bgcolor:"transparent"},children:"Tab"}),v("payment.checkout.donation.tabHint")]})]}),T.map(P=>u.jsx(vD,{item:P,settings:R,onChange:Z,currency:Q},`${P.price_id}-${Q.id}`))]}),u.jsx(ti,{sx:{mt:{xs:"32px",md:"0"},mb:{xs:"16px",md:"-8px"}}}),u.jsxs(ge,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1},children:[A&&A.length>0&&(q.open?u.jsxs(oe,{onClick:()=>z({open:!1}),sx:{cursor:"pointer",color:"text.secondary","&:hover":{color:"text.primary"},display:"flex",alignItems:"center"},children:[u.jsx(Rf,{className:"benefits-arrow",sx:{fontSize:"18px",mr:.5}}),v("common.back")]}):u.jsxs(Se,{onClick:()=>z({open:!0}),sx:{display:"flex",gap:.5,alignItems:"center",color:"text.secondary",cursor:"pointer","& .benefits-arrow":{opacity:0,transform:"translateX(-4px)",transition:"all 0.2s"},"&:hover":{color:"text.primary","& .benefits-arrow":{opacity:1,transform:"translateX(0)"}}},children:[u.jsx(ix,{sx:{fontSize:"18px"}}),u.jsx(oe,{variant:"body2",children:me()}),u.jsx(rx,{className:"benefits-arrow",sx:{fontSize:"18px"}})]})),q.open?null:u.jsxs(Se,{sx:{display:"flex",gap:2,flex:{xs:1,md:"auto"},justifyContent:"flex-end",whiteSpace:"nowrap"},children:[x?.cancel,u.jsx(hD,{currencyId:re,checkoutSession:k.checkoutSession,paymentMethods:r,paymentIntent:s,paymentLink:o,customer:f,onPaid:ne,onError:g,mode:c,action:S,onlyShowBtn:!0,isDonation:!0})]})]})]}),k.customerLimited&&u.jsx(Ul,{onConfirm:()=>window.open(Dt(Qn(),`/customer/invoice/past-due?referer=${encodeURIComponent(window.location.href)}`),"_self"),onCancel:()=>K({customerLimited:!1}),confirm:v("payment.customer.pastDue.alert.confirm"),title:v("payment.customer.pastDue.alert.title"),message:v("payment.customer.pastDue.alert.description"),color:"primary"})]})})}function _w({checkoutSession:a,paymentMethods:r,paymentIntent:o,paymentLink:s,customer:f,completed:m=!1,error:c=null,mode:h,onPaid:g,onError:y,onChange:S,goBack:x,action:A,showCheckoutSummary:v=!0,formRender:N={},id:B}){const{t:O}=ft(),{refresh:k,livemode:K,setLivemode:j}=_n(),{isMobile:w}=qi(),[G,T]=V.useState(!1),R=iu(),q=B.startsWith("plink_")?B:void 0,{data:z,loading:$}=Pi(()=>q?xA(q):Promise.resolve([]),{refreshDeps:[q||s?.id],ready:!!q||!!s?.id});b0(()=>{setTimeout(()=>{T(!0)},500)}),V.useEffect(()=>{a&&K!==a.livemode&&j(a.livemode)},[a,K,j,k]);const re=()=>{const Q=u.jsxs(u.Fragment,{children:[u.jsx(ti,{sx:{mt:{xs:"16px",md:"-24px"},mb:{xs:"16px",md:"-16px"}}}),u.jsx(ge,{direction:"row",sx:{justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap",gap:1},children:u.jsx(pt,{variant:"outlined",size:"large",onClick:N?.onCancel,children:O("common.cancel")})})]});return c?u.jsxs(u.Fragment,{children:[u.jsx(so,{mode:h,title:"Oops",description:Pt(c),button:null}),Q]}):!a||!G||!s||$?u.jsx(bA,{}):a?.expires_at<=Math.round(Date.now()/1e3)?u.jsxs(u.Fragment,{children:[u.jsx(so,{mode:h,title:O("payment.checkout.expired.title"),description:O("payment.checkout.expired.description"),button:null}),Q]}):a.line_items.length?u.jsx(CA,{formRender:N,checkoutSession:a,paymentMethods:r,paymentLink:s,paymentIntent:o,completed:m||a.status==="complete",customer:f,onPaid:g,onError:y,onChange:S,goBack:x,mode:h,action:A,showCheckoutSummary:v,benefits:z}):u.jsxs(u.Fragment,{children:[u.jsx(so,{mode:h,title:O("payment.checkout.emptyItems.title"),description:O("payment.checkout.emptyItems.description"),button:null}),Q]})};return u.jsxs(ge,{sx:{display:"flex",flexDirection:"column",height:h==="standalone"?"100vh":"auto",overflow:R?"visible":"hidden"},children:[h==="standalone"?u.jsx(Uf,{meta:void 0,addons:void 0,sessionManagerProps:void 0,homeLink:void 0,theme:void 0,hideNavMenu:void 0,maxWidth:!1,sx:{borderBottom:"1px solid",borderColor:"divider"}}):null,u.jsxs(SA,{mode:h,sx:{flex:1,overflow:{xs:R?"visible":"auto",md:"hidden"},...w&&h==="standalone"?{".cko-payment-submit-btn":{position:"fixed",bottom:20,left:0,right:0,zIndex:999,backgroundColor:"background.paper",padding:"10px",textAlign:"center",button:{maxWidth:542}}}:{}},children:[x&&u.jsx(Rf,{sx:{mr:.5,color:"text.secondary",alignSelf:"flex-start",margin:"16px 0",cursor:"pointer"},onClick:x,fontSize:"medium"}),u.jsx(ge,{className:"cko-container",sx:{gap:{sm:h==="standalone"?0:h==="inline"?4:8}},children:re()})]})]})}const SA=Zn(Se)`
372
+ `;function vA({children:a,theme:r={}}){const{sx:o={},...s}=r||{},f=cs(),m=V.useMemo(()=>{const c=f.themeName==="ArcBlock"?f:Vx(),{mode:h}=c.palette;let g=Hx(c,{palette:{chip:{success:{text:h==="dark"?"#10b981":"#047857",background:h==="dark"?"#022c22":"#d1fae5",border:h==="dark"?"#064e3b":"#a7f3d0"},default:{text:h==="dark"?"#adb1b8":"#4b5563",background:h==="dark"?"#2e3035":"#f3f4f6",border:h==="dark"?"#3c3f44":"#e5e7eb"},secondary:{text:h==="dark"?"#8b5cf6":"#6d28d9",background:h==="dark"?"#2e1064":"#ede9fe",border:h==="dark"?"#3c3f44":"#ddd6fe"},error:{text:h==="dark"?"#ff6369":"#be123c",background:h==="dark"?"#4c0519":"#ffe4e6",border:h==="dark"?"#881337":"#fecdd3"},warning:{text:h==="dark"?"#f59e0b":"#b45309",background:h==="dark"?"#451a03":"#fef4c7",border:h==="dark"?"#78350f":"#fde68a"},info:{text:h==="dark"?"#3b82f6":"#1d4ed8",background:h==="dark"?"#172554":"#dbeafe",border:h==="dark"?"#1e3a8a":"#bfdbfe"}}}});const{palette:y,shape:{borderRadius:S},shadows:x}=g;return g=Yx([g,{palette:{text:{lighter:y.grey[400],link:y.secondary.main}}},{components:{MuiOutlinedInput:{styleOverrides:{root:{borderRadius:S,backgroundColor:y.grey[50],"&.Mui-disabled":{backgroundColor:y.grey[100]},".MuiInputBase-input":{fontSize:"14px",minHeight:"1.65em",lineHeight:"1.65em"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderWidth:"1px"}}}},MuiButton:{defaultProps:{size:"small"},styleOverrides:{root:{fontSize:"0.875rem",fontWeight:500,textTransform:"none",boxShadow:"none"},sizeSmall:{height:32},outlinedPrimary:{borderColor:y.divider,"&:hover":{borderColor:y.divider}}}},MuiIconButton:{defaultProps:{size:"small"},styleOverrides:{root:{textTransform:"none"},colorPrimary:{backgroundColor:y.background.default}}},MuiToggleButton:{styleOverrides:{root:{textTransform:"none"}}},MuiTab:{styleOverrides:{root:{textTransform:"none",fontSize:"0.875rem"}}},MuiTooltip:{defaultProps:{enterTouchDelay:3e3,leaveTouchDelay:100},styleOverrides:{tooltip:{fontSize:"0.875rem"}}},MuiPopover:{styleOverrides:{root:{zIndex:1200},paper:{border:`1px solid ${y.divider}`,boxShadow:x[2]}}},MuiCssBaseline:{styleOverrides:{".base-card":{padding:"20px",borderRadius:1.5*S,background:y.background.default,border:`1px solid ${y.divider}`,boxShadow:x[1]},".base-label":{color:y.grey.A700,fontSize:"16px",fontWeight:"500",lineHeight:"24px"},".base-dialog":{".MuiPaper-root>.MuiDialogContent-root":{paddingTop:"0"}},a:{textDecoration:"none !important"}}},MuiRadio:{styleOverrides:{root:{"&:hover":{background:"none"},"&.Mui-checked":{color:y.primary.main}}}},MuiCheckbox:{styleOverrides:{root:{color:y.primary.main,"&.Mui-checked":{color:y.primary.main}}}},MuiInputBase:{defaultProps:{size:"small"},styleOverrides:{root:{fontSize:"0.875rem",backgroundColor:y.grey[50]}}},MuiInputLabel:{defaultProps:{size:"small"},styleOverrides:{root:{fontSize:"0.875rem"}}},MuiChip:{styleOverrides:{root:{borderRadius:`${S*2}px`,border:"1px solid transparent","&.MuiChip-filledSuccess":{color:y.chip.success.text,backgroundColor:y.chip.success.background,borderColor:y.chip.success.border},"&.MuiChip-filledDefault":{color:y.chip.default.text,backgroundColor:y.chip.default.background,borderColor:y.chip.default.border},"&.MuiChip-filled.MuiChip-colorSecondary":{color:y.chip.secondary.text,backgroundColor:y.chip.secondary.background,borderColor:y.chip.secondary.border},"&.MuiChip-filledError":{color:y.chip.error.text,backgroundColor:y.chip.error.background,borderColor:y.chip.error.border},"&.MuiChip-filledWarning":{color:y.chip.warning.text,backgroundColor:y.chip.warning.background,borderColor:y.chip.warning.border},"&.MuiChip-filled.MuiChip-colorPrimary,&.MuiChip-filledInfo":{color:y.chip.info.text,backgroundColor:y.chip.info.background,borderColor:y.chip.info.border}}}},MuiDialog:{styleOverrides:{root:{zIndex:1200}}}}},s]),tx(g)},[f,s]);return u.jsxs(nx,{theme:m,children:[u.jsx(ax,{}),u.jsx(Se,{sx:{height:"100%",...o},children:a})]})}function bA({data:a,currency:r,totalAmount:o="0"}){const{t:s,locale:f}=ft();return u.jsxs(ge,{spacing:2,children:[u.jsx(oe,{variant:"subtitle2",sx:{color:"text.secondary"},children:s("benefits.title",{count:a.length})}),a.map(m=>{const c=m.amount||(o?new ze(o).mul(new ze(Number(m.percent))).div(new ze(100)).toString():"0");return u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",px:.5,borderRadius:1,bgcolor:"background.paper","&:hover":{bgcolor:"action.hover"}},children:[u.jsxs(ge,{direction:"row",spacing:1.5,sx:{alignItems:"center",width:{xs:"100%",sm:"auto"}},children:[u.jsx(pr,{src:m.avatar,alt:m.name,sx:{width:32,height:32},variant:m.type==="dapp"?"square":"circular"}),u.jsxs(Se,{children:[u.jsx(oe,{variant:"subtitle2",onClick:()=>{m.url&&window.open(OS(m.url,f),"_blank")},sx:{cursor:m.url?"pointer":"default","&:hover":{color:m.url?"text.link":"inherit"}},children:m.name}),u.jsx(A0,{did:m.address,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap",fontSize:"0.875rem !important"},copyable:!1})]})]}),u.jsxs(ge,{sx:{alignItems:"flex-end",width:{xs:"100%",sm:"auto"},mt:{xs:1,sm:0}},children:[u.jsxs(oe,{variant:"subtitle2",children:[Ui(c,r.decimal,r?.maximum_precision??6)," ",r.symbol]}),u.jsxs(oe,{variant:"caption",sx:{color:"text.secondary",fontSize:"0.875rem"},children:[Number(m.percent),"%"]})]})]},m.address)})]})}function xA(){return u.jsx(Gn,{in:!0,children:u.jsxs(ge,{direction:"column",children:[u.jsx(Ot,{variant:"text",sx:{fontSize:"1.75rem",width:"40%"}}),u.jsx(Ot,{sx:{mt:2},variant:"rounded",height:40}),u.jsx(ti,{sx:{mt:{xs:"16px",md:"16px"},mb:{xs:"16px",md:"16px"}}}),u.jsxs(ge,{direction:"row",spacing:2,sx:{justifyContent:"space-between"},children:[u.jsx(Ot,{variant:"text",sx:{fontSize:"1.5rem",width:"40%"}}),u.jsxs(Se,{sx:{display:"flex",alignItems:"center",gap:2},children:[u.jsx(Se,{children:u.jsx(Ot,{height:60,width:80})}),u.jsx(Se,{children:u.jsx(Ot,{height:60,width:120})})]})]})]})})}const CA=async(a,r)=>{const{data:o}=await ot.get(`/api/payment-links/${a}/benefits?`);return o};function SA({checkoutSession:a,paymentMethods:r,paymentLink:o,paymentIntent:s,customer:f,completed:m=!1,mode:c,onPaid:h,onError:g,onChange:y,action:S,formRender:x={},benefits:A}){const{t:v}=ft(),{settings:N,session:B}=_n(),{isMobile:O}=qi(),[k,K]=ni({checkoutSession:a,submitting:!1,paying:!1,paid:!1,paymentIntent:s,stripeContext:void 0,customer:f,customerLimited:!1,stripePaying:!1}),j=Hf(window.location.href),w=j.currencyId||k.checkoutSession.currency_id||k.checkoutSession.line_items[0]?.price.currency_id,G=r.find(P=>P.payment_currencies.some(D=>D.id===w))?.id,T=k.checkoutSession.line_items,R=o?.donation_settings,[q,z]=ni({open:!1,amount:"0"}),$=nD({defaultValues:{customer_name:f?.name||B?.user?.fullName||"",customer_email:f?.email||B?.user?.email||"",customer_phone:Jf(f?.phone||B?.user?.phone||""),payment_method:G,payment_currency:w,billing_address:Object.assign({country:B?.user?.address?.country||"",state:B?.user?.address?.province||"",city:B?.user?.address?.city||"",line1:B?.user?.address?.line1||"",line2:B?.user?.address?.line2||"",postal_code:B?.user?.address?.postalCode||""},f?.address||{},{country:Vf(f?.address?.country||B?.user?.address?.country||"")?f?.address?.country:"us"})}});V.useEffect(()=>{if(!iu())return()=>{};let P=0;const D=()=>{P=window.scrollY},F=()=>{window.scrollTo(0,P)};return document.body.addEventListener("focusin",D),document.body.addEventListener("focusout",F),()=>{document.body.removeEventListener("focusin",D),document.body.removeEventListener("focusout",F)}},[]),V.useEffect(()=>{!$||j.currencyId||k.checkoutSession.currency_id!==w&&$.setValue("payment_currency",k.checkoutSession.currency_id)},[k.checkoutSession,w,j.currencyId]);const re=ba({control:$.control,name:"payment_currency",defaultValue:w}),Q=au(r,re)||N.baseCurrency;V.useEffect(()=>{y&&y($.getValues())},[re]);const Z=async({priceId:P,amount:D})=>{const F=Kn(D,Q.decimal).toString();z({amount:F});try{if(!F||Number(F)===0)return;const{data:ae}=await ot.put(`/api/checkout-sessions/${k.checkoutSession.id}/amount`,{priceId:P,amount:F});K({checkoutSession:ae})}catch(ae){console.error(ae),rt.error(Pt(ae))}},ne=P=>{K({checkoutSession:P.checkoutSession}),h(P)},me=()=>A?A.length===1?v("payment.checkout.donation.benefits.one",{name:A[0].name}):v("payment.checkout.donation.benefits.multiple",{count:A.length}):null;return u.jsx(K0,{...$,children:u.jsxs(ge,{className:"cko-container",sx:{gap:{sm:c==="standalone"?0:c==="inline"?4:8}},children:[m?u.jsxs(ge,{children:[u.jsx(gD,{mode:c,payee:tu(k.checkoutSession.line_items),action:k.checkoutSession.mode,invoiceId:k.checkoutSession.invoice_id,subscriptionId:k.checkoutSession.subscription_id,message:o?.after_completion?.hosted_confirmation?.custom_message||v("payment.checkout.completed.donate")}),u.jsx(ti,{sx:{mt:{xs:"16px",md:"-24px"},mb:{xs:"16px",md:"16px"}}}),u.jsx(ge,{direction:"row",sx:{justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap",gap:1},children:u.jsx(pt,{variant:"outlined",size:"large",onClick:x?.onCancel,sx:{width:"fit-content",minWidth:120},children:v("common.close")})})]}):u.jsxs(u.Fragment,{children:[q.open&&u.jsx(bA,{data:A,currency:Q,totalAmount:q.amount}),u.jsxs(ge,{sx:{display:q.open?"none":"block"},children:[u.jsxs(ge,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",mb:2},children:[u.jsx(oe,{title:v("payment.checkout.orderSummary"),sx:{color:"text.primary",fontSize:"18px",fontWeight:"500",lineHeight:"24px"},children:v("payment.checkout.donation.tipAmount")}),!O&&R?.amount?.presets&&R.amount.presets.length>0&&u.jsxs(oe,{sx:{color:"text.secondary",fontSize:"13px",display:"flex",alignItems:"center",gap:.5,opacity:.8},children:[u.jsx(Se,{component:"span",sx:{border:"1px solid",borderColor:"divider",borderRadius:.75,px:.75,py:.25,fontSize:"12px",lineHeight:1,color:"text.secondary",fontWeight:"400",bgcolor:"transparent"},children:"Tab"}),v("payment.checkout.donation.tabHint")]})]}),T.map(P=>u.jsx(vD,{item:P,settings:R,onChange:Z,currency:Q},`${P.price_id}-${Q.id}`))]}),u.jsx(ti,{sx:{mt:{xs:"32px",md:"0"},mb:{xs:"16px",md:"-8px"}}}),u.jsxs(ge,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1},children:[A&&A.length>0&&(q.open?u.jsxs(oe,{onClick:()=>z({open:!1}),sx:{cursor:"pointer",color:"text.secondary","&:hover":{color:"text.primary"},display:"flex",alignItems:"center"},children:[u.jsx(Rf,{className:"benefits-arrow",sx:{fontSize:"18px",mr:.5}}),v("common.back")]}):u.jsxs(Se,{onClick:()=>z({open:!0}),sx:{display:"flex",gap:.5,alignItems:"center",color:"text.secondary",cursor:"pointer","& .benefits-arrow":{opacity:0,transform:"translateX(-4px)",transition:"all 0.2s"},"&:hover":{color:"text.primary","& .benefits-arrow":{opacity:1,transform:"translateX(0)"}}},children:[u.jsx(ix,{sx:{fontSize:"18px"}}),u.jsx(oe,{variant:"body2",children:me()}),u.jsx(rx,{className:"benefits-arrow",sx:{fontSize:"18px"}})]})),q.open?null:u.jsxs(Se,{sx:{display:"flex",gap:2,flex:{xs:1,md:"auto"},justifyContent:"flex-end",whiteSpace:"nowrap"},children:[x?.cancel,u.jsx(hD,{currencyId:re,checkoutSession:k.checkoutSession,paymentMethods:r,paymentIntent:s,paymentLink:o,customer:f,onPaid:ne,onError:g,mode:c,action:S,onlyShowBtn:!0,isDonation:!0})]})]})]}),k.customerLimited&&u.jsx(Ul,{onConfirm:()=>window.open(Dt(Qn(),`/customer/invoice/past-due?referer=${encodeURIComponent(window.location.href)}`),"_self"),onCancel:()=>K({customerLimited:!1}),confirm:v("payment.customer.pastDue.alert.confirm"),title:v("payment.customer.pastDue.alert.title"),message:v("payment.customer.pastDue.alert.description"),color:"primary"})]})})}function Aw({checkoutSession:a,paymentMethods:r,paymentIntent:o,paymentLink:s,customer:f,completed:m=!1,error:c=null,mode:h,onPaid:g,onError:y,onChange:S,goBack:x,action:A,showCheckoutSummary:v=!0,formRender:N={},id:B}){const{t:O}=ft(),{refresh:k,livemode:K,setLivemode:j}=_n(),{isMobile:w}=qi(),[G,T]=V.useState(!1),R=iu(),q=B.startsWith("plink_")?B:void 0,{data:z,loading:$}=Pi(()=>q?CA(q):Promise.resolve([]),{refreshDeps:[q||s?.id],ready:!!q||!!s?.id});b0(()=>{setTimeout(()=>{T(!0)},500)}),V.useEffect(()=>{a&&K!==a.livemode&&j(a.livemode)},[a,K,j,k]);const re=()=>{const Q=u.jsxs(u.Fragment,{children:[u.jsx(ti,{sx:{mt:{xs:"16px",md:"-24px"},mb:{xs:"16px",md:"-16px"}}}),u.jsx(ge,{direction:"row",sx:{justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap",gap:1},children:u.jsx(pt,{variant:"outlined",size:"large",onClick:N?.onCancel,children:O("common.cancel")})})]});return c?u.jsxs(u.Fragment,{children:[u.jsx(so,{mode:h,title:"Oops",description:Pt(c),button:null}),Q]}):!a||!G||!s||$?u.jsx(xA,{}):a?.expires_at<=Math.round(Date.now()/1e3)?u.jsxs(u.Fragment,{children:[u.jsx(so,{mode:h,title:O("payment.checkout.expired.title"),description:O("payment.checkout.expired.description"),button:null}),Q]}):a.line_items.length?u.jsx(SA,{formRender:N,checkoutSession:a,paymentMethods:r,paymentLink:s,paymentIntent:o,completed:m||a.status==="complete",customer:f,onPaid:g,onError:y,onChange:S,goBack:x,mode:h,action:A,showCheckoutSummary:v,benefits:z}):u.jsxs(u.Fragment,{children:[u.jsx(so,{mode:h,title:O("payment.checkout.emptyItems.title"),description:O("payment.checkout.emptyItems.description"),button:null}),Q]})};return u.jsxs(ge,{sx:{display:"flex",flexDirection:"column",height:h==="standalone"?"100vh":"auto",overflow:R?"visible":"hidden"},children:[h==="standalone"?u.jsx(Uf,{meta:void 0,addons:void 0,sessionManagerProps:void 0,homeLink:void 0,theme:void 0,hideNavMenu:void 0,maxWidth:!1,sx:{borderBottom:"1px solid",borderColor:"divider"}}):null,u.jsxs(_A,{mode:h,sx:{flex:1,overflow:{xs:R?"visible":"auto",md:"hidden"},...w&&h==="standalone"?{".cko-payment-submit-btn":{position:"fixed",bottom:20,left:0,right:0,zIndex:999,backgroundColor:"background.paper",padding:"10px",textAlign:"center",button:{maxWidth:542}}}:{}},children:[x&&u.jsx(Rf,{sx:{mr:.5,color:"text.secondary",alignSelf:"flex-start",margin:"16px 0",cursor:"pointer"},onClick:x,fontSize:"medium"}),u.jsx(ge,{className:"cko-container",sx:{gap:{sm:h==="standalone"?0:h==="inline"?4:8}},children:re()})]})]})}const _A=Zn(Se)`
373
373
  box-sizing: border-box;
374
374
  display: flex;
375
375
  flex-direction: column;
@@ -443,13 +443,13 @@ function print() { __p += __j.call(arguments, '') }
443
443
  transform: translateX(0);
444
444
  }
445
445
  }
446
- `,_A=V.createContext({api:ot}),{Provider:Aw,Consumer:Ew}=_A,ww=a=>{const r=localStorage.getItem("livemode")!=="false",o=`donate-settings-${a}-${r}`;localStorage.removeItem(o)},AA=Zn(({className:a,...r})=>u.jsx(Un,{...r,classes:{popper:a}}))({[`& .${ox.tooltip}`]:{fontSize:11,maxHeight:120,maxWidth:500,overflowY:"auto"}});function Tw({text:a="",maxLength:r=100,useWidth:o=!1}){if(!a)return null;const s=RS(a,r,o);return s.endsWith("...")?u.jsx(AA,{title:a,placement:"bottom",enterTouchDelay:0,children:u.jsx(oe,{children:s})}):u.jsx(oe,{children:s})}function kw({details:a,method:r,mode:o="dashboard",align:s="left",size:f=20}){const{t:m}=ft();if(!a||o==="customer"&&r.type==="stripe")return u.jsx(oe,{component:"small",sx:{color:"text.secondary"},children:m("common.none")});const{text:c,link:h}=I0(r,a);return h&&c?u.jsx(cr,{href:h,target:"_blank",rel:"noopener noreferrer",children:u.jsxs(EA,{direction:"row",alignItems:"center",justifyContent:s==="left"?"flex-start":"flex-end",sx:{color:"text.link"},spacing:1,children:[u.jsx(oe,{className:"tx-link-text",component:"span",sx:{color:"text.link"},children:c.length>40?[c.slice(0,6),c.slice(-6)].join("..."):c}),u.jsx(y0,{fontSize:"small",sx:{width:f,height:f}})]})}):u.jsx(oe,{component:"small",sx:{color:"text.secondary"},children:m("common.none")})}const EA=Zn(ge)`
446
+ `,AA=V.createContext({api:ot}),{Provider:Ew,Consumer:ww}=AA,Tw=a=>{const r=localStorage.getItem("livemode")!=="false",o=`donate-settings-${a}-${r}`;localStorage.removeItem(o)},EA=Zn(({className:a,...r})=>u.jsx(Un,{...r,classes:{popper:a}}))({[`& .${ox.tooltip}`]:{fontSize:11,maxHeight:120,maxWidth:500,overflowY:"auto"}});function kw({text:a="",maxLength:r=100,useWidth:o=!1}){if(!a)return null;const s=MS(a,r,o);return s.endsWith("...")?u.jsx(EA,{title:a,placement:"bottom",enterTouchDelay:0,children:u.jsx(oe,{children:s})}):u.jsx(oe,{children:s})}function Fw({details:a,method:r,mode:o="dashboard",align:s="left",size:f=20}){const{t:m}=ft();if(!a||o==="customer"&&r.type==="stripe")return u.jsx(oe,{component:"small",sx:{color:"text.secondary"},children:m("common.none")});const{text:c,link:h}=I0(r,a);return h&&c?u.jsx(cr,{href:h,target:"_blank",rel:"noopener noreferrer",children:u.jsxs(wA,{direction:"row",alignItems:"center",justifyContent:s==="left"?"flex-start":"flex-end",sx:{color:"text.link"},spacing:1,children:[u.jsx(oe,{className:"tx-link-text",component:"span",sx:{color:"text.link"},children:c.length>40?[c.slice(0,6),c.slice(-6)].join("..."):c}),u.jsx(y0,{fontSize:"small",sx:{width:f,height:f}})]})}):u.jsx(oe,{component:"small",sx:{color:"text.secondary"},children:m("common.none")})}const wA=Zn(ge)`
447
447
  @media (max-width: 600px) {
448
448
  svg.MuiSvgIcon-root {
449
449
  display: none !important;
450
450
  }
451
451
  }
452
- `;function Wg(){return null}const tm=Ne.memo(({options:a,columns:r,toolbar:o=!0,footer:s=!0,hasRowLink:f=!1,emptyNodeText:m="",bordered:c=!0,...h})=>{const{locale:g,t:y}=ft(),{isMobile:S}=qi(),x={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:S?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},A={};return o||(A.TableToolbar=Wg),s||(A.TableFooter=Wg),u.jsx(wA,{locale:g,options:{...x,...a},columns:r.map(v=>(v.options=v.options||{},v.options.filter=v.options.filter||!1,v.options.sort=v.options.sort||!1,v)),emptyNode:u.jsx(Yx,{children:m||y("empty.records")}),...h,components:A,hasRowLink:f,isMobile:S,bordered:c})}),wA=Zn(Gx)`
452
+ `;function Wg(){return null}const tm=Ne.memo(({options:a,columns:r,toolbar:o=!0,footer:s=!0,hasRowLink:f=!1,emptyNodeText:m="",bordered:c=!0,...h})=>{const{locale:g,t:y}=ft(),{isMobile:S}=qi(),x={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:S?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},A={};return o||(A.TableToolbar=Wg),s||(A.TableFooter=Wg),u.jsx(TA,{locale:g,options:{...x,...a},columns:r.map(v=>(v.options=v.options||{},v.options.filter=v.options.filter||!1,v.options.sort=v.options.sort||!1,v)),emptyNode:u.jsx(Gx,{children:m||y("empty.records")}),...h,components:A,hasRowLink:f,isMobile:S,bordered:c})}),TA=Zn(Kx)`
453
453
  ${a=>a?.hasRowLink?`.MuiTableCell-root {
454
454
  font-size: 0.875rem !important;
455
455
  }`:""}
@@ -605,7 +605,7 @@ function print() { __p += __j.call(arguments, '') }
605
605
  }
606
606
  `:""}
607
607
  }
608
- `;function TA(){return(window.blocklet?.componentId||"").split("/").pop()===us}function ii(a,r=!1){const o=/^https?:\/\//.test(a),s=r||o;return{url:s?a:Dt(Qn(),a),external:s,path:a}}function fr(a,r,o,s={}){a&&a.preventDefault();const{replace:f=!1,target:m="_self"}=s;if(r.external||m==="_blank"){window.open(r.url,m);return}if(TA()&&o){o(r.path,{replace:f});return}f?window.location.replace(r.url):window.location.href=r.url}const kA=a=>{const r={};return a.forEach(o=>{const s=new Date(o.created_at).toLocaleDateString();r[s]||(r[s]=[]),r[s]?.push(o)}),r},xD=(a={})=>{const r=new URLSearchParams,o={include_quote:!0,...a};return Object.keys(o).forEach(s=>{o[s]&&r.set(s,String(o[s]))}),ot.get(`/api/invoices?${r.toString()}`).then(s=>s.data)},CD=a=>{const r=a.lines||[];for(const o of r){const s=o.metadata?.quote;if(s?.exchange_rate)return s}return null},kf=(a,r)=>{if(a.id.startsWith("in_")){const o=`/customer/invoice/${a.id}${a.status==="uncollectible"&&r?`?action=${r}`:""}`;return{connect:a.status==="uncollectible",link:ii(o)}}return{connect:!1,link:ii(I0(a.paymentMethod,a.metadata?.payment_details).link,!0)}},is={cursor:"pointer"},FA=Ne.memo(a=>{const{pageSize:r,target:o,action:s,onPay:f,status:m,customer_id:c,currency_id:h,subscription_id:g,include_staking:y,include_return_staking:S,include_recovered_from:x,onTableDataChange:A,relatedSubscription:v}=a,N="invoice-table",{t:B,locale:O}=ft(),k=ds(),{getCurrency:K}=_n(),[j,w]=V.useState({pageSize:r||10,page:1}),{loading:G,data:T={list:[],count:0},refresh:R}=Pi(()=>xD({...j,status:m,customer_id:c,currency_id:h,subscription_id:g,include_staking:y,include_return_staking:S,include_recovered_from:x,ignore_zero:!0}),{refreshDeps:[j,m,c,h,g,y,x]}),q=V.useRef(T);V.useEffect(()=>{A&&(A(T,q.current),q.current=T)},[T]);const z=cu("events"),$=Bf(async()=>{rt.close(),rt.success(B("payment.customer.invoice.paySuccess")),await R()},1e3,{leading:!1,trailing:!0,maxWait:5e3});V.useEffect(()=>{z&&c&&z.on("invoice.paid",({response:me})=>{me.customer_id===c&&$()})},[z]);const re=(me,P)=>{const{link:D}=kf(P,s);fr(me,D,k,{target:D.external?"_blank":o})},Q=(me,P)=>{P.subscription_id&&fr(me,ii(`/customer/subscription/${P.subscription_id}`),k)},Z=[{label:B("common.amount"),name:"total",width:80,align:"right",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P],F=D.status==="void",ae=CD(D),Me=(ae?.providers||[]).map(Ue=>Ue.provider_name).filter(Boolean),Fe=Me.length>0?Me.join(", "):ae?.rate_provider_name||ae?.rate_provider_id||"—",Ae=ae?.providers?.map(Ue=>{const b=Ue.provider_name||Ue.provider_id||"—";return Ue.rate?`${b}`:b}).filter(Boolean)||[],ue=ae?.rate_timestamp_ms?CS(ae.rate_timestamp_ms):"—",$e=Il(ae?.exchange_rate||null),Pe=$e?(()=>{const b={USD:"$",CNY:"¥"}[ae?.base_currency];return`1 ${D.paymentCurrency.symbol} ≈ ${b?`${b}${$e}`:`${$e} ${ae?.base_currency||"USD"}`}`})():null;let Xe=null;if(ae?.base_amount)Xe=zi(ae.base_amount,O);else if(ae?.exchange_rate&&D.total){const Ue=If(new ze(D.total),D.paymentCurrency.decimal,ae.exchange_rate);Ue&&(Xe=zi(Ue,O))}const Ze=ae?u.jsxs(ge,{spacing:.5,sx:{p:1},children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",spacing:2,children:[u.jsxs(oe,{variant:"caption",sx:{color:"text.secondary"},children:[B("payment.customer.invoice.quote.providers"),":"]}),u.jsx(oe,{variant:"caption",sx:{color:"text.primary"},children:(Ae.length>0?Ae.join(", "):Fe)||"—"})]}),Pe&&u.jsxs(ge,{direction:"row",justifyContent:"space-between",spacing:2,children:[u.jsxs(oe,{variant:"caption",sx:{color:"text.secondary"},children:[B("payment.customer.invoice.quote.exchangeRate"),":"]}),u.jsx(oe,{variant:"caption",sx:{color:"text.primary"},children:Pe})]}),u.jsxs(ge,{direction:"row",justifyContent:"space-between",spacing:2,children:[u.jsxs(oe,{variant:"caption",sx:{color:"text.secondary"},children:[B("payment.customer.invoice.quote.rateTimestamp"),":"]}),u.jsx(oe,{variant:"caption",sx:{color:"text.primary"},children:ue})]})]}):null;return u.jsx(Se,{onClick:Ue=>re(Ue,D),sx:is,children:u.jsxs(ge,{spacing:.25,alignItems:"flex-end",children:[u.jsxs(oe,{sx:F?{textDecoration:"line-through"}:{},children:[Ca(D.total,D.paymentCurrency.decimal)," ",D.paymentCurrency.symbol]}),(Xe||Pe)&&u.jsx(Un,{title:Ze,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{backgroundColor:"background.paper",boxShadow:1}}},children:u.jsx(ge,{spacing:.25,alignItems:"flex-end",children:Xe&&u.jsxs(oe,{variant:"caption",sx:{color:"text.secondary",fontSize:"0.75rem",fontWeight:400,lineHeight:1.2},children:["≈ $",Xe]})})})]})})}}},{label:B("common.paymentMethod"),name:"paymentMethod",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P];return u.jsxs(oe,{sx:{display:"flex",alignItems:"center",whiteSpace:"nowrap"},onClick:F=>re(F,D),children:[u.jsx(pr,{src:D.paymentMethod.logo,sx:{width:18,height:18,mr:1}}),D.paymentMethod.name]})}}},{label:B("common.type"),name:"billing_reason",options:{customBodyRenderLite:(me,P)=>{const D=T.list[P];return u.jsx(Se,{onClick:F=>re(F,D),sx:is,children:u.jsx(Oi,{label:MS(D,O)?.type})})}}},{label:B("payment.customer.invoice.invoiceNumber"),name:"number",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P];return u.jsx(Se,{onClick:F=>re(F,D),sx:is,children:D?.number})}}},...v?[{label:B("common.purchaseItems"),name:"purchase_items",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P],ae=(D.lines||[]).map(Fe=>{const Ae=Fe.price?.product?.name||Fe.description;if(!Ae)return null;const ue=Number(Fe.quantity||0),$e=Number.isFinite(ue)&&ue>1?`${Ae} x${ue}`:Ae,Pe=Fe.id||Fe.price?.id||Fe.price?.product?.id||Fe.description||Ae;return{key:String(Pe),label:$e}}).filter(Boolean);ae.length===0&&D.subscription?.description&&ae.push({key:`subscription-${D.subscription_id||D.id}`,label:D.subscription.description});const be=!!D.subscription_id,Me=be?{onClick:Fe=>Q(Fe,D)}:{};return ae.length===0?u.jsx(Se,{sx:{color:"text.lighter"},children:u.jsx(oe,{sx:{fontSize:14},children:B("common.none")})}):u.jsx(Se,{...Me,sx:be?{cursor:"pointer"}:void 0,children:u.jsx(ge,{spacing:.5,children:ae.map(Fe=>u.jsx(oe,{sx:{fontSize:14,color:be?"text.link":"text.primary"},noWrap:!0,children:Fe.label},`${D.id}-item-${Fe.key}`))})})}}},{label:B("common.credits"),name:"credits",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P],F=D.lines||[],ae=[];return F.forEach(be=>{const Me=String(be.id||be.price?.id||be.price?.product?.id||be.description||D.id),Fe=(Ue,b)=>{ae.push({key:`${Me}-${Ue}`,label:b})},Ae=be.price?.metadata?.credit_config,ue=Number(Ae?.credit_amount||0);if(ue>0){const Ue=Number(be.quantity||0),b=ue*(Number.isFinite(Ue)&&Ue>0?Ue:1),E=K(Ae?.currency_id)?.symbol||Ae?.currency_id||"Credits";Fe("amount",`+${dr(String(b),E)}`);return}const $e=Ae?.schedule,Pe=Number($e?.amount_per_grant||0);if($e?.enabled&&$e?.delivery_mode==="schedule"&&Pe>0){const Ue=Number(be.quantity||0),b=Pe*(Number.isFinite(Ue)&&Ue>0?Ue:1),E=K(Ae?.currency_id)?.symbol||Ae?.currency_id||"Credits";Fe("schedule",`+${dr(String(b),E)}`);return}const Xe=be.price?.credit,Ze=Number(Xe?.amount||0);if(Ze>0){const Ue=Xe.currency?.symbol||"Credits";Fe("credit",`+${dr(String(Ze),Ue)}`)}}),ae.length===0?"-":u.jsx(ge,{spacing:.5,children:ae.map(be=>u.jsx(oe,{sx:{fontSize:14,color:"success.main"},noWrap:!0,children:be.label},`${D.id}-credit-${be.key}`))})}}}]:[],{label:B("common.updatedAt"),name:"name",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P],F=D.subscription_id&&D.period_start&&D.period_end?`${B("common.billingPeriod")}: ${ln(D.period_start*1e3,O,"YYYY-MM-DD HH:mm")} ~ ${ln(D.period_end*1e3,O,"YYYY-MM-DD HH:mm")}`:"";return u.jsx(Un,{title:F,arrow:!0,placement:"top-start",children:u.jsx(Se,{onClick:ae=>re(ae,D),sx:is,children:ln(D.created_at,O,v?"YYYY-MM-DD HH:mm":"YYYY-MM-DD HH:mm:ss")})})}}},{label:B("common.status"),name:"status",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P],F=D.billing_reason==="overdraft-protection",{connect:ae}=kf(D,s),be=D.status==="void";return s&&!F?ae?D.paymentMethod?.type==="stripe"?u.jsx(em,{invoice:D,paymentMethod:D.paymentMethod,onSuccess:()=>{R()},children:(Me,Fe)=>u.jsx(pt,{variant:"text",size:"small",sx:{color:"text.link"},disabled:Fe,onClick:Ae=>{Ae.preventDefault(),Ae.stopPropagation(),Me()},children:B(Fe?"payment.checkout.processing":"payment.customer.invoice.pay")})}):u.jsx(pt,{variant:"text",size:"small",onClick:()=>f(D.id),sx:{color:"text.link"},children:B("payment.customer.invoice.pay")}):u.jsx(pt,{component:"a",variant:"text",size:"small",onClick:Me=>re(Me,D),sx:{color:"text.link"},rel:"noreferrer",children:B("payment.customer.invoice.pay")}):u.jsx(Se,{onClick:Me=>re(Me,D),sx:is,children:be?u.jsx(Un,{title:B("payment.customer.invoice.noPaymentRequired"),arrow:!0,placement:"top",children:u.jsx("span",{children:u.jsx(Oi,{label:D.status,color:Vl(D.status)})})}):u.jsx(Oi,{label:D.status,color:Vl(D.status)})})}}}],ne=({page:me,rowsPerPage:P})=>{j.pageSize!==P?w(D=>({...D,pageSize:P,page:1})):j.page!==me+1&&w(D=>({...D,page:me+1}))};return u.jsx(jA,{children:u.jsx(tm,{hasRowLink:!0,durable:`__${N}__`,durableKeys:["page","rowsPerPage","searchText"],data:T.list,columns:Z,options:{count:T.count,page:j.page-1,rowsPerPage:j.pageSize},loading:G,onChange:ne,toolbar:!1,sx:{mt:2},showMobile:!1,mobileTDFlexDirection:"row",emptyNodeText:B("payment.customer.invoice.emptyList")})})}),jA=Zn(Se)`
608
+ `;function kA(){return(window.blocklet?.componentId||"").split("/").pop()===us}function ii(a,r=!1){const o=/^https?:\/\//.test(a),s=r||o;return{url:s?a:Dt(Qn(),a),external:s,path:a}}function fr(a,r,o,s={}){a&&a.preventDefault();const{replace:f=!1,target:m="_self"}=s;if(r.external||m==="_blank"){window.open(r.url,m);return}if(kA()&&o){o(r.path,{replace:f});return}f?window.location.replace(r.url):window.location.href=r.url}const FA=a=>{const r={};return a.forEach(o=>{const s=new Date(o.created_at).toLocaleDateString();r[s]||(r[s]=[]),r[s]?.push(o)}),r},xD=(a={})=>{const r=new URLSearchParams,o={include_quote:!0,...a};return Object.keys(o).forEach(s=>{o[s]&&r.set(s,String(o[s]))}),ot.get(`/api/invoices?${r.toString()}`).then(s=>s.data)},CD=a=>{const r=a.lines||[];for(const o of r){const s=o.metadata?.quote;if(s?.exchange_rate)return s}return null},kf=(a,r)=>{if(a.id.startsWith("in_")){const o=`/customer/invoice/${a.id}${a.status==="uncollectible"&&r?`?action=${r}`:""}`;return{connect:a.status==="uncollectible",link:ii(o)}}return{connect:!1,link:ii(I0(a.paymentMethod,a.metadata?.payment_details).link,!0)}},is={cursor:"pointer"},jA=Ne.memo(a=>{const{pageSize:r,target:o,action:s,onPay:f,status:m,customer_id:c,currency_id:h,subscription_id:g,include_staking:y,include_return_staking:S,include_recovered_from:x,onTableDataChange:A,relatedSubscription:v}=a,N="invoice-table",{t:B,locale:O}=ft(),k=ds(),{getCurrency:K}=_n(),[j,w]=V.useState({pageSize:r||10,page:1}),{loading:G,data:T={list:[],count:0},refresh:R}=Pi(()=>xD({...j,status:m,customer_id:c,currency_id:h,subscription_id:g,include_staking:y,include_return_staking:S,include_recovered_from:x,ignore_zero:!0}),{refreshDeps:[j,m,c,h,g,y,x]}),q=V.useRef(T);V.useEffect(()=>{A&&(A(T,q.current),q.current=T)},[T]);const z=cu("events"),$=Bf(async()=>{rt.close(),rt.success(B("payment.customer.invoice.paySuccess")),await R()},1e3,{leading:!1,trailing:!0,maxWait:5e3});V.useEffect(()=>{z&&c&&z.on("invoice.paid",({response:me})=>{me.customer_id===c&&$()})},[z]);const re=(me,P)=>{const{link:D}=kf(P,s);fr(me,D,k,{target:D.external?"_blank":o})},Q=(me,P)=>{P.subscription_id&&fr(me,ii(`/customer/subscription/${P.subscription_id}`),k)},Z=[{label:B("common.amount"),name:"total",width:80,align:"right",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P],F=D.status==="void",ae=CD(D),Me=(ae?.providers||[]).map(Ue=>Ue.provider_name).filter(Boolean),Fe=Me.length>0?Me.join(", "):ae?.rate_provider_name||ae?.rate_provider_id||"—",Ae=ae?.providers?.map(Ue=>{const b=Ue.provider_name||Ue.provider_id||"—";return Ue.rate?`${b}`:b}).filter(Boolean)||[],ue=ae?.rate_timestamp_ms?SS(ae.rate_timestamp_ms):"—",$e=Il(ae?.exchange_rate||null),Pe=$e?(()=>{const b={USD:"$",CNY:"¥"}[ae?.base_currency];return`1 ${D.paymentCurrency.symbol} ≈ ${b?`${b}${$e}`:`${$e} ${ae?.base_currency||"USD"}`}`})():null;let Xe=null;if(ae?.base_amount)Xe=zi(ae.base_amount,O);else if(ae?.exchange_rate&&D.total){const Ue=If(new ze(D.total),D.paymentCurrency.decimal,ae.exchange_rate);Ue&&(Xe=zi(Ue,O))}const Ze=ae?u.jsxs(ge,{spacing:.5,sx:{p:1},children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",spacing:2,children:[u.jsxs(oe,{variant:"caption",sx:{color:"text.secondary"},children:[B("payment.customer.invoice.quote.providers"),":"]}),u.jsx(oe,{variant:"caption",sx:{color:"text.primary"},children:(Ae.length>0?Ae.join(", "):Fe)||"—"})]}),Pe&&u.jsxs(ge,{direction:"row",justifyContent:"space-between",spacing:2,children:[u.jsxs(oe,{variant:"caption",sx:{color:"text.secondary"},children:[B("payment.customer.invoice.quote.exchangeRate"),":"]}),u.jsx(oe,{variant:"caption",sx:{color:"text.primary"},children:Pe})]}),u.jsxs(ge,{direction:"row",justifyContent:"space-between",spacing:2,children:[u.jsxs(oe,{variant:"caption",sx:{color:"text.secondary"},children:[B("payment.customer.invoice.quote.rateTimestamp"),":"]}),u.jsx(oe,{variant:"caption",sx:{color:"text.primary"},children:ue})]})]}):null;return u.jsx(Se,{onClick:Ue=>re(Ue,D),sx:is,children:u.jsxs(ge,{spacing:.25,alignItems:"flex-end",children:[u.jsxs(oe,{sx:F?{textDecoration:"line-through"}:{},children:[Ca(D.total,D.paymentCurrency.decimal)," ",D.paymentCurrency.symbol]}),(Xe||Pe)&&u.jsx(Un,{title:Ze,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{backgroundColor:"background.paper",boxShadow:1}}},children:u.jsx(ge,{spacing:.25,alignItems:"flex-end",children:Xe&&u.jsxs(oe,{variant:"caption",sx:{color:"text.secondary",fontSize:"0.75rem",fontWeight:400,lineHeight:1.2},children:["≈ $",Xe]})})})]})})}}},{label:B("common.paymentMethod"),name:"paymentMethod",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P];return u.jsxs(oe,{sx:{display:"flex",alignItems:"center",whiteSpace:"nowrap"},onClick:F=>re(F,D),children:[u.jsx(pr,{src:D.paymentMethod.logo,sx:{width:18,height:18,mr:1}}),D.paymentMethod.name]})}}},{label:B("common.type"),name:"billing_reason",options:{customBodyRenderLite:(me,P)=>{const D=T.list[P];return u.jsx(Se,{onClick:F=>re(F,D),sx:is,children:u.jsx(Oi,{label:NS(D,O)?.type})})}}},{label:B("payment.customer.invoice.invoiceNumber"),name:"number",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P];return u.jsx(Se,{onClick:F=>re(F,D),sx:is,children:D?.number})}}},...v?[{label:B("common.purchaseItems"),name:"purchase_items",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P],ae=(D.lines||[]).map(Fe=>{const Ae=Fe.price?.product?.name||Fe.description;if(!Ae)return null;const ue=Number(Fe.quantity||0),$e=Number.isFinite(ue)&&ue>1?`${Ae} x${ue}`:Ae,Pe=Fe.id||Fe.price?.id||Fe.price?.product?.id||Fe.description||Ae;return{key:String(Pe),label:$e}}).filter(Boolean);ae.length===0&&D.subscription?.description&&ae.push({key:`subscription-${D.subscription_id||D.id}`,label:D.subscription.description});const be=!!D.subscription_id,Me=be?{onClick:Fe=>Q(Fe,D)}:{};return ae.length===0?u.jsx(Se,{sx:{color:"text.lighter"},children:u.jsx(oe,{sx:{fontSize:14},children:B("common.none")})}):u.jsx(Se,{...Me,sx:be?{cursor:"pointer"}:void 0,children:u.jsx(ge,{spacing:.5,children:ae.map(Fe=>u.jsx(oe,{sx:{fontSize:14,color:be?"text.link":"text.primary"},noWrap:!0,children:Fe.label},`${D.id}-item-${Fe.key}`))})})}}},{label:B("common.credits"),name:"credits",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P],F=D.lines||[],ae=[];return F.forEach(be=>{const Me=String(be.id||be.price?.id||be.price?.product?.id||be.description||D.id),Fe=(Ue,b)=>{ae.push({key:`${Me}-${Ue}`,label:b})},Ae=be.price?.metadata?.credit_config,ue=Number(Ae?.credit_amount||0);if(ue>0){const Ue=Number(be.quantity||0),b=ue*(Number.isFinite(Ue)&&Ue>0?Ue:1),E=K(Ae?.currency_id)?.symbol||Ae?.currency_id||"Credits";Fe("amount",`+${dr(String(b),E)}`);return}const $e=Ae?.schedule,Pe=Number($e?.amount_per_grant||0);if($e?.enabled&&$e?.delivery_mode==="schedule"&&Pe>0){const Ue=Number(be.quantity||0),b=Pe*(Number.isFinite(Ue)&&Ue>0?Ue:1),E=K(Ae?.currency_id)?.symbol||Ae?.currency_id||"Credits";Fe("schedule",`+${dr(String(b),E)}`);return}const Xe=be.price?.credit,Ze=Number(Xe?.amount||0);if(Ze>0){const Ue=Xe.currency?.symbol||"Credits";Fe("credit",`+${dr(String(Ze),Ue)}`)}}),ae.length===0?"-":u.jsx(ge,{spacing:.5,children:ae.map(be=>u.jsx(oe,{sx:{fontSize:14,color:"success.main"},noWrap:!0,children:be.label},`${D.id}-credit-${be.key}`))})}}}]:[],{label:B("common.updatedAt"),name:"name",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P],F=D.subscription_id&&D.period_start&&D.period_end?`${B("common.billingPeriod")}: ${ln(D.period_start*1e3,O,"YYYY-MM-DD HH:mm")} ~ ${ln(D.period_end*1e3,O,"YYYY-MM-DD HH:mm")}`:"";return u.jsx(Un,{title:F,arrow:!0,placement:"top-start",children:u.jsx(Se,{onClick:ae=>re(ae,D),sx:is,children:ln(D.created_at,O,v?"YYYY-MM-DD HH:mm":"YYYY-MM-DD HH:mm:ss")})})}}},{label:B("common.status"),name:"status",options:{customBodyRenderLite:(me,P)=>{const D=T?.list[P],F=D.billing_reason==="overdraft-protection",{connect:ae}=kf(D,s),be=D.status==="void";return s&&!F?ae?D.paymentMethod?.type==="stripe"?u.jsx(em,{invoice:D,paymentMethod:D.paymentMethod,onSuccess:()=>{R()},children:(Me,Fe)=>u.jsx(pt,{variant:"text",size:"small",sx:{color:"text.link"},disabled:Fe,onClick:Ae=>{Ae.preventDefault(),Ae.stopPropagation(),Me()},children:B(Fe?"payment.checkout.processing":"payment.customer.invoice.pay")})}):u.jsx(pt,{variant:"text",size:"small",onClick:()=>f(D.id),sx:{color:"text.link"},children:B("payment.customer.invoice.pay")}):u.jsx(pt,{component:"a",variant:"text",size:"small",onClick:Me=>re(Me,D),sx:{color:"text.link"},rel:"noreferrer",children:B("payment.customer.invoice.pay")}):u.jsx(Se,{onClick:Me=>re(Me,D),sx:is,children:be?u.jsx(Un,{title:B("payment.customer.invoice.noPaymentRequired"),arrow:!0,placement:"top",children:u.jsx("span",{children:u.jsx(Oi,{label:D.status,color:Vl(D.status)})})}):u.jsx(Oi,{label:D.status,color:Vl(D.status)})})}}}],ne=({page:me,rowsPerPage:P})=>{j.pageSize!==P?w(D=>({...D,pageSize:P,page:1})):j.page!==me+1&&w(D=>({...D,page:me+1}))};return u.jsx(RA,{children:u.jsx(tm,{hasRowLink:!0,durable:`__${N}__`,durableKeys:["page","rowsPerPage","searchText"],data:T.list,columns:Z,options:{count:T.count,page:j.page-1,rowsPerPage:j.pageSize},loading:G,onChange:ne,toolbar:!1,sx:{mt:2},showMobile:!1,mobileTDFlexDirection:"row",emptyNodeText:B("payment.customer.invoice.emptyList")})})}),RA=Zn(Se)`
609
609
  @media (max-width: ${({theme:a})=>a.breakpoints.values.md}px) {
610
610
  .MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > td.MuiTableCell-root {
611
611
  > div {
@@ -618,7 +618,7 @@ function print() { __p += __j.call(arguments, '') }
618
618
  padding-right: 20px;
619
619
  }
620
620
  }
621
- `,RA=Ne.memo(a=>{const{customer_id:r,subscription_id:o,include_recovered_from:s,currency_id:f,include_staking:m,status:c,pageSize:h,target:g,action:y,onPay:S,onTableDataChange:x}=a,A=h||10,v=cu("events"),{t:N,locale:B}=ft(),O=ds(),{data:k,loadMore:K,loadingMore:j,loading:w,reloadAsync:G}=Kx(re=>{const Q=re?Math.ceil(re.list.length/A)+1:1;return xD({page:Q,pageSize:A,status:c,customer_id:r,currency_id:f,subscription_id:o,include_staking:m,include_recovered_from:s,ignore_zero:!0})},{reloadDeps:[r,o,c,m,s]}),T=V.useRef(k);V.useEffect(()=>{x&&(x(k,T.current),T.current=k)},[k]);const R=Bf(async()=>{rt.close(),rt.success(N("payment.customer.invoice.paySuccess")),await G()},1e3,{leading:!1,trailing:!0,maxWait:5e3});if(V.useEffect(()=>{v&&r&&v.on("invoice.paid",({response:re})=>{re.customer_id===r&&R()})},[v]),w||!k)return u.jsx(gr,{});if(k&&k.list.length===0)return k.subscription&&["active","trialing"].includes(k.subscription.status)?u.jsx(oe,{sx:{color:"text.secondary",my:.5},children:N("payment.customer.invoice.next",{date:xS(k.subscription.current_period_end*1e3)})}):u.jsx(oe,{sx:{color:"text.secondary",my:.5},children:N("payment.customer.invoice.empty")});const q=k&&k.list.length<k.count,z=kA(k.list),$=(re,Q)=>{fr(re,Q,O,{target:Q.external?"_blank":g})};return u.jsxs(MA,{direction:"column",gap:1,sx:{mt:1},children:[Object.entries(z).map(([re,Q])=>u.jsxs(Se,{children:[u.jsx(oe,{sx:{fontWeight:"bold",color:"text.secondary",mt:2,mb:1},children:re}),Q.map(Z=>{const{link:ne,connect:me}=kf(Z,y),P=Z.status==="void",D=CD(Z),F=Il(D?.exchange_rate||null),ae=F?`1 ${Z.paymentCurrency.symbol} ≈ ${F} ${D?.base_currency||"USD"}`:null;return u.jsxs(ge,{direction:"row",sx:{gap:{xs:.5,sm:1.5,md:3},alignItems:"center",flexWrap:"nowrap",my:1},children:[u.jsx(Se,{sx:{flex:2},children:u.jsx("a",{href:ne.url,target:ne.external?"_blank":g,rel:"noreferrer",onClick:be=>$(be,ne),children:u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center"},children:[u.jsx(oe,{component:"span",children:Z.number}),ne.external&&u.jsx(y0,{fontSize:"small",sx:{color:"text.secondary",display:{xs:"none",md:"inline-flex"}}})]})})}),u.jsxs(Se,{sx:{flex:1,textAlign:"right"},children:[u.jsxs(oe,{sx:P?{textDecoration:"line-through"}:{},children:[Ca(Z.total,Z.paymentCurrency.decimal)," ",Z.paymentCurrency.symbol]}),ae&&u.jsx(oe,{variant:"caption",sx:{color:"text.secondary",display:"block"},children:ae})]}),u.jsx(Un,{title:Z.subscription_id&&Z.period_start&&Z.period_end?`${N("common.billingPeriod")}: ${ln(Z.period_start*1e3,B,"YYYY-MM-DD HH:mm")} ~ ${ln(Z.period_end*1e3,B,"YYYY-MM-DD HH:mm")}`:"",arrow:!0,placement:"top-start",children:u.jsx(Se,{sx:{flex:1,textAlign:"right"},children:u.jsx(oe,{children:ln(Z.created_at,B,"HH:mm:ss")})})}),!y&&u.jsx(Se,{className:"invoice-description",sx:{flex:2,textAlign:"right",display:{xs:"none",lg:"inline-flex"}},children:u.jsx(oe,{children:Z.description||Z.id})}),u.jsx(Se,{sx:{flex:1,textAlign:"right"},children:y?me?Z.paymentMethod?.type==="stripe"?u.jsx(em,{invoice:Z,paymentMethod:Z.paymentMethod,onSuccess:async()=>{await G()},children:(be,Me)=>u.jsx(pt,{variant:"contained",color:"primary",size:"small",sx:{whiteSpace:"nowrap"},disabled:Me,onClick:Fe=>{Fe.preventDefault(),Fe.stopPropagation(),be()},children:N(Me?"payment.checkout.processing":"payment.customer.invoice.pay")})}):u.jsx(pt,{variant:"contained",color:"primary",size:"small",onClick:()=>S(Z.id),sx:{whiteSpace:"nowrap"},children:N("payment.customer.invoice.pay")}):u.jsx(pt,{component:"a",variant:"contained",size:"small",onClick:be=>$(be,ne),sx:{whiteSpace:"nowrap"},rel:"noreferrer",children:N("payment.customer.invoice.pay")}):P?u.jsx(Un,{title:N("payment.customer.invoice.noPaymentRequired"),arrow:!0,placement:"top",children:u.jsx("span",{children:u.jsx(Oi,{label:Z.status,color:Vl(Z.status)})})}):u.jsx(Oi,{label:Z.status,color:Vl(Z.status)})})]},Z.id)})]},re)),u.jsxs(Se,{children:[q&&u.jsx(pt,{variant:"text",type:"button",color:"inherit",onClick:K,disabled:j,children:j?N("common.loadingMore",{resource:N("payment.customer.invoices")}):N("common.loadMore",{resource:N("payment.customer.invoices")})}),!q&&k.count>A&&u.jsx(oe,{sx:{color:"text.secondary"},children:N("common.noMore",{resource:N("payment.customer.invoices")})})]})]})});function Fw(a){const r=Object.assign({customer_id:"",subscription_id:"",currency_id:"",include_staking:!1,include_recovered_from:!1,status:"open,paid,uncollectible",pageSize:10,target:"_self",action:"",type:"list",onTableDataChange:()=>{},relatedSubscription:!1},a),{action:o,type:s}=r,{t:f,locale:m}=ft(),{connect:c}=_n(),[h,g]=ni({paying:""}),y=S=>{h.paying||(g({paying:S}),c.open({action:"collect",saveConnect:!1,locale:m,useSocket:Lf()===!1,messages:{scan:"",title:f(`payment.customer.invoice.${o||"pay"}`),success:f(`payment.customer.invoice.${o||"pay"}Success`),error:f(`payment.customer.invoice.${o||"pay"}Error`),confirm:""},extraParams:{invoiceId:S,action:o},onSuccess:()=>{c.close(),g({paying:""})},onClose:()=>{c.close(),g({paying:""})},onError:x=>{g({paying:""}),rt.error(Pt(x))}}))};return s==="table"?u.jsx(FA,{...r,onPay:y}):u.jsx(RA,{...r,onPay:y})}const MA=Zn(ge)`
621
+ `,MA=Ne.memo(a=>{const{customer_id:r,subscription_id:o,include_recovered_from:s,currency_id:f,include_staking:m,status:c,pageSize:h,target:g,action:y,onPay:S,onTableDataChange:x}=a,A=h||10,v=cu("events"),{t:N,locale:B}=ft(),O=ds(),{data:k,loadMore:K,loadingMore:j,loading:w,reloadAsync:G}=Qx(re=>{const Q=re?Math.ceil(re.list.length/A)+1:1;return xD({page:Q,pageSize:A,status:c,customer_id:r,currency_id:f,subscription_id:o,include_staking:m,include_recovered_from:s,ignore_zero:!0})},{reloadDeps:[r,o,c,m,s]}),T=V.useRef(k);V.useEffect(()=>{x&&(x(k,T.current),T.current=k)},[k]);const R=Bf(async()=>{rt.close(),rt.success(N("payment.customer.invoice.paySuccess")),await G()},1e3,{leading:!1,trailing:!0,maxWait:5e3});if(V.useEffect(()=>{v&&r&&v.on("invoice.paid",({response:re})=>{re.customer_id===r&&R()})},[v]),w||!k)return u.jsx(gr,{});if(k&&k.list.length===0)return k.subscription&&["active","trialing"].includes(k.subscription.status)?u.jsx(oe,{sx:{color:"text.secondary",my:.5},children:N("payment.customer.invoice.next",{date:CS(k.subscription.current_period_end*1e3)})}):u.jsx(oe,{sx:{color:"text.secondary",my:.5},children:N("payment.customer.invoice.empty")});const q=k&&k.list.length<k.count,z=FA(k.list),$=(re,Q)=>{fr(re,Q,O,{target:Q.external?"_blank":g})};return u.jsxs(NA,{direction:"column",gap:1,sx:{mt:1},children:[Object.entries(z).map(([re,Q])=>u.jsxs(Se,{children:[u.jsx(oe,{sx:{fontWeight:"bold",color:"text.secondary",mt:2,mb:1},children:re}),Q.map(Z=>{const{link:ne,connect:me}=kf(Z,y),P=Z.status==="void",D=CD(Z),F=Il(D?.exchange_rate||null),ae=F?`1 ${Z.paymentCurrency.symbol} ≈ ${F} ${D?.base_currency||"USD"}`:null;return u.jsxs(ge,{direction:"row",sx:{gap:{xs:.5,sm:1.5,md:3},alignItems:"center",flexWrap:"nowrap",my:1},children:[u.jsx(Se,{sx:{flex:2},children:u.jsx("a",{href:ne.url,target:ne.external?"_blank":g,rel:"noreferrer",onClick:be=>$(be,ne),children:u.jsxs(ge,{direction:"row",spacing:.5,sx:{alignItems:"center"},children:[u.jsx(oe,{component:"span",children:Z.number}),ne.external&&u.jsx(y0,{fontSize:"small",sx:{color:"text.secondary",display:{xs:"none",md:"inline-flex"}}})]})})}),u.jsxs(Se,{sx:{flex:1,textAlign:"right"},children:[u.jsxs(oe,{sx:P?{textDecoration:"line-through"}:{},children:[Ca(Z.total,Z.paymentCurrency.decimal)," ",Z.paymentCurrency.symbol]}),ae&&u.jsx(oe,{variant:"caption",sx:{color:"text.secondary",display:"block"},children:ae})]}),u.jsx(Un,{title:Z.subscription_id&&Z.period_start&&Z.period_end?`${N("common.billingPeriod")}: ${ln(Z.period_start*1e3,B,"YYYY-MM-DD HH:mm")} ~ ${ln(Z.period_end*1e3,B,"YYYY-MM-DD HH:mm")}`:"",arrow:!0,placement:"top-start",children:u.jsx(Se,{sx:{flex:1,textAlign:"right"},children:u.jsx(oe,{children:ln(Z.created_at,B,"HH:mm:ss")})})}),!y&&u.jsx(Se,{className:"invoice-description",sx:{flex:2,textAlign:"right",display:{xs:"none",lg:"inline-flex"}},children:u.jsx(oe,{children:Z.description||Z.id})}),u.jsx(Se,{sx:{flex:1,textAlign:"right"},children:y?me?Z.paymentMethod?.type==="stripe"?u.jsx(em,{invoice:Z,paymentMethod:Z.paymentMethod,onSuccess:async()=>{await G()},children:(be,Me)=>u.jsx(pt,{variant:"contained",color:"primary",size:"small",sx:{whiteSpace:"nowrap"},disabled:Me,onClick:Fe=>{Fe.preventDefault(),Fe.stopPropagation(),be()},children:N(Me?"payment.checkout.processing":"payment.customer.invoice.pay")})}):u.jsx(pt,{variant:"contained",color:"primary",size:"small",onClick:()=>S(Z.id),sx:{whiteSpace:"nowrap"},children:N("payment.customer.invoice.pay")}):u.jsx(pt,{component:"a",variant:"contained",size:"small",onClick:be=>$(be,ne),sx:{whiteSpace:"nowrap"},rel:"noreferrer",children:N("payment.customer.invoice.pay")}):P?u.jsx(Un,{title:N("payment.customer.invoice.noPaymentRequired"),arrow:!0,placement:"top",children:u.jsx("span",{children:u.jsx(Oi,{label:Z.status,color:Vl(Z.status)})})}):u.jsx(Oi,{label:Z.status,color:Vl(Z.status)})})]},Z.id)})]},re)),u.jsxs(Se,{children:[q&&u.jsx(pt,{variant:"text",type:"button",color:"inherit",onClick:K,disabled:j,children:j?N("common.loadingMore",{resource:N("payment.customer.invoices")}):N("common.loadMore",{resource:N("payment.customer.invoices")})}),!q&&k.count>A&&u.jsx(oe,{sx:{color:"text.secondary"},children:N("common.noMore",{resource:N("payment.customer.invoices")})})]})]})});function jw(a){const r=Object.assign({customer_id:"",subscription_id:"",currency_id:"",include_staking:!1,include_recovered_from:!1,status:"open,paid,uncollectible",pageSize:10,target:"_self",action:"",type:"list",onTableDataChange:()=>{},relatedSubscription:!1},a),{action:o,type:s}=r,{t:f,locale:m}=ft(),{connect:c}=_n(),[h,g]=ni({paying:""}),y=S=>{h.paying||(g({paying:S}),c.open({action:"collect",saveConnect:!1,locale:m,useSocket:Lf()===!1,messages:{scan:"",title:f(`payment.customer.invoice.${o||"pay"}`),success:f(`payment.customer.invoice.${o||"pay"}Success`),error:f(`payment.customer.invoice.${o||"pay"}Error`),confirm:""},extraParams:{invoiceId:S,action:o},onSuccess:()=>{c.close(),g({paying:""})},onClose:()=>{c.close(),g({paying:""})},onError:x=>{g({paying:""}),rt.error(Pt(x))}}))};return s==="table"?u.jsx(jA,{...r,onPay:y}):u.jsx(MA,{...r,onPay:y})}const NA=Zn(ge)`
622
622
  @media (max-width: ${({theme:a})=>a.breakpoints.values.md}px) {
623
623
  svg.MuiSvgIcon-root {
624
624
  display: none !important;
@@ -628,7 +628,7 @@ function print() { __p += __j.call(arguments, '') }
628
628
  a.MuiButton-root {
629
629
  text-decoration: none !important;
630
630
  }
631
- `,NA=(a={})=>{const r=new URLSearchParams;return Object.keys(a).forEach(o=>{a[o]&&r.set(o,String(a[o]))}),ot.get(`/api/credit-grants?${r.toString()}`).then(o=>o.data)};function BA({status:a,label:r}){const o=s=>{switch(s){case"granted":return"success";case"pending":return"warning";case"expired":return"default";case"depleted":return"default";case"voided":return"default";default:return"default"}};return u.jsx(Xl,{label:r||a,size:"small",color:o(a)})}const UA=(a,r)=>{let o=`/customer/credit-grant/${a.id}`;return r&&(o=`/admin/customers/${a.id}`),{link:ii(o),connect:!1}},OA=Ne.memo(a=>{const{pageSize:r,status:o="",customer_id:s,subscription_id:f,onTableDataChange:m}=a,c="credit-grants-table",{t:h,locale:g}=ft(),{session:y}=_n(),S=ds(),x=["owner","admin"].includes(y?.user?.role||""),A=a.mode==="dashboard"&&x,v=s||y?.user?.did,[N,B]=V.useState({pageSize:r||10,page:1}),{loading:O,data:k={list:[],count:0}}=Pi(()=>NA({...N,status:o,customer_id:v,subscription_id:f}),{refreshDeps:[N,o,v,f]}),K=V.useRef(k),j=(T,R)=>{const{link:q}=UA(R,A);fr(T,q,S,{target:q.external?"_blank":"_self"})};V.useEffect(()=>{m&&(m(k,K.current),K.current=k)},[k]);const w=[{label:h("common.name"),name:"name",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R];return u.jsx(Se,{onClick:z=>j(z,q),children:q.name||q.id})}}},{label:h("common.status"),name:"status",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R];return u.jsx(Se,{onClick:z=>j(z,q),children:u.jsx(BA,{status:q.status,label:h(`admin.customer.creditGrants.status.${q.status}`)})})}}},{label:h("common.remainingCredit"),name:"remaining_amount",align:"right",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R];return u.jsx(Se,{onClick:z=>j(z,q),children:u.jsx(oe,{variant:"body2",children:dr(Ui(q.remaining_amount,q.paymentCurrency.decimal),q.paymentCurrency.symbol)})})}}},{label:h("common.scope"),name:"scope",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R];let z="general";return q.applicability_config?.scope?.prices&&(z="specific"),u.jsx(Se,{onClick:$=>j($,q),children:h(z==="specific"?"common.specific":"common.general")})}}},{label:h("common.effectiveDate"),name:"effective_at",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R],z=q.effective_at?q.effective_at*1e3:q.created_at;return u.jsx(Se,{onClick:$=>j($,q),children:ln(z,g,"YYYY-MM-DD HH:mm")})}}},{label:h("common.expirationDate"),name:"expires_at",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R];return u.jsx(Se,{onClick:z=>j(z,q),children:u.jsx(oe,{variant:"body2",children:q.expires_at?ln(q.expires_at*1e3,g,"YYYY-MM-DD HH:mm"):"-"})})}}}],G=({page:T,rowsPerPage:R})=>{N.pageSize!==R?B(q=>({...q,pageSize:R,page:1})):N.page!==T+1&&B(q=>({...q,page:T+1}))};return u.jsx(zA,{children:u.jsx(tm,{hasRowLink:!0,durable:`__${c}__`,durableKeys:["page","rowsPerPage","searchText"],data:k.list,columns:w,options:{count:k.count,page:N.page-1,rowsPerPage:N.pageSize},loading:O,onChange:G,toolbar:!1,sx:{mt:2},showMobile:!1,mobileTDFlexDirection:"row",emptyNodeText:h("admin.creditGrants.noGrants")})})}),zA=Zn(Se)`
631
+ `,BA=(a={})=>{const r=new URLSearchParams;return Object.keys(a).forEach(o=>{a[o]&&r.set(o,String(a[o]))}),ot.get(`/api/credit-grants?${r.toString()}`).then(o=>o.data)};function UA({status:a,label:r}){const o=s=>{switch(s){case"granted":return"success";case"pending":return"warning";case"expired":return"default";case"depleted":return"default";case"voided":return"default";default:return"default"}};return u.jsx(Xl,{label:r||a,size:"small",color:o(a)})}const OA=(a,r)=>{let o=`/customer/credit-grant/${a.id}`;return r&&(o=`/admin/customers/${a.id}`),{link:ii(o),connect:!1}},zA=Ne.memo(a=>{const{pageSize:r,status:o="",customer_id:s,subscription_id:f,onTableDataChange:m}=a,c="credit-grants-table",{t:h,locale:g}=ft(),{session:y}=_n(),S=ds(),x=["owner","admin"].includes(y?.user?.role||""),A=a.mode==="dashboard"&&x,v=s||y?.user?.did,[N,B]=V.useState({pageSize:r||10,page:1}),{loading:O,data:k={list:[],count:0}}=Pi(()=>BA({...N,status:o,customer_id:v,subscription_id:f}),{refreshDeps:[N,o,v,f]}),K=V.useRef(k),j=(T,R)=>{const{link:q}=OA(R,A);fr(T,q,S,{target:q.external?"_blank":"_self"})};V.useEffect(()=>{m&&(m(k,K.current),K.current=k)},[k]);const w=[{label:h("common.name"),name:"name",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R];return u.jsx(Se,{onClick:z=>j(z,q),children:q.name||q.id})}}},{label:h("common.status"),name:"status",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R];return u.jsx(Se,{onClick:z=>j(z,q),children:u.jsx(UA,{status:q.status,label:h(`admin.customer.creditGrants.status.${q.status}`)})})}}},{label:h("common.remainingCredit"),name:"remaining_amount",align:"right",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R];return u.jsx(Se,{onClick:z=>j(z,q),children:u.jsx(oe,{variant:"body2",children:dr(Ui(q.remaining_amount,q.paymentCurrency.decimal),q.paymentCurrency.symbol)})})}}},{label:h("common.scope"),name:"scope",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R];let z="general";return q.applicability_config?.scope?.prices&&(z="specific"),u.jsx(Se,{onClick:$=>j($,q),children:h(z==="specific"?"common.specific":"common.general")})}}},{label:h("common.effectiveDate"),name:"effective_at",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R],z=q.effective_at?q.effective_at*1e3:q.created_at;return u.jsx(Se,{onClick:$=>j($,q),children:ln(z,g,"YYYY-MM-DD HH:mm")})}}},{label:h("common.expirationDate"),name:"expires_at",options:{customBodyRenderLite:(T,R)=>{const q=k?.list[R];return u.jsx(Se,{onClick:z=>j(z,q),children:u.jsx(oe,{variant:"body2",children:q.expires_at?ln(q.expires_at*1e3,g,"YYYY-MM-DD HH:mm"):"-"})})}}}],G=({page:T,rowsPerPage:R})=>{N.pageSize!==R?B(q=>({...q,pageSize:R,page:1})):N.page!==T+1&&B(q=>({...q,page:T+1}))};return u.jsx(PA,{children:u.jsx(tm,{hasRowLink:!0,durable:`__${c}__`,durableKeys:["page","rowsPerPage","searchText"],data:k.list,columns:w,options:{count:k.count,page:N.page-1,rowsPerPage:N.pageSize},loading:O,onChange:G,toolbar:!1,sx:{mt:2},showMobile:!1,mobileTDFlexDirection:"row",emptyNodeText:h("admin.creditGrants.noGrants")})})}),PA=Zn(Se)`
632
632
  @media (max-width: ${({theme:a})=>a.breakpoints.values.md}px) {
633
633
  .MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > td.MuiTableCell-root {
634
634
  > div {
@@ -641,7 +641,7 @@ function print() { __p += __j.call(arguments, '') }
641
641
  padding-right: 20px;
642
642
  }
643
643
  }
644
- `;function jw(a){const r=Object.assign({customer_id:"",subscription_id:"",status:"granted,pending,depleted,expired",pageSize:10,onTableDataChange:()=>{}},a);return u.jsx(OA,{...r})}function PA({tempValue:a,setTempValue:r,handleCancel:o,handleApply:s,handleClear:f}){const{t:m}=ft();return u.jsx(Se,{sx:{p:2,minWidth:320},children:u.jsxs(ge,{spacing:2,children:[u.jsxs(Se,{children:[u.jsx(Nn,{children:m("common.startDate")}),u.jsx(Yn,{type:"date",value:a.startDate,onChange:c=>r(h=>({...h,startDate:c.target.value})),size:"small",fullWidth:!0,slotProps:{inputLabel:{shrink:!0}}})]}),u.jsxs(Se,{children:[u.jsx(Nn,{children:m("common.endDate")}),u.jsx(Yn,{type:"date",value:a.endDate,onChange:c=>r(h=>({...h,endDate:c.target.value})),size:"small",fullWidth:!0,slotProps:{inputLabel:{shrink:!0}}})]}),u.jsxs(ge,{direction:"row",spacing:1,sx:{justifyContent:"space-between"},children:[u.jsx(pt,{variant:"text",onClick:f,size:"small",color:"secondary",sx:{px:.5,minWidth:0},children:m("common.clear")}),u.jsxs(ge,{direction:"row",spacing:1,children:[u.jsx(pt,{variant:"outlined",onClick:o,size:"small",children:m("common.cancel")}),u.jsx(pt,{variant:"contained",onClick:s,size:"small",children:m("common.confirm")})]})]})]})})}const Ri="YYYY-MM-DD";function qA({value:a,onChange:r,label:o="",size:s="small",fullWidth:f=!1,disabled:m=!1}){const c=cs(),h=jf(c.breakpoints.down("sm")),[g,y]=V.useState(!1),{t:S,locale:x}=ft(),[A,v]=V.useState({startDate:a.start?ln(a.start*1e3,x,Ri):"",endDate:a.end?ln(a.end*1e3,x,Ri):""}),N=V.useRef(null),B=(T,R)=>{if(!T||!R)return S("common.selectTimeRange");const q=ln(T*1e3,x,Ri),z=ln(R*1e3,x,Ri);return`${q} ~ ${z}`},O=()=>{m||(v({startDate:a.start?ln(a.start*1e3,x,Ri):"",endDate:a.end?ln(a.end*1e3,x,Ri):""}),y(!0))},k=()=>{y(!1)},K=()=>{const T={start:A.startDate?Math.floor(new Date(`${A.startDate}T00:00:00`).getTime()/1e3):0,end:A.endDate?Math.floor(new Date(`${A.endDate}T23:59:59`).getTime()/1e3):0};r(T),y(!1)},j=()=>{v({startDate:a.start?ln(a.start*1e3,x,Ri):"",endDate:a.end?ln(a.end*1e3,x,Ri):""}),y(!1)},w=()=>{r({start:void 0,end:void 0}),v({startDate:"",endDate:""}),y(!1)},G=!!a.start&&!!a.end;return u.jsxs(u.Fragment,{children:[u.jsx(Yn,{ref:N,label:o,value:B(a.start,a.end),size:s,fullWidth:f,disabled:m,sx:{"& .MuiInputBase-input":{cursor:m?"default":"pointer"}},onClick:O,placeholder:S("common.selectTimeRange"),slotProps:{input:{readOnly:!0,startAdornment:u.jsx(sx,{fontSize:"small",sx:{mr:1,color:"text.secondary"}}),endAdornment:G&&!m&&u.jsx(ei,{size:"small",onClick:T=>{T.stopPropagation(),w()},sx:{color:"text.secondary","&:hover":{color:"text.primary"}},children:u.jsx(mf,{fontSize:"small"})})},inputLabel:{shrink:!0}}}),!h&&u.jsx(lx,{open:g,anchorEl:N.current,onClose:k,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{"& .MuiPaper-root":{boxShadow:c.shadows[8],border:`1px solid ${c.palette.divider}`}},children:u.jsx(PA,{tempValue:A,setTempValue:v,handleCancel:j,handleApply:K,handleClear:w})}),h&&u.jsxs(lo,{open:g,onClose:k,fullWidth:!0,maxWidth:"sm",PaperProps:{sx:{m:1,maxHeight:"calc(100% - 64px)"}},children:[u.jsxs(Zl,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pb:1},children:[u.jsx(oe,{variant:"h6",children:S("common.selectTimeRange")}),u.jsx(ei,{edge:"end",color:"inherit",onClick:k,"aria-label":"close",size:"small",children:u.jsx(m0,{})})]}),u.jsx(uo,{sx:{pb:1},children:u.jsxs(ge,{spacing:2,sx:{mt:1},children:[u.jsx(Nn,{children:S("common.startDate")}),u.jsx(Yn,{type:"date",value:A.startDate,onChange:T=>v(R=>({...R,startDate:T.target.value})),size:"small",fullWidth:!0,slotProps:{inputLabel:{shrink:!0}}}),u.jsx(Nn,{children:S("common.endDate")}),u.jsx(Yn,{type:"date",value:A.endDate,onChange:T=>v(R=>({...R,endDate:T.target.value})),size:"small",fullWidth:!0,slotProps:{inputLabel:{shrink:!0}}})]})}),u.jsxs(o0,{sx:{px:3,pb:2},children:[u.jsx(pt,{onClick:j,color:"inherit",children:S("common.cancel")}),u.jsx(pt,{onClick:K,variant:"contained",children:S("common.confirm")})]})]})]})}const LA=(a={})=>{const r=new URLSearchParams;return Object.keys(a).forEach(o=>{a[o]&&r.set(o,String(a[o]))}),ot.get(`/api/credit-transactions?${r.toString()}`).then(o=>o.data)},IA=(a,r)=>{let o=`/customer/credit-grant/${a}`;return r&&(o=`/admin/customers/${a}`),{link:ii(o),connect:!1}},SD=(a,r)=>{let o=`/customer/invoice/${a}`;return r&&(o=`/admin/billing/${a}`),{link:ii(o),connect:!1}},$A=(a,r)=>{let o=`/customer/subscription/${a}`;return r&&(o=`/admin/billing/${a}`),{link:ii(o),connect:!1}},VA=a=>{const r=`/customer/credit-transaction/${a}`;return{link:ii(r),connect:!1}},HA=a=>{const r=`/admin/billing/${a}`;return{link:ii(r),connect:!1}},YA=a=>a.metadata?.subscription_id||a.subscription_id||a.invoice?.subscription_id,_D=a=>a.metadata?.invoice_id||a.invoice?.id,GA=a=>a.source||a.metadata?.meter_event_id,Ff=a=>{const r=a.activity_type==="grant",o=r&&a.metadata?.delivery_mode==="schedule",s=r&&a.status==="depleted",f=r&&(a.status==="expired"||a.status==="voided");return{isGrant:r,isScheduled:o,isDepleted:s,isExpired:f,isInactive:s||f}},KA=(a,r)=>{if(a.activity_type==="grant"){const s=_D(a);return s?SD(s,r):IA(a.id,r)}if(!r)return VA(a.id);const o=GA(a);return o?HA(o):null},QA=(a,r)=>{const{isGrant:o,isScheduled:s,isInactive:f}=Ff(a),m=o&&a.category==="paid"&&(!s||a.metadata?.schedule_seq===1);if(!o){const c=a.metadata?.is_repayment?r("common.creditActivity.repayment"):a.description||"";return{isGrant:o,isInactive:f,activityType:r("common.creditActivity.consumption"),secondLine:c}}if(m){let c=a.description||"";if(a.invoice?.total&&a.invoice?.paymentCurrency){const h=a.invoice.paymentCurrency,g=dr(Ui(a.invoice.total,h.decimal||0),h.symbol||"");c=r("common.creditActivity.paidAmount",{amount:g})}return{isGrant:o,isInactive:f,activityType:r("common.creditActivity.paidGrant"),secondLine:c}}return s?{isGrant:o,isInactive:f,activityType:r("common.creditActivity.resetGrant"),secondLine:a.description||""}:{isGrant:o,isInactive:f,activityType:r("common.creditActivity.promotionalGrant"),secondLine:a.description||""}},ZA=Ne.memo(a=>{const{pageSize:r,customer_id:o,subscription_id:s,credit_grant_id:f,onTableDataChange:m,showAdminColumns:c=!1,showTimeFilter:h=!1,includeGrants:g=!1,source:y,mode:S="portal"}=a,x="credit-transactions-table",{t:A,locale:v}=ft(),{session:N}=_n(),B=["owner","admin"].includes(N?.user?.role||""),O=B&&S==="dashboard",k=ds(),K=o||N?.user?.did,[j,w]=V.useState({pageSize:r||10,page:1}),[G,T]=V.useState({start:void 0,end:void 0}),R=D=>{T(D),w(F=>({...F,page:1,start:D.start||void 0,end:D.end||void 0}))},{loading:q,data:z={list:[],count:0}}=Pi(()=>LA({...j,customer_id:K,subscription_id:s,credit_grant_id:f,source:y,include_grants:g}),{refreshDeps:[j,K,s,f,y,g]});V.useEffect(()=>{h&&!j.start&&!j.end&&w(D=>({...D,page:1,start:G.start||void 0,end:G.end||void 0}))},[h,j.start,j.end,G.start,G.end]);const $=V.useRef(z);V.useEffect(()=>{m&&(m(z,$.current),$.current=z)},[z]);const re=(D,F)=>{const ae=KA(F,O);ae&&fr(D,ae.link,k,{target:ae.link.external?"_blank":"_self"})},Q=(D,F)=>{D.preventDefault();const ae=$A(F,O);fr(D,ae.link,k)},Z=(D,F)=>{D.preventDefault();const ae=SD(F,O);fr(D,ae.link,k)},ne=(D,F)=>u.jsx(pt,{variant:"text",size:"small",color:"primary",sx:{whiteSpace:"nowrap"},onClick:F,children:D}),me=[{label:A("common.date"),name:"created_at",options:{setCellProps:()=>({style:{width:"25%"}}),customBodyRenderLite:(D,F)=>{const ae=z?.list[F];return u.jsx(Se,{onClick:be=>re(be,ae),children:u.jsx(oe,{variant:"body2",sx:{fontSize:"0.875rem"},children:ln(ae.created_at,v,"YYYY-MM-DD HH:mm")})})}}},{label:A("common.description"),name:"description",options:{setCellProps:()=>({style:{width:"25%"}}),customBodyRenderLite:(D,F)=>{const ae=z?.list[F],{activityType:be,secondLine:Me,isInactive:Fe,isGrant:Ae}=QA(ae,A);return u.jsx(Se,{onClick:ue=>re(ue,ae),sx:{cursor:"pointer"},children:u.jsxs(ge,{direction:"column",spacing:.25,children:[u.jsx(oe,{variant:"body2",sx:{color:Fe?"text.secondary":Ae?"success.main":"error.main"},children:be}),Me&&u.jsx(oe,{variant:"caption",sx:{color:"text.secondary"},children:Me})]})})}}},{label:A("common.amount"),name:"credit_amount",align:"right",options:{setCellProps:()=>({style:{width:"20%"}}),customHeadLabelRender:()=>u.jsx(Se,{sx:{pr:5},children:A("common.amount")}),customBodyRenderLite:(D,F)=>{const ae=z?.list[F],{isGrant:be,isDepleted:Me,isExpired:Fe,isInactive:Ae}=Ff(ae),ue=be?ae.amount:ae.credit_amount,$e=ae.paymentCurrency||ae.currency,Pe=!be&&ae.meter?.unit?ae.meter.unit:$e?.symbol,Xe=dr(Ui(ue,$e?.decimal||0),Pe);return g?u.jsx(Se,{onClick:Ze=>re(Ze,ae),sx:{pr:5},children:u.jsxs(ge,{direction:"column",spacing:.25,alignItems:"flex-end",children:[u.jsxs(oe,{sx:{fontWeight:500,color:Ae?"text.secondary":be?"success.main":"error.main",whiteSpace:"nowrap"},children:[be?"+":"-"," ",Xe]}),Me?u.jsx(oe,{variant:"caption",sx:{color:"text.secondary"},children:A("common.consumed")}):Fe?u.jsx(oe,{variant:"caption",sx:{color:"text.secondary"},children:A("common.expired")}):null]})}):u.jsx(Se,{onClick:Ze=>re(Ze,ae),sx:{pr:5},children:u.jsx(oe,{children:Xe})})}}},...c&&B?[{label:A("common.meterEvent"),name:"meter_event",options:{customBodyRenderLite:(D,F)=>{const ae=z?.list[F];return ae.meter?u.jsx(cr,{href:Dt(Qn(),`/admin/billing/${ae.meter.id}`),children:u.jsx(oe,{variant:"body2",sx:{color:"text.link"},children:ae.meter.event_name})}):u.jsx(oe,{variant:"body2",children:"-"})}}}]:[],{label:A("common.actions"),name:"actions",options:{setCellProps:()=>({style:{width:"25%"}}),customBodyRenderLite:(D,F)=>{const ae=z?.list[F],{isGrant:be,isScheduled:Me}=Ff(ae),Fe=be&&ae.category==="paid"&&!Me,Ae=YA(ae),ue=be?_D(ae):null,$e=!!Ae&&(!be||Me||Fe);return u.jsxs(Se,{sx:{display:"flex",gap:1,alignItems:"center",flexWrap:"nowrap"},children:[$e&&Ae?ne(A("common.viewSubscription"),Pe=>Q(Pe,Ae)):null,Fe&&ue?ne(A("common.viewInvoice"),Pe=>Z(Pe,ue)):null]})}}}].filter(Boolean),P=({page:D,rowsPerPage:F})=>{j.pageSize!==F?w(ae=>({...ae,pageSize:F,page:1})):j.page!==D+1&&w(ae=>({...ae,page:D+1}))};return u.jsxs(XA,{children:[h&&u.jsx(Se,{sx:{my:2},children:u.jsx(Se,{sx:{mt:2},children:u.jsx(ss,{container:!0,spacing:2,sx:{alignItems:"center"},children:u.jsx(ss,{size:{xs:12,sm:6,md:4},children:u.jsx(qA,{value:G,onChange:R,size:"small",fullWidth:!0})})})})}),u.jsx(tm,{hasRowLink:!0,durable:`__${x}__`,durableKeys:["page","rowsPerPage"],data:z.list,columns:me,options:{count:z.count,page:j.page-1,rowsPerPage:j.pageSize},loading:q,onChange:P,toolbar:!1,sx:{mt:2},showMobile:!1,mobileTDFlexDirection:"row",emptyNodeText:A("admin.creditTransactions.noTransactions")})]})}),XA=Zn(Se)`
644
+ `;function Rw(a){const r=Object.assign({customer_id:"",subscription_id:"",status:"granted,pending,depleted,expired",pageSize:10,onTableDataChange:()=>{}},a);return u.jsx(zA,{...r})}function qA({tempValue:a,setTempValue:r,handleCancel:o,handleApply:s,handleClear:f}){const{t:m}=ft();return u.jsx(Se,{sx:{p:2,minWidth:320},children:u.jsxs(ge,{spacing:2,children:[u.jsxs(Se,{children:[u.jsx(Nn,{children:m("common.startDate")}),u.jsx(Yn,{type:"date",value:a.startDate,onChange:c=>r(h=>({...h,startDate:c.target.value})),size:"small",fullWidth:!0,slotProps:{inputLabel:{shrink:!0}}})]}),u.jsxs(Se,{children:[u.jsx(Nn,{children:m("common.endDate")}),u.jsx(Yn,{type:"date",value:a.endDate,onChange:c=>r(h=>({...h,endDate:c.target.value})),size:"small",fullWidth:!0,slotProps:{inputLabel:{shrink:!0}}})]}),u.jsxs(ge,{direction:"row",spacing:1,sx:{justifyContent:"space-between"},children:[u.jsx(pt,{variant:"text",onClick:f,size:"small",color:"secondary",sx:{px:.5,minWidth:0},children:m("common.clear")}),u.jsxs(ge,{direction:"row",spacing:1,children:[u.jsx(pt,{variant:"outlined",onClick:o,size:"small",children:m("common.cancel")}),u.jsx(pt,{variant:"contained",onClick:s,size:"small",children:m("common.confirm")})]})]})]})})}const Ri="YYYY-MM-DD";function LA({value:a,onChange:r,label:o="",size:s="small",fullWidth:f=!1,disabled:m=!1}){const c=cs(),h=jf(c.breakpoints.down("sm")),[g,y]=V.useState(!1),{t:S,locale:x}=ft(),[A,v]=V.useState({startDate:a.start?ln(a.start*1e3,x,Ri):"",endDate:a.end?ln(a.end*1e3,x,Ri):""}),N=V.useRef(null),B=(T,R)=>{if(!T||!R)return S("common.selectTimeRange");const q=ln(T*1e3,x,Ri),z=ln(R*1e3,x,Ri);return`${q} ~ ${z}`},O=()=>{m||(v({startDate:a.start?ln(a.start*1e3,x,Ri):"",endDate:a.end?ln(a.end*1e3,x,Ri):""}),y(!0))},k=()=>{y(!1)},K=()=>{const T={start:A.startDate?Math.floor(new Date(`${A.startDate}T00:00:00`).getTime()/1e3):0,end:A.endDate?Math.floor(new Date(`${A.endDate}T23:59:59`).getTime()/1e3):0};r(T),y(!1)},j=()=>{v({startDate:a.start?ln(a.start*1e3,x,Ri):"",endDate:a.end?ln(a.end*1e3,x,Ri):""}),y(!1)},w=()=>{r({start:void 0,end:void 0}),v({startDate:"",endDate:""}),y(!1)},G=!!a.start&&!!a.end;return u.jsxs(u.Fragment,{children:[u.jsx(Yn,{ref:N,label:o,value:B(a.start,a.end),size:s,fullWidth:f,disabled:m,sx:{"& .MuiInputBase-input":{cursor:m?"default":"pointer"}},onClick:O,placeholder:S("common.selectTimeRange"),slotProps:{input:{readOnly:!0,startAdornment:u.jsx(sx,{fontSize:"small",sx:{mr:1,color:"text.secondary"}}),endAdornment:G&&!m&&u.jsx(ei,{size:"small",onClick:T=>{T.stopPropagation(),w()},sx:{color:"text.secondary","&:hover":{color:"text.primary"}},children:u.jsx(mf,{fontSize:"small"})})},inputLabel:{shrink:!0}}}),!h&&u.jsx(lx,{open:g,anchorEl:N.current,onClose:k,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{"& .MuiPaper-root":{boxShadow:c.shadows[8],border:`1px solid ${c.palette.divider}`}},children:u.jsx(qA,{tempValue:A,setTempValue:v,handleCancel:j,handleApply:K,handleClear:w})}),h&&u.jsxs(lo,{open:g,onClose:k,fullWidth:!0,maxWidth:"sm",PaperProps:{sx:{m:1,maxHeight:"calc(100% - 64px)"}},children:[u.jsxs(Zl,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pb:1},children:[u.jsx(oe,{variant:"h6",children:S("common.selectTimeRange")}),u.jsx(ei,{edge:"end",color:"inherit",onClick:k,"aria-label":"close",size:"small",children:u.jsx(m0,{})})]}),u.jsx(uo,{sx:{pb:1},children:u.jsxs(ge,{spacing:2,sx:{mt:1},children:[u.jsx(Nn,{children:S("common.startDate")}),u.jsx(Yn,{type:"date",value:A.startDate,onChange:T=>v(R=>({...R,startDate:T.target.value})),size:"small",fullWidth:!0,slotProps:{inputLabel:{shrink:!0}}}),u.jsx(Nn,{children:S("common.endDate")}),u.jsx(Yn,{type:"date",value:A.endDate,onChange:T=>v(R=>({...R,endDate:T.target.value})),size:"small",fullWidth:!0,slotProps:{inputLabel:{shrink:!0}}})]})}),u.jsxs(o0,{sx:{px:3,pb:2},children:[u.jsx(pt,{onClick:j,color:"inherit",children:S("common.cancel")}),u.jsx(pt,{onClick:K,variant:"contained",children:S("common.confirm")})]})]})]})}const IA=(a={})=>{const r=new URLSearchParams;return Object.keys(a).forEach(o=>{a[o]&&r.set(o,String(a[o]))}),ot.get(`/api/credit-transactions?${r.toString()}`).then(o=>o.data)},$A=(a,r)=>{let o=`/customer/credit-grant/${a}`;return r&&(o=`/admin/customers/${a}`),{link:ii(o),connect:!1}},SD=(a,r)=>{let o=`/customer/invoice/${a}`;return r&&(o=`/admin/billing/${a}`),{link:ii(o),connect:!1}},VA=(a,r)=>{let o=`/customer/subscription/${a}`;return r&&(o=`/admin/billing/${a}`),{link:ii(o),connect:!1}},HA=a=>{const r=`/customer/credit-transaction/${a}`;return{link:ii(r),connect:!1}},YA=a=>{const r=`/admin/billing/${a}`;return{link:ii(r),connect:!1}},GA=a=>a.metadata?.subscription_id||a.subscription_id||a.invoice?.subscription_id,_D=a=>a.metadata?.invoice_id||a.invoice?.id,KA=a=>a.source||a.metadata?.meter_event_id,Ff=a=>{const r=a.activity_type==="grant",o=r&&a.metadata?.delivery_mode==="schedule",s=r&&a.status==="depleted",f=r&&(a.status==="expired"||a.status==="voided");return{isGrant:r,isScheduled:o,isDepleted:s,isExpired:f,isInactive:s||f}},QA=(a,r)=>{if(a.activity_type==="grant"){const s=_D(a);return s?SD(s,r):$A(a.id,r)}if(!r)return HA(a.id);const o=KA(a);return o?YA(o):null},ZA=(a,r)=>{const{isGrant:o,isScheduled:s,isInactive:f}=Ff(a),m=o&&a.category==="paid"&&(!s||a.metadata?.schedule_seq===1);if(!o){const c=a.metadata?.is_repayment?r("common.creditActivity.repayment"):a.description||"";return{isGrant:o,isInactive:f,activityType:r("common.creditActivity.consumption"),secondLine:c}}if(m){let c=a.description||"";if(a.invoice?.total&&a.invoice?.paymentCurrency){const h=a.invoice.paymentCurrency,g=dr(Ui(a.invoice.total,h.decimal||0),h.symbol||"");c=r("common.creditActivity.paidAmount",{amount:g})}return{isGrant:o,isInactive:f,activityType:r("common.creditActivity.paidGrant"),secondLine:c}}return s?{isGrant:o,isInactive:f,activityType:r("common.creditActivity.resetGrant"),secondLine:a.description||""}:{isGrant:o,isInactive:f,activityType:r("common.creditActivity.promotionalGrant"),secondLine:a.description||""}},XA=Ne.memo(a=>{const{pageSize:r,customer_id:o,subscription_id:s,credit_grant_id:f,onTableDataChange:m,showAdminColumns:c=!1,showTimeFilter:h=!1,includeGrants:g=!1,source:y,mode:S="portal"}=a,x="credit-transactions-table",{t:A,locale:v}=ft(),{session:N}=_n(),B=["owner","admin"].includes(N?.user?.role||""),O=B&&S==="dashboard",k=ds(),K=o||N?.user?.did,[j,w]=V.useState({pageSize:r||10,page:1}),[G,T]=V.useState({start:void 0,end:void 0}),R=D=>{T(D),w(F=>({...F,page:1,start:D.start||void 0,end:D.end||void 0}))},{loading:q,data:z={list:[],count:0}}=Pi(()=>IA({...j,customer_id:K,subscription_id:s,credit_grant_id:f,source:y,include_grants:g}),{refreshDeps:[j,K,s,f,y,g]});V.useEffect(()=>{h&&!j.start&&!j.end&&w(D=>({...D,page:1,start:G.start||void 0,end:G.end||void 0}))},[h,j.start,j.end,G.start,G.end]);const $=V.useRef(z);V.useEffect(()=>{m&&(m(z,$.current),$.current=z)},[z]);const re=(D,F)=>{const ae=QA(F,O);ae&&fr(D,ae.link,k,{target:ae.link.external?"_blank":"_self"})},Q=(D,F)=>{D.preventDefault();const ae=VA(F,O);fr(D,ae.link,k)},Z=(D,F)=>{D.preventDefault();const ae=SD(F,O);fr(D,ae.link,k)},ne=(D,F)=>u.jsx(pt,{variant:"text",size:"small",color:"primary",sx:{whiteSpace:"nowrap"},onClick:F,children:D}),me=[{label:A("common.date"),name:"created_at",options:{setCellProps:()=>({style:{width:"25%"}}),customBodyRenderLite:(D,F)=>{const ae=z?.list[F];return u.jsx(Se,{onClick:be=>re(be,ae),children:u.jsx(oe,{variant:"body2",sx:{fontSize:"0.875rem"},children:ln(ae.created_at,v,"YYYY-MM-DD HH:mm")})})}}},{label:A("common.description"),name:"description",options:{setCellProps:()=>({style:{width:"25%"}}),customBodyRenderLite:(D,F)=>{const ae=z?.list[F],{activityType:be,secondLine:Me,isInactive:Fe,isGrant:Ae}=ZA(ae,A);return u.jsx(Se,{onClick:ue=>re(ue,ae),sx:{cursor:"pointer"},children:u.jsxs(ge,{direction:"column",spacing:.25,children:[u.jsx(oe,{variant:"body2",sx:{color:Fe?"text.secondary":Ae?"success.main":"error.main"},children:be}),Me&&u.jsx(oe,{variant:"caption",sx:{color:"text.secondary"},children:Me})]})})}}},{label:A("common.amount"),name:"credit_amount",align:"right",options:{setCellProps:()=>({style:{width:"20%"}}),customHeadLabelRender:()=>u.jsx(Se,{sx:{pr:5},children:A("common.amount")}),customBodyRenderLite:(D,F)=>{const ae=z?.list[F],{isGrant:be,isDepleted:Me,isExpired:Fe,isInactive:Ae}=Ff(ae),ue=be?ae.amount:ae.credit_amount,$e=ae.paymentCurrency||ae.currency,Pe=!be&&ae.meter?.unit?ae.meter.unit:$e?.symbol,Xe=dr(Ui(ue,$e?.decimal||0),Pe);return g?u.jsx(Se,{onClick:Ze=>re(Ze,ae),sx:{pr:5},children:u.jsxs(ge,{direction:"column",spacing:.25,alignItems:"flex-end",children:[u.jsxs(oe,{sx:{fontWeight:500,color:Ae?"text.secondary":be?"success.main":"error.main",whiteSpace:"nowrap"},children:[be?"+":"-"," ",Xe]}),Me?u.jsx(oe,{variant:"caption",sx:{color:"text.secondary"},children:A("common.consumed")}):Fe?u.jsx(oe,{variant:"caption",sx:{color:"text.secondary"},children:A("common.expired")}):null]})}):u.jsx(Se,{onClick:Ze=>re(Ze,ae),sx:{pr:5},children:u.jsx(oe,{children:Xe})})}}},...c&&B?[{label:A("common.meterEvent"),name:"meter_event",options:{customBodyRenderLite:(D,F)=>{const ae=z?.list[F];return ae.meter?u.jsx(cr,{href:Dt(Qn(),`/admin/billing/${ae.meter.id}`),children:u.jsx(oe,{variant:"body2",sx:{color:"text.link"},children:ae.meter.event_name})}):u.jsx(oe,{variant:"body2",children:"-"})}}}]:[],{label:A("common.actions"),name:"actions",options:{setCellProps:()=>({style:{width:"25%"}}),customBodyRenderLite:(D,F)=>{const ae=z?.list[F],{isGrant:be,isScheduled:Me}=Ff(ae),Fe=be&&ae.category==="paid"&&!Me,Ae=GA(ae),ue=be?_D(ae):null,$e=!!Ae&&(!be||Me||Fe);return u.jsxs(Se,{sx:{display:"flex",gap:1,alignItems:"center",flexWrap:"nowrap"},children:[$e&&Ae?ne(A("common.viewSubscription"),Pe=>Q(Pe,Ae)):null,Fe&&ue?ne(A("common.viewInvoice"),Pe=>Z(Pe,ue)):null]})}}}].filter(Boolean),P=({page:D,rowsPerPage:F})=>{j.pageSize!==F?w(ae=>({...ae,pageSize:F,page:1})):j.page!==D+1&&w(ae=>({...ae,page:D+1}))};return u.jsxs(WA,{children:[h&&u.jsx(Se,{sx:{my:2},children:u.jsx(Se,{sx:{mt:2},children:u.jsx(ss,{container:!0,spacing:2,sx:{alignItems:"center"},children:u.jsx(ss,{size:{xs:12,sm:6,md:4},children:u.jsx(LA,{value:G,onChange:R,size:"small",fullWidth:!0})})})})}),u.jsx(tm,{hasRowLink:!0,durable:`__${x}__`,durableKeys:["page","rowsPerPage"],data:z.list,columns:me,options:{count:z.count,page:j.page-1,rowsPerPage:j.pageSize},loading:q,onChange:P,toolbar:!1,sx:{mt:2},showMobile:!1,mobileTDFlexDirection:"row",emptyNodeText:A("admin.creditTransactions.noTransactions")})]})}),WA=Zn(Se)`
645
645
  @media (max-width: ${({theme:a})=>a.breakpoints.values.md}px) {
646
646
  .MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > td.MuiTableCell-root {
647
647
  > div {
@@ -654,16 +654,16 @@ function print() { __p += __j.call(arguments, '') }
654
654
  padding-right: 20px;
655
655
  }
656
656
  }
657
- `;function Rw(a){const r=Object.assign({customer_id:"",subscription_id:"",credit_grant_id:"",source:"",pageSize:10,onTableDataChange:()=>{},showAdminColumns:!1,showTimeFilter:!1,includeGrants:!1,mode:"portal"},a);return u.jsx(ZA,{...r})}const Jg="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk";function WA(){const a=window.blocklet?.prefix||"/",r=window.location?.origin;if(window.__PAYMENT_KIT_BASE_URL)try{if(new URL(window.__PAYMENT_KIT_BASE_URL).origin!==window.location.origin)return window.__PAYMENT_KIT_BASE_URL}catch{}if((window.blocklet?.componentId||"").split("/").pop()===Jg)return`${r}${a}`;const s=(window.blocklet?.componentMountPoints||[]).find(f=>f?.did===Jg);return s?`${r}${s.mountPoint}`:`${r}${a}`}function JA(a){if(typeof window>"u")return"en";try{const r=localStorage.getItem("locale");if(r)return r}catch{}return a&&a.length>0?a[0]:navigator.language?.split("-")[0]||"en"}function eE(){const a=v0();return a.interceptors.request.use(r=>{const o=WA();r.baseURL=o||"";const s=JA(window.blocklet?.languages),f=new URLSearchParams(r.url?.split("?").pop());r.params={...r.params||{},locale:s};const m=window.__PAYMENT_KIT_AUTH_TOKEN;if(m&&typeof r.params.authToken>"u"&&!f.has("authToken")&&(r.params.authToken=m),typeof r.params.livemode>"u"&&f.has("livemode")===!1){const c=localStorage.getItem("livemode");r.params.livemode=E0(c)?!0:JSON.parse(c)}return r},r=>Promise.reject(r)),a}const Mw=eE(),Nw={START_PAYMENT_LINK:a=>`/api/checkout-sessions/start/${a}`,RETRIEVE_SESSION:a=>`/api/checkout-sessions/retrieve/${a}`,STATUS_SESSION:a=>`/api/checkout-sessions/status/${a}`,SWITCH_CURRENCY:a=>`/api/checkout-sessions/${a}/switch-currency`,SUBMIT:a=>`/api/checkout-sessions/${a}/submit`,DONATE_SUBMIT:a=>`/api/checkout-sessions/${a}/donate-submit`,FAST_CHECKOUT_CONFIRM:a=>`/api/checkout-sessions/${a}/fast-checkout-confirm`,EXCHANGE_RATE:a=>`/api/checkout-sessions/${a}/exchange-rate`,ADJUST_QUANTITY:a=>`/api/checkout-sessions/${a}/adjust-quantity`,UPSELL:a=>`/api/checkout-sessions/${a}/upsell`,DOWNSELL:a=>`/api/checkout-sessions/${a}/downsell`,CROSS_SELL:a=>`/api/checkout-sessions/${a}/cross-sell`,CHANGE_AMOUNT:a=>`/api/checkout-sessions/${a}/amount`,SLIPPAGE:a=>`/api/checkout-sessions/${a}/slippage`,ABORT_STRIPE:a=>`/api/checkout-sessions/${a}/abort-stripe`,SKIP_PAYMENT_METHOD:a=>`/api/checkout-sessions/${a}/skip-payment-method`,RECALCULATE_PROMOTION_SESSION:a=>`/api/checkout-sessions/${a}/recalculate-promotion`,APPLY_PROMOTION:a=>`/api/checkout-sessions/${a}/apply-promotion`,REMOVE_PROMOTION:a=>`/api/checkout-sessions/${a}/remove-promotion`,CUSTOMER_ME:"/api/customers/me",VENDOR_ORDER_STATUS:a=>`/api/vendors/order/${a}/status`},tE=V.createContext(null);function Bw(){const a=V.useContext(tE);if(!a)throw new Error("useSessionContext must be used within <CheckoutProvider>");return a}const nE=V.createContext(null);function aE(){const a=V.useContext(nE);if(!a)throw new Error("usePaymentMethodContext must be used within <CheckoutProvider>");return a}const iE=V.createContext(null);function Uw(){const a=V.useContext(iE);if(!a)throw new Error("useExchangeRateContext must be used within <CheckoutProvider>");return a}const rE=V.createContext(null);function Ow(){const a=V.useContext(rE);if(!a)throw new Error("useCustomerFormContext must be used within <CheckoutProvider>");return a}const oE=V.createContext(null);function zw(){const a=V.useContext(oE);if(!a)throw new Error("useSubmitContext must be used within <CheckoutProvider>");return a}const Pw={day:"common.daily",week:"common.weekly",month:"common.monthly",year:"common.yearly"};function qw(a){return!a||a.length!==2?"":String.fromCodePoint(...a.toUpperCase().split("").map(r=>127397+r.charCodeAt(0)))}function AD(a,r){if(!a||!r)return"0";try{const o=qt(String(a),r.decimal||0),s=Number(o);if(!Number.isFinite(s))return"0";const f=Math.abs(s),m=f>0&&f<.01?6:2;return s.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:m}).replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")||"0"}catch{return"0"}}function sE(a,r){if(!a||!r)return"0";const s=(a.price_currency_options||a.currency_options||[]).find(f=>f.currency_id===r.id);return s?s.custom_unit_amount&&(s.custom_unit_amount.preset||s.custom_unit_amount.presets?.[0])||s.unit_amount:a.currency_id===r.id&&a.unit_amount||"0"}function Lw(a,r,o){if(!a||!r)return null;if(a.pricing_type==="dynamic"&&o&&a.base_amount){const f=Number(o);if(f>0&&Number.isFinite(f)){const m=Number(a.base_amount);if(m>0&&Number.isFinite(m)){const c=m/f,h=Math.abs(c),g=h>0&&h<.01?6:2;return c.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:g}).replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")||"0"}}}if(!o&&a.base_amount!=null){const f=Number(a.base_amount);if(f>=0&&Number.isFinite(f))return f.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}return AD(sE(a,r),r)}function Iw(a,r,o){const s=a(r);return s&&!s.includes(".")?s:o}const e0={"& .MuiTooltip-tooltip":{bgcolor:"background.paper",color:"text.primary",border:"1px solid",borderColor:"divider",borderRadius:"10px",boxShadow:"0 8px 24px rgba(0,0,0,0.12)",p:1.5,maxWidth:280,fontSize:12},"& .MuiTooltip-arrow":{color:"background.paper","&::before":{border:"1px solid",borderColor:"divider"}}};function $w(a,r,o){const s=o||"day",f=r>1?`common.${s}s`:`common.${s}`;return a("payment.checkout.free",{count:r,interval:a(f)})}function Vw(a,r,o,s){const f=r?.mode||"payment",m=["subscription","setup"].includes(f),c=s.length===1&&f==="payment"&&s[0]?.price?.product?.type==="credit"&&s[0]?.price?.metadata?.credit_config;let h;c?h="topup":m?h="subscription":h="oneTime";const g=a(`payment.checkout.typeBadge.${h}`),y=o?.name||s[0]?.price?.product?.name||"";let S=y;y&&(m?S=a("payment.checkout.headerTitle.subscribe",{name:y}):c||(S=a("payment.checkout.headerTitle.purchase",{name:y})));let x="";if(c)x=a("payment.checkout.subtitle.creditsTopup");else if(m){const A=o?.metadata?.plan_name||o?.metadata?.plan_display_name;A&&(x=A)}else x=a("payment.checkout.subtitle.oneTime");return{badge:h,badgeLabel:g,title:S,subtitle:x}}const lE=Mf`
657
+ `;function Mw(a){const r=Object.assign({customer_id:"",subscription_id:"",credit_grant_id:"",source:"",pageSize:10,onTableDataChange:()=>{},showAdminColumns:!1,showTimeFilter:!1,includeGrants:!1,mode:"portal"},a);return u.jsx(XA,{...r})}const Jg="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk";function JA(){const a=window.blocklet?.prefix||"/",r=window.location?.origin;if(window.__PAYMENT_KIT_BASE_URL)try{if(new URL(window.__PAYMENT_KIT_BASE_URL).origin!==window.location.origin)return window.__PAYMENT_KIT_BASE_URL}catch{}if((window.blocklet?.componentId||"").split("/").pop()===Jg)return`${r}${a}`;const s=(window.blocklet?.componentMountPoints||[]).find(f=>f?.did===Jg);return s?`${r}${s.mountPoint}`:`${r}${a}`}function eE(a){if(typeof window>"u")return"en";try{const r=localStorage.getItem("locale");if(r)return r}catch{}return a&&a.length>0?a[0]:navigator.language?.split("-")[0]||"en"}function tE(){const a=v0();return a.interceptors.request.use(r=>{const o=JA();r.baseURL=o||"";const s=eE(window.blocklet?.languages),f=new URLSearchParams(r.url?.split("?").pop());r.params={...r.params||{},locale:s};const m=window.__PAYMENT_KIT_AUTH_TOKEN;if(m&&typeof r.params.authToken>"u"&&!f.has("authToken")&&(r.params.authToken=m),typeof r.params.livemode>"u"&&f.has("livemode")===!1){const c=localStorage.getItem("livemode");r.params.livemode=E0(c)?!0:JSON.parse(c)}return r},r=>Promise.reject(r)),a}const Nw=tE(),Bw={START_PAYMENT_LINK:a=>`/api/checkout-sessions/start/${a}`,RETRIEVE_SESSION:a=>`/api/checkout-sessions/retrieve/${a}`,STATUS_SESSION:a=>`/api/checkout-sessions/status/${a}`,SWITCH_CURRENCY:a=>`/api/checkout-sessions/${a}/switch-currency`,SUBMIT:a=>`/api/checkout-sessions/${a}/submit`,DONATE_SUBMIT:a=>`/api/checkout-sessions/${a}/donate-submit`,FAST_CHECKOUT_CONFIRM:a=>`/api/checkout-sessions/${a}/fast-checkout-confirm`,EXCHANGE_RATE:a=>`/api/checkout-sessions/${a}/exchange-rate`,ADJUST_QUANTITY:a=>`/api/checkout-sessions/${a}/adjust-quantity`,UPSELL:a=>`/api/checkout-sessions/${a}/upsell`,DOWNSELL:a=>`/api/checkout-sessions/${a}/downsell`,CROSS_SELL:a=>`/api/checkout-sessions/${a}/cross-sell`,CHANGE_AMOUNT:a=>`/api/checkout-sessions/${a}/amount`,SLIPPAGE:a=>`/api/checkout-sessions/${a}/slippage`,ABORT_STRIPE:a=>`/api/checkout-sessions/${a}/abort-stripe`,SKIP_PAYMENT_METHOD:a=>`/api/checkout-sessions/${a}/skip-payment-method`,RECALCULATE_PROMOTION_SESSION:a=>`/api/checkout-sessions/${a}/recalculate-promotion`,APPLY_PROMOTION:a=>`/api/checkout-sessions/${a}/apply-promotion`,REMOVE_PROMOTION:a=>`/api/checkout-sessions/${a}/remove-promotion`,CUSTOMER_ME:"/api/customers/me",VENDOR_ORDER_STATUS:a=>`/api/vendors/order/${a}/status`},nE=V.createContext(null);function Uw(){const a=V.useContext(nE);if(!a)throw new Error("useSessionContext must be used within <CheckoutProvider>");return a}const aE=V.createContext(null);function iE(){const a=V.useContext(aE);if(!a)throw new Error("usePaymentMethodContext must be used within <CheckoutProvider>");return a}const rE=V.createContext(null);function Ow(){const a=V.useContext(rE);if(!a)throw new Error("useExchangeRateContext must be used within <CheckoutProvider>");return a}const oE=V.createContext(null);function zw(){const a=V.useContext(oE);if(!a)throw new Error("useCustomerFormContext must be used within <CheckoutProvider>");return a}const sE=V.createContext(null);function Pw(){const a=V.useContext(sE);if(!a)throw new Error("useSubmitContext must be used within <CheckoutProvider>");return a}const qw={day:"common.daily",week:"common.weekly",month:"common.monthly",year:"common.yearly"};function Lw(a){return!a||a.length!==2?"":String.fromCodePoint(...a.toUpperCase().split("").map(r=>127397+r.charCodeAt(0)))}function AD(a,r){if(!a||!r)return"0";try{const o=qt(String(a),r.decimal||0),s=Number(o);if(!Number.isFinite(s))return"0";const f=Math.abs(s),m=f>0&&f<.01?6:2;return s.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:m}).replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")||"0"}catch{return"0"}}function lE(a,r){if(!a||!r)return"0";const s=(a.price_currency_options||a.currency_options||[]).find(f=>f.currency_id===r.id);return s?s.custom_unit_amount&&(s.custom_unit_amount.preset||s.custom_unit_amount.presets?.[0])||s.unit_amount:a.currency_id===r.id&&a.unit_amount||"0"}function Iw(a,r,o){if(!a||!r)return null;if(a.pricing_type==="dynamic"&&o&&a.base_amount){const f=Number(o);if(f>0&&Number.isFinite(f)){const m=Number(a.base_amount);if(m>0&&Number.isFinite(m)){const c=m/f,h=Math.abs(c),g=h>0&&h<.01?6:2;return c.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:g}).replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")||"0"}}}if(!o&&a.base_amount!=null){const f=Number(a.base_amount);if(f>=0&&Number.isFinite(f))return f.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}return AD(lE(a,r),r)}function $w(a,r,o){const s=a(r);return s&&!s.includes(".")?s:o}const e0={"& .MuiTooltip-tooltip":{bgcolor:"background.paper",color:"text.primary",border:"1px solid",borderColor:"divider",borderRadius:"10px",boxShadow:"0 8px 24px rgba(0,0,0,0.12)",p:1.5,maxWidth:280,fontSize:12},"& .MuiTooltip-arrow":{color:"background.paper","&::before":{border:"1px solid",borderColor:"divider"}}};function Vw(a,r,o){const s=o||"day",f=r>1?`common.${s}s`:`common.${s}`;return a("payment.checkout.free",{count:r,interval:a(f)})}function Hw(a,r,o,s){const f=r?.mode||"payment",m=["subscription","setup"].includes(f),c=s.length===1&&f==="payment"&&s[0]?.price?.product?.type==="credit"&&s[0]?.price?.metadata?.credit_config;let h;c?h="topup":m?h="subscription":h="oneTime";const g=a(`payment.checkout.typeBadge.${h}`),y=o?.name||s[0]?.price?.product?.name||"";let S=y;y&&(m?S=a("payment.checkout.headerTitle.subscribe",{name:y}):c||(S=a("payment.checkout.headerTitle.purchase",{name:y})));let x="";if(c)x=a("payment.checkout.subtitle.creditsTopup");else if(m){const A=o?.metadata?.plan_name||o?.metadata?.plan_display_name;A&&(x=A)}else x=a("payment.checkout.subtitle.oneTime");return{badge:h,badgeLabel:g,title:S,subtitle:x}}const uE=Mf`
658
658
  75%, 100% { transform: scale(2); opacity: 0; }
659
- `;function uE(a){if(!a)return"—";const r=new Date(a),o=s=>String(s).padStart(2,"0");return`${r.getFullYear()}-${o(r.getMonth()+1)}-${o(r.getDate())} ${o(r.getHours())}:${o(r.getMinutes())}`}function Hw({hasDynamicPricing:a,rate:r,slippage:o,currencySymbol:s,isSubscription:f}){const{t:m}=ft(),[c,h]=V.useState(!1),[g,y]=V.useState(null),[S,x]=V.useState(!1),[A,v]=V.useState(o?.percent??.5);if(V.useEffect(()=>{v(o?.percent??.5)},[o?.percent]),!a||!r.value||r.status==="unavailable")return null;const N=r.display||`$${Number(r.value).toFixed(2)}`,B=f&&typeof o?.set=="function",O=()=>{y({mode:"percent",percent:A}),h(!0)},k=()=>{h(!1),y(null)},K=ne=>{y(me=>me?{...me,percent:ne}:{mode:"percent",percent:ne})},j=ne=>{y(ne)},w=async()=>{if(!(!g||!o?.set)){x(!0);try{v(g.percent),await o.set({...g,base_currency:"USD"}),h(!1),y(null)}catch(ne){v(o?.percent??.5),console.error("Failed to update slippage",ne)}finally{x(!1)}}},G={fontSize:11,fontWeight:700,color:"primary.main",letterSpacing:"0.02em"},T=r.providerDisplay||r.provider||"—",R=uE(r.fetchedAt),q=`$${r.value}`,z=e0,$={fontSize:12,color:"text.secondary",lineHeight:1.4},re={fontSize:12,fontWeight:600,color:"text.primary",lineHeight:1.4},Q=u.jsxs(ge,{spacing:.75,children:[u.jsxs(oe,{sx:{fontSize:13,fontWeight:700,color:"text.primary",mb:.25},children:["1 ",s," = ",q]}),u.jsx(Se,{sx:{borderTop:"1px solid",borderColor:"divider",pt:.75},children:u.jsxs(ge,{spacing:.5,children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",spacing:2,children:[u.jsx(oe,{sx:$,children:m("payment.checkout.quote.detailProvider")}),u.jsx(oe,{sx:re,children:T})]}),u.jsxs(ge,{direction:"row",justifyContent:"space-between",spacing:2,children:[u.jsx(oe,{sx:$,children:m("payment.checkout.quote.detailUpdatedAt")}),u.jsx(oe,{sx:re,children:R})]})]})})]}),Z=m("payment.checkout.quote.slippage.tooltip");return u.jsxs(u.Fragment,{children:[u.jsx(Se,{sx:{width:"100%",pt:3,pb:1,borderTop:"1px solid",borderColor:"divider"},children:u.jsx(Gn,{in:!0,timeout:300,children:u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between"},children:[u.jsx(Un,{title:Q,placement:"top",arrow:!0,slotProps:{popper:{sx:z}},children:u.jsxs(ge,{direction:"row",alignItems:"center",spacing:1,sx:{cursor:"default"},children:[u.jsxs(Se,{sx:{position:"relative",width:8,height:8,flexShrink:0},children:[u.jsx(Se,{sx:{position:"absolute",inset:0,borderRadius:"50%",bgcolor:"#60a5fa",opacity:.6,animation:`${lE} 1s cubic-bezier(0, 0, 0.2, 1) infinite`}}),u.jsx(Se,{sx:{position:"relative",width:8,height:8,borderRadius:"50%",bgcolor:"primary.main"}})]}),u.jsxs(oe,{sx:G,children:["1 ",s," ≈ ",N]})]})}),B&&u.jsx(Un,{title:Z,placement:"top",arrow:!0,slotProps:{popper:{sx:e0}},children:u.jsxs(ge,{direction:"row",alignItems:"center",spacing:.75,onClick:O,sx:{cursor:"pointer","&:hover":{opacity:1},"&:hover .tune-icon":{transform:"rotate(90deg)"},transition:"opacity 0.2s"},children:[u.jsx(ux,{className:"tune-icon",sx:{fontSize:16,color:"primary.main",transition:"transform 0.5s"}}),u.jsxs(oe,{sx:G,children:[m("payment.checkout.quote.detailSlippage")," ",A,"%"]})]})})]})})}),u.jsxs(lo,{open:c,onClose:k,maxWidth:"sm",fullWidth:!0,children:[u.jsx(Zl,{children:m("payment.checkout.quote.slippage.title")}),u.jsx(uo,{children:u.jsx(bD,{value:g?.percent??A,onChange:K,config:g||{mode:"percent",percent:A},onConfigChange:j,exchangeRate:r.value?String(r.value):null,baseCurrency:"USD",disabled:S,sx:{mt:1},onCancel:k,onSave:w})})]})]})}const ED=Mf`
659
+ `;function cE(a){if(!a)return"—";const r=new Date(a),o=s=>String(s).padStart(2,"0");return`${r.getFullYear()}-${o(r.getMonth()+1)}-${o(r.getDate())} ${o(r.getHours())}:${o(r.getMinutes())}`}function Yw({hasDynamicPricing:a,rate:r,slippage:o,currencySymbol:s,isSubscription:f}){const{t:m}=ft(),[c,h]=V.useState(!1),[g,y]=V.useState(null),[S,x]=V.useState(!1),[A,v]=V.useState(o?.percent??.5);if(V.useEffect(()=>{v(o?.percent??.5)},[o?.percent]),!a||!r.value||r.status==="unavailable")return null;const N=r.display||`$${Number(r.value).toFixed(2)}`,B=f&&typeof o?.set=="function",O=()=>{y({mode:"percent",percent:A}),h(!0)},k=()=>{h(!1),y(null)},K=ne=>{y(me=>me?{...me,percent:ne}:{mode:"percent",percent:ne})},j=ne=>{y(ne)},w=async()=>{if(!(!g||!o?.set)){x(!0);try{v(g.percent),await o.set({...g,base_currency:"USD"}),h(!1),y(null)}catch(ne){v(o?.percent??.5),console.error("Failed to update slippage",ne)}finally{x(!1)}}},G={fontSize:11,fontWeight:700,color:"primary.main",letterSpacing:"0.02em"},T=r.providerDisplay||r.provider||"—",R=cE(r.fetchedAt),q=`$${r.value}`,z=e0,$={fontSize:12,color:"text.secondary",lineHeight:1.4},re={fontSize:12,fontWeight:600,color:"text.primary",lineHeight:1.4},Q=u.jsxs(ge,{spacing:.75,children:[u.jsxs(oe,{sx:{fontSize:13,fontWeight:700,color:"text.primary",mb:.25},children:["1 ",s," = ",q]}),u.jsx(Se,{sx:{borderTop:"1px solid",borderColor:"divider",pt:.75},children:u.jsxs(ge,{spacing:.5,children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",spacing:2,children:[u.jsx(oe,{sx:$,children:m("payment.checkout.quote.detailProvider")}),u.jsx(oe,{sx:re,children:T})]}),u.jsxs(ge,{direction:"row",justifyContent:"space-between",spacing:2,children:[u.jsx(oe,{sx:$,children:m("payment.checkout.quote.detailUpdatedAt")}),u.jsx(oe,{sx:re,children:R})]})]})})]}),Z=m("payment.checkout.quote.slippage.tooltip");return u.jsxs(u.Fragment,{children:[u.jsx(Se,{sx:{width:"100%",pt:3,pb:1,borderTop:"1px solid",borderColor:"divider"},children:u.jsx(Gn,{in:!0,timeout:300,children:u.jsxs(ge,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between"},children:[u.jsx(Un,{title:Q,placement:"top",arrow:!0,slotProps:{popper:{sx:z}},children:u.jsxs(ge,{direction:"row",alignItems:"center",spacing:1,sx:{cursor:"default"},children:[u.jsxs(Se,{sx:{position:"relative",width:8,height:8,flexShrink:0},children:[u.jsx(Se,{sx:{position:"absolute",inset:0,borderRadius:"50%",bgcolor:"#60a5fa",opacity:.6,animation:`${uE} 1s cubic-bezier(0, 0, 0.2, 1) infinite`}}),u.jsx(Se,{sx:{position:"relative",width:8,height:8,borderRadius:"50%",bgcolor:"primary.main"}})]}),u.jsxs(oe,{sx:G,children:["1 ",s," ≈ ",N]})]})}),B&&u.jsx(Un,{title:Z,placement:"top",arrow:!0,slotProps:{popper:{sx:e0}},children:u.jsxs(ge,{direction:"row",alignItems:"center",spacing:.75,onClick:O,sx:{cursor:"pointer","&:hover":{opacity:1},"&:hover .tune-icon":{transform:"rotate(90deg)"},transition:"opacity 0.2s"},children:[u.jsx(ux,{className:"tune-icon",sx:{fontSize:16,color:"primary.main",transition:"transform 0.5s"}}),u.jsxs(oe,{sx:G,children:[m("payment.checkout.quote.detailSlippage")," ",A,"%"]})]})})]})})}),u.jsxs(lo,{open:c,onClose:k,maxWidth:"sm",fullWidth:!0,children:[u.jsx(Zl,{children:m("payment.checkout.quote.slippage.title")}),u.jsx(uo,{children:u.jsx(bD,{value:g?.percent??A,onChange:K,config:g||{mode:"percent",percent:A},onConfigChange:j,exchangeRate:r.value?String(r.value):null,baseCurrency:"USD",disabled:S,sx:{mt:1},onCancel:k,onSave:w})})]})]})}const ED=Mf`
660
660
  from { transform: scale(0); opacity: 0; }
661
661
  60% { transform: scale(1.15); }
662
662
  to { transform: scale(1); opacity: 1; }
663
663
  `,yr=Mf`
664
664
  from { opacity: 0; transform: translateY(16px); }
665
665
  to { opacity: 1; transform: translateY(0); }
666
- `;function cE(a,r){const o=V.useRef(!1);V.useEffect(()=>{if(!r||o.current||!a.current)return;o.current=!0;const s=a.current,f=document.createElement("canvas");f.style.cssText="position:absolute;inset:0;pointer-events:none;z-index:10;",f.width=s.offsetWidth,f.height=s.offsetHeight,s.appendChild(f);const m=f.getContext("2d");if(!m)return;const c=["#3b82f6","#60a5fa","#34d399","#fbbf24","#f472b6","#a78bfa","#f97316"],h=[];for(let v=0;v<80;v++)h.push({x:f.width/2+(Math.random()-.5)*60,y:f.height*.35,vx:(Math.random()-.5)*12,vy:-Math.random()*14-4,w:Math.random()*8+4,h:Math.random()*6+2,color:c[Math.floor(Math.random()*c.length)],rot:Math.random()*Math.PI*2,rv:(Math.random()-.5)*.3,opacity:1});let g;const y=.25,S=.99,x=()=>{m.clearRect(0,0,f.width,f.height);let v=!1;for(const N of h)N.vy+=y,N.vx*=S,N.x+=N.vx,N.y+=N.vy,N.rot+=N.rv,N.y>f.height*.6&&(N.opacity-=.02),N.opacity>0&&(v=!0,m.save(),m.globalAlpha=N.opacity,m.translate(N.x,N.y),m.rotate(N.rot),m.fillStyle=N.color,m.fillRect(-N.w/2,-N.h/2,N.w,N.h),m.restore());v?g=requestAnimationFrame(x):f.remove()},A=setTimeout(()=>{g=requestAnimationFrame(x)},400);return()=>{clearTimeout(A),cancelAnimationFrame(g),f.remove()}},[r,a])}function dE(a){return a?.payment_link?.after_completion?.hosted_confirmation?.custom_message}function fE(a){const r=a?.line_items||[];for(const o of r)if(o?.price?.product?.statement_descriptor)return o.price.product.statement_descriptor;return a?.app_name||a?.payment_link?.app_name||""}function mE(a,r,o){const s=a.name||a.title,f=a.status==="delivered";return a.vendorType==="didnames"?r?o("payment.checkout.vendor.didnames.failed",{name:s}):f?o("payment.checkout.vendor.didnames.completed",{name:s}):o("payment.checkout.vendor.didnames.processing",{name:s}):r?o("payment.checkout.vendor.launcher.failed",{name:s}):f?o("payment.checkout.vendor.launcher.completed",{name:s}):o("payment.checkout.vendor.launcher.processing",{name:s})}function pE(){return u.jsxs(Se,{sx:{position:"relative",mb:1,animation:`${ED} 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both`},children:[u.jsx(Se,{sx:{position:"absolute",inset:-24,background:a=>a.palette.mode==="dark"?"radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%)":"radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%)",borderRadius:"50%",pointerEvents:"none"}}),u.jsxs(Se,{sx:{position:"relative",width:{xs:100,md:120},height:{xs:100,md:120},borderRadius:{xs:"28px",md:"32px"},background:a=>a.palette.mode==="dark"?"linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(255,255,255,0.04) 100%)":"linear-gradient(135deg, #eff6ff 0%, #ffffff 100%)",border:"1px solid",borderColor:a=>a.palette.mode==="dark"?"rgba(59,130,246,0.2)":"rgba(59,130,246,0.12)",boxShadow:a=>a.palette.mode==="dark"?"0 10px 30px -5px rgba(0,0,0,0.3)":"0 10px 30px -5px rgba(59,130,246,0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:[u.jsx(Se,{sx:{position:"absolute",inset:0,borderRadius:"inherit",background:a=>a.palette.mode==="dark"?"linear-gradient(to top-right, rgba(59,130,246,0.1), transparent)":"linear-gradient(to top-right, rgba(59,130,246,0.06), transparent)",pointerEvents:"none"}}),u.jsx(dx,{sx:{fontSize:{xs:52,md:64},color:"primary.main",filter:a=>a.palette.mode==="dark"?"drop-shadow(0 0 12px rgba(59,130,246,0.4))":"drop-shadow(0 0 12px rgba(59,130,246,0.2))"}})]}),u.jsx(Se,{sx:{position:"absolute",bottom:{xs:-6,md:-8},right:{xs:-6,md:-8},width:{xs:32,md:38},height:{xs:32,md:38},borderRadius:{xs:"12px",md:"14px"},bgcolor:"background.paper",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",border:"1px solid",borderColor:a=>a.palette.mode==="dark"?"rgba(255,255,255,0.1)":"rgba(59,130,246,0.08)",display:"flex",alignItems:"center",justifyContent:"center"},children:u.jsx(r0,{sx:{fontSize:{xs:20,md:24},color:"success.main"}})})]})}function hE({session:a,t:r}){const{currencies:o}=aE(),s=a?.amount_total,f=a?.currency_id,m=a?.subscription_data;if(Number(m?.trial_period_days||0)>0||!s||s==="0")return null;const c=o.find(x=>x.id===f)||null;if(!c)return null;const h=AD(s,c);if(!h||h==="0")return null;const g=`${h} ${c.symbol||""}`.trim(),y=r("payment.checkout.completed.summary.paid",{amount:g}),S=y.indexOf(g);return u.jsx(oe,{sx:{fontSize:{xs:15,md:16},color:"text.secondary",fontWeight:500,lineHeight:1.6,textAlign:"center",maxWidth:440,animation:`${yr} 0.5s ease 0.3s both`},children:S>=0?u.jsxs(u.Fragment,{children:[y.slice(0,S),u.jsx(Se,{component:"span",sx:{fontWeight:700,color:"text.primary"},children:g}),y.slice(S+g.length)]}):y})}function yE({vendor:a,t:r}){const[o,s]=V.useState(0),f=V.useRef(),m=V.useCallback(()=>{const y=a.progress||0;let S,x;const A=v=>{S||(S=v,x=o);const N=v-S;let B;if(y===100)B=100;else if(y===0)B=Math.min(x+N/1e3,99);else if(y>x){const O=Math.min(N/1e3,1);B=x+(y-x)*O}else B=Math.min(x+N/1e3,99);B=Math.round(B),s(O=>Math.min(O>B?O:B,100)),y!==100&&B<99&&y<100&&(f.current=requestAnimationFrame(A))};f.current&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame(A)},[a.progress,o]);V.useEffect(()=>(m(),()=>{f.current&&cancelAnimationFrame(f.current)}),[m]);const c=o>=100,h=a.status==="failed",g=mE(a,h,r);return!a.name&&!a.title?u.jsxs(Se,{sx:{mb:1.5},children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:.75},children:[u.jsx(Ot,{variant:"rounded",height:14,width:150}),u.jsx(Ot,{variant:"rounded",height:14,width:50})]}),u.jsx(Ot,{variant:"rounded",height:6,width:"100%"})]}):u.jsxs(Se,{sx:{mb:1.5},children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:.75},children:[u.jsxs(oe,{sx:{fontSize:13,fontWeight:600,color:h?"error.main":"text.secondary",display:"flex",alignItems:"center"},children:[g,c&&!h&&u.jsx(s0,{sx:{color:"success.main",ml:.5,fontSize:16}})]}),!c&&u.jsx(oe,{sx:{fontSize:12,fontWeight:600,color:h?"error.main":"text.secondary"},children:r("payment.checkout.vendor.progress",{progress:h?0:o})})]}),u.jsx(zl,{variant:"determinate",value:h?100:o||0,sx:{height:6,borderRadius:3,bgcolor:y=>y.palette.mode==="dark"?"rgba(255,255,255,0.08)":"grey.200","& .MuiLinearProgress-bar":{borderRadius:3,bgcolor:h?"error.main":c?"success.main":"primary.main",transition:"background-color 0.3s linear"}}})]})}function gE({vendorStatus:a,pageInfo:r=void 0,locale:o,t:s}){return u.jsxs(Se,{sx:{width:"100%",maxWidth:420,p:2.5,borderRadius:3,bgcolor:f=>f.palette.mode==="dark"?"rgba(255,255,255,0.04)":"grey.50",border:"1px solid",borderColor:"divider",animation:`${yr} 0.5s ease 0.3s both`},children:[(a.vendors||[]).map((f,m)=>u.jsx(yE,{vendor:f,t:s},f.title||`vendor-${m}`)),a.hasFailed&&u.jsx(oe,{sx:{fontSize:13,fontWeight:600,color:"warning.main",mt:1},children:s("payment.checkout.vendor.failedMsg")}),a.isAllCompleted&&r?.success_message?.[o]&&u.jsx(oe,{sx:{fontSize:14,fontWeight:600,color:"text.primary",mt:1},children:r.success_message[o]})]})}function DE({mode:a,subscriptions:r,subscriptionId:o=void 0,payee:s,prefix:f,t:m}){return["subscription","setup"].includes(a)?r.length>1?u.jsx(Se,{sx:{width:"100%",maxWidth:420,borderRadius:3,bgcolor:c=>c.palette.mode==="dark"?"rgba(255,255,255,0.04)":"grey.50",border:"1px solid",borderColor:"divider",overflow:"hidden",animation:`${yr} 0.5s ease 0.35s both`},children:r.map((c,h)=>u.jsxs(Se,{children:[h>0&&u.jsx(ti,{}),u.jsxs(ge,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{px:2.5,py:1.5},children:[u.jsx(oe,{sx:{fontSize:13,fontWeight:500,color:"text.secondary",flex:1,minWidth:0},noWrap:!0,children:c.description||c.id}),u.jsx(Se,{sx:{flex:1,borderBottom:"1px dashed",borderColor:"grey.300",mx:2,minWidth:20}}),u.jsxs(cr,{href:Dt(f,`/customer/subscription/${c.id}`),underline:"none",sx:{display:"flex",alignItems:"center",gap:.5,fontSize:13,fontWeight:600,color:"primary.main",flexShrink:0},children:[m("payment.checkout.next.view"),u.jsx(Ol,{sx:{fontSize:14}})]})]})]},c.id))}):o?u.jsx(pt,{variant:"contained",href:Dt(f,`/customer/subscription/${o}`),endIcon:u.jsx(Ol,{sx:{fontSize:16}}),sx:{width:"100%",maxWidth:320,height:52,borderRadius:"16px",textTransform:"none",fontWeight:700,fontSize:{xs:16,md:17},letterSpacing:"0.02em",color:c=>Yf(c),boxShadow:"0 8px 24px -4px rgba(59,130,246,0.25)","&:hover":{boxShadow:"0 12px 28px -4px rgba(59,130,246,0.35)"},animation:`${yr} 0.5s ease 0.35s both`},children:m("payment.checkout.next.subscription",{payee:s})}):null:null}function vE({mode:a,invoiceId:r=void 0,prefix:o,t:s}){return a!=="payment"||!r?null:u.jsx(pt,{variant:"contained",href:Dt(o,`/customer/invoice/${r}`),endIcon:u.jsx(Ol,{sx:{fontSize:16}}),sx:{width:"100%",maxWidth:320,height:52,borderRadius:"16px",textTransform:"none",fontWeight:700,fontSize:{xs:16,md:17},letterSpacing:"0.02em",color:f=>Yf(f),boxShadow:"0 8px 24px -4px rgba(59,130,246,0.25)","&:hover":{boxShadow:"0 12px 28px -4px rgba(59,130,246,0.35)"},animation:`${yr} 0.5s ease 0.35s both`},children:s("payment.checkout.next.invoice")})}function Yw({submit:a,session:r}){const{t:o,locale:s}=ft(),{vendorStatus:f}=a,m=fE(r),c=Qn(),h=r?.mode||"payment",g=a.result?.checkoutSession,y=r?.subscriptions||[],S=r?.subscription_id||g?.subscription_id,x=r?.invoice_id||a.result?.checkoutSession?.invoice_id||a.result?.checkoutSession?.payment_intent?.invoice_id,A=r?.metadata?.page_info,v=dE(r),B=r?.submit_type==="donate"?"payment.checkout.completed.donate":`payment.checkout.completed.${h}`,O=v||o(B),k=f&&!f.isAllCompleted&&!f.hasFailed,K=V.useRef(null),j=!f?.hasFailed;return cE(K,j),u.jsx(Se,{ref:K,sx:{position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flex:1,minHeight:400,p:{xs:3,md:4},textAlign:"center",overflow:"hidden"},children:u.jsxs(ge,{spacing:3,alignItems:"center",sx:{width:"100%",maxWidth:440},children:[f?.hasFailed?u.jsx(f0,{sx:{fontSize:64,color:"warning.main",animation:`${ED} 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both`}}):u.jsx(pE,{}),u.jsxs(ge,{spacing:1,alignItems:"center",sx:{animation:`${yr} 0.5s ease 0.2s both`},children:[u.jsx(oe,{sx:{fontSize:{xs:28,md:36},fontWeight:800,color:"text.primary",lineHeight:1.2,letterSpacing:"-0.02em"},children:O}),m&&u.jsx(oe,{sx:{fontSize:{xs:14,md:16},color:"text.secondary",fontWeight:500,lineHeight:1.6,maxWidth:360},children:o("payment.checkout.completed.tip",{payee:m})})]}),u.jsx(hE,{session:g||r,t:o}),f&&u.jsx(gE,{vendorStatus:f,pageInfo:A,locale:s,t:o}),f?.hasFailed&&f.error&&u.jsx(mr,{severity:"warning",sx:{maxWidth:420,borderRadius:3,width:"100%"},children:f.error}),!k&&u.jsx(DE,{mode:h,subscriptions:y,subscriptionId:S,payee:m,prefix:c,t:o}),!k&&u.jsx(vE,{mode:h,invoiceId:x,prefix:c,t:o}),!k&&u.jsx(pt,{variant:"text",startIcon:u.jsx(cx,{sx:{fontSize:16}}),onClick:()=>{window.history.length>1?window.history.back():window.location.href="/"},sx:{textTransform:"none",fontWeight:600,fontSize:14,color:"text.secondary","&:hover":{bgcolor:"action.hover"},animation:`${yr} 0.5s ease 0.45s both`},children:o("common.back")})]})})}const bE=Zn(Se)`
666
+ `;function dE(a,r){const o=V.useRef(!1);V.useEffect(()=>{if(!r||o.current||!a.current)return;o.current=!0;const s=a.current,f=document.createElement("canvas");f.style.cssText="position:absolute;inset:0;pointer-events:none;z-index:10;",f.width=s.offsetWidth,f.height=s.offsetHeight,s.appendChild(f);const m=f.getContext("2d");if(!m)return;const c=["#3b82f6","#60a5fa","#34d399","#fbbf24","#f472b6","#a78bfa","#f97316"],h=[];for(let v=0;v<80;v++)h.push({x:f.width/2+(Math.random()-.5)*60,y:f.height*.35,vx:(Math.random()-.5)*12,vy:-Math.random()*14-4,w:Math.random()*8+4,h:Math.random()*6+2,color:c[Math.floor(Math.random()*c.length)],rot:Math.random()*Math.PI*2,rv:(Math.random()-.5)*.3,opacity:1});let g;const y=.25,S=.99,x=()=>{m.clearRect(0,0,f.width,f.height);let v=!1;for(const N of h)N.vy+=y,N.vx*=S,N.x+=N.vx,N.y+=N.vy,N.rot+=N.rv,N.y>f.height*.6&&(N.opacity-=.02),N.opacity>0&&(v=!0,m.save(),m.globalAlpha=N.opacity,m.translate(N.x,N.y),m.rotate(N.rot),m.fillStyle=N.color,m.fillRect(-N.w/2,-N.h/2,N.w,N.h),m.restore());v?g=requestAnimationFrame(x):f.remove()},A=setTimeout(()=>{g=requestAnimationFrame(x)},400);return()=>{clearTimeout(A),cancelAnimationFrame(g),f.remove()}},[r,a])}function fE(a){return a?.payment_link?.after_completion?.hosted_confirmation?.custom_message}function mE(a){const r=a?.line_items||[];for(const o of r)if(o?.price?.product?.statement_descriptor)return o.price.product.statement_descriptor;return a?.app_name||a?.payment_link?.app_name||""}function pE(a,r,o){const s=a.name||a.title,f=a.status==="delivered";return a.vendorType==="didnames"?r?o("payment.checkout.vendor.didnames.failed",{name:s}):f?o("payment.checkout.vendor.didnames.completed",{name:s}):o("payment.checkout.vendor.didnames.processing",{name:s}):r?o("payment.checkout.vendor.launcher.failed",{name:s}):f?o("payment.checkout.vendor.launcher.completed",{name:s}):o("payment.checkout.vendor.launcher.processing",{name:s})}function hE(){return u.jsxs(Se,{sx:{position:"relative",mb:1,animation:`${ED} 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both`},children:[u.jsx(Se,{sx:{position:"absolute",inset:-24,background:a=>a.palette.mode==="dark"?"radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%)":"radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%)",borderRadius:"50%",pointerEvents:"none"}}),u.jsxs(Se,{sx:{position:"relative",width:{xs:100,md:120},height:{xs:100,md:120},borderRadius:{xs:"28px",md:"32px"},background:a=>a.palette.mode==="dark"?"linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(255,255,255,0.04) 100%)":"linear-gradient(135deg, #eff6ff 0%, #ffffff 100%)",border:"1px solid",borderColor:a=>a.palette.mode==="dark"?"rgba(59,130,246,0.2)":"rgba(59,130,246,0.12)",boxShadow:a=>a.palette.mode==="dark"?"0 10px 30px -5px rgba(0,0,0,0.3)":"0 10px 30px -5px rgba(59,130,246,0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:[u.jsx(Se,{sx:{position:"absolute",inset:0,borderRadius:"inherit",background:a=>a.palette.mode==="dark"?"linear-gradient(to top-right, rgba(59,130,246,0.1), transparent)":"linear-gradient(to top-right, rgba(59,130,246,0.06), transparent)",pointerEvents:"none"}}),u.jsx(dx,{sx:{fontSize:{xs:52,md:64},color:"primary.main",filter:a=>a.palette.mode==="dark"?"drop-shadow(0 0 12px rgba(59,130,246,0.4))":"drop-shadow(0 0 12px rgba(59,130,246,0.2))"}})]}),u.jsx(Se,{sx:{position:"absolute",bottom:{xs:-6,md:-8},right:{xs:-6,md:-8},width:{xs:32,md:38},height:{xs:32,md:38},borderRadius:{xs:"12px",md:"14px"},bgcolor:"background.paper",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",border:"1px solid",borderColor:a=>a.palette.mode==="dark"?"rgba(255,255,255,0.1)":"rgba(59,130,246,0.08)",display:"flex",alignItems:"center",justifyContent:"center"},children:u.jsx(r0,{sx:{fontSize:{xs:20,md:24},color:"success.main"}})})]})}function yE({session:a,t:r}){const{currencies:o}=iE(),s=a?.amount_total,f=a?.currency_id,m=a?.subscription_data;if(Number(m?.trial_period_days||0)>0||!s||s==="0")return null;const c=o.find(x=>x.id===f)||null;if(!c)return null;const h=AD(s,c);if(!h||h==="0")return null;const g=`${h} ${c.symbol||""}`.trim(),y=r("payment.checkout.completed.summary.paid",{amount:g}),S=y.indexOf(g);return u.jsx(oe,{sx:{fontSize:{xs:15,md:16},color:"text.secondary",fontWeight:500,lineHeight:1.6,textAlign:"center",maxWidth:440,animation:`${yr} 0.5s ease 0.3s both`},children:S>=0?u.jsxs(u.Fragment,{children:[y.slice(0,S),u.jsx(Se,{component:"span",sx:{fontWeight:700,color:"text.primary"},children:g}),y.slice(S+g.length)]}):y})}function gE({vendor:a,t:r}){const[o,s]=V.useState(0),f=V.useRef(),m=V.useCallback(()=>{const y=a.progress||0;let S,x;const A=v=>{S||(S=v,x=o);const N=v-S;let B;if(y===100)B=100;else if(y===0)B=Math.min(x+N/1e3,99);else if(y>x){const O=Math.min(N/1e3,1);B=x+(y-x)*O}else B=Math.min(x+N/1e3,99);B=Math.round(B),s(O=>Math.min(O>B?O:B,100)),y!==100&&B<99&&y<100&&(f.current=requestAnimationFrame(A))};f.current&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame(A)},[a.progress,o]);V.useEffect(()=>(m(),()=>{f.current&&cancelAnimationFrame(f.current)}),[m]);const c=o>=100,h=a.status==="failed",g=pE(a,h,r);return!a.name&&!a.title?u.jsxs(Se,{sx:{mb:1.5},children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:.75},children:[u.jsx(Ot,{variant:"rounded",height:14,width:150}),u.jsx(Ot,{variant:"rounded",height:14,width:50})]}),u.jsx(Ot,{variant:"rounded",height:6,width:"100%"})]}):u.jsxs(Se,{sx:{mb:1.5},children:[u.jsxs(ge,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:.75},children:[u.jsxs(oe,{sx:{fontSize:13,fontWeight:600,color:h?"error.main":"text.secondary",display:"flex",alignItems:"center"},children:[g,c&&!h&&u.jsx(s0,{sx:{color:"success.main",ml:.5,fontSize:16}})]}),!c&&u.jsx(oe,{sx:{fontSize:12,fontWeight:600,color:h?"error.main":"text.secondary"},children:r("payment.checkout.vendor.progress",{progress:h?0:o})})]}),u.jsx(zl,{variant:"determinate",value:h?100:o||0,sx:{height:6,borderRadius:3,bgcolor:y=>y.palette.mode==="dark"?"rgba(255,255,255,0.08)":"grey.200","& .MuiLinearProgress-bar":{borderRadius:3,bgcolor:h?"error.main":c?"success.main":"primary.main",transition:"background-color 0.3s linear"}}})]})}function DE({vendorStatus:a,pageInfo:r=void 0,locale:o,t:s}){return u.jsxs(Se,{sx:{width:"100%",maxWidth:420,p:2.5,borderRadius:3,bgcolor:f=>f.palette.mode==="dark"?"rgba(255,255,255,0.04)":"grey.50",border:"1px solid",borderColor:"divider",animation:`${yr} 0.5s ease 0.3s both`},children:[(a.vendors||[]).map((f,m)=>u.jsx(gE,{vendor:f,t:s},f.title||`vendor-${m}`)),a.hasFailed&&u.jsx(oe,{sx:{fontSize:13,fontWeight:600,color:"warning.main",mt:1},children:s("payment.checkout.vendor.failedMsg")}),a.isAllCompleted&&r?.success_message?.[o]&&u.jsx(oe,{sx:{fontSize:14,fontWeight:600,color:"text.primary",mt:1},children:r.success_message[o]})]})}function vE({mode:a,subscriptions:r,subscriptionId:o=void 0,payee:s,prefix:f,t:m}){return["subscription","setup"].includes(a)?r.length>1?u.jsx(Se,{sx:{width:"100%",maxWidth:420,borderRadius:3,bgcolor:c=>c.palette.mode==="dark"?"rgba(255,255,255,0.04)":"grey.50",border:"1px solid",borderColor:"divider",overflow:"hidden",animation:`${yr} 0.5s ease 0.35s both`},children:r.map((c,h)=>u.jsxs(Se,{children:[h>0&&u.jsx(ti,{}),u.jsxs(ge,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{px:2.5,py:1.5},children:[u.jsx(oe,{sx:{fontSize:13,fontWeight:500,color:"text.secondary",flex:1,minWidth:0},noWrap:!0,children:c.description||c.id}),u.jsx(Se,{sx:{flex:1,borderBottom:"1px dashed",borderColor:"grey.300",mx:2,minWidth:20}}),u.jsxs(cr,{href:Dt(f,`/customer/subscription/${c.id}`),underline:"none",sx:{display:"flex",alignItems:"center",gap:.5,fontSize:13,fontWeight:600,color:"primary.main",flexShrink:0},children:[m("payment.checkout.next.view"),u.jsx(Ol,{sx:{fontSize:14}})]})]})]},c.id))}):o?u.jsx(pt,{variant:"contained",href:Dt(f,`/customer/subscription/${o}`),endIcon:u.jsx(Ol,{sx:{fontSize:16}}),sx:{width:"100%",maxWidth:320,height:52,borderRadius:"16px",textTransform:"none",fontWeight:700,fontSize:{xs:16,md:17},letterSpacing:"0.02em",color:c=>Yf(c),boxShadow:"0 8px 24px -4px rgba(59,130,246,0.25)","&:hover":{boxShadow:"0 12px 28px -4px rgba(59,130,246,0.35)"},animation:`${yr} 0.5s ease 0.35s both`},children:m("payment.checkout.next.subscription",{payee:s})}):null:null}function bE({mode:a,invoiceId:r=void 0,prefix:o,t:s}){return a!=="payment"||!r?null:u.jsx(pt,{variant:"contained",href:Dt(o,`/customer/invoice/${r}`),endIcon:u.jsx(Ol,{sx:{fontSize:16}}),sx:{width:"100%",maxWidth:320,height:52,borderRadius:"16px",textTransform:"none",fontWeight:700,fontSize:{xs:16,md:17},letterSpacing:"0.02em",color:f=>Yf(f),boxShadow:"0 8px 24px -4px rgba(59,130,246,0.25)","&:hover":{boxShadow:"0 12px 28px -4px rgba(59,130,246,0.35)"},animation:`${yr} 0.5s ease 0.35s both`},children:s("payment.checkout.next.invoice")})}function Gw({submit:a,session:r}){const{t:o,locale:s}=ft(),{vendorStatus:f}=a,m=mE(r),c=Qn(),h=r?.mode||"payment",g=a.result?.checkoutSession,y=r?.subscriptions||[],S=r?.subscription_id||g?.subscription_id,x=r?.invoice_id||a.result?.checkoutSession?.invoice_id||a.result?.checkoutSession?.payment_intent?.invoice_id,A=r?.metadata?.page_info,v=fE(r),B=r?.submit_type==="donate"?"payment.checkout.completed.donate":`payment.checkout.completed.${h}`,O=v||o(B),k=f&&!f.isAllCompleted&&!f.hasFailed,K=V.useRef(null),j=!f?.hasFailed;return dE(K,j),u.jsx(Se,{ref:K,sx:{position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flex:1,minHeight:400,p:{xs:3,md:4},textAlign:"center",overflow:"hidden"},children:u.jsxs(ge,{spacing:3,alignItems:"center",sx:{width:"100%",maxWidth:440},children:[f?.hasFailed?u.jsx(f0,{sx:{fontSize:64,color:"warning.main",animation:`${ED} 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both`}}):u.jsx(hE,{}),u.jsxs(ge,{spacing:1,alignItems:"center",sx:{animation:`${yr} 0.5s ease 0.2s both`},children:[u.jsx(oe,{sx:{fontSize:{xs:28,md:36},fontWeight:800,color:"text.primary",lineHeight:1.2,letterSpacing:"-0.02em"},children:O}),m&&u.jsx(oe,{sx:{fontSize:{xs:14,md:16},color:"text.secondary",fontWeight:500,lineHeight:1.6,maxWidth:360},children:o("payment.checkout.completed.tip",{payee:m})})]}),u.jsx(yE,{session:g||r,t:o}),f&&u.jsx(DE,{vendorStatus:f,pageInfo:A,locale:s,t:o}),f?.hasFailed&&f.error&&u.jsx(mr,{severity:"warning",sx:{maxWidth:420,borderRadius:3,width:"100%"},children:f.error}),!k&&u.jsx(vE,{mode:h,subscriptions:y,subscriptionId:S,payee:m,prefix:c,t:o}),!k&&u.jsx(bE,{mode:h,invoiceId:x,prefix:c,t:o}),!k&&u.jsx(pt,{variant:"text",startIcon:u.jsx(cx,{sx:{fontSize:16}}),onClick:()=>{window.history.length>1?window.history.back():window.location.href="/"},sx:{textTransform:"none",fontWeight:600,fontSize:14,color:"text.secondary","&:hover":{bgcolor:"action.hover"},animation:`${yr} 0.5s ease 0.45s both`},children:o("common.back")})]})})}const xE=Zn(Se)`
667
667
  width: 100%;
668
668
  height: 100vh;
669
669
  display: flex;
@@ -681,4 +681,4 @@ function print() { __p += __j.call(arguments, '') }
681
681
  font-weight: 400;
682
682
  line-height: 20px;
683
683
  text-align: center;
684
- `;function xE({error:a=void 0}){const{t:r}=ft();return u.jsxs(bE,{children:[u.jsx(t0,{children:a?.message||r("common.error")}),u.jsx(t0,{children:a?.stack||r("common.error")})]})}function CE({error:a}){return u.jsx(xE,{error:a})}function SE(a){return typeof window<"u"&&window?.blocklet?.serviceHost||""||a}const{SessionProvider:_E,SessionContext:AE,SessionConsumer:Gw,withSession:Kw}=Qx();function wD(){return V.useContext(AE)}function EE(a){const{session:r,connectApi:o,events:s}=wD(),[f]=eC(),m=f.get("embed")||sessionStorage.getItem("embed");return V.useEffect(()=>{m&&sessionStorage.setItem("embed",m)},[m]),V.useEffect(()=>{s.once("logout",()=>{r.login(()=>{},{openMode:"redirect",redirect:window.location.href})})},[]),V.useEffect(()=>{r.initialized&&!r.user&&r.login(()=>{},{openMode:"redirect",redirect:window.location.href})},[r.initialized]),r.user?u.jsx(sD,{session:r,connect:o,children:u.jsx(Zx,{currentTab:`${window.blocklet.prefix}customer`,hideFooter:!0,embed:m==="1",notLoginContent:"undefined",children:a.children})}):null}function n0(){return u.jsx(Se,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:u.jsx(gr,{})})}function wE(){const a=window.blocklet;return!!(a&&a.appPid&&a.prefix)}function TE(a){const{session:r,connectApi:o}=wD();return V.useEffect(()=>{r.initialized&&!r.user&&r.login(()=>{})},[r.initialized]),!wE()||!r.initialized?u.jsx(n0,{}):r.user?u.jsxs(sD,{session:r,connect:o,children:[u.jsx(Uf,{meta:void 0,addons:void 0,sessionManagerProps:void 0,homeLink:void 0,theme:void 0,hideNavMenu:void 0,maxWidth:!1,sx:{borderBottom:"1px solid",borderColor:"divider"}}),u.jsx(Se,{sx:{flex:1,maxWidth:1200,mx:"auto",px:3,py:3,width:"100%"},children:a.children})]}):u.jsx(n0,{})}function Qw({pending:a=!0}){const[r,o]=V.useState(0);return V.useEffect(()=>{const s=setInterval(()=>{o(f=>{if(f===100)return s&&clearInterval(s),-1;const m=Math.random()*10;return Math.min(f+m,100)})},a?500:30);return()=>{clearInterval(s)}},[a]),u.jsx(Se,{sx:{width:"100%",height:"4px",position:"fixed",top:0,left:0,zIndex:"999999"},children:u.jsx(zl,{variant:"determinate",value:r,sx:{opacity:r===-1?0:1,transition:"0.3s"}})})}const TD=V.createContext({});function kE({children:a}){const[r,o]=V.useTransition(),s=V.useMemo(()=>({isPending:r,startTransition:o}),[r]);return u.jsx(TD.Provider,{value:s,children:a})}function Zw(){return V.useContext(TD)}var FE=Xx();const jE=ri(FE),RE=Wl({common:{redirecting:"Redirecting...",title:"Name",estimated:"Estimated",total:"Total",active:"Active",every:"Every",inactive:"Inactive",enabled:"Enabled",disabled:"Disabled",metadata:{label:"Metadata",description:"Add custom key-value pairs to store additional information about this meter.",add:"Add more metadata",edit:"Edit metadata",empty:"No metadata",emptyTip:"You haven't added any metadata yet. You can add it now",formMode:"Switch to form mode",jsonMode:"Switch to JSON mode",jsonPlaceholder:"Enter JSON data...",invalidJson:"Invalid JSON format. Please check your input",formatJson:"Format JSON"},price:"Price",add:"Add",fullscreen:"Fullscreen",exit:"Exit",maxLength:"Max {len} characters",minLength:"Min {len} characters",invalidCharacters:"Invalid characters",latinOnly:`Must contain at least one letter and cannot include Chinese characters or special characters such as <, >, ", ' or \\`,loading:"Loading...",loadMore:"Load more",noMoreData:"No more data",rechargeTime:"Recharge Time",submit:"Submit",custom:"Custom",estimatedDuration:"{duration} est.",detail:"Detail",setting:"Setting",slippage:"Slippage Limit",slippageMinRate:"Min acceptable rate {rate} {currency}",slippageTooltip:"The minimum acceptable exchange rate for automatic payments. If the rate drops below this, payment will be paused.",welcome:"Welcome to Payment Kit",welcomeDesc:"Start accepting payments in minutes with Payment Kit. Choose a feature to get started.",quickStart:"Quick Start Guides",advancedFeatures:"Advanced Features",quickStarts:"Quick Starts",homeTagline:"A decentralized Stripe-like payment solution for Blocklets",adminDashboard:"Admin Dashboard",customerPortal:"Customer Portal",copy:"Copy",copied:"Copied",copySuccess:"Copied successfully",copyFailed:"Copy failed",copyTip:"Please copy manually",save:"Save",saving:"Saving...",saved:"Saved successfully",refresh:"Refresh",cancel:"Cancel",back:"Back",know:"I Know",confirm:"Confirm",increased:"increased",decreased:"decreased",edit:"Edit",view:"View",select:"Select",clear:"Clear",delete:"Delete",deleting:"Deleting...",activate:"Activate",deactivate:"Deactivate",yes:"Yes",no:"No",never:"Never",created:"Created",updated:"Updated",valid:"Valid",events:"Events",details:"Details",discount:"Discount",deleted:"Deleted",maxAmount:"Max amount is {max}",days:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},name:"Name",type:"Type",status:"Status",remainingCredit:"Remaining Credit",scope:"Scope",source:"Source",effectiveDate:"Effective Date",expirationDate:"Expiration Date",creditGrant:"Grant",date:"Date",subscription:"Subscription",meter:"Meter",meterEvent:"Meter Event",creditAmount:"Credit",createdAt:"Created At",expiresAt:"Expires At",general:"All usage-based prices",specific:"Specific usage-based prices",paid:"Paid",promotional:"Promotional",viewInvoice:"View Invoice",viewSourceData:"View Source",goToConfigure:"Go to Configure",noData:"No data"},notification:{preferences:{title:"Email Notification Settings",button:"Email Settings",frequency:{label:"Notification Frequency",default:"Instant Notifications (Default)",daily:"Daily",weekly:"Weekly",monthly:"Monthly"},day:"Day",timeFormatError:"Please enter a valid time in 24-hour format (HH:MM)",monthlyHelp:"If day is not available in a month, the last day will be used",subscriptionRenewalNote:"This setting applies to subscription renewal notifications."}},admin:{description:"Manage your products, pricing, billing, and payments.",balances:"Balances",trends:"Trends",addresses:"Addresses",metrics:"Metrics",attention:"Attention",overview:"Overview",overviewPage:{financialIndicatorsTitle:"Financial Indicators",businessMonitoringTitle:"Business Monitoring",filters:{dateRange:"Select Date Range",currencyLabel:"Currencies",productLabel:"Products",regionLabel:"Regions",allCurrencies:"All Currencies",allProducts:"All Products",allRegions:"All Regions"},financialIndicators:{totalIncome:{title:"Total Income",subtitle:"User's actual payment"},refundAmount:{title:"Refund Amount",subtitle:"Total refunds issued"},costOfGoods:{title:"Cost of Goods",subtitle:"Supplier share"},netRevenue:{title:"Net Revenue",subtitle:"Revenue after vendor costs"},promotionCost:{title:"Promotion Cost",subtitle:"Discount"},taxedRevenue:{title:"Taxed Revenue",subtitle:"Revenue with tax"}},charts:{title:"Transaction Trends",payments:"Payments",payouts:"Payouts",refunds:"Refunds",allCurrencies:"All currencies"},metrics:{transaction:"Transaction Metrics",essential:"Essential Metrics"},overdue:{title:"Pending Consumption",subtitle:"Unpaid credit consumption",customers:"{count} customers",events:"{count} pending records",viewAll:"View All",noOverdue:"No pending consumption"}},payments:"Payments",connections:"Connections",back:"Back",actions:"Actions",create:"Create",creating:"Creating...",save:"Save",saving:"Saving...",cancel:"Cancel",paymentLinks:"Payment links",paymentMethods:"Payment methods",customers:"Customers",products:"Products",invoiceItems:"Invoice Items",pricing:"Pricing",coupons:"Coupons",tax:"Tax",taxRates:"Tax Rates",taxRate:{create:"Create Tax Rate",createTitle:"Create Tax Rate",createAction:"Add Tax Rate",created:"Tax rate created successfully",updated:"Tax rate updated successfully",deleted:"Tax rate deleted successfully",label:"Tax Rate",view:"View Tax Rate",displayName:"Display Name",displayNamePlaceholder:"Name shown on invoices and reports",displayNameAuto:"Auto-generated if left empty",displayNameRequired:"Display name is required",description:"Description",descriptionPlaceholder:"Optional description",country:"Country",countryRequired:"Country is required",state:"State/Province",postalCode:"Postal Code",taxCode:"Product Tax Code",taxCodeDescription:"Tax codes are used to calculate automatic taxes based on product type and location. You can ",taxCodeDescriptionLink:"manage tax rates",taxCodeDescriptionSuffix:" to create custom tax rates for specific tax codes and regions.",selectTaxCode:"Select product tax code",percentage:"Tax Rate (%)",percentageRequired:"Tax rate percentage is required",percentageMin:"Tax rate must be 0% or higher",percentageMax:"Tax rate must be less than 100%",active:"Active by default",location:"Region",advanced:"Advanced options",search:"Search tax rates",searchCountry:"Search country",back:"Back to tax rates",associatedInvoices:"Related Invoices",deleteTitle:"Delete Tax Rate",deleteMessage:"Are you sure you want to delete tax rate “{name}”? This action cannot be undone.",deactivateTitle:"Deactivate Tax Rate",deactivateMessage:"Deactivate “{name}”? It will no longer apply automatically to invoices.",activateTitle:"Activate Tax Rate",activateMessage:"Activate “{name}”? It will be available for future invoices.",createTitleShort:"Add tax rate",edit:"Edit",editTitle:"Edit Tax Rate",selectTaxCodeHint:"We'll use this tax code to calculate automatic tax on invoices.",searchPlaceholder:"Search by product or tax code",previewPlaceholder:"Select a tax code to see details.",usePreset:"Use preset",noPreset:"No preset selected",noSuggestions:"No tax codes match your search.",relatedInvoiceNum:"Related Invoices",notUsed:"Not used",taxCodeLabel:"Tax code: {code}",types:{general:"General",digital:"Digital products",services:"Services",physical:"Physical goods"}},pricingTables:"Pricing tables",vendors:"Vendors",billing:"Billing",invoices:"Invoices",subscriptions:"Subscriptions",meters:"Meters",meterEvents:{title:"Meter Events"},overdue:{title:"Pending Consumption",pendingAmount:"Pending Amount",eventCount:"Pending Records",noOverdue:"No pending consumption",selectCurrency:"Currency"},meter:{add:"Add meter",edit:"Edit meter",save:"Save meter",saved:"Meter successfully saved",creditMode:{onchain:"OnChain",onChainDescription:"Once enabled, your credit will be published as a Token on the ArcBlock blockchain",tokenConfiguration:"Token Configuration",createNewToken:"Create New Token",useExistingToken:"Use Existing Token",createTokenHint:"Fill in the token name and symbol to create a new Token",tokenName:"Token Name",tokenNamePlaceholder:"Enter token name",tokenNameRequired:"Token name is required",tokenSymbol:"Token Symbol",tokenSymbolPlaceholder:"Enter token symbol",tokenSymbolRequired:"Token symbol is required",tokenSymbolFormat:"Symbol must be 1-6 uppercase letters or numbers",createTokenButton:"Create Token",creatingToken:"Creating...",tokenCreated:"Token created successfully",tokenCreatedLabel:"Token Created",tokenAddress:"Token Address",selectToken:"Select Token",selectTokenPlaceholder:"Select an existing token",tokenAddressRequired:"Token address is required",enabled:"Enabled"},activate:"Activate meter",activated:"Meter activated successfully",deactivate:"Deactivate meter",deactivated:"Meter deactivated successfully",deleted:"Meter deleted successfully",deleteConfirm:"Are you sure you want to delete this meter? This action cannot be undone.",activateConfirm:"Are you sure you want to activate this meter? It will start collecting usage data.",deactivateConfirm:"By deactivating, no further events for this meter can be reported. Attempts to create events for this meter will return an error. Previously reported usage will remain. You can reactivate at any time.",view:"View meter",basicInfo:"Basic information",basicInfoDescription:"Configure the core settings for your meter to track usage events.",editDescription:"Update the meter name, description, and metadata. Core settings like event name and aggregation method cannot be changed.",inactive:"Meter is inactive",inactiveTip:"This meter is not collecting usage data. Activate it to start tracking events.",name:{label:"Meter name",required:"Meter name is required",placeholder:"API requests",help:"A descriptive name for this meter that will be displayed in your dashboard and user's personal bill."},eventName:{label:"Event name",required:"Event name is required",placeholder:"api_request",help:"The event name that will be sent to this meter",editHelp:"Event name cannot be changed after meter creation to maintain data consistency."},aggregationMethod:{label:"Aggregation method",required:"Aggregation method is required",sum:"Sum",sumHint:"Add all event values together",sumDescription:"The sum aggregation method adds all usage event values together and reports the total for event summaries and billing.",count:"Count",countHint:"Count the number of events",countDescription:"The count aggregation method counts the number of events received and reports the total count for event summaries and billing.",last:"Last value",lastHint:"Use the most recent event value",lastDescription:"The last value aggregation method uses the most recent event value received and reports that value for event summaries and billing.",editHelp:"Aggregation method cannot be changed after meter creation to maintain data consistency."},unit:{label:"Measurement unit",required:"Measurement unit is required",placeholder:"request",help:"The unit of measurement for this meter",editHelp:"Measurement unit cannot be changed after meter creation to maintain data consistency."},description:{label:"Description",placeholder:"Track API usage for billing",help:"Optional description to help you and your team understand what this meter tracks."},events:{title:"Events",dailyEventCount:"Daily Event Count",dailyTotalValue:"Daily Total Value",eventName:"Event Name",value:"Value",customer:"Customer",subscription:"Subscription",reportTime:"Report Time",count:"{count} events total",empty:"No event data",emptyTip:"Data will appear here when events are reported",filterByCustomer:"Filter by customer",eventCount:"Event Count",totalValue:"Total Value"},usageGuide:{title:"How to report usage",description:'Send events to this meter using the event name "{eventName}". The meter will {method} the values and track usage in {unit}.',tip:'Send events to this meter using the event name "{eventName}". The meter will {aggregationMethodHint} and track usage in {unit}.',apiEndpoint:"API Endpoint",curlExample:"cURL Example",jsExample:"JavaScript Example",pythonExample:"Python Example",important:"Important",tip1:"Replace YOUR_API_KEY with your actual API key",tip2:"The event_name must match exactly: {eventName}",tip3:"Include a timestamp for accurate tracking",moreInfo:"For more information, see our",apiDocs:"API documentation"},products:{count:"{count} associated products",create:"Create product",created:"Product created successfully",createPrompt:"Enter product name:",manage:"Manage",empty:"No products",title:"Products",emptyTip:"No products are associated with this meter yet.",meterService:"Meter Service",creditCharge:"Credit Charge"},creditProducts:{emptyTip:"No credit products are associated with this meter yet."},rechargePackage:{priceId:"Top-up Package",tooltip:"The top-up package is used to recharge {name}, and users can get the corresponding {name} after purchase."}},creditProduct:{create:"Create Credit Product",defaultName:"{name} Top-up Package",defaultDescription:"{name} Top-up Package",defaultNickname:"Credit Recharge",unitLabel:"units",settings:"Credit Settings",configTitle:"Credit Configuration",expirationTime:{label:"Expiration",expireWithNextGrant:"Expire with Next Grant"},name:{placeholder:"Enter Credit product name"},description:{placeholder:"Describe the purpose and value of this Credit product"},priceNotice:"Credit products are used to provide consumable credits to users, supporting both one-time purchase and package pricing models.",creditAmount:{label:"Credit Amount",placeholder:"Amount of credits users receive when purchasing this price",help:"Leave empty for pay-per-unit pricing, enter a number for fixed package deals",description:"Purchase quantity determines the amount of Credits received"},validDuration:{label:"Valid Duration",help:"Credit validity period, calculated from purchase time",description:"Set to 0 for permanent validity",hours:"hours",days:"days",weeks:"weeks",months:"months",years:"years"},associatedPrices:{label:"Associated Prices",placeholder:"Select service prices this Credit can be used for",help:"When selected, purchased Credits can only be used for specified services",description:"No selection means Credits can be used for all services"},priority:{label:"Usage Priority",help:"Usage order when user has multiple Credits, lower numbers have higher priority",description:"Range: 0-100, 0 is highest priority, 50 is default value"},deliveryMode:{label:"Delivery Mode",once:"One-time",periodic:"Periodic"},schedule:{interval:{label:"Grant Frequency",hour:"hours",day:"days",week:"weeks",month:"months"},amountPerGrant:{label:"Amount per Grant",description:"Fixed Credit amount per grant"},expireWithNextGrant:{label:"Expire with Next Grant",description:"This Credit expires when the next grant is issued (refresh mode)"}}},meterEvent:{title:"Meter Event Details",id:"Event ID",totalEvents:"Total events: {count}",noEvents:"No events found",noEventsHint:"You can manually add test events in test mode.",identifier:"Identifier",customer:"Customer",customerId:"Customer ID",value:"Value",subscription:"Subscription",creditConsumed:"Credit Consumed",usageValue:"Usage Value",settlementAmount:"Settlement Amount",reportedAmount:"Reported Amount",overdueAmount:"Overdue Amount",reportedAt:"Reported At",processedAt:"Processed At",eventIdentifier:"Event Identifier",usageDetails:"Usage Details",chart:{eventCount:"Daily Event Count",totalValue:"Daily Total Value"},filter:{customer:"Filter by Customer"},add:{button:"Add usage",title:"Add usage",customerId:"Customer",customerIdPlaceholder:"Select customer",value:"Value",valuePlaceholder:"Enter usage value",subscriptionId:"Subscription",subscriptionIdPlaceholder:"Enter subscription ID (optional)",subscriptionIdHint:"Optional - link this usage to a specific subscription",timestamp:"Timestamp",timestampHint:"When this usage occurred",validation:"Customer and value are required",success:"Usage event added successfully",submit:"Submit"}},developers:"Developers",webhooks:"Webhooks",events:{title:"Events",dailyEventCount:"Daily Event Count",dailyTotalValue:"Daily Total Value",eventName:"Event Name",value:"Value",customer:"Customer",subscription:"Subscription",reportTime:"Report Time",count:"{count} events total",empty:"No event data",emptyTip:"Data will appear here when events are reported",filterByCustomer:"Filter by customer",eventCount:"Event Count",totalValue:"Total Value",hourly:"Hourly",totalEvents:"Total Events",timeRange:"Time Range",hourlyView:"Hourly View",dailyView:"Daily View"},refunds:"Refunds",payouts:"Payouts",logs:"Logs",passports:"Passports",details:"Details",settings:"Settings",branding:"Branding",business:"Business",summary:"Summary",product:{empty:"No product",info:"Product information",add:"Add product",view:"View product details",save:"Save product",saved:"Product successfully saved",additional:"Additional options",edit:"Edit product",pricing:"Pricing",find:"Find a product",archive:"Archive product",archiveTip:"Archiving will hide this product from new purchases. Are you sure you want to archive this product?",unarchive:"Unarchive product",unarchiveTip:"Unarchiving will enable this product for new purchases. Are you sure you want to unarchive this product?",remove:"Remove product",removeTip:"Removing will hide this product from new purchases. Are you sure you want to remove this product?",archived:"This product has been archived",archivedTip:"This product can't be added to new invoices, subscriptions, payment links, or pricing tables. Any existing subscriptions with this product remain active until canceled and any existing payment links or pricing tables are deactivated.",locked:"This product is locked because at least one of its prices is used by a subscription or a payment.",currencyNotAligned:"All prices must have the same currency settings",image:{label:"Image",add:"Add image"},features:{label:"Features",add:"Add another feature"},name:{label:"Name",required:"Product name is required",placeholder:"Premium plan"},description:{label:"Description",required:"Product description is required",placeholder:"Product descriptions that appear on checkout, invoice pages"},statement_descriptor:{label:"Statement descriptor",placeholder:"ArcBlock"},unit_label:{label:"Unit label",placeholder:"Unit"},billingType:{label:"Billing type",standard:"Standard billing",standardDesc:"Charge a fixed amount on a recurring basis",metered:"Metered billing",meteredDesc:"Charge based on usage tracked by a meter",help:"Choose how customers will be charged for this product"},meter:{label:"Meter",placeholder:"Select a meter to track usage",required:"Please select a meter for metered billing",help:"Select the meter to track usage for this product",pricingNote:"For metered products, pricing is automatically based on usage tracked by the selected meter. You only need to set the unit price and billing period."},cross_sell:{title:"Cross-sells",to:"Cross-sells to",tip:""},type:{label:"Product Type",service:"Service",serviceDesc:"Digital services or subscriptions",credit:"Credit",creditDesc:"Credit top-up product for credit-based billing scenarios",creditDescLink:"Create meters first",good:"Good",goodDesc:"Physical products or tangible goods"},vendorConfig:{title:"Vendor Configuration",add:"Add Vendor",empty:'No vendors configured. Click "Add Vendor" to configure vendor services',vendor:"Vendor",vendorRequired:"Vendor is required",productCode:"Product Code",productCodeRequired:"Product code is required",commissionType:"Commission Type",commissionRate:"Commission Rate",commissionRateRequired:"Commission rate is required",commissionRateMin:"Commission rate must be at least 0",commissionRateMax:"Commission rate cannot exceed 100%",amount:"Fixed Amount",noVendor:"No vendor available",amountRequired:"Fixed amount is required",totalCommission:"Total commission rate: {total}%",totalCommissionExceeded:"Total commission rate exceeds 100%: {total}%"}},price:{name:"Price",type:"Usage type",plan:"Price plan",info:"Price information",count:"{count} prices",empty:"No price",addAnother:"Add another price",order:"Plan {order}",lookupKey:"Lookup key",setAsDefault:"Set as default price",detail:"Pricing details",add:"Add another price",view:"View price details",additional:"Additional options",model:"Pricing model",amount:"Price",amountDescription:"This is the tax-inclusive price that customers will pay.",locked:"This price is locked because it is used by a subscription or a payment.",amountTip:"Choose recurring for subscriptions and one-time for everything else.",duplicate:"Duplicate price",edit:"Edit price",find:"Find or add a price",archive:"Archive price",archiveTip:"Archiving will hide this price from new purchases. Are you sure you want to archive this price?",remove:"Remove price",removeTip:"Removing will hide this price from new purchases. Are you sure you want to remove this price?",unit_amount:{required:"Price is required",positive:"Price must be positive",stripeTip:"Stripe requires the price to be at least 0.5"},nickname:{label:"Price description",placeholder:""},lookup_key:{label:"Lookup key",placeholder:"",description:"Lookup key is used to identify the price in the API"},recurring:{interval:"Billing period",metered:"Usage is metered?",meteredTip:"Metered billing lets you charge customers based on reported usage at the end of each billing period.",aggregate:"Charge for metered usage by",intervalCountTip:"Billing interval must be a positive number",stripeTip:"Stripe requires the billing period to be at least 1 day"},currency:{add:"Add more currencies",list:"Currencies"},models:{standard:"Standard pricing",standardDesc:"A single, fixed price",package:"Package pricing",packageDesc:"Price by number of units",graduated:"Graduated Pricing",volume:"Volume pricing",custom:"Customer chooses price",usageBased:"Usage-based",creditMetered:"Credit metered"},creditMetered:{label:"Credit metered",placeholder:"Select a meter to track usage",required:"Please select a meter for metered billing",help:"Select the meter to track usage for this product",selectMeter:"Select meter",pricingNote:"For metered products, pricing is automatically based on usage tracked by the selected meter.",description:"Credit metered billing requires corresponding credit consumption. If credits are consumed, the corresponding service will stop."},credit:{saveAsBasePrice:"Set as Top-up Package",saveSuccess:"Successfully set as top-up package"},types:{onetime:"One time",onetimeDesc:"Charge a one-time fee",recurring:"Recurring",recurringDesc:"Charge an ongoing fee"},paymentType:"Payment Type",billingModel:"Billing Model",pricing:"Pricing",additionalCurrencies:"Additional Currencies",advanced:"Advanced Settings",customInterval:"Custom Interval",perUnit:"Per Unit",choosePricingModel:"Choose your pricing model",usage:"Usage",usageDesc:"Price by number of users, units, or seats. Requires a record for Stripe to track customer service usage.",meter:"Meter",billingPeriod:"Billing period",aggregate:{sum:"Sum of usage values during period",max:"Maximum usage value during period",last_during_period:"Most recent usage value during period",last_ever:"Most recent usage value"},upsell:{title:"Upsells",to:"Upsells to",tip:""},quantity:{tip:"Quantity must be at least 0"},quantityAvailable:{label:"Available quantity",placeholder:"0 means unlimited",format:"Available {num} pieces",noLimit:"No limit on available quantity",valid:"Available quantity must be at least the sold quantity",description:"Enter the number of units that can be sold, 0 means unlimited"},quantitySold:{label:"Sold quantity",format:"Sold {num} pieces"},quantityLimitPerCheckout:{label:"Limit per checkout quantity",placeholder:"0 means unlimited",format:"Limit {num} pieces per checkout",noLimit:"No limit on quantity per checkout",description:"Enter the number of units that can be purchased in a single checkout, 0 means unlimited"},inventory:"Inventory Settings",dynamicPricing:{label:"Enable Dynamic Pricing",description:"Price fluctuates based on real-time exchange rates",config:{title:"Dynamic Pricing Configuration",baseAmount:{label:"Base Price",description:"The base price in fiat currency",required:"Base price is required"}},validation:{checking:"Checking exchange rate availability...",rateLine:"Current rate: 1 {currency} ≈ ${rate}",usdLine:"USD estimate: ≈ ${amount}",error:"Failed to fetch exchange rate, currency not supported or data source exception",estimatedLine:"Estimated amount: ≈ {amount} {currency}",useAmount:"Fill amount"}},referencePricing:{label:"Reference Exchange Rate Pricing",description:"Use current exchange rates to estimate token amounts without enabling dynamic pricing"}},coupon:{create:"Create Coupon",view:"View coupon",description:"Coupons can be used to discount invoices, subscriptions, or entire customer accounts.",listTitle:"Coupon",terms:"Terms",tab:"Coupons",redemptions:"Redemptions",expires:"Expires",noDiscount:"No discount",name:"Name",nameHelp:"This will appear on customers' receipts and invoices.",desc:"Description",descriptionInternal:"This description is for internal use only and will not be shown to customers.",id:"ID",idOptional:"ID (Optional)",idHelp:"This will identify this coupon in the API. We recommend leaving this blank so we can generate an ID for you.",type:"Type",percentageOff:"Percentage off",fixedAmountOff:"Fixed amount off",percentageDiscount:"Percentage discount",fixedAmount:"Discount amount",currency:"Currency",applyToProducts:"Apply to specific products",duration:"Duration",once:"Once",forever:"Forever",repeating:"Repeating",durationHelp:'For subscriptions and customers, this determines how long this coupon will apply once redeemed. One-time invoices accept both "once" and "forever" coupons.',durationInMonths:"Duration in months",redemptionLimits:"Redemption limits",limitDateRange:"Limit the date range when customers can redeem this coupon",limitTotalNumber:"Limit the total number of times this coupon can be redeemed",codes:"Codes",useCustomerFacingCodes:"Use customer-facing coupon codes",promotionCodes:"Promotion Codes",promotionCodesHelp:"Promotion codes will be created after the coupon is saved.",addPromotionCode:"Add promotion code",eligibleFirstTime:"Eligible for first-time order only (each user can only use one coupon discount)",limitNumberRedemptions:"Limit the number of times this code can be redeemed",addExpirationDate:"Add an expiration date",requireMinimumOrder:"Require minimum order value",addAnotherCode:"Add another code",saved:"Coupon saved successfully",codeOptional:"Code (Optional)",codeHelp:"Leave blank to auto-generate upon creation",generate:"Generate",verificationType:"Verification Type",codeOnly:"Code Only",nftVerification:"NFT Verification",vcVerification:"Passport Verification",userWhitelist:"Specific Users",nftSettings:"NFT Verification Settings",vcSettings:"Passport Verification Settings",userWhitelistSettings:"Specific Users Settings",nftAddresses:"NFT Addresses",nftAddressesPlaceholder:"Enter NFT contract addresses",nftTags:"NFT Tags",nftTagsPlaceholder:"Enter NFT tags",trustedIssuers:"Trusted Issuers",trustedIssuersPlaceholder:"Enter trusted issuers",trustedParents:"Trusted Parents",trustedParentsPlaceholder:"Enter trusted parents",minBalance:"NFT Required Quantity",requiredRoles:"Required Roles",requiredRolesPlaceholder:"Enter required roles",trustedVcIssuers:"Trusted VC Issuers",trustedVcIssuersPlaceholder:"Enter trusted VC issuer DIDs",customerDids:"Customer DIDs",customerDidsPlaceholder:"Enter customer DIDs",customerDidsHelp:"You can select existing customers or enter DID manually",maxRedemptions:"Max Redemptions",expiresAt:"Expires At",pressEnterToAdd:"Press Enter to add",couponConfiguration:"Coupon Configuration",selectProducts:"Select Products",noProductsSelected:"No products selected",newCode:"New Code",createPromotionCode:"Create Promotion Code",promotionCodeDescription:"Create a promotion code for this coupon to allow customers to redeem the discount.",minimumAmount:"Minimum Amount",minimumAmountHelp:"Set minimum order amounts for different currencies",discountAmount:"Discount Amount",currencies:"Currencies",times:"times",months:"months",addProduct:"Add another product",unlimited:"Unlimited",inactive:"Coupon is inactive",inactiveTip:"This coupon is currently inactive and cannot be used.",discount:"Discount",updated:"Updated",timesRedeemed:"Times Redeemed",deletedSuccessfully:"Coupon deleted successfully",deleteConfirmTitle:"Delete Coupon",deleteConfirmMessage:"Are you sure you want to delete this coupon? This action cannot be undone.",cannotDeleteWithPromotionCodes:"Cannot delete coupon with existing promotion codes",couponTermsPercentage:"{percent}% off",couponTermsFixedAmount:"{amount} {symbol} off",couponTerms:{forever:"{couponOff} forever",once:"{couponOff} once",repeating:"{couponOff} for {months} months"},couponTermsDuration:{forever:"Forever",once:"Once",repeating:"For {months} months"},applicableProducts:"Applicable Products",noApplicableProducts:"This coupon applies to all products",activeRedemptions:"Active redemptions",customers:"Customers",subscriptions:"Subscriptions",noCustomersFound:"No customers found",noCustomersRedeem:"No customers currently redeem this coupon",noSubscriptionsFound:"No subscriptions found",noSubscriptionsRedeem:"No subscriptions currently redeem this coupon",rename:"Rename",renameCoupon:"Rename coupon",updateCouponDetails:"Update coupon details",nameWillAppear:"This will appear on customers' receipts and invoices.",updateCouponButton:"Update coupon",discountStart:"Discount Start",usageStats:"Usage Statistics",totalDiscounts:"Total Discounts",uniqueSessions:"Unique Sessions",uniqueSubscriptions:"Unique Subscriptions",promotionCodesUsed:"Promotion Codes Used",noExpiration:"No Expiration",usagePeriod:"Usage Period",firstUsed:"First Used",lastUsed:"Last Used",promotionCodeInfo:"Promotion Code Info",directCouponUsage:"Direct Coupon Usage",usageLimit:"Usage Limit",discountInfo:"Discount Info",discountPeriod:"Discount Period",couponExpires:"Coupon Expires",totalSavings:"Total Discounts",viewPromotionCode:"View Promotion Code"},discount:{totalSaved:"Total Saved",timesUsed:"Times Used",appliedDiscounts:"Applied Discounts"},promotionCode:{code:"Code",status:"Status",redemptions:"Redemptions",expires:"Expires",created:"Created",actions:"Actions",active:"Active",inactive:"Inactive",expired:"Expired",maxedOut:"Maxed Out",viewDetails:"View Details",edit:"Edit Promotion Code",delete:"Delete Promotion Code",archive:"Archive Promotion Code",archiveTip:"Archiving will prevent this promotion code from being used. Are you sure you want to archive this promotion code?",deleteTip:"Deleting will permanently delete this promotion code. Are you sure you want to delete this promotion code?",title:"Promotion Code",id:"ID",type:"Type",couponId:"Coupon ID",maxRedemptions:"Max Redemptions",timesRedeemed:"Times Redeemed",verificationType:"Verification Type",updated:"Updated",activate:"Activate",deactivate:"Deactivate",inactiveTitle:"Promotion code is inactive",inactiveTip:"This promotion code is currently inactive and cannot be used.",deleteSuccess:"Promotion code deleted successfully",activateSuccess:"Promotion code activated successfully",deactivateSuccess:"Promotion code deactivated successfully",verificationConfig:"Verification Configuration",nftAddresses:"NFT Addresses",nftTags:"NFT Tags",minBalance:"Min Balance",requiredRoles:"Required Roles",trustedIssuers:"Trusted Issuers",allowedUsers:"Allowed Users",noNftConfig:"No NFT configuration",noVcConfig:"No VC configuration",noUsersSpecified:"No users specified",codeVerificationOnly:"Code verification only",unlimited:"Unlimited",never:"Never",yes:"Yes",no:"No",verificationTypeMap:{code:"Code Only",nft:"NFT Verification",vc:"Passport Verification",user_restricted:"User Whitelist"}},paymentLink:{view:"View payment link",info:"Payment link information",add:"Create payment link",save:"Create link",openLink:"Open URL",copyLink:"Copy URL",saved:"Payment link successfully saved",additional:"Additional options",beforePay:"Payment page",afterPay:"After payment",products:"Products",addProduct:"Add another product",requireBillingAddress:"Collect customer billing addresses",requirePhoneNumber:"Collect customer phone numbers",allowPromotionCodes:"Allow promotion codes",enablePromotionCodes:"Enable promotion codes",disablePromotionCodes:"Disable promotion codes",enablePromotionCodesTip:"Enable promotion codes for this payment link. Customers will be able to apply discount codes during checkout.",disablePromotionCodesTip:"Disable promotion codes for this payment link. Customers will not be able to apply discount codes during checkout.",requireCrossSell:"Require cross-sell products to be selected if eligible",includeFreeTrial:"Include a free trial",noStakeRequired:"No stake required",showProductFeatures:"Show product features",allowSkipPaymentMethod:"Allow skipping payment method for $0 checkout",enableSkipPaymentMethod:"Allow skipping payment method",disableSkipPaymentMethod:"Require payment method",enableSkipPaymentMethodTip:"Allow customers to skip binding a payment method when the checkout amount is $0. The subscription will auto-cancel at the end of the current period if no payment method is added.",disableSkipPaymentMethodTip:"Require customers to provide a payment method even when the checkout amount is $0.",freeTrialDaysPositive:"Free trial days must be positive",includeCustomFields:"Add custom fields",confirmPage:"Confirmation Page",showConfirmPage:"Show confirmation page",customMessage:"Replace default with custom message",customMessageTip:"Include any details you see fit, such as delivery information.",noConfirmPage:"Do not show confirmation page",mintNft:"Mint NFT to user on payment",mintNftFrom:"Mint from following factory (collection)",createInvoice:"Creates invoices for related payments.",adjustable:"Adjustable quantity",adjustableQuantity:"Let customers adjust quantity",noProducts:"Payment link must have at least one product",noRedirectUrl:"Payment link must have a redirect url",noSubscriptionTrialDays:"You must specify a trial period for subscription",recurringNotAligned:"The prices on all line items must have the same recurring interval",currencyNotAligned:"The prices on all line items must have the same currency settings",edit:"Edit payment link",rename:"Change name",archive:"Archive payment link",archiveTip:"Archiving will hide this payment link from new purchases. Are you sure you want to archive this payment link?",remove:"Remove payment link",removeTip:"Removing will hide this payment link from new purchases. Are you sure you want to remove this payment link?",name:{label:"Name",placeholder:"Not consumer facing"},adjustableQuantityError:"Minimum must be less than maximum"},pricingTable:{view:"View pricing table",add:"Create pricing table",save:"Create",openLink:"Open URL",copyLink:"Copy URL",saved:"Pricing table successfully saved",edit:"Edit pricing table",rename:"Change name",archive:"Archive pricing table",archiveTip:"Archiving will hide this pricing table from new purchases. Are you sure you want to archive this pricing table?",remove:"Remove pricing table",removeTip:"Removing will hide this pricing table from new purchases. Are you sure you want to remove this pricing table?",name:{label:"Name",placeholder:"Not consumer facing"},display:"Display Settings",highlight:"Highlight product",customer:"Customer portal"},paymentIntent:{list:"Payments",name:"Payment",view:"View payment detail",empty:"No payment intent",refund:"Refund payment",status:{active:"Active",paid:"Paid",succeeded:"Succeeded"},received:"Received",attention:"Failed payments",refundError:"Failed to refund payment",refundSuccess:"Refund application has been successfully created",cancelRefund:"Cancel refund",refundCanceled:"Cancel refund successfully",refundCanceledError:"Failed to cancel refund",refundCanceledTip:"Are you sure you want to cancel the refund application? After cancellation, the refund will no longer be processed.",refundForm:{reason:"Refund reason",amount:"Refund amount",description:"Refund description",duplicate:"Duplicate payment",requestedByCustomer:"Requested by customer",requestedByAdmin:"Requested by admin",fraudulent:"Fraudulent",expiredUncapturedCharge:"Expired uncaptured charge",amountRange:"Refund amount must be between {min} and {max} {symbol}",amountHelper:"Refund amount must be less than or equal to {max} {symbol}",required:"Please fill in the refund information",empty:"The current order has been fully refunded"}},payout:{list:"Payouts",name:"Payout",view:"View payout",empty:"No payout",attention:"Failed payouts",requestRefund:"Request Refund",confirmRefund:"Are you sure you want to request a refund from the vendor?",refundRequested:"Refund request sent to vendor",refundReason:"Refund Reason",refundReasonPlaceholder:"Please enter the reason for refund (at least 5 characters)",refundReasonRequired:"Refund reason is required",refundReasonMinLength:"Refund reason must be at least {min} characters",refundReasonHelper:"Please enter at least {min} characters",status:{active:"Active",paid:"Paid",succeeded:"Succeeded"}},paymentMethod:{_name:"Payment Method",type:"Type",add:"Add payment method",edit:"Edit payment method",save:"Save payment method",saved:"Payment method successfully saved",settings:"Settings",gasTip:"Ensure your account on the {chain} network has sufficient balance to cover transaction fees when using {method}.",recharge:"Scan to add balance",props:{type:"Type",confirmation:"Confirmation",recurring:"Recurring support",refund:"Refund support",dispute:"Dispute support",currencies:"Currency support",explorer_host:"Explorer Host",balance:"Balance"},name:{label:"Name",tip:"Customer-facing"},description:{label:"Description",tip:"Not customer-facing"},stripe:{dashboard:{label:"Dashboard URL",tip:"Used to generate links to Stripe dashboard"},publishable_key:{label:"Publishable Key",tip:"Publishable Key, See Dashboard > Developers > API Keys"},secret_key:{label:"Secret Key",tip:"Secret Key, See Dashboard > Developers > API Keys"},webhook_signing_secret:{label:"Webhook Signing Secret",tip:"Webhook Signing Secret, See Dashboard > Developers > Webhooks > Signing Secret"},webhookHint:"If webhook events are not received, manually configure STRIPE_WEBHOOK_SECRET in environment variables",configureEnv:"Go to Settings"},arcblock:{chain_id:{label:"Chain ID",tip:"Just a name"},api_host:{label:"API Host",tip:"The GraphQL endpoint to send transactions to"},explorer_host:{label:"Explorer Host",tip:"The web app endpoint to view transaction details"}},ethereum:{chain_id:{label:"Chain ID",tip:"Must be a valid EVM chain id, usually an integer, https://chainlist.org"},api_host:{label:"RPC Endpoint",tip:"The RPC endpoint to send transactions to"},explorer_host:{label:"Explorer Host",tip:"The web app endpoint to view transaction details"},native_symbol:{label:"Native Symbol",tip:"The symbol for native token on this chain"},confirmation:{label:"Confirmation Count",tip:"Number of blocks required since transaction execution"}},evm:{checking:"Checking connection...",connected:"Connected",connectionError:"Connection failed",blockHeight:"Block Height",rpcStatus:"RPC Status"},base:{chain_id:{label:"Chain ID",tip:"Must be a valid EVM chain id, usually an integer, https://chainlist.org"},api_host:{label:"RPC Endpoint",tip:"The RPC endpoint to send transactions to"},explorer_host:{label:"Explorer Host",tip:"The web app endpoint to view transaction details"},native_symbol:{label:"Native Symbol",tip:"The symbol for native token on this chain"},confirmation:{label:"Confirmation Count",tip:"Number of blocks required since transaction execution"}},google_play:{package_name:{label:"Package Name",tip:"e.g. com.example.app, configured in Play Console"},service_account_json:{label:"Service Account JSON",tip:"Paste the full service account credentials JSON downloaded from Google Cloud Console",invalidJson:"Not valid JSON",missingFields:"JSON is missing client_email or private_key",detectedClient:"Detected client"},pubsub_topic_name:{label:"Pub/Sub Topic (optional)",tip:"projects/<project-id>/topics/<topic-name>, for receiving RTDN"}},app_store:{bundle_id:{label:"Bundle ID",tip:"e.g. com.example.app, configured in App Store Connect"},environment:{label:"Environment",tip:"StoreKit 2 JWS environment must match this setting",production:"Production",sandbox:"Sandbox"},shared_secret:{label:"Shared Secret (for StoreKit 1)",tip:"App-Specific Shared Secret for legacy receipt verification. Not needed for StoreKit 2 JWS. Find it at App Store Connect → App Information → App-Specific Shared Secret"},serverApi:{heading:"Server API Credentials (optional)",tip:"Not required for StoreKit 2 JWS verification. Only needed when querying App Store Server API for subscription status. Provide all three or none."},issuer_id:{label:"Issuer ID",tip:"App Store Connect API Issuer ID"},key_id:{label:"Key ID",tip:"App Store Connect API Key ID"},private_key_pem:{label:"Private Key (.p8 contents)",tip:"Paste the contents of the .p8 file downloaded from App Store Connect"}}},paymentCurrency:{name:"Payment Currency",add:"Add Currency",edit:"Edit Currency",save:"Save payment currency",saved:"Payment currency successfully saved",delete:"Delete payment currency",deleteConfirm:"Are you sure you want to delete this payment currency? Once deleted, it cannot be recovered",deleted:"Payment currency successfully deleted",quickAdd:"Quick add supported currency",searchToken:"Search currency",orManualInput:"Or manually fill in currency information below",logo:{label:"Logo",tip:"Displayed on payment page"},contract:{label:"Contract",tip:"Used to fetch token symbol, decimals and other info"}},event:{empty:"No events",view:"View event",data:"Event Data",webhooks:"Webhook Attempts",type:"Type",pendingWebhooks:"Pending Webhooks",noAttempts:"No Attempt",retry:"Retry",retrying:"Retrying...",retryOptions:{title:"Retry Webhook",confirmMessage:"Are you sure you want to retry this webhook? This will send another request to the webhook endpoint.",success:"Webhook scheduled for retry",error:"Failed to retry webhook"},response:"Response",request:"Request",eventData:"Event Data"},invoice:{view:"View invoice",attention:"Uncollectible invoices",metric:"Paid invoices",name:"Invoice",status:{active:"Active",paid:"Paid",succeeded:"Succeeded"},from:"Billed from",empty:"No invoices",number:"Invoice Number",description:"Billing Description",dueDate:"Due",finalizedAt:"Finalized At",paidAt:"Payment Date",summary:"Summary",billingContextNote:"Invoice amounts are calculated based on real-time prices at the time of billing.",dynamicPricingNote:"This invoice uses dynamic pricing with locked exchange rates.",billTo:"Billed to",billing:"Billing Method",download:"Download PDF",edit:"Edit Invoice",duplicate:"Duplicate Invoice",retryUncollectible:{title:"Retry collection",tip:"Are you sure you want to retry collecting this invoice? This will attempt to charge the customer again.",success:"Retry request submitted"},returnStake:{title:"Return Stake",tip:"Are you sure you want to return the stake? This action will return the stake to the customer immediately.",success:"Stake return application has been successfully created"},void:{title:"Void Invoice",tip:"Are you sure you want to void this invoice? This action will immediately void the invoice.",success:"Invoice voided"}},vendor:{create:"Create Vendor",edit:"Edit Vendor",delete:"Delete Vendor",save:"Save Vendor",saved:"Vendor saved successfully",test:"Test",testConnection:"Test Connection",testConnectionTip:'Are you sure you want to test the connection for vendor "{name}"?',testConnectionSuccess:"Connection test successful",testConnectionFailed:"Connection test failed",testSuccess:"Connection test successful",testAfterSave:"Vendor saved successfully. You can test the connection to verify the configuration.",testToEnable:"Vendor saved successfully. Test the connection to enable the vendor.",enabled:"Enabled",disabled:"Disabled",addressCheckFailed:"Address check failed, cannot save when enabled",updateSuccess:"Vendor updated successfully",testFailed:"Connection test failed (Status: {status})",testError:"Connection test failed - network error",vendorKeyInvalid:"Vendor type must contain only lowercase letters, numbers, and underscores",deleteTitle:"Delete Vendor",deleteContent:'Are you sure you want to delete vendor "{name}"? This action cannot be undone.',deleteTip:'Are you sure you want to delete vendor "{name}"? This action cannot be undone.',activate:"Activate Vendor",activateTip:'Are you sure you want to activate vendor "{name}"?',deactivate:"Deactivate Vendor",deactivateTip:'Are you sure you want to deactivate vendor "{name}"?',name:"Vendor Name",nameRequired:"Vendor name is required",vendorType:"Vendor Type",vendorTypeRequired:"Vendor type is required",didnames:"DID Names",launcher:"Launcher",vendorKey:"Vendor Key",vendorKeyRequired:"Vendor key is required",vendorKeyHelp:"Unique identifier for the vendor",description:"Description",displayNameRequired:"Display name is required",displayNameHelp:"This name will be displayed on the installation interface after successful payment",appUrl:"App URL",appUrlRequired:"App URL is required",appUrlInvalid:"Please enter a valid URL starting with http:// or https://",appUrlHelp:"The base URL of the vendor application",vendorDid:"Vendor DID",vendorDidInvalid:"Please enter a valid DID",vendorDidHelp:"Optional DID address for the vendor",webhookPath:"Webhook Path",webhookPathInvalid:"Please enter a valid path starting with /",webhookPathHelp:"Optional webhook callback path (e.g., /webhooks/status)",blockletMetaUrl:"Blocklet Meta URL",blockletMetaUrlRequired:"Blocklet Meta URL is required",blockletMetaUrlInvalid:"Please enter a valid URL starting with http:// or https://",blockletMetaUrlHelp:"Required blocklet metadata URL for application information",commission:"Commission",commissionRate:"Commission Rate",commissionRateRequired:"Commission rate is required",commissionRateMin:"Commission rate must be at least 0",commissionRateMax:"Commission rate is too high",commissionType:"Commission Type",commissionRateHelp:"Commission rate as percentage",commissionAmountHelp:"Fixed commission amount",percentage:"Percentage",fixedAmount:"Fixed Amount",active:"Active",inactive:"Inactive",basicInfo:"Basic Information",apiConfig:"API Configuration",commissionConfig:"Commission Configuration",status:"Status",brokerDID:"Broker DID",brokerPublicKey:"Broker Public Key"},subscription:{view:"View subscription",name:"Subscription",empty:"No subscriptions",status:{active:"Active",paid:"Paid",succeeded:"Succeeded"},viewAll:"View all subscriptions",noActiveEmpty:"You currently have no active subscriptions. You can choose to view your subscription history.",includedServices:"Included Services",serviceHome:"Visit Service Homepage",serviceDashboard:"Access Service Dashboard",attention:"Past due subscriptions",product:"Product",collectionMethod:"Billing",channel:"Channel",currentPeriod:"Current Period",iap:{googlePlayTitle:"Google Play Purchase",appStoreTitle:"App Store Purchase",purchaseToken:"Purchase Token",orderId:"Order ID",productId:"Product ID",originalTransactionId:"Original Transaction ID",transactionId:"Transaction ID",expiryTime:"Expires At",environment:"Environment"},trialingPeriod:"Trial Period",trialEnd:"Trial ends {prefix} {date}",willEnd:"Will end {prefix} {date}",ended:"Ended {prefix} {date}",renew:"Renew {prefix} {date}",discount:"Discount",activeDiscount:"Active Discount",startedAt:"Started",nextInvoice:"Next Invoice",nextInvoiceAmount:"Next Invoice Amount",nextInvoiceAmountTip:"The next invoice amount is estimated, the actual amount will be calculated based on actual usage.",itemId:"Subscription Item ID",update:"Update subscription",resume:"Resume payment collection",resumeTip:"Are you sure you want to resume collecting payments? Any future invoices for this subscription will resume payment collection.",paymentAddress:"Payment Address",currentBalance:"Current Balance",insufficientBalance:"Insufficient Balance, please add funds",cancel:{schedule:"Scheduled to cancel",title:"Cancel subscription",required:"Custom cancel time is required",will:"End {prefix} {date}",done:"Canceled",at:{title:"Cancel",now:"Immediately ({date})",current_period_end:"End of current period ({date})",custom:"On a custom date",timeError:"Cancel time must be within the current period"},refund:{title:"Refund",none:"No refund",last:"Last payment {total}{symbol}",proration:"Proration amount {unused}/{total}{symbol}"},staking:{title:"Stake",none:"No return or slash",proration:"Return Remaining Stake {unused}{symbol}",slash:"Slash Remaining Stake {unused}{symbol}",slashReason:"Slash Reason",slashTip:"The remaining stake of this subscription {unused}{symbol} will be slashed, please confirm to continue?",slashTitle:"Slash stake"},comment:{title:"Reason",placeholder:"Please provide the reason for cancellation"}},pause:{title:"Pause payment collection",required:"Custom resume time is required",type:{title:"Pause duration",never:"Indefinite",custom:"Until a custom date"},behavior:{title:"Invoice behavior",keep_as_draft:"Keep invoices as drafts",keep_as_draft_tip:"For businesses currently offering services but waiting to collect payments.",mark_uncollectible:"Mark invoices as uncollectible",mark_uncollectible_tip:"For businesses currently offering services for free.",void:"Void invoices",voidTip:"For businesses not currently offering services."},until:{never:"Collection paused",custom:"Collection paused until {date}"}},usage:{title:"Usage records",current:"Usage records for current period",range:"Usage records for {start} - {end}",view:"View usage",vary:"Varies with usage",used:"Unit used",cycle:"Usage cycle"},batchPay:{button:"Pay due invoices"},payerAddress:"Payment Address",noPaymentMethod:"Not bound",bindPaymentMethod:"Bind now",bindPaymentMethodFirst:"Please bind a payment method first before resuming the subscription",noPaymentMethodWarning:"No payment method is bound to this subscription. Please bind one to avoid cancellation at the end of the current period.",changePayer:{btn:"Change",stripe:{linkType:"Stripe Link",bankAccount:"Bank Account"},connect:{title:"Change Payment Address",success:"Payment Address changed successfully",error:"Failed to change payment Address"}}},customer:{view:"View customer",edit:"Edit information",spent:"Spent Amount",refund:"Refund Amount",dispute:"Dispute Amount",due:"Due Amount",stake:"Stake Amount",token:"Token Balance",name:"Name",email:"Email",phone:"Phone",invoicePrefix:"Invoice Prefix",googlePlayUuid:"Google Play UUID",appStoreUuid:"App Store UUID",balance:"Balance ({currency})",summary:{refund:"Refunds",spent:"Spent",due:"Due",stake:"Stake",stats:"Stats",balance:"Balance"},address:{label:"Address",country:"Country",state:"State or province",city:"City or town",line1:"Address",line2:"Line2",postal_code:"Postal Code"},creditGrants:{title:"Credit Grants",description:"View your available credit grants and usage history",grants:"Credit Grants",transactions:"Credit Usage",summary:"Credit Summary",noGrants:"No credit grants available",grantDetail:"Credit Grant Details",creditBalance:"Credit Balance",totalAmount:"Total Amount",status:{granted:"Active",pending:"Pending",expired:"Expired",depleted:"Depleted",voided:"Voided"},originalAmount:"Original Amount",usage:"Usage",viewInvoice:"View Invoice",grantId:"Grant ID",currency:"Currency",created:"Created",effectiveDate:"Effective Date",expirationDate:"Expiration Date",transactionHistory:"Transaction History",backToGrants:"Back to Credit Grants",viewDetails:"View Details",overview:"Overview",relatedGrants:"Credit Grants",category:"Category",overviewDescription:"Monitor all currency credit balances, usage, and outstanding debt.",availableBalance:"Available Balance",viewGrants:"View Grants",viewUsage:"View Usage",recentActivity:"Recent Activity",quickStats:"Quick Stats",activeGrants:"Active Grants",outstandingDebt:"Outstanding Debt",buyCredits:"Buy Credits",viewAllActivity:"View All Activity",pendingAmount:"Outstanding Charges",grantCount:"Grant Count",noGrantsDescription:"You don't have any credit grants yet.",addCredit:"Add Credit"}},passport:{intro:"Manage payment settings for blocklet passports, you should assign both product and payment entry to a passport to make it available for purchase.",payLink:"Payment entry",payPreview:"Payment preview",preview:"Preview payment page",assign:"Assign to passport",assignTip:"Assign this payment link to selected passport to make it available for purchase",unassign:"Reset purchase config",unassignTip:"Confirm to clear the payment entry and product config for this passport?",assignError:"Must select a passport to assign"},webhookEndpoint:{hosted:"Hosted endpoints",add:"Add endpoint",addTip:"Set up your webhook endpoint to receive live events from",listen:"Listen for",version:"API Version",attempts:"Webhook attempts",url:{label:"URL",description:"Endpoint URL"},description:{label:"Description",description:"An optional description of what this endpoint is used for."},events:{label:"Select events to listen to",description:""}},refund:{name:"Refunds",view:"View refund detail",attention:"Failed refunds",status:{active:"Active",paid:"Paid",succeeded:"Succeeded"}},usageRecord:{empty:"No usage records",add:{label:"Add usage record",success:"Successfully added usage record",quantity:"Quantity"}},donate:{title:"Donation Settings",mountLocation:"Mount Location",component:"Component",description:"Description",status:{title:"Status",active:"Enable",inactive:"Disable",inactiveTip:"After disabling donations, the donation button will no longer be displayed and users cannot use the donation feature. Are you sure you want to disable it?",inactiveTitle:"Disable Donation",activeSuccess:"Donation feature has been enabled",inactiveSuccess:"Donation feature has been disabled"},editTitle:"Edit Donation Settings",updateSuccess:"Donation settings have been updated",amountSettings:"Amount Settings",presets:"Preset Amounts",presetsHelper:"Enter preset amounts, separated by commas (e.g., 1,5,10)",preset:"Default Amount",presetHelper:"Default selected amount (must be one of the presets)",custom:"Allow Custom Amount",minimum:"Minimum Amount",maximum:"Maximum Amount",amountRange:"Amount Range: {min} - {max}",customAmount:"Custom Amount",buttonSettings:"Donation Button Settings",btn:{text:"Button Text",helper:"Set the text displayed on the donation button",preview:"Button Preview"},dialog:{preview:"Donation Dialog Preview",confirmButton:"Confirm Donation {amount}"},previewTitle:"Live Preview",validation:{invalidPreset:"Default amount must be one of the presets",invalidRange:"Minimum amount must be less than maximum amount",invalidAmount:"Amount must be within allowed range"},historyType:{title:"Donation History Display",avatar:"Avatar Wall",list:"List"},intro:"Configure the display effect of the donation button and donation dialog, and the donation feature will take effect after completion.",usage:{viewExample:"View Usage Example",title:"Donation Component Usage Example",description:"To use the donation feature, you need to correctly configure PaymentProvider and DonateProvider in the component. Here is a basic example:",note:"Note: mountLocation must be unique, used to identify the donation instance. After configuration, the instance will appear in the list, and you can make further settings."}},vaultConfig:{title:"Vault",learnMore:"Learn more about vault configuration",goToConfig:"Go to system configuration",description:"By enabling the vault wallet, you create a secure offline storage solution that automatically transfers excess funds when your hot wallet balance exceeds the threshold. This separation significantly enhances security by keeping the majority of your assets safely offline, protected from potential online threats.",notConfigured:"Vault wallet not configured",configureFirst:"Please #go to the dashboard# to configure the vault wallet address before setting up individual currencies.",ownerOnly:"Only administrators with owner permissions can modify vault wallet settings.",permissionRequired:"Owner permissions required",enabled:"Status",enabledYes:"Enabled",enabledNo:"Disabled",depositThreshold:"Deposit Threshold",withdrawThreshold:"Withdrawal Threshold",bufferThreshold:"Buffer Threshold",bufferThresholdHelp:"Only when the amount exceeding the deposit threshold reaches the buffer threshold will the collection operation be triggered.",bufferThresholdInvalid:"Buffer threshold must be at least 0",edit:"Configure",enable:"Enable",editTitle:"Configure {currency} Vault Settings",enableTitle:"Enable Vault Wallet for {currency}",enableVault:"Enable Vault Wallet",enableVaultHelp:"When enabled, excess funds automatically transfer to the vault wallet, and withdrawals exceeding the threshold require admin approval for security and risk control.",depositThresholdHelp:"When the hot wallet balance exceeds this amount, the excess funds will be automatically transferred to the vault wallet.",withdrawThresholdHelp:"For withdrawals exceeding this amount, approval from the vault wallet administrator is required.",notConfig:"Not configured",noLimit:"No limit",withdrawThresholdNoLimit:"0 means no withdrawal limit",depositThresholdRequired:"Deposit threshold must be greater than 0",withdrawThresholdInvalid:"Withdrawal threshold must be at least 0",enableSuccess:"Successfully enabled vault wallet for {currency}",disableSuccess:"Successfully disabled vault wallet for {currency}",updateSuccess:"Successfully updated vault wallet settings for {currency}",depositConfirmTitle:"Deposit to Vault",depositConfirmMessage:"{currency} balance has exceeded the threshold, do you want to deposit to vault immediately?",depositQueued:"Deposit to vault request queued, please check the result later",depositFailed:"Deposit to vault request failed",appBalance:"App Balance"},creditGrants:{tab:"Grants",title:"Credits",summary:"Credit Summary",noGrants:"No credit grants found",grantDetail:"Credit Grant Details",overview:"Overview",overviewDescription:"Monitor credit balances, usage, and outstanding debt across all currencies.",availableBalance:"Available Balance",usage:"Usage",viewGrants:"View Grants",viewUsage:"View Usage",recentActivity:"Recent Activity",quickStats:"Quick Stats",activeGrants:"Active Grants",totalCreditValue:"Total Credit Value",outstandingDebt:"Outstanding Debt",buyCredits:"Buy Credits",viewAllActivity:"View All Activity",creditBalance:"Credit Balance",totalAmount:"Total Amount",pendingAmount:"Pending Amount",grantCount:"Grant Count",noGrantsDescription:"You don't have any credit grants yet.",status:{granted:"Active",pending:"Pending",expired:"Expired",depleted:"Depleted",voided:"Voided"},originalAmount:"Original Amount",grantId:"Grant ID",grants:"Grants",addCredit:"Add Credit",viewDetails:"View Details"},creditTransactions:{tab:"Transactions",title:"Transactions",summary:"Transaction Summary",noTransactions:"No credit transactions found",totalTransactions:"Total Transactions",totalCreditUsed:"Total Credit Used",transactionDate:"Transaction Date"},exchangeRateProvider:{title:"Exchange Rate Providers",subtitle:"Manage exchange rate data sources for dynamic pricing",medianStrategyNote:"Exchange rates are calculated automatically using multiple data sources. You only need to manage this list when a provider is consistently failing or needs to be temporarily disabled.",disableConfirmTitle:"Disable Provider?",disableConfirmMessage:"Disabling this provider may affect dynamic pricing payments. Are you sure?",table:{name:"Name",participation:"Participation",health:"Health",recentActivity:"Recent Activity",trustLevel:"Trust Level",trustLevelTip:"Indicates confidence and eligibility for rate calculation. Higher values do not mean preferred or primary source.",enabled:"Enabled",lastUpdate:"Last update: {time}",failures24h:"Failures (24h): {count}"},participation:{included:"Included",excluded:"Excluded"},health:{active:"Healthy",degraded:"Unstable",paused:"Outlier",inactive:"Outlier"},status:{active:"Active",degraded:"Degraded",paused:"Paused",inactive:"Inactive"},create:{title:"Add Provider",primaryAction:"Add Exchange Rate Provider"},edit:{title:"Edit {name}",name:"Name",nameHelp:"Unique identifier for this data source",nameRequired:"Name is required",type:"Provider Type",typeHelp:"Data source type. Cannot be changed after creation.",baseUrl:"Base URL (Optional)",baseUrlHelp:"Custom base URL for proxy or self-hosted instance. Default: {defaultUrl}",apiKey:"API Key",apiKeyHelp:"API key for accessing the data source.",apiKeyLinkText:"Get your API key at",apiKeyLinkAction:"CoinMarketCap account",testConnection:"Test Connection",testing:"Testing...",testSuccess:"Connection successful ({symbol}/USD: {rate}, {time}ms)",testFailed:"Connection failed: {error}",enabled:"Enabled",priority:"Priority",priorityHelp:"Lower number = higher priority. Providers are used in priority order.",status:"Status",statusHelp:'Set to "paused" to temporarily disable this provider.',pausedReason:"Paused Reason",pausedReasonHelp:"Explain why this provider is paused (optional)."}}},empty:{image:"No Image",refunds:"No Refunds",invoices:"No Invoices",subscriptions:"No Subscriptions",customers:"No Customers",products:"No Products",invoiceItems:"No Invoice Items",payouts:"No Payouts",paymentLinks:"No Payment Links",paymentMethods:"No Payment Methods",pricingTables:"No Pricing Tables",paymentCurrencies:"No Payment Currencies",webhooks:"No Webhooks",events:"No Events",records:"No matching records found",payments:"No Payments",prices:"No Prices",pricing:"You haven't added any prices you can add it",summary:"No Summary"},customer:{subscription:{cancel:"Cancel Subscription",manage:"Manage Subscription",title:"Subscriptions"},invoiceHistory:"Invoice History",product:{empty:"No Products"},credit:{recharge:"Buy Credits",autoRecharge:"Auto Top-up",unsupported:"Not supported yet"},recharge:{title:"Add Funds",amount:"Amount",submit:"Submit",unsupported:"Unsupported currency, please select another one",receiveAddress:"Receive Address",view:"View Subscription",success:"Add funds successfully",custom:"Custom",estimatedDuration:"{duration} {unit} est.",intervals:"intervals",history:"Fund History",relatedSubscriptions:"Related Subscriptions",rechargeTooltip:"Click to add funds"},delegation:{title:"Seems your delegation to this blocklet is revoked or insufficient, which will cause automatic payment failures for your subscription.",btn:"Delegate Now",success:"Delegate successful",error:"Delegate failed"},overdraftProtection:{title:"SubGuard™",setting:"Set SubGuard™",learnMore:"Click to learn more about SubGuard™",tip:"To avoid service interruption due to unpaid invoices, you can enable SubGuard™ by staking. Timely payment will not incur additional fees. Please settle your invoices promptly. If your available stake is insufficient or payment is overdue, we will deduct the amount from your stake and charge a service fee.",enabled:"Enabled",disabled:"Disabled",returnRemaining:"Return Remaining Stake",returnRemainingTip:"Once the remaining stake is returned, the SubGuard™ will be automatically disabled. Please confirm the action.",applyRemainingSuccess:"Stake return application successful",remaining:"Your current remaining stake: {amount} {symbol}, estimated required stake per cycle: {estimateAmount} {symbol}.",noRemaining:"No remaining stake available. Please stake at least {estimateAmount} {symbol} as soon as possible to ensure SubGuard™ is enabled.",remainingNotEnough:"You have unpaid invoices totaling {due} {symbol}. If not paid, your remaining stake will be insufficient to cover the next invoice. Available stake: {unused} {symbol}. Please stake at least {min} {symbol}.",due:"Please pay the outstanding amount first",insufficient:"Insufficient Stake to cover the next invoice, please add stake",insufficientTip:"Insufficient Stake, please stake to ensure SubGuard™ is enabled.",intervals:"cycles",estimatedDuration:"{duration} {unit} est.",rule:"Rule: N * ( P + Fee )",ruleTip:"N is the number of cycles, P is the subscription bill amount, Fee is the SubGuard™ service fee, the single fee is {gas} {symbol}",min:"The amount must be greater or equal to {min} {symbol}",settingSuccess:"Settings Updated",settingError:"Failed to update SubGuard™ settings",openSuccess:"SubGuard™ Enabled",closeSuccess:"SubGuard™ Disabled",keepStake:"Keep Remaining Stake For SubGuard™",returnStake:"Return Remaining Stake",stake:"Stake",address:"Staking Address",total:"Total Stake: {total} {symbol}, ",disableConfirm:"You currently have unpaid invoices, please settle your invoices first.",open:"Enable SubGuard™",payerAddress:"Payer",stakingAddress:"Staking Address"},unpaidInvoicesWarning:"You currently have unpaid invoices, please settle your invoices first.",unpaidInvoicesWarningTip:"You currently have unpaid invoices, please settle your invoices promptly.",pendingAmountWarningTip:"You have {amount} {symbol} in unpaid usage charges due to insufficient credit balance. Please top up your account.",invoice:{relatedInvoice:"Related Invoice",donation:"Donation",creditsInfo:"Total {amount} included",appliedDiscounts:"Applied Discounts",priceChanged:"The exchange rate has changed by {percent}%. The payment amount will be updated. Do you want to continue?",paymentCancelled:"Payment cancelled",paymentMethodChanged:"Payment method changed",priceChangeTitle:"Price Changed",priceChangeDescription:"The exchange rate has {direction} by {percent}%. Your payment amount will be updated.",currentPaymentMethod:"Current Payment Method",otherPaymentMethods:"Or pay with another method",confirmAndPay:"Confirm & Pay",switchAndPay:"Switch & Pay",current:"current"},payout:{empty:"No Revenues",payer:"Payer",receiver:"Receiver",payTxHash:"Payment TxHash",viewReference:"View Reference",title:"Revenues"},pastDue:{warning:"You have due invoices, please pay them to keep your services active",invoices:"Due Invoices",payNow:"Pay Now",alert:"You have due invoices. Please pay them promptly to avoid service interruption.",title:"Settle Due Invoices"},quote:{title:"Price Quotes",noQuotes:"No price quotes for this invoice",id:"Quote ID",pricingDetails:"Pricing Details",baseAmount:"Base Amount",exchangeRate:"Exchange Rate",consensusMethod:"Consensus",referenceRate:"Reference Rate: 1 {symbol} ≈ ${rate}",quotedAmount:"Quoted Amount",providerInfo:"Rate Provider",provider:"Provider",rateTimestamp:"Rate Timestamp",slippage:"Slippage",lifecycle:"Lifecycle",expiresAt:"Expires At",riskInfo:"Risk Information",deviation:"Price Deviation",anomalyDetected:"Anomaly Detected",degraded:"Degraded",status:{active:"Active",used:"Used",paid:"Paid",expired:"Expired",cancelled:"Cancelled",failed:"Failed"}}},integrations:{description:"Configure and manage how Payment Kit integrates with your application.",basicFeatures:"Basic Features",advancedFeatures:"Advanced Features",features:{products:{title:"Create Products",intro:"Create and manage your products or services"},paymentLinks:{title:"Payment Links",intro:"Create shareable payment links for quick checkout"},pricingTables:{title:"Pricing Tables",intro:"Create beautiful pricing tables for your products"},metering:{title:"Usage Metering",intro:"Track usage with meters and sell credits as top-up packages",dialog:{title:"How to set up credit-based metering",description:"Credit-based metering allows you to track usage and charge customers based on consumption. Follow these steps to get started:",steps:{step1:{title:"Create a meter to track your usage events",description:"Set up meters to monitor API calls, data usage, or any measurable activity in your application."},step2:{title:"Create Credit top-up products and pricing",description:"Define credit packages that customers can purchase, with flexible pricing models and validity periods."},step3:{title:"Create a payment link and share it so users can buy Credits",description:"Generate shareable payment links that allow customers to easily purchase credit packages."},step4:{title:"Integrate and report Credit usage",description:"Use our SDK to report usage events and automatically deduct credits from customer balances."}},docText:"Read the credit billing guide"}},promotions:{title:"Promotions",intro:"Create coupons and promotion codes to drive conversions"},donate:{title:"Donation",intro:"Add donation button to your application with <CheckoutDonate />"},paymentMethods:{title:"Payment Methods",intro:"Configure multiple payment methods and currencies"},api:{title:"API Integration",intro:"Integrate with our JavaScript SDK for custom solutions",link:"https://www.npmjs.com/package/@blocklet/payment-js"}},viewDocs:"View docs"}}),ME=Wl({common:{redirecting:"跳转中...",title:"名称",estimated:"预估",total:"总量",active:"生效中",inactive:"未生效",enabled:"已启用",disabled:"已禁用",every:"每",metadata:{label:"元数据",description:"添加自定义键值对以存储有关此计量器的其他信息。",add:"添加更多元数据",edit:"编辑元数据",empty:"无元数据",emptyTip:"您还没有添加任何元数据,您可以添加它",formMode:"切换到表单模式",jsonMode:"切换到JSON模式",jsonPlaceholder:"输入JSON数据...",invalidJson:"JSON格式无效,请检查您的输入",formatJson:"格式化JSON"},price:"价格",add:"添加",fullscreen:"全屏",exit:"退出",maxLength:"最多输入{len}个字符",minLength:"最少输入{len}个字符",invalidCharacters:"无效字符",latinOnly:'至少包含一个字母,并且不能包含中文字符和特殊字符如 <, >、"、’ 或 \\',loading:"加载中...",loadMore:"加载更多",noMoreData:"没有更多数据",rechargeTime:"充值时间",submit:"提交",custom:"自定义",estimatedDuration:"预计可用 {duration}",detail:"详情",setting:"配置",slippage:"滑点下限",slippageMinRate:"最低可接受汇率 {rate} {currency}",slippageTooltip:"自动扣款时可接受的最低汇率,当汇率低于此值时将暂停扣款",welcome:"欢迎使用 Payment Kit",welcomeDesc:"从基础功能开始,轻松接入支付功能。选择下方任意功能,立即开始使用。",quickStart:"快速入门指南",advancedFeatures:"高级功能",quickStarts:"快速入门",homeTagline:"为 Blocklet 构建的去中心化支付解决方案",adminDashboard:"管理后台",customerPortal:"客户门户",copy:"复制",copied:"已复制",copySuccess:"复制成功",copyFailed:"复制失败",copyTip:"请手动复制",save:"保存",saving:"保存中...",saved:"保存成功",refresh:"刷新",cancel:"取消",back:"返回",know:"知道了",confirm:"确认",increased:"上涨",decreased:"下跌",edit:"编辑",view:"查看",select:"选择",clear:"清除",delete:"删除",deleting:"删除中...",activate:"启用",deactivate:"停用",yes:"是",no:"否",never:"永不",created:"创建时间",updated:"更新时间",valid:"有效",events:"事件",details:"详情",discount:"折扣",deleted:"已删除",days:{sunday:"星期日",monday:"星期一",tuesday:"星期二",wednesday:"星期三",thursday:"星期四",friday:"星期五",saturday:"星期六"},maxAmount:"最大金额为 {max}",name:"名称",type:"类型",status:"状态",remainingCredit:"剩余额度",scope:"适用范围",source:"来源",effectiveDate:"生效时间",expirationDate:"过期时间",creditGrant:"信用额度",date:"日期",subscription:"订阅",meter:"计量器",meterEvent:"计量事件",creditAmount:"额度",createdAt:"创建时间",expiresAt:"过期时间",general:"通用",specific:"指定使用范围",paid:"付费",promotional:"促销",viewInvoice:"查看账单",viewSourceData:"查看来源",goToConfigure:"前往配置",noData:"暂无数据"},notification:{preferences:{title:"邮件通知设置",button:"邮件设置",frequency:{label:"通知频率",default:"即时通知 (默认)",daily:"每日",weekly:"每周",monthly:"每月"},day:"日",timeFormatError:"请输入有效的时间,格式为24小时制 (HH:MM)",monthlyHelp:"如果所选日期在某月不存在,将使用该月的最后一天",subscriptionRenewalNote:"此设置适用于订阅续费通知。"}},admin:{description:"管理你的产品、定价、账单和支付流程。",balances:"余额",addresses:"地址",trends:"趋势",metrics:"指标",attention:"注意",overview:"总览",overviewPage:{financialIndicatorsTitle:"财务指标",businessMonitoringTitle:"业务监控",filters:{dateRange:"选择日期范围",currencyLabel:"币种",productLabel:"产品",regionLabel:"地区",allCurrencies:"全部币种",allProducts:"全部产品",allRegions:"全部地区"},financialIndicators:{totalIncome:{title:"总收入",subtitle:"用户实际支付"},refundAmount:{title:"退款金额",subtitle:"已退款总额"},costOfGoods:{title:"进货成本",subtitle:"供应商分成"},netRevenue:{title:"净收入",subtitle:"扣除供货成本后的收入"},promotionCost:{title:"促销成本",subtitle:"折扣"},taxedRevenue:{title:"含税收入",subtitle:"包含税费的收入"}},charts:{title:"交易趋势",payments:"付款",payouts:"出款",refunds:"退款",allCurrencies:"全部币种"},metrics:{transaction:"交易指标",essential:"关键指标"},overdue:{title:"欠费额度",subtitle:"待支付的额度",customers:"{count} 位用户",events:"{count} 笔欠费记录",viewAll:"查看全部",noOverdue:"暂无欠费"}},payments:"支付管理",connections:"连接",back:"返回",actions:"操作",create:"创建",creating:"创建中...",save:"保存",saving:"保存中...",cancel:"取消",paymentLinks:"支付链接",paymentMethods:"支付方式",customers:"客户管理",products:"产品定价",invoiceItems:"账单明细",coupons:"优惠券",tax:"税务",taxRates:"税率",taxRate:{create:"创建税率",createTitle:"新建税率",createAction:"添加税率",created:"税率创建成功",updated:"税率更新成功",deleted:"税率删除成功",label:"税率",view:"查看税率",displayName:"显示名称",displayNamePlaceholder:"显示在账单和报表上的名称",displayNameAuto:"留空则自动生成",displayNameRequired:"请填写显示名称",description:"描述",descriptionPlaceholder:"可选描述信息",country:"国家/地区",countryRequired:"请选择国家/地区",state:"州 / 省",postalCode:"邮政编码",taxCode:"产品税码",taxCodeDescription:"产品税码用于根据产品类型和地区自动计算税费。您可以",taxCodeDescriptionLink:"管理税率",taxCodeDescriptionSuffix:"以创建针对特定税码和地区的自定义税率。",selectTaxCode:"选择产品税码",percentage:"税率 (%)",percentageRequired:"请填写税率",percentageMin:"税率需大于或等于 0%",percentageMax:"税率需小于 100%",active:"默认启用",location:"适用区域",advanced:"高级选项",search:"搜索税率",searchCountry:"搜索国家/地区",back:"返回税率列表",associatedInvoices:"关联账单",deleteTitle:"删除税率",deleteMessage:"确定要删除税率“{name}”吗?该操作无法撤销。",deactivateTitle:"停用税率",deactivateMessage:"确定要停用“{name}”吗?停用后将不再自动应用。",activateTitle:"启用税率",activateMessage:'确定要启用"{name}"吗?启用后可用于新的账单。',edit:"编辑",editTitle:"编辑税率",selectTaxCodeHint:"税率将用于自动计算账单中的税费。",searchPlaceholder:"按产品或税码搜索",previewPlaceholder:"请选择税码以查看详情。",usePreset:"默认税码",noPreset:"暂无默认税码",noSuggestions:"没有符合搜索条件的税码。",relatedInvoiceNum:"关联账单数",notUsed:"未使用",taxCodeLabel:"税码:{code}",types:{general:"通用类别",digital:"数字产品",services:"服务类",physical:"实物商品"}},pricing:"定价",pricingTables:"定价表",vendors:"供应商",billing:"订阅和账单",invoices:"账单",subscriptions:"订阅",meters:"计量器",meterEvents:{title:"计量事件"},overdue:{title:"欠费额度",pendingAmount:"欠费额度",eventCount:"欠费笔数",noOverdue:"暂无欠费",selectCurrency:"币种"},meter:{add:"添加计量器",edit:"编辑计量器",save:"保存计量器",saved:"计量器保存成功",activate:"激活计量器",activated:"计量器激活成功",deactivate:"停用计量器",deactivated:"计量器停用成功",deleted:"计量器删除成功",deleteConfirm:"确定要删除此计量器吗?此操作无法撤销。",activateConfirm:"确定要激活此计量器吗?它将开始收集使用数据。",deactivateConfirm:"停用后,此计量器将无法接收更多事件。尝试为此计量器创建事件将返回错误。之前报告的使用数据将保留。您可以随时重新激活。",view:"查看计量器",basicInfo:"基本信息",basicInfoDescription:"配置计量器的核心设置以跟踪使用事件。",editDescription:"更新计量器名称、描述和元数据。事件名称和聚合方法等核心设置无法更改。",creditMode:{onchain:"OnChain",onChainDescription:"开启后你的 Credit 将作为 Token 发布在 ArcBlock 区块链上,用户的充值、退款和消费将在链上公开记录且不可篡改。",tokenConfiguration:"Token 配置",createNewToken:"创建新 Token",useExistingToken:"使用现有 Token",createTokenHint:"填写 Token 名称和符号以创建新 Token",tokenName:"Token 名称",tokenNamePlaceholder:"请输入 Token 名称",tokenNameRequired:"Token 名称不能为空",tokenSymbol:"Token 符号",tokenSymbolPlaceholder:"请输入 Token 符号",tokenSymbolRequired:"Token 符号不能为空",tokenSymbolFormat:"符号必须为 1-6 个大写字母或数字",createTokenButton:"创建 Token",creatingToken:"创建中...",tokenCreated:"Token 创建成功",tokenCreatedLabel:"Token 已创建",tokenAddress:"Token 地址",selectToken:"选择 Token",selectTokenPlaceholder:"请选择一个现有的 Token",tokenAddressRequired:"Token 地址不能为空",enabled:"已启用"},inactive:"计量器未激活",inactiveTip:"此计量器未收集使用数据。激活它以开始跟踪事件。",name:{label:"计量器名称",required:"计量器名称为必填项",placeholder:"API 请求",help:"此计量器的描述性名称,将在您的仪表板以及用户个人账单中显示。"},eventName:{label:"事件名称",required:"事件名称为必填项",placeholder:"api_request",help:"将发送到此计量器的事件名称",editHelp:"为保持数据一致性,计量器创建后无法更改事件名称。"},aggregationMethod:{label:"聚合方法",required:"聚合方法为必填项",sum:"求和",sumHint:"将所有事件值相加",sumDescription:"求和聚合方法将所有使用事件值相加,并报告事件摘要和计费的总计。",count:"计数",countHint:"计算事件数量",countDescription:"计数聚合方法计算接收到的事件数量,并报告事件摘要和计费的总计数。",last:"最后值",lastHint:"使用最近的事件值",lastDescription:"最后值聚合方法使用接收到的最近事件值,并报告该值用于事件摘要和计费。",editHelp:"为保持数据一致性,计量器创建后无法更改聚合方法。"},unit:{label:"计量单位",required:"计量单位为必填项",placeholder:"请求",help:"此计量器的测量单位",editHelp:"为保持数据一致性,计量器创建后无法更改计量单位。"},description:{label:"描述",placeholder:"跟踪 API 使用情况以进行计费",help:"可选描述,帮助您和您的团队了解此计量器跟踪的内容。"},events:{title:"事件",dailyEventCount:"每日事件数量",dailyTotalValue:"每日总使用量",eventName:"事件名称",value:"使用量",customer:"客户",subscription:"订阅",reportTime:"上报时间",count:"共 {count} 个事件",empty:"暂无事件数据",emptyTip:"当有事件上报时,数据将显示在这里",filterByCustomer:"按客户筛选",eventCount:"事件数量",totalValue:"总使用量",hourly:"按小时",totalEvents:"总事件数",timeRange:"时间粒度",hourlyView:"小时视图",dailyView:"日视图"},usageGuide:{title:"如何报告使用情况",description:'使用事件名称 "{eventName}" 向此计量器发送事件。计量器将{method}值并以{unit}为单位跟踪使用情况。',tip:'使用事件名称 "{eventName}" 向此计量器发送事件。计量器将{aggregationMethodHint},并以{unit}为单位跟踪使用情况。',apiEndpoint:"API 端点",curlExample:"cURL 示例",jsExample:"JavaScript 示例",pythonExample:"Python 示例",important:"重要提示",tip1:"将 YOUR_API_KEY 替换为您的实际 API 密钥",tip2:"事件名称必须完全匹配:{eventName}",tip3:"包含时间戳以进行准确跟踪",moreInfo:"更多信息,请参阅我们的",apiDocs:"API 文档"},products:{count:"{count} 个关联产品",create:"创建产品",created:"产品创建成功",createPrompt:"输入产品名称:",manage:"管理",empty:"无产品",title:"产品",emptyTip:"此计量器尚未关联任何产品。",meterService:"计量服务",creditCharge:"Credit 计费"},creditProducts:{emptyTip:"此计量器尚未关联任何 Credit 产品。"},rechargePackage:{priceId:"充值套餐",tooltip:"充值套餐是用于充值 {name} 的套餐,用户购买后可以获得对应的 {name}。"}},creditProduct:{create:"创建 Credit 产品",defaultName:"{name} 额度充值包",defaultDescription:"{name} 额度充值包",defaultNickname:"Credit 充值",unitLabel:"单位",settings:"Credit 设置",configTitle:"Credit 配置",expirationTime:{label:"过期时间",expireWithNextGrant:"随下次发放过期"},name:{placeholder:"输入 Credit 产品名称"},description:{placeholder:"描述此 Credit 产品的用途和价值"},priceNotice:"Credit 产品用于为用户提供可消费的额度,支持一次性购买和套餐包两种模式。",creditAmount:{label:"Credit 数量",placeholder:"用户购买此价格获得的 Credit 数量",help:"留空表示按单价售卖,填入数字表示固定套餐包",description:"用户购买数量决定获得的 Credit"},validDuration:{label:"可用时长",help:"Credit 的有效期限,从购买时开始计算",description:"设置为 0 表示永不过期",hours:"小时",days:"天",weeks:"周",months:"月",years:"年"},associatedPrices:{label:"关联价格",placeholder:"选择此 Credit 可用于的服务价格",help:"选择后,购买的 Credit 只能用于指定的服务",description:"不选择任何价格表示 Credit 可用于所有服务"},priority:{label:"使用优先级",help:"当用户有多个 Credit 时的使用顺序,数字越小优先级越高",description:"范围:0-100,0 为最高优先级,50 为默认值"},deliveryMode:{label:"发放模式",once:"一次性发放",periodic:"周期性发放"},schedule:{interval:{label:"发放频率",hour:"小时",day:"天",week:"周",month:"月"},amountPerGrant:{label:"每次发放数量",description:"每次发放固定数量的 Credit"},expireWithNextGrant:{label:"随下次发放过期",description:"本次 Credit 将在下一次发放时自动过期"}}},meterEvent:{title:"计量事件详情",id:"事件ID",totalEvents:"总事件数:{count}",noEvents:"暂无事件",noEventsHint:"您可以在测试模式下手动添加测试事件。",identifier:"标识符",customer:"客户",customerId:"客户ID",value:"数值",subscription:"订阅",creditConsumed:"消耗额度",usageValue:"使用量",settlementAmount:"结算额度",reportedAmount:"上报额度",overdueAmount:"欠费额度",reportedAt:"上报时间",processedAt:"处理时间",eventIdentifier:"事件标识符",usageDetails:"使用详情",chart:{eventCount:"每日事件数",totalValue:"每日用量总数"},filter:{customer:"筛选客户"},add:{button:"添加用量",title:"添加用量",customerId:"客户",customerIdPlaceholder:"选择客户",value:"数值",valuePlaceholder:"输入用量数值",subscriptionId:"订阅",subscriptionIdPlaceholder:"输入订阅ID(可选)",subscriptionIdHint:"可选 - 将此用量关联到特定订阅",timestamp:"时间",timestampHint:"此用量发生的时间",validation:"客户和数值为必填项",success:"用量事件添加成功",submit:"提交"}},developers:"开发者工具箱",webhooks:"钩子",events:"事件",refunds:"退款记录",payouts:"出款记录",logs:"日志",passports:"通行证",details:"详情",settings:"系统设置",branding:"品牌设置",business:"企业设置",summary:"摘要",product:{empty:"暂无产品",info:"产品信息",add:"添加产品",view:"查看产品详情",save:"保存产品",saved:"产品已成功保存",additional:"附加选项",edit:"编辑产品",pricing:"定价",find:"选择产品",archive:"存档产品",archiveTip:"存档将隐藏此产品不再允许新购买。确定要存档此产品吗?",unarchive:"取消存档产品",unarchiveTip:"取消存档将使此产品可以用于新的购买。确定要取消存档此产品吗?",remove:"删除产品",removeTip:"删除将隐藏此产品不再允许新购买。确定要删除此产品吗?",archived:"此产品已存档",archivedTip:"此产品无法添加到新的账单、订阅、支付链接或定价表。具有此产品的任何现有订阅将保持活动状态,直到取消,任何现有的支付链接或定价表将被停用。",locked:"此产品已锁定,因为至少有一个价格用于订阅或支付。",currencyNotAligned:"所有价格必须具有相同的货币设置",image:{label:"图片",add:"添加图片"},features:{label:"特点",add:"添加其他特点"},name:{label:"名称",required:"产品名称是必需的",placeholder:"高级套餐"},description:{label:"描述",required:"产品描述是必需的",placeholder:"在结账、账单页面显示的产品描述"},statement_descriptor:{label:"声明描述",placeholder:"ArcBlock"},unit_label:{label:"单位标签",placeholder:"单位"},billingType:{label:"计费类型",standard:"标准计费",metered:"计量计费",help:"选择如何向客户收费"},meter:{label:"计量器",placeholder:"选择计量器来跟踪使用情况",required:"计量计费需要选择一个计量器",help:"选择用于跟踪此产品使用情况的计量器",pricingNote:"对于计量产品,定价会自动基于所选计量器跟踪的使用情况。您只需要设置单价和计费周期。"},cross_sell:{title:"交叉销售",to:"交叉销售",tip:""},type:{label:"产品类型",service:"服务",serviceDesc:"数字服务或订阅",credit:"Credit",creditDesc:"用于基于 Credit 计费场景的充值产品",creditDescLink:"请先创建计量器",good:"商品",goodDesc:"实体商品或有形产品"},vendorConfig:{title:"供应商配置",add:"添加供应商",empty:'未配置供应商。点击"添加供应商"来配置供应商服务。',vendor:"供应商",vendorRequired:"供应商是必填项",productCode:"产品代码",productCodeRequired:"产品代码是必填项",commissionType:"分成类型",commissionRate:"分成比例",commissionRateRequired:"分成比例是必填项",commissionRateMin:"分成比例必须大于或等于0",commissionRateMax:"分成比例不能超过100%",amount:"固定金额",noVendor:"无供应商可选",amountRequired:"固定金额是必填项",totalCommission:"总分成比例:{total}%",totalCommissionExceeded:"总分成比例超过100%:{total}%"}},price:{name:"价格",type:"使用类型",info:"价格信息",plan:"价格方案",lookupKey:"查找键",setAsDefault:"设置为默认价格",detail:"定价详情",addAnother:"添加价格方案",order:"方案 {order}",add:"添加另一个价格",view:"查看价格详情",additional:"附加选项",model:"定价模型",amount:"价格",amountDescription:"这是客户将支付的含税价格。",locked:"此价格已锁定,因为它用于订阅或支付。",amountTip:"对于订阅选择周期,对于其他所有选择一次性。",duplicate:"复制价格",edit:"编辑价格",find:"选择或新建价格",archive:"存档价格",archiveTip:"存档将隐藏此价格不再允许新购买。确定要存档此价格吗?",remove:"删除价格",removeTip:"删除将隐藏此价格不再允许新购买。确定要删除此价格吗?",unit_amount:{required:"价格是必需的",positive:"价格必须是正数",stripeTip:"Stripe要求价格必须大于等于0.5"},nickname:{label:"价格描述",placeholder:""},lookup_key:{label:"查找键",placeholder:"",description:"查找键用于在API中识别价格"},recurring:{interval:"计费周期",metered:"使用量按计量收费?",meteredTip:"计量计费允许您根据每个计费周期结束时的报告的使用情况向客户收费。",aggregate:"按何种方式收费计量使用",intervalCountTip:"计费周期必须是正整数",stripeTip:"Stripe要求计费周期不能为小时"},currency:{add:"添加更多货币",list:"货币"},models:{standard:"标准定价",standardDesc:"单一固定价格",package:"套餐定价",packageDesc:"按单位数量定价",graduated:"毕业定价",volume:"量价定价",custom:"客户自定义价格",usageBased:"基于使用量",creditMetered:"Credit 计量计费"},creditMetered:{label:"Credit 计量计费",placeholder:"选择计量器来跟踪使用情况",required:"Credit 计量计费需要选择一个计量器",help:"选择用于跟踪此产品使用情况的计量器",selectMeter:"选择计量器",pricingNote:"对于计量产品,定价会自动基于所选计量器跟踪的使用情况。",description:"Credit 计量计费的订阅需要有对应的 Credit 消费,如果 Credit 消耗完,对应的服务会停止。"},credit:{saveAsBasePrice:"设为充值套餐",saveSuccess:"设置成功"},types:{onetime:"一次性",onetimeDesc:"收取一次性费用",recurring:"周期性",recurringDesc:"收取持续费用"},paymentType:"付费类型",billingModel:"计费模式",pricing:"定价",additionalCurrencies:"其他货币",advanced:"高级设置",customInterval:"自定义间隔",perUnit:"每单位",choosePricingModel:"选择定价模式",usage:"使用量",usageDesc:"根据用户数量、单位或席位定价。需要记录以便Stripe跟踪客户服务使用情况。",meter:"计量器",billingPeriod:"计费周期",aggregate:{sum:"在周期内的使用值总和",max:"周期内的最大使用值",last_during_period:"周期内的最近使用值",last_ever:"最近的使用值"},upsell:{title:"升级选项",to:"可升级至",tip:""},quantity:{tip:"数量必须是自然数"},quantityAvailable:{label:"可售数量",placeholder:"0表示无限制",format:"可售{num}件",noLimit:"不限制可售数量",valid:"可售数量不得少于已售数量",description:"输入可售数量,0表示不限制可售数量"},quantitySold:{label:"已售数量",format:"已售{num}件"},quantityLimitPerCheckout:{label:"单次购买最大数量",placeholder:"0表示无限制",format:"单次最多购买{num}件",noLimit:"不限制单次购买数量",description:"输入限制单次购买的最大数量, 0表示无限制"},inventory:"库存设置",dynamicPricing:{label:"启用动态定价",description:"价格根据实时汇率波动",config:{title:"动态定价配置",baseAmount:{label:"基准价格",description:"以法定货币计算的基准价格",required:"基准价格是必需的"}},validation:{checking:"正在检查汇率可用性...",rateLine:"当前汇率:1 {currency} ≈ ${rate}",usdLine:"参考 USD:≈ ${amount}",error:"获取汇率失败,货币不支持或者数据源异常",estimatedLine:"预估数量:≈ {amount} {currency}",useAmount:"填入"}},referencePricing:{label:"参考汇率定价",description:"仅用于参考并快速填充币种数量,不会开启动态定价"}},coupon:{create:"创建优惠券",view:"查看优惠券",description:"优惠券可用于对发票、订阅或整个客户账户提供折扣。",listTitle:"优惠券",terms:"优惠条款",tab:"优惠券",redemptions:"兑换次数",expires:"过期时间",noDiscount:"无折扣",name:"名称",nameHelp:"这将显示在客户的收据和发票上。",desc:"描述",descriptionInternal:"此描述仅供内部使用,不会向客户显示。",id:"ID",idOptional:"ID(可选)",idHelp:"这将在 API 中标识此优惠券。我们建议将此留空,以便我们为您生成 ID。",type:"类型",percentageOff:"百分比折扣",fixedAmountOff:"固定金额折扣",percentageDiscount:"百分比折扣",fixedAmount:"折扣金额",currency:"货币",applyToProducts:"应用于特定产品",duration:"持续时间",once:"一次",forever:"永久",repeating:"重复",durationHelp:'对于订阅和客户,这决定了此优惠券一旦兑换后的有效期。一次性发票接受"一次"和"永久"优惠券。',durationInMonths:"持续月数",redemptionLimits:"兑换限制",limitDateRange:"限制客户可以兑换此优惠券的日期范围",limitTotalNumber:"限制此优惠券可以被兑换的总次数",codes:"代码",useCustomerFacingCodes:"使用面向客户的优惠券代码",promotionCodes:"促销码",promotionCodesHelp:"促销码将在优惠券保存后创建。",addPromotionCode:"添加促销码",eligibleFirstTime:"仅限首次订单(每个用户只能享受一次优惠券折扣)",limitNumberRedemptions:"限制此代码可以被兑换的次数",addExpirationDate:"添加过期日期",requireMinimumOrder:"要求最小订单金额",addAnotherCode:"添加另一个代码",saved:"优惠券保存成功",codeOptional:"代码(可选)",codeHelp:"留空将在创建时自动生成",generate:"生成",verificationType:"验证类型",codeOnly:"仅代码",nftVerification:"NFT 验证",vcVerification:"通行证验证",userWhitelist:"限制特定用户",nftSettings:"NFT 验证设置",vcSettings:"通行证验证设置",userWhitelistSettings:"特定用户设置",nftAddresses:"NFT 地址",nftAddressesPlaceholder:"输入 NFT 合约地址",nftTags:"NFT 标签",nftTagsPlaceholder:"输入 NFT 标签",trustedIssuers:"可信发行者",trustedIssuersPlaceholder:"输入可信发行者",trustedParents:"可信 NFT 工厂",trustedParentsPlaceholder:"输入可信 NFT 工厂",minBalance:"NFT 所需数量",requiredRoles:"必需角色",requiredRolesPlaceholder:"输入必需角色",trustedVcIssuers:"可信 VC 发行者",trustedVcIssuersPlaceholder:"输入可信 VC 发行者 DID",customerDids:"客户 DID",customerDidsPlaceholder:"输入客户 DID",customerDidsHelp:"您可以选择现有客户或手动输入DID",maxRedemptions:"最大兑换次数",expiresAt:"过期时间",pressEnterToAdd:"按回车键添加",couponConfiguration:"优惠券配置",selectProducts:"选择产品",noProductsSelected:"未选择产品",newCode:"新代码",createPromotionCode:"创建促销码",promotionCodeDescription:"为此优惠券创建促销码,让客户兑换折扣。",minimumAmount:"最低金额",minimumAmountHelp:"为不同货币设置最低订单金额",discountAmount:"折扣金额",currencies:"货币",times:"次",months:"月",addProduct:"添加另一个产品",unlimited:"不限量",inactive:"优惠券已停用",inactiveTip:"此优惠券当前处于停用状态,无法使用。",discount:"折扣",updated:"更新时间",timesRedeemed:"已使用次数",deletedSuccessfully:"优惠券删除成功",deleteConfirmTitle:"删除优惠券",deleteConfirmMessage:"确定要删除此优惠券吗?此操作无法撤销。",cannotDeleteWithPromotionCodes:"存在促销码时无法删除优惠券",couponTermsPercentage:"{percent}%",couponTermsFixedAmount:"{amount} {symbol}",couponTerms:{forever:"永久享 {couponOff} 折扣",once:"单次享 {couponOff} 折扣",repeating:"{months} 个月内享 {couponOff} 折扣"},couponTermsDuration:{forever:"永久",once:"单次",repeating:"{months} 个月"},applicableProducts:"适用产品",noApplicableProducts:"此优惠券适用于所有产品",activeRedemptions:"兑换使用记录",customers:"客户",subscriptions:"订阅",noCustomersFound:"未找到客户",noCustomersRedeem:"当前没有客户使用此优惠券",noSubscriptionsFound:"未找到订阅",noSubscriptionsRedeem:"当前没有订阅使用此优惠券",rename:"重命名",renameCoupon:"重命名优惠券",updateCouponDetails:"更新优惠券详情",nameWillAppear:"此名称将显示在客户的收据和发票上。",updateCouponButton:"更新优惠券",discountStart:"折扣开始时间",usageStats:"使用统计",totalDiscounts:"总折扣记录",uniqueSessions:"独立会话",uniqueSubscriptions:"独立订阅",promotionCodesUsed:"使用的促销码",noExpiration:"无过期时间",usagePeriod:"使用时期",firstUsed:"首次使用",lastUsed:"最后使用",promotionCodeInfo:"促销码信息",directCouponUsage:"直接优惠券使用",usageLimit:"使用次数",discountInfo:"折扣信息",discountPeriod:"折扣有效期",couponExpires:"优惠券过期",totalSavings:"累计优惠",viewPromotionCode:"查看促销码"},discount:{totalSaved:"总共节省",timesUsed:"使用次数",appliedDiscounts:"应用的优惠"},promotionCode:{code:"代码",status:"状态",redemptions:"兑换次数",expires:"过期时间",created:"创建时间",actions:"操作",active:"生效中",inactive:"已停用",expired:"已过期",maxedOut:"已用尽",viewDetails:"查看详情",edit:"编辑促销码",delete:"删除促销码",archive:"存档促销码",archiveTip:"存档后,此促销码将不再允许新兑换。确定要存档此促销码吗?",deleteTip:"删除将永久删除此促销码。确定要删除此促销码吗?",title:"促销码",id:"ID",type:"类型",couponId:"优惠券ID",maxRedemptions:"最大兑换次数",timesRedeemed:"已兑换次数",verificationType:"验证类型",updated:"更新时间",activate:"激活",deactivate:"停用",inactiveTitle:"促销码已停用",inactiveTip:"此促销码目前已停用,无法使用。",deleteSuccess:"促销码删除成功",activateSuccess:"促销码激活成功",deactivateSuccess:"促销码停用成功",verificationConfig:"验证配置",nftAddresses:"NFT地址",nftTags:"NFT标签",minBalance:"最小余额",requiredRoles:"所需角色",trustedIssuers:"可信签发方",allowedUsers:"允许的用户",noNftConfig:"无NFT配置",noVcConfig:"无VC配置",noUsersSpecified:"未指定用户",codeVerificationOnly:"仅代码验证",unlimited:"无限制",never:"永不过期",yes:"是",no:"否",verificationTypeMap:{code:"仅代码",nft:"NFT验证",vc:"通行证验证",user_restricted:"限制特定用户"}},paymentLink:{view:"查看支付链接",info:"支付链接信息",add:"创建支付链接",save:"创建链接",openLink:"打开URL",copyLink:"复制URL",saved:"支付链接已成功保存",additional:"附加选项",beforePay:"支付页面",afterPay:"支付后",products:"产品",addProduct:"添加另一个产品",requireBillingAddress:"收集客户的账单地址",requirePhoneNumber:"收集客户的电话号码",allowPromotionCodes:"允许促销码",enablePromotionCodes:"启用促销码",disablePromotionCodes:"禁用促销码",enablePromotionCodesTip:"为此支付链接启用促销码功能。客户在结账时将能够使用折扣代码。",disablePromotionCodesTip:"为此支付链接禁用促销码功能。客户在结账时将无法使用折扣代码。",includeFreeTrial:"包含免费试用",noStakeRequired:"无需质押",showProductFeatures:"显示产品特性",allowSkipPaymentMethod:"允许 $0 结账时跳过绑定支付方式",enableSkipPaymentMethod:"允许跳过支付方式",disableSkipPaymentMethod:"要求绑定支付方式",enableSkipPaymentMethodTip:"当结账金额为 $0 时,允许客户跳过绑定支付方式。若未绑定,订阅将在当前周期结束时自动取消。",disableSkipPaymentMethodTip:"即使结账金额为 $0,也要求客户提供支付方式。",freeTrialDaysPositive:"免费试用天数必须是正数",includeCustomFields:"添加自定义字段",requireCrossSell:"用户必须选择交叉销售的商品(如果有的话)",confirmPage:"确认页面",showConfirmPage:"显示确认页面",customMessage:"用自定义消息替换默认消息",customMessageTip:"包括您认为合适的任何细节,如交付信息。",mintNft:"购买完成时铸造 NFT",mintNftFrom:"从下面的 NFT 集合铸造",noConfirmPage:"不显示确认页面",createInvoice:"为相关付款创建账单。",adjustable:"可调整数量",adjustableQuantity:"允许客户调整数量",noProducts:"支付链接必须至少有一个产品",noRedirectUrl:"支付链接必须有重定向URL",noSubscriptionTrialDays:"您必须为订阅指定试用期",recurringNotAligned:"所有行项目的价格必须具有相同的周期",currencyNotAligned:"所有行项目的价格必须具有相同的货币设置",edit:"编辑支付链接",rename:"更改名称",archive:"存档支付链接",archiveTip:"存档将隐藏此支付链接不再允许新购买。确定要存档此支付链接吗?",remove:"删除支付链接",removeTip:"删除将隐藏此支付链接不再允许新购买。确定要删除此支付链接吗?",name:{label:"名称",placeholder:"不向消费者展示"},adjustableQuantityError:"最小数量必须小于最大数量"},payout:{list:"对外支付",name:"对外支付",view:"查看对外支付",empty:"没有记录",attention:"失败的对外支付",requestRefund:"请求退款",confirmRefund:"确定要向供应商请求退款吗?",refundRequested:"退款请求已发送给供应商",refundReason:"退款原因",refundReasonPlaceholder:"请输入退款原因(至少 5 个字符)",refundReasonRequired:"退款原因为必填项",refundReasonMinLength:"退款原因至少需要 {min} 个字符",refundReasonHelper:"请输入至少 {min} 个字符",status:{active:"生效中",paid:"已支付",succeeded:"成功"}},pricingTable:{view:"查看定价表",add:"创建定价表",save:"创建",openLink:"打开URL",copyLink:"复制URL",saved:"定价表已成功保存",edit:"编辑定价表",rename:"更改名称",archive:"存档定价表",archiveTip:"存档将隐藏此定价表不再允许新购买。确定要存档此定价表吗?",remove:"删除定价表",removeTip:"删除将隐藏此定价表不再允许新购买。确定要删除此定价表吗?",name:{label:"名称",placeholder:"不向消费者展示"},display:"显示设置",highlight:"突出显示产品",customer:"客户门户"},paymentIntent:{list:"付款记录",name:"付款记录",view:"查看付款详情",empty:"没有付款记录",refund:"退款",status:{active:"生效中",paid:"已支付",succeeded:"成功"},received:"实收金额",attention:"失败的付款",refundError:"退款申请失败",refundSuccess:"退款申请已成功创建",cancelRefund:"取消退款",refundCanceled:"取消退款成功",refundCanceledError:"取消退款失败",refundCanceledTip:"您确定要取消退款申请吗?取消后,退款将不再进行。",refundForm:{reason:"退款原因",amount:"退款金额",description:"退款说明",duplicate:"订单因重复下单已被取消并退款",requestedByCustomer:"订单已被客户取消并退款",requestedByAdmin:"订单已被管理员取消并退款",fraudulent:"订单因涉嫌欺诈已被取消并退款",expiredUncapturedCharge:"订单因支付未完成已被取消并退款",amountRange:"退款金额必须在 {min} {symbol} 到 {max} {symbol} 之间",amountHelper:"目前最大退款金额为{max} {symbol}",required:"请完整填写退款信息",empty:"当前订单已全部退款完成"}},paymentMethod:{_name:"支付方式",type:"类型",add:"添加支付方式",edit:"编辑支付方式",save:"保存支付方式",saved:"支付方式已成功保存",settings:"设置",gasTip:"使用 {method} 支付需保证账户在 {chain} 链上有余额支付手续费",recharge:"扫码充值",props:{type:"类型",confirmation:"确认",recurring:"重复支持",refund:"退款支持",dispute:"纠纷支持",currencies:"货币支持",explorer_host:"区块浏览器",balance:"余额"},name:{label:"名称",tip:"面向消费者"},description:{label:"描述",tip:"不向消费者展示"},stripe:{dashboard:{label:"仪表板 URL",tip:"用于生成指向 Stripe 仪表板的链接"},publishable_key:{label:"可发布密钥",tip:"可发布密钥,请查看仪表板 > 开发人员 > API密钥"},secret_key:{label:"秘密密钥",tip:"秘密密钥,请查看仪表板 > 开发人员 > API密钥"},webhook_signing_secret:{label:"钩子签名密钥",tip:"钩子签名密钥,请查看仪表板 > 开发人员 > 钩子 > 签名密钥"},webhookHint:"若无法接收 Webhook 事件,可手动在环境变量配置 STRIPE_WEBHOOK_SECRET",configureEnv:"前往配置"},arcblock:{chain_id:{label:"链 ID",tip:"仅是名称"},api_host:{label:"API 地址",tip:"发送交易的 API 端点"},explorer_host:{label:"区块浏览器",tip:"查看交易详情的地址"}},ethereum:{chain_id:{label:"链 ID",tip:"必须是有效的EVM链ID,通常是一个整数,https://chainlist.org"},api_host:{label:"RPC 端点",tip:"发送交易的RPC端点"},explorer_host:{label:"区块浏览器",tip:"查看交易详情的区块浏览器"},native_symbol:{label:"货币符号",tip:"链上主货币符号"},confirmation:{label:"确认区块数",tip:"交易标记为确认需要的区块数"}},evm:{checking:"正在检查连接...",connected:"连接成功",connectionError:"连接失败",blockHeight:"区块高度",rpcStatus:"RPC 状态"},base:{chain_id:{label:"链 ID",tip:"必须是有效的EVM链ID,通常是一个整数,https://chainlist.org"},api_host:{label:"RPC 端点",tip:"发送交易的RPC端点"},explorer_host:{label:"区块浏览器",tip:"查看交易详情的区块浏览器"},native_symbol:{label:"货币符号",tip:"链上主货币符号"},confirmation:{label:"确认区块数",tip:"交易标记为确认需要的区块数"}},google_play:{package_name:{label:"应用包名",tip:"例如 com.example.app,在 Play Console 中配置"},service_account_json:{label:"服务账号 JSON",tip:"从 Google Cloud Console 下载的 service account credentials JSON,整段粘贴",invalidJson:"不是合法的 JSON",missingFields:"JSON 缺少 client_email 或 private_key 字段",detectedClient:"识别到客户端"},pubsub_topic_name:{label:"Pub/Sub 主题名(可选)",tip:"projects/<project-id>/topics/<topic-name>,用于接收 RTDN"}},app_store:{bundle_id:{label:"应用 Bundle ID",tip:"例如 com.example.app,在 App Store Connect 中配置"},environment:{label:"环境",tip:"StoreKit 2 JWS 中携带的 environment 必须与此匹配",production:"正式环境",sandbox:"沙盒环境"},shared_secret:{label:"Shared Secret(StoreKit 1 用)",tip:"App-Specific Shared Secret,用于 legacy receipt 校验。StoreKit 2 JWS 不需要。在 App Store Connect → App Information → App-Specific Shared Secret"},serverApi:{heading:"Server API 凭据(可选)",tip:"StoreKit 2 JWS 校验不需要凭据;只在调用 App Store Server API 查询订阅状态时使用。三项需同时填写。"},issuer_id:{label:"Issuer ID",tip:"App Store Connect API 的 Issuer ID"},key_id:{label:"Key ID",tip:"App Store Connect API 的 Key ID"},private_key_pem:{label:"私钥 (.p8 内容)",tip:"从 App Store Connect 下载的 .p8 文件内容,整段粘贴"}}},paymentCurrency:{name:"支付货币",add:"添加货币",edit:"编辑货币",save:"保存货币",saved:"货币已成功保存",delete:"删除货币",deleteConfirm:"确定要删除此货币吗?一旦删除,将无法恢复",deleted:"货币已成功删除",quickAdd:"快速添加已支持的货币",searchToken:"搜索货币",orManualInput:"或在下方手动填写货币信息",logo:{label:"Logo",tip:"在支付页面显示"},contract:{label:"合约地址",tip:"用于获取代币符号、小数位数和其他信息"}},event:{empty:"没有事件",view:"查看事件",data:"事件数据",webhooks:"钩子调用",type:"类型",pendingWebhooks:"待处理的钩子",noAttempts:"无调用记录",retry:"重试",retrying:"重试中...",retryOptions:{title:"重试 Webhook",confirmMessage:"确定要重试此 webhook 吗?这将向 webhook 端点发送另一个请求。",success:"Webhook 已安排重试",error:"重试 webhook 失败"},response:"响应",request:"请求",eventData:"事件数据",events:{dailyEventCount:"每日事件数量",dailyTotalValue:"每日总使用量",eventName:"事件名称",value:"值",customer:"客户",subscription:"订阅",reportTime:"上报时间",count:"共 {count} 个事件",empty:"暂无事件数据",emptyTip:"当有事件上报时,数据将显示在这里",filterByCustomer:"按客户筛选",eventCount:"事件数量",totalValue:"总使用量"}},invoice:{view:"查看账单",name:"账单",from:"账单来自",empty:"没有账单",status:{active:"生效中",paid:"已支付",succeeded:"成功"},number:"账单编号",description:"账单说明",dueDate:"截止日期",finalizedAt:"已完成时间",paidAt:"支付日期",summary:"摘要",billingContextNote:"本账单金额基于结算时的实时价格计算。",dynamicPricingNote:"本账单使用动态定价并锁定了汇率。",billTo:"开具给",billing:"计费方式",download:"下载PDF",edit:"编辑账单",duplicate:"复制账单",retryUncollectible:{title:"重新收款",tip:"确定要重新尝试收取该笔账单吗?系统将再次尝试向客户发起扣款。",success:"重新收款请求已提交"},attention:"未完成的账单",returnStake:{title:"退还质押",tip:"您确定要退还质押吗?此操作将立即退还质押给客户。",success:"质押退还申请已提交"},void:{title:"作废账单",tip:"您确定要作废此账单吗?此操作将立即作废账单。",success:"账单作废成功"}},vendor:{create:"创建供应商",edit:"编辑供应商",delete:"删除供应商",save:"保存供应商",saved:"供应商保存成功",test:"测试",testConnection:"测试连接",testConnectionTip:'确定要测试供应商 "{name}" 的连接吗?',testConnectionSuccess:"连接测试成功",testConnectionFailed:"连接测试失败",testSuccess:"连接测试成功",testAfterSave:"供应商保存成功。您可以测试连接以验证配置是否正确。",testToEnable:"供应商保存成功。请测试连接以启用供应商。",enabled:"已启用",disabled:"未启用",addressCheckFailed:"地址检测失败,启用状态下无法保存",updateSuccess:"供应商更新成功",testFailed:"连接测试失败 (状态码: {status})",testError:"连接测试失败 - 网络错误",vendorKeyInvalid:"供应商类型只能包含小写字母、数字和下划线",deleteTitle:"删除供应商",deleteContent:'确定要删除供应商 "{name}" 吗?此操作无法撤销。',deleteTip:'确定要删除供应商 "{name}" 吗?此操作无法撤销。',activate:"激活供应商",activateTip:'确定要激活供应商 "{name}" 吗?',deactivate:"停用供应商",deactivateTip:'确定要停用供应商 "{name}" 吗?',name:"供应商名称",nameRequired:"供应商名称是必填项",vendorType:"供应商类型",vendorTypeRequired:"供应商类型是必填项",didnames:"DID Names",launcher:"Launcher",vendorKey:"供应商标识",vendorKeyRequired:"供应商标识是必填项",vendorKeyHelp:"供应商的唯一标识符",description:"描述",displayNameRequired:"前台展示名称是必填项",displayNameHelp:"此数据会展示到付款成功后的安装界面",appUrl:"应用地址",appUrlRequired:"应用地址是必填项",appUrlInvalid:"请输入有效的 URL,以 http:// 或 https:// 开头",appUrlHelp:"供应商应用的基础 URL 地址",vendorDid:"供应商 DID",vendorDidInvalid:"请输入有效的 DID",vendorDidHelp:"供应商的可选 DID 地址",webhookPath:"Webhook路径",webhookPathInvalid:"请输入以/开头的有效路径",webhookPathHelp:"可选的webhook回调路径(如:/webhooks/status)",blockletMetaUrl:"Blocklet元数据URL",blockletMetaUrlRequired:"Blocklet元数据URL是必填项",blockletMetaUrlInvalid:"请输入有效的URL,以http://或https://开头",blockletMetaUrlHelp:"必填的blocklet元数据URL,用于获取应用信息",commission:"分成",commissionRate:"分成比例",commissionRateRequired:"分成比例是必填项",commissionRateMin:"分成比例必须大于或等于0",commissionRateMax:"分成比例过高",commissionType:"分成类型",commissionRateHelp:"分成比例,以百分比形式",commissionAmountHelp:"固定分成金额",percentage:"百分比",fixedAmount:"固定金额",active:"启用",inactive:"禁用",basicInfo:"基本信息",apiConfig:"API配置",commissionConfig:"分成配置",status:"状态",brokerDID:"平台 DID",brokerPublicKey:"平台公钥"},subscription:{view:"查看订阅",name:"订阅",empty:"没有订阅",status:{active:"生效中",paid:"已支付",succeeded:"成功"},viewAll:"查看历史订阅",noActiveEmpty:"您当前没有服务中的订阅,您可以选择查看历史订阅",includedServices:"包含的服务",serviceHome:"访问服务主页",serviceDashboard:"访问服务管理后台",product:"产品",attention:"将过期的订阅",collectionMethod:"计费",channel:"渠道",currentPeriod:"当前周期",iap:{googlePlayTitle:"Google Play 订阅详情",appStoreTitle:"App Store 订阅详情",purchaseToken:"购买令牌",orderId:"订单号",productId:"产品 ID",originalTransactionId:"原始交易 ID",transactionId:"本次交易 ID",expiryTime:"过期时间",environment:"环境"},trialingPeriod:"试用期",trialEnd:"试用期结束于 {date}",willEnd:"将于 {date} 结束",ended:"结束于 {date}",renew:"下次续费: {date}",discount:"折扣",activeDiscount:"当前优惠",startedAt:"开始于",nextInvoice:"下次账单时间",nextInvoiceAmount:"下次账单金额",nextInvoiceAmountTip:"下次账单金额为预估,最终金额会根据实际使用情况结算。",itemId:"订阅项目ID",update:"更新订阅",resume:"恢复付款",resumeTip:"您确定要继续收款吗?此订阅的未来账单将继续付款。",paymentAddress:"扣费地址",currentBalance:"扣款账户余额",insufficientBalance:"余额不足,立即充值",cancel:{schedule:"计划取消",title:"取消订阅",required:"必须指定自定义取消时间",will:"于 {date} 取消",done:"已取消",at:{title:"取消",now:"立即取消({date})",current_period_end:"本周期结束后({date})",custom:"自定义取消日期",timeError:"取消时间必须在当前周期内"},refund:{title:"退款",none:"仅取消不退款",last:"退款最近付款的全部 {total}{symbol}",proration:"退款最近付款的未使用部分 {unused}/{total}{symbol}"},staking:{title:"质押",none:"不退还 / 罚没质押",proration:"退还剩余部分 {unused}{symbol}",slash:"罚没剩余部分 {unused}{symbol}",slashReason:"罚没原因",slashTip:"该订阅剩余的质押部分 {unused}{symbol} 将被罚没, 请确认是否继续?",slashTitle:"罚没质押"},comment:{title:"原因",placeholder:"请填写取消订阅的原因"}},pause:{title:"暂停付款",required:"必须指定自定义恢复时间",type:{title:"持续时间",never:"无限期暂停",custom:"暂停到自定义日期"},behavior:{title:"账单行为",keep_as_draft:"保留账单为草稿",keep_as_draft_tip:"对于目前提供服务但等待收款的企业。",mark_uncollectible:"将账单标记为不可收款",mark_uncollectible_tip:"对于目前提供免费服务的企业。",void:"作废账单",voidTip:"对于目前不提供服务的企业。"},until:{never:"付款暂停",custom:"付款暂停直到{date}"}},usage:{title:"使用记录",current:"当前周期的使用记录",range:"周期使用记录({start} - {end})",view:"查看使用情况",vary:"随使用情况变化",used:"已使用单位",cycle:"统计周期"},batchPay:{button:"批量付款"},payerAddress:"扣费地址",noPaymentMethod:"未绑定",bindPaymentMethod:"立即绑定",bindPaymentMethodFirst:"请先绑定支付方式后再恢复订阅",noPaymentMethodWarning:"当前订阅未绑定支付方式,请尽快绑定,否则订阅将在当前周期结束时自动取消。",changePayer:{btn:"变更",stripe:{linkType:"Stripe Link",bankAccount:"银行账户"},connect:{title:"变更扣费地址",success:"扣费地址变更成功",error:"扣费地址变更失败"}}},customer:{view:"查看客户",edit:"编辑信息",spent:"花费金额",refund:"退款金额",stake:"质押金额",dispute:"争议金额",token:"链上余额",due:"欠款金额",name:"名称",email:"电子邮件",phone:"电话",invoicePrefix:"账单前缀",googlePlayUuid:"Google Play UUID",appStoreUuid:"App Store UUID",balance:"余额 ({currency})",summary:{refund:"退款金额",spent:"花费金额",due:"欠款金额",stake:"质押金额",stats:"统计",balance:"余额"},address:{label:"地址",country:"国家",state:"州或省份",city:"城市或城镇",line1:"地址",line2:"详细地址",postal_code:"邮政编码"},creditGrants:{tab:"信用额度",title:"信用额度",summary:"额度汇总",noGrants:"未找到信用额度",grantDetail:"信用额度详情",overview:"概览",overviewDescription:"监控所有货币的信用余额、使用情况和未偿债务。",availableBalance:"可用余额",usage:"使用情况",viewInvoice:"查看账单",viewGrants:"查看额度",viewUsage:"查看使用情况",recentActivity:"最近活动",quickStats:"快速统计",activeGrants:"活跃额度",totalCreditValue:"总信用价值",outstandingDebt:"未偿债务",buyCredits:"购买额度",viewAllActivity:"查看所有活动",creditBalance:"信用余额",totalAmount:"总额度",pendingAmount:"欠费额度",grantCount:"额度数量",noGrantsDescription:"您还没有任何信用额度",relatedGrants:"信用额度",category:"分类",status:{granted:"生效中",pending:"待生效",expired:"已过期",depleted:"已耗尽",voided:"已作废"},originalAmount:"原始金额",grantId:"额度ID",grants:"额度",addCredit:"添加额度",viewDetails:"查看详情"}},passport:{intro:"管理应用通行证的付款设置,必须同时设置商品和购买入口",payLink:"支付入口",payPreview:"支付预览",preview:"支付页面预览",assign:"分配给通行证",assignTip:"将此支付链接分配给所选通行证,以使其可供购买",unassign:"重置购买配置",unassignTip:"确认要将购买入口和关联商品配置清空?",assignError:"必须选择一个要分配的通行证"},webhookEndpoint:{hosted:"托管的钩子",add:"添加钩子",addTip:"设置钩子端点以接收来自",listen:"监听",version:"API版本",attempts:"钩子调用",url:{label:"URL",description:"端点URL"},description:{label:"描述",description:"此端点用于何种目的的可选描述。"},events:{label:"选择要监听的事件",description:""}},refund:{name:"退款",attention:"失败的退款",view:"查看退款详情",status:{active:"生效中",paid:"已支付",succeeded:"成功"}},usageRecord:{empty:"用量记录为空",add:{label:"添加用量记录",success:"添加用量记录成功",quantity:"数量"}},donate:{title:"打赏配置",mountLocation:"名称",component:"组件",description:"描述",status:{title:"启用状态",active:"启用",inactive:"关闭",inactiveTip:"关闭打赏后,打赏按钮将不再显示,用户无法使用打赏功能,请确认是否关闭?",inactiveTitle:"关闭打赏",activeSuccess:"打赏功能已启用",inactiveSuccess:"打赏功能已关闭"},editTitle:"编辑打赏配置",updateSuccess:"打赏配置已更新",amountSettings:"金额设置",presets:"预设金额",presetsHelper:"请输入预设金额,用英文逗号分隔(例如:1,5,10)",preset:"默认金额",presetHelper:"默认选中的金额(必须是预设金额之一)",custom:"允许自定义金额",minimum:"最小金额",maximum:"最大金额",amountRange:"金额范围:{min} - {max}",customAmount:"自定义金额",buttonSettings:"打赏按钮设置",btn:{text:"按钮文本",helper:"设置打赏按钮显示的文字",preview:"按钮预览"},dialog:{preview:"打赏弹窗预览",confirmButton:"确认打赏 {amount}"},previewTitle:"实时预览",validation:{invalidPreset:"默认金额必须是预设金额之一",invalidRange:"最小金额必须小于最大金额",invalidAmount:"金额必须在允许范围内"},historyType:{title:"打赏记录显示方式",avatar:"头像墙",list:"列表"},intro:"配置打赏按钮和打赏弹窗的展示效果,完成配置后打赏功能将自动生效。",usage:{viewExample:"查看使用示例",title:"打赏组件使用示例",description:"要使用打赏功能,您需要先在组件中正确配置 PaymentProvider 和 DonateProvider。以下是一个基本示例:",note:"注意:mountLocation 必须是唯一的,用于标识打赏实例。配置完成后,该实例将出现在列表中,您可以进行进一步的设置。"}},vaultConfig:{title:"冷钱包配置",description:"启用冷钱包后,系统会在热钱包余额超过阈值时,自动将多余资金转移至安全的离线存储。这种隔离机制将大部分资产与在线环境分离,有效抵御网络攻击,显著提升资金安全性。",learnMore:"了解更多",goToConfig:"前往系统配置",notConfigured:"冷钱包尚未配置",configureFirst:"请先#前往仪表盘#配置冷钱包地址,然后再设置各币种参数。",ownerOnly:"仅拥有所有者权限的管理员可修改冷钱包设置。",permissionRequired:"需要所有者权限",enabled:"状态",enabledYes:"已启用",enabledNo:"未启用",depositThreshold:"存入阈值",withdrawThreshold:"提取阈值",bufferThreshold:"差额阈值",bufferThresholdHelp:"只有当超出存入阈值的金额达到差额阈值时,才会触发归集操作.",bufferThresholdInvalid:"差额阈值不能小于0",edit:"配置",enable:"启用",editTitle:"配置 {currency} 冷钱包设置",enableTitle:"为 {currency} 启用冷钱包",enableVault:"启用冷钱包",enableVaultHelp:"启用冷钱包后,超额资金将自动转入冷钱包,提款超出阈值需管理员审核,确保资产安全与风控。",depositThresholdHelp:"当热钱包余额超过此金额时,多余资金将自动转入冷钱包。",withdrawThresholdHelp:"当单笔提款超过此金额时,需由冷钱包管理员审核并批准。",notConfig:"未配置",noLimit:"无限制",withdrawThresholdNoLimit:"0 表示无提款限制",depositThresholdRequired:"存入阈值必须大于0",withdrawThresholdInvalid:"提款阈值不能小于0",enableSuccess:"{currency} 冷钱包已启用",disableSuccess:"{currency} 冷钱包已关闭",updateSuccess:"{currency} 冷钱包设置已更新",depositConfirmTitle:"转入冷钱包",depositConfirmMessage:"{currency}余额已超过阈值,是否立即转入冷钱包?",depositQueued:"申请转入冷钱包成功,请稍后查看结果",depositFailed:"申请转入冷钱包失败",appBalance:"热钱包余额"},creditGrants:{tab:"信用额度",title:"额度",summary:"额度汇总",noGrants:"未找到信用额度",grantDetail:"信用额度详情",overview:"额度概览",overviewDescription:"监控所有货币的信用余额、使用情况和未偿债务。",availableBalance:"可用余额",usage:"使用情况",viewGrants:"查看额度",viewUsage:"查看使用情况",recentActivity:"最近活动",quickStats:"快速统计",activeGrants:"活跃额度",totalCreditValue:"总信用价值",outstandingDebt:"未偿债务",buyCredits:"购买额度",viewAllActivity:"查看所有活动",creditBalance:"信用余额",totalAmount:"总额度",pendingAmount:"欠费额度",grantCount:"额度数量",noGrantsDescription:"您还没有任何信用额度",status:{granted:"生效中",pending:"待生效",expired:"已过期",depleted:"已耗尽",voided:"已作废"},originalAmount:"原始金额",grantId:"额度ID",grants:"额度",addCredit:"添加额度",viewDetails:"查看详情"},creditTransactions:{tab:"账单",title:"额度账单",summary:"账单汇总",noTransactions:"未找到额度账单",totalTransactions:"总账单数",totalCreditUsed:"总使用额度",transactionDate:"交易时间"},exchangeRateProvider:{title:"汇率数据源",subtitle:"管理动态定价使用的汇率数据源",medianStrategyNote:"系统会自动从多个数据源计算汇率。只有当数据源长期异常或需要临时禁用时才需要在这里处理。",disableConfirmTitle:"确认停用该数据源?",disableConfirmMessage:"停用后可能影响动态计价支付流程,确定要停用吗?",table:{name:"名称",participation:"参与计算",health:"健康度",recentActivity:"最近活动",trustLevel:"可信度",trustLevelTip:"表示可信度与参与资格,不表示优先使用顺序",enabled:"启用",lastUpdate:"最近更新:{time}",failures24h:"24h 失败次数:{count}"},participation:{included:"已参与",excluded:"已排除"},health:{active:"健康",degraded:"不稳定",paused:"异常",inactive:"异常"},status:{active:"正常",degraded:"降级",paused:"已暂停",inactive:"停用"},create:{title:"新增数据源",primaryAction:"新增汇率数据源"},edit:{title:"编辑 {name}",name:"名称",nameHelp:"数据源的唯一标识",nameRequired:"名称必填",type:"数据源类型",typeHelp:"数据源类型。创建后不可修改。",baseUrl:"接口地址(可选)",baseUrlHelp:"自定义接口地址,用于代理或自建实例。默认:{defaultUrl}",apiKey:"API Key",apiKeyHelp:"访问数据源的 API 密钥。",apiKeyLinkText:"API Key 管理地址:",apiKeyLinkAction:"CoinMarketCap 账户",testConnection:"测试连接",testing:"测试中...",testSuccess:"连接成功({symbol}/USD:{rate},{time}ms)",testFailed:"连接失败:{error}",enabled:"启用",priority:"优先级",priorityHelp:"数字越小优先级越高。系统按优先级顺序使用数据源。",status:"状态",statusHelp:'设置为"已暂停"可临时禁用此数据源。',pausedReason:"暂停原因",pausedReasonHelp:"说明为何暂停此数据源(可选)。"}}},empty:{image:"无图片",refunds:"没有退款记录",invoices:"没有账单",invoiceItems:"没有账单明细",subscriptions:"没有订阅记录",customers:"没有客户",products:"没有产品",payouts:"没有出款记录",paymentLinks:"没有支付链接",paymentMethods:"没有支付方式",pricingTables:"没有定价表",paymentCurrencies:"没有货币",webhooks:"没有钩子",events:"没有事件",records:"没有找到匹配的记录",payments:"没有付款记录",prices:"没有价格",pricing:"您还没有设置定价,您可以添加它",summary:"没有摘要"},customer:{subscription:{manage:"管理订阅",cancel:"取消订阅",title:"订阅"},invoiceHistory:"历史账单",product:{empty:"没有订阅产品"},credit:{recharge:"购买额度",autoRecharge:"自动充值",unsupported:"暂不支持购买额度"},recharge:{title:"充值",amount:"金额",submit:"提交",unsupported:"暂不支持该货币充值,请选择其他货币",receiveAddress:"收款地址",view:"查看订阅",success:"充值成功",estimatedDuration:"预计可用 {duration} {unit}",custom:"自定义",intervals:"个周期",history:"充值记录",relatedSubscriptions:"关联订阅",rechargeTooltip:"点击充值余额"},delegation:{title:"检测到你未完成账户的授权,为了不影响订阅的扣费,请尽快完成授权",btn:"支付授权",success:"授权成功",error:"授权失败"},overdraftProtection:{title:"订阅守护",setting:"配置订阅守护",learnMore:"点击了解更多关于订阅守护",tip:"为避免因扣费失败中断服务,您可以通过质押开启订阅守护。按时付款不会收取额外费用,请及时付清账单,若可用质押不足或者超期未付,我们将从质押中扣除并收取服务费",enabled:"已启用",disabled:"未启用",returnRemaining:"退还剩余质押",returnRemainingTip:"退还剩余质押后,订阅守护服务将自动关闭,请确认操作。",applyRemainingSuccess:"质押退还申请成功",remaining:"您当前剩余可用质押:{amount} {symbol}, 每周期预计需质押:{estimateAmount} {symbol}。",noRemaining:"当前无质押,为确保订阅守护服务的正常使用,请至少质押 {estimateAmount} {symbol}。",remainingNotEnough:"当前存在未支付的账单,总计 {due} {symbol},如果不支付,您当前剩余质押将无法覆盖下期账单,剩余可用质押:{unused} {symbol},请质押至少 {min} {symbol}。",due:"请先支付欠款",insufficient:"额度不足,下期账单将无法使用订阅守护服务, 请添加额度",insufficientTip:"订阅守护服务额度不足,请尽快质押保证订阅守护服务的正常使用。",intervals:"个周期",estimatedDuration:"预计可用 {duration} {unit}",rule:"规则:N * ( P + Fee )",ruleTip:"N 为周期数, P 为订阅账单费用, Fee 为订阅守护服务费用,单次费用为 {gas} {symbol}",min:"质押金额不得小于 {min} {symbol}",settingSuccess:"配置更新成功",settingError:"配置更新失败",openSuccess:"订阅守护已开启",closeSuccess:"订阅守护已关闭",keepStake:"不退还质押",returnStake:"退还剩余质押",stake:"质押",address:"质押账户",total:"总质押:{total} {symbol},",disableConfirm:"您当前有未支付的账单,请先付清账单。",open:"开启订阅守护",payerAddress:"付款账户",stakingAddress:"质押地址"},unpaidInvoicesWarning:"您当前有未支付的账单,请先付清账单。",unpaidInvoicesWarningTip:"您当前有未支付的账单,请及时付清。",pendingAmountWarningTip:"您有 {amount} {symbol} 的使用费用因额度不足无法处理,请及时充值。",invoice:{relatedInvoice:"关联账单",donation:"打赏记录",creditsInfo:"总共包含 {amount}",appliedDiscounts:"已应用优惠",priceChanged:"汇率已变动 {percent}%。支付金额将会更新,是否继续?",paymentCancelled:"支付已取消",paymentMethodChanged:"支付方式已更换",priceChangeTitle:"价格已变动",priceChangeDescription:"汇率{direction}了 {percent}%,支付金额将会更新。",currentPaymentMethod:"当前支付方式",otherPaymentMethods:"或使用其他方式支付",confirmAndPay:"确认并支付",switchAndPay:"切换并支付",current:"当前"},payout:{empty:"没有收款记录",payer:"付款方",receiver:"收款方",payTxHash:"交易详情",viewReference:"查看打赏原文",title:"收款记录"},pastDue:{warning:"您有欠费账单,请及时付款以保持服务正常运行",invoices:"欠费账单",payNow:"立即付款",alert:"您有欠费账单需要处理,请及时付款以避免服务中断",title:"结清欠费账单"},quote:{title:"价格锁定记录",noQuotes:"此账单没有价格锁定记录",id:"报价 ID",pricingDetails:"定价详情",baseAmount:"基础金额",exchangeRate:"汇率",consensusMethod:"汇率算法",referenceRate:"参考汇率:1 {symbol} ≈ ${rate}",quotedAmount:"锁定金额",providerInfo:"汇率来源",provider:"数据源",rateTimestamp:"汇率时间",slippage:"滑点",lifecycle:"生命周期",expiresAt:"过期时间",riskInfo:"风险信息",deviation:"价格偏差",anomalyDetected:"检测到异常",degraded:"降级",status:{active:"活跃",used:"已使用",paid:"已支付",expired:"已过期",cancelled:"已取消",failed:"失败"}}},integrations:{description:"用于配置和管理 Payment Kit 与你应用之间的集成方式。",basicFeatures:"基础功能",advancedFeatures:"高级功能",features:{products:{title:"创建产品",intro:"创建和管理您的产品或服务"},paymentLinks:{title:"支付链接",intro:"创建可分享的支付链接,快速完成收款"},pricingTables:{title:"定价表",intro:"为您的产品创建美观的定价表"},metering:{title:"计量与额度",intro:"使用计量器跟踪用量,并通过额度套餐售卖 Credits",dialog:{title:"如何开启 Credit 计费",description:"Credit 计费模式让您可以跟踪用量并基于消费向客户收费。按照以下步骤开始配置:",steps:{step1:{title:"创建计量器用于跟踪用量事件",description:"设置计量器来监控 API 调用、数据使用量或应用中任何可测量的活动。"},step2:{title:"创建 Credits 购买套餐和定价",description:"定义客户可以购买的额度套餐,支持灵活的定价模式和有效期设置。"},step3:{title:"创建支付链接并分享给用户",description:"生成可分享的支付链接,让客户轻松购买额度套餐。"},step4:{title:"集成并上报 Credits 用量",description:"使用我们的 SDK 上报使用事件,自动从客户余额中扣除额度。"}},docText:"查看 Credit 计费指南"}},promotions:{title:"促销与优惠",intro:"创建优惠券与促销码,提升转化率"},donate:{title:"打赏功能",intro:"使用 <CheckoutDonate /> 组件为应用添加打赏按钮"},paymentMethods:{title:"支付方式",intro:"配置多种支付方式和货币支持"},api:{title:"API 集成",intro:"使用我们的 JavaScript SDK 实现自定义解决方案",link:"https://www.npmjs.com/package/@blocklet/payment-js"}},viewDocs:"查看文档"}}),kD=jE({zh:ME,en:RE},O0),NE=z0({fallbackLocale:"en"},kD),Xw=NE,ga=window.blocklet?.cloudflareWorker?TE:EE,BE=Ne.lazy(()=>Ht(()=>import("./home-HbrLyxJL.js"),[])),UE=Ne.lazy(()=>Ht(()=>import("./index-BoQ7wf3O.js"),[])),no=Ne.lazy(()=>Ht(()=>import("./index-BJ_E6bEO.js"),[])),OE=Ne.lazy(()=>Ht(()=>import("./index-Drav4oDH.js"),[])),zE=Ne.lazy(()=>Ht(()=>import("./detail-OZeeKI69.js"),[])),PE=Ne.lazy(()=>Ht(()=>import("./past-due-CGGRZmXY.js"),[])),qE=Ne.lazy(()=>Ht(()=>import("./detail-uhlID8jD.js"),[])),a0=Ne.lazy(()=>Ht(()=>import("./embed-CsNqeCd0.js"),[])),LE=Ne.lazy(()=>Ht(()=>import("./change-plan-CxE-XfWc.js"),[])),IE=Ne.lazy(()=>Ht(()=>import("./change-payment-CPUCUEER.js"),[])),$E=Ne.lazy(()=>Ht(()=>import("./detail-DE3OOC5M.js"),[])),VE=Ne.lazy(()=>Ht(()=>import("./detail-15zxCbV9.js"),[])),HE=Ne.lazy(()=>Ht(()=>import("./subscription-DcwhSOpa.js"),[])),YE=Ne.lazy(()=>Ht(()=>import("./detail-cwHZbY62.js"),[])),Rl=Ne.lazy(()=>Ht(()=>import("./index-DPodCQ9c.js"),[])),GE=Ne.lazy(()=>Ht(()=>import("./account-DETfFe4_.js"),[]));function KE(){const a=ds();V.useEffect(()=>{const r=o=>{if(o.button!==0||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey)return;const s=o.target?.closest("a");if(!s)return;const f=s.getAttribute("href");if(!f||s.target&&s.target!==""&&s.target!=="_self"||s.hasAttribute("download")||/^[a-z]+:/i.test(f)&&!/^https?:/i.test(f)||f.startsWith("#"))return;let m;try{m=new URL(f,window.location.href)}catch{return}if(m.origin!==window.location.origin)return;o.preventDefault();const c=window?.blocklet?.prefix||"/";let h=m.pathname+m.search+m.hash;c!=="/"&&h.startsWith(c.replace(/\/$/,""))&&(h=h.slice(c.replace(/\/$/,"").length)||"/"),a(h)};return document.addEventListener("click",r),()=>document.removeEventListener("click",r)},[a])}function QE(){return KE(),u.jsx(kE,{children:u.jsx(fC,{FallbackComponent:CE,onReset:()=>window.location.reload(),children:u.jsx(V.Suspense,{fallback:u.jsx(x0,{children:u.jsx(gr,{})}),children:u.jsxs(nC,{children:[u.jsx(jt,{path:"/",element:u.jsx(BE,{})}),u.jsx(jt,{path:"/checkout/:action/:id",element:u.jsx(UE,{})}),u.jsx(jt,{path:"/admin",element:u.jsx(no,{})},"admin-index"),",",u.jsx(jt,{path:"/admin/:group",element:u.jsx(no,{})},"admin-tabs"),",",u.jsx(jt,{path:"/admin/:group/:page",element:u.jsx(no,{})},"admin-sub"),",",u.jsx(jt,{path:"/admin/:group/:page/:id",element:u.jsx(no,{})},"admin-detail"),",",u.jsx(jt,{path:"/admin/:group/:page/:subpage/:id",element:u.jsx(no,{})},"admin-nested"),",",u.jsx(jt,{path:"/admin/*",element:u.jsx(no,{})},"admin-fallback"),",",u.jsx(jt,{path:"/integrations",element:u.jsx(Rl,{})},"integrations-index"),u.jsx(jt,{path:"/integrations/:group",element:u.jsx(Rl,{})},"integrations-tabs"),u.jsx(jt,{path:"/integrations/:group/:page",element:u.jsx(Rl,{})},"integrations-sub"),u.jsx(jt,{path:"/integrations/*",element:u.jsx(Rl,{})},"integrations-fallback"),u.jsx(jt,{path:"/customer",element:u.jsx(ga,{children:u.jsx(OE,{})})},"customer-home"),u.jsx(jt,{path:"/customer/subscription/:id",element:u.jsx(ga,{children:u.jsx(qE,{})})},"customer-subscription"),u.jsx(jt,{path:"/customer/subscription/:id/change-plan",element:u.jsx(ga,{children:u.jsx(LE,{})})},"customer-subscription-change-plan"),u.jsx(jt,{path:"/customer/subscription/:id/change-payment",element:u.jsx(ga,{children:u.jsx(IE,{})})},"customer-subscription-change-payment"),u.jsx(jt,{path:"/customer/subscription/:id/recharge",element:u.jsx(ga,{children:u.jsx(HE,{})})},"customer-recharge"),u.jsx(jt,{path:"/customer/recharge/:currencyId",element:u.jsx(ga,{children:u.jsx(GE,{})})},"customer-balance-recharge"),u.jsx(jt,{path:"/customer/embed/subscription",element:u.jsx(a0,{})},"customer-embed"),u.jsx(jt,{path:"/embed/customer/subscription",element:u.jsx(a0,{})},"subscription-embed"),u.jsx(jt,{path:"/customer/invoice/past-due",element:u.jsx(ga,{children:u.jsx(PE,{})})},"customer-due"),u.jsx(jt,{path:"/customer/invoice/:id",element:u.jsx(ga,{children:u.jsx(zE,{})})},"customer-invoice"),u.jsx(jt,{path:"/customer/payout/:id",element:u.jsx(ga,{children:u.jsx(YE,{})})},"customer-payout"),u.jsx(jt,{path:"/customer/credit-grant/:id",element:u.jsx(ga,{children:u.jsx($E,{})})},"customer-credit-grant"),u.jsx(jt,{path:"/customer/credit-transaction/:id",element:u.jsx(ga,{children:u.jsx(VE,{})})},"customer-credit-transaction"),u.jsx(jt,{path:"/customer/*",element:u.jsx(Zy,{to:"/customer"})},"customer-fallback"),",",u.jsx(jt,{path:"*",element:u.jsx(Zy,{to:"/"})})]})})})})}const ZE=Wx(QE);function XE(){const a=window?.blocklet?.prefix||"/";return DD(),u.jsx(cC,{translations:kD,fallbackLocale:"en",children:u.jsx(Jx,{children:u.jsx(DA,{children:u.jsx(_E,{serviceHost:SE(a),useSocket:!window.blocklet?.cloudflareWorker,protectedRoutes:["/admin/*","/customer/*","/integrations/*"].map(r=>Dt(a,r)),children:u.jsx(tC,{basename:a,children:u.jsx(ZE,{})})})})})})}const WE=lC.createRoot(document.getElementById("app"));WE.render(u.jsx(XE,{}));export{R_ as $,Rw as A,bD as B,Yl as C,Lf as D,hs as E,K0 as F,jg as G,fw as H,Ul as I,cw as J,nw as K,hr as L,xS as M,yw as N,Gg as O,sD as P,hA as Q,Vf as R,Zg as S,tm as T,tu as U,_S as V,jS as W,ba as X,au as Y,BS as Z,M_ as _,_n as a,ns as a$,fD as a0,lD as a1,BA as a2,dr as a3,NS as a4,lA as a5,lw as a6,Dw as a7,Ja as a8,I0 as a9,wf as aA,qw as aB,bS as aC,e0 as aD,Qg as aE,Kg as aF,mw as aG,DA as aH,Yw as aI,_w as aJ,Sw as aK,eA as aL,Tw as aM,iu as aN,nu as aO,Rn as aP,iw as aQ,un as aR,zi as aS,Z_ as aT,cA as aU,Il as aV,Nn as aW,Xa as aX,ii as aY,fr as aZ,jw as a_,Bi as aa,Wa as ab,Nl as ac,W1 as ad,Mw as ae,Nw as af,tE as ag,nE as ah,iE as ai,rE as aj,oE as ak,Bw as al,aE as am,Uw as an,Ow as ao,zw as ap,Lw as aq,AD as ar,Pw as as,Yf as at,$w as au,Iw as av,Vw as aw,Hw as ax,kl as ay,dD as az,Zw as b,rw as b0,pw as b1,Xw as b2,FS as b3,uw as b4,hw as b5,If as b6,xw as b7,aD as b8,iD as b9,rD as ba,bw as bb,ww as bc,sw as bd,Hg as be,U_ as bf,B_ as bg,Tf as bh,jE as bi,sC as bj,vw as bk,Qw as c,qi as d,ot as e,kg as f,dw as g,nD as h,Ui as i,CS as j,Pt as k,Qn as l,Fw as m,Oi as n,ow as o,kw as p,ln as q,em as r,Vl as s,MS as t,wD as u,Ca as v,vA as w,Hf as x,aw as y,gw as z};
684
+ `;function CE({error:a=void 0}){const{t:r}=ft();return u.jsxs(xE,{children:[u.jsx(t0,{children:a?.message||r("common.error")}),u.jsx(t0,{children:a?.stack||r("common.error")})]})}function SE({error:a}){return u.jsx(CE,{error:a})}function _E(a){return typeof window<"u"&&window?.blocklet?.serviceHost||""||a}const{SessionProvider:AE,SessionContext:EE,SessionConsumer:Kw,withSession:Qw}=Zx();function wD(){return V.useContext(EE)}function wE(a){const{session:r,connectApi:o,events:s}=wD(),[f]=tC(),m=f.get("embed")||sessionStorage.getItem("embed");return V.useEffect(()=>{m&&sessionStorage.setItem("embed",m)},[m]),V.useEffect(()=>{s.once("logout",()=>{r.login(()=>{},{openMode:"redirect",redirect:window.location.href})})},[]),V.useEffect(()=>{r.initialized&&!r.user&&r.login(()=>{},{openMode:"redirect",redirect:window.location.href})},[r.initialized]),r.user?u.jsx(sD,{session:r,connect:o,children:u.jsx(Xx,{currentTab:"/customer",hideFooter:!0,embed:m==="1",notLoginContent:"undefined",children:a.children})}):null}function n0(){return u.jsx(Se,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:u.jsx(gr,{})})}function TE(){const a=window.blocklet;return!!(a&&a.appPid&&a.prefix)}function kE(a){const{session:r,connectApi:o}=wD();return V.useEffect(()=>{r.initialized&&!r.user&&r.login(()=>{})},[r.initialized]),!TE()||!r.initialized?u.jsx(n0,{}):r.user?u.jsxs(sD,{session:r,connect:o,children:[u.jsx(Uf,{meta:void 0,addons:void 0,sessionManagerProps:void 0,homeLink:void 0,theme:void 0,hideNavMenu:void 0,maxWidth:!1,sx:{borderBottom:"1px solid",borderColor:"divider"}}),u.jsx(Se,{sx:{flex:1,maxWidth:1200,mx:"auto",px:3,py:3,width:"100%"},children:a.children})]}):u.jsx(n0,{})}function Zw({pending:a=!0}){const[r,o]=V.useState(0);return V.useEffect(()=>{const s=setInterval(()=>{o(f=>{if(f===100)return s&&clearInterval(s),-1;const m=Math.random()*10;return Math.min(f+m,100)})},a?500:30);return()=>{clearInterval(s)}},[a]),u.jsx(Se,{sx:{width:"100%",height:"4px",position:"fixed",top:0,left:0,zIndex:"999999"},children:u.jsx(zl,{variant:"determinate",value:r,sx:{opacity:r===-1?0:1,transition:"0.3s"}})})}const TD=V.createContext({});function FE({children:a}){const[r,o]=V.useTransition(),s=V.useMemo(()=>({isPending:r,startTransition:o}),[r]);return u.jsx(TD.Provider,{value:s,children:a})}function Xw(){return V.useContext(TD)}var jE=Wx();const RE=ri(jE),ME=Wl({common:{redirecting:"Redirecting...",title:"Name",estimated:"Estimated",total:"Total",active:"Active",every:"Every",inactive:"Inactive",enabled:"Enabled",disabled:"Disabled",metadata:{label:"Metadata",description:"Add custom key-value pairs to store additional information about this meter.",add:"Add more metadata",edit:"Edit metadata",empty:"No metadata",emptyTip:"You haven't added any metadata yet. You can add it now",formMode:"Switch to form mode",jsonMode:"Switch to JSON mode",jsonPlaceholder:"Enter JSON data...",invalidJson:"Invalid JSON format. Please check your input",formatJson:"Format JSON"},price:"Price",add:"Add",fullscreen:"Fullscreen",exit:"Exit",maxLength:"Max {len} characters",minLength:"Min {len} characters",invalidCharacters:"Invalid characters",latinOnly:`Must contain at least one letter and cannot include Chinese characters or special characters such as <, >, ", ' or \\`,loading:"Loading...",loadMore:"Load more",noMoreData:"No more data",rechargeTime:"Recharge Time",submit:"Submit",custom:"Custom",estimatedDuration:"{duration} est.",detail:"Detail",setting:"Setting",slippage:"Slippage Limit",slippageMinRate:"Min acceptable rate {rate} {currency}",slippageTooltip:"The minimum acceptable exchange rate for automatic payments. If the rate drops below this, payment will be paused.",welcome:"Welcome to Payment Kit",welcomeDesc:"Start accepting payments in minutes with Payment Kit. Choose a feature to get started.",quickStart:"Quick Start Guides",advancedFeatures:"Advanced Features",quickStarts:"Quick Starts",homeTagline:"A decentralized Stripe-like payment solution for Blocklets",adminDashboard:"Admin Dashboard",customerPortal:"Customer Portal",copy:"Copy",copied:"Copied",copySuccess:"Copied successfully",copyFailed:"Copy failed",copyTip:"Please copy manually",save:"Save",saving:"Saving...",saved:"Saved successfully",refresh:"Refresh",cancel:"Cancel",back:"Back",know:"I Know",confirm:"Confirm",increased:"increased",decreased:"decreased",edit:"Edit",view:"View",select:"Select",clear:"Clear",delete:"Delete",deleting:"Deleting...",activate:"Activate",deactivate:"Deactivate",yes:"Yes",no:"No",never:"Never",created:"Created",updated:"Updated",valid:"Valid",events:"Events",details:"Details",discount:"Discount",deleted:"Deleted",maxAmount:"Max amount is {max}",days:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},name:"Name",type:"Type",status:"Status",remainingCredit:"Remaining Credit",scope:"Scope",source:"Source",effectiveDate:"Effective Date",expirationDate:"Expiration Date",creditGrant:"Grant",date:"Date",subscription:"Subscription",meter:"Meter",meterEvent:"Meter Event",creditAmount:"Credit",createdAt:"Created At",expiresAt:"Expires At",general:"All usage-based prices",specific:"Specific usage-based prices",paid:"Paid",promotional:"Promotional",viewInvoice:"View Invoice",viewSourceData:"View Source",goToConfigure:"Go to Configure",noData:"No data"},notification:{preferences:{title:"Email Notification Settings",button:"Email Settings",frequency:{label:"Notification Frequency",default:"Instant Notifications (Default)",daily:"Daily",weekly:"Weekly",monthly:"Monthly"},day:"Day",timeFormatError:"Please enter a valid time in 24-hour format (HH:MM)",monthlyHelp:"If day is not available in a month, the last day will be used",subscriptionRenewalNote:"This setting applies to subscription renewal notifications."}},admin:{description:"Manage your products, pricing, billing, and payments.",balances:"Balances",trends:"Trends",addresses:"Addresses",metrics:"Metrics",attention:"Attention",overview:"Overview",overviewPage:{financialIndicatorsTitle:"Financial Indicators",businessMonitoringTitle:"Business Monitoring",filters:{dateRange:"Select Date Range",currencyLabel:"Currencies",productLabel:"Products",regionLabel:"Regions",allCurrencies:"All Currencies",allProducts:"All Products",allRegions:"All Regions"},financialIndicators:{totalIncome:{title:"Total Income",subtitle:"User's actual payment"},refundAmount:{title:"Refund Amount",subtitle:"Total refunds issued"},costOfGoods:{title:"Cost of Goods",subtitle:"Supplier share"},netRevenue:{title:"Net Revenue",subtitle:"Revenue after vendor costs"},promotionCost:{title:"Promotion Cost",subtitle:"Discount"},taxedRevenue:{title:"Taxed Revenue",subtitle:"Revenue with tax"}},charts:{title:"Transaction Trends",payments:"Payments",payouts:"Payouts",refunds:"Refunds",allCurrencies:"All currencies"},metrics:{transaction:"Transaction Metrics",essential:"Essential Metrics"},overdue:{title:"Pending Consumption",subtitle:"Unpaid credit consumption",customers:"{count} customers",events:"{count} pending records",viewAll:"View All",noOverdue:"No pending consumption"}},payments:"Payments",connections:"Connections",back:"Back",actions:"Actions",create:"Create",creating:"Creating...",save:"Save",saving:"Saving...",cancel:"Cancel",paymentLinks:"Payment links",paymentMethods:"Payment methods",customers:"Customers",products:"Products",invoiceItems:"Invoice Items",pricing:"Pricing",coupons:"Coupons",tax:"Tax",taxRates:"Tax Rates",taxRate:{create:"Create Tax Rate",createTitle:"Create Tax Rate",createAction:"Add Tax Rate",created:"Tax rate created successfully",updated:"Tax rate updated successfully",deleted:"Tax rate deleted successfully",label:"Tax Rate",view:"View Tax Rate",displayName:"Display Name",displayNamePlaceholder:"Name shown on invoices and reports",displayNameAuto:"Auto-generated if left empty",displayNameRequired:"Display name is required",description:"Description",descriptionPlaceholder:"Optional description",country:"Country",countryRequired:"Country is required",state:"State/Province",postalCode:"Postal Code",taxCode:"Product Tax Code",taxCodeDescription:"Tax codes are used to calculate automatic taxes based on product type and location. You can ",taxCodeDescriptionLink:"manage tax rates",taxCodeDescriptionSuffix:" to create custom tax rates for specific tax codes and regions.",selectTaxCode:"Select product tax code",percentage:"Tax Rate (%)",percentageRequired:"Tax rate percentage is required",percentageMin:"Tax rate must be 0% or higher",percentageMax:"Tax rate must be less than 100%",active:"Active by default",location:"Region",advanced:"Advanced options",search:"Search tax rates",searchCountry:"Search country",back:"Back to tax rates",associatedInvoices:"Related Invoices",deleteTitle:"Delete Tax Rate",deleteMessage:"Are you sure you want to delete tax rate “{name}”? This action cannot be undone.",deactivateTitle:"Deactivate Tax Rate",deactivateMessage:"Deactivate “{name}”? It will no longer apply automatically to invoices.",activateTitle:"Activate Tax Rate",activateMessage:"Activate “{name}”? It will be available for future invoices.",createTitleShort:"Add tax rate",edit:"Edit",editTitle:"Edit Tax Rate",selectTaxCodeHint:"We'll use this tax code to calculate automatic tax on invoices.",searchPlaceholder:"Search by product or tax code",previewPlaceholder:"Select a tax code to see details.",usePreset:"Use preset",noPreset:"No preset selected",noSuggestions:"No tax codes match your search.",relatedInvoiceNum:"Related Invoices",notUsed:"Not used",taxCodeLabel:"Tax code: {code}",types:{general:"General",digital:"Digital products",services:"Services",physical:"Physical goods"}},pricingTables:"Pricing tables",vendors:"Vendors",billing:"Billing",invoices:"Invoices",subscriptions:"Subscriptions",meters:"Meters",meterEvents:{title:"Meter Events"},overdue:{title:"Pending Consumption",pendingAmount:"Pending Amount",eventCount:"Pending Records",noOverdue:"No pending consumption",selectCurrency:"Currency"},meter:{add:"Add meter",edit:"Edit meter",save:"Save meter",saved:"Meter successfully saved",creditMode:{onchain:"OnChain",onChainDescription:"Once enabled, your credit will be published as a Token on the ArcBlock blockchain",tokenConfiguration:"Token Configuration",createNewToken:"Create New Token",useExistingToken:"Use Existing Token",createTokenHint:"Fill in the token name and symbol to create a new Token",tokenName:"Token Name",tokenNamePlaceholder:"Enter token name",tokenNameRequired:"Token name is required",tokenSymbol:"Token Symbol",tokenSymbolPlaceholder:"Enter token symbol",tokenSymbolRequired:"Token symbol is required",tokenSymbolFormat:"Symbol must be 1-6 uppercase letters or numbers",createTokenButton:"Create Token",creatingToken:"Creating...",tokenCreated:"Token created successfully",tokenCreatedLabel:"Token Created",tokenAddress:"Token Address",selectToken:"Select Token",selectTokenPlaceholder:"Select an existing token",tokenAddressRequired:"Token address is required",enabled:"Enabled"},activate:"Activate meter",activated:"Meter activated successfully",deactivate:"Deactivate meter",deactivated:"Meter deactivated successfully",deleted:"Meter deleted successfully",deleteConfirm:"Are you sure you want to delete this meter? This action cannot be undone.",activateConfirm:"Are you sure you want to activate this meter? It will start collecting usage data.",deactivateConfirm:"By deactivating, no further events for this meter can be reported. Attempts to create events for this meter will return an error. Previously reported usage will remain. You can reactivate at any time.",view:"View meter",basicInfo:"Basic information",basicInfoDescription:"Configure the core settings for your meter to track usage events.",editDescription:"Update the meter name, description, and metadata. Core settings like event name and aggregation method cannot be changed.",inactive:"Meter is inactive",inactiveTip:"This meter is not collecting usage data. Activate it to start tracking events.",name:{label:"Meter name",required:"Meter name is required",placeholder:"API requests",help:"A descriptive name for this meter that will be displayed in your dashboard and user's personal bill."},eventName:{label:"Event name",required:"Event name is required",placeholder:"api_request",help:"The event name that will be sent to this meter",editHelp:"Event name cannot be changed after meter creation to maintain data consistency."},aggregationMethod:{label:"Aggregation method",required:"Aggregation method is required",sum:"Sum",sumHint:"Add all event values together",sumDescription:"The sum aggregation method adds all usage event values together and reports the total for event summaries and billing.",count:"Count",countHint:"Count the number of events",countDescription:"The count aggregation method counts the number of events received and reports the total count for event summaries and billing.",last:"Last value",lastHint:"Use the most recent event value",lastDescription:"The last value aggregation method uses the most recent event value received and reports that value for event summaries and billing.",editHelp:"Aggregation method cannot be changed after meter creation to maintain data consistency."},unit:{label:"Measurement unit",required:"Measurement unit is required",placeholder:"request",help:"The unit of measurement for this meter",editHelp:"Measurement unit cannot be changed after meter creation to maintain data consistency."},description:{label:"Description",placeholder:"Track API usage for billing",help:"Optional description to help you and your team understand what this meter tracks."},events:{title:"Events",dailyEventCount:"Daily Event Count",dailyTotalValue:"Daily Total Value",eventName:"Event Name",value:"Value",customer:"Customer",subscription:"Subscription",reportTime:"Report Time",count:"{count} events total",empty:"No event data",emptyTip:"Data will appear here when events are reported",filterByCustomer:"Filter by customer",eventCount:"Event Count",totalValue:"Total Value"},usageGuide:{title:"How to report usage",description:'Send events to this meter using the event name "{eventName}". The meter will {method} the values and track usage in {unit}.',tip:'Send events to this meter using the event name "{eventName}". The meter will {aggregationMethodHint} and track usage in {unit}.',apiEndpoint:"API Endpoint",curlExample:"cURL Example",jsExample:"JavaScript Example",pythonExample:"Python Example",important:"Important",tip1:"Replace YOUR_API_KEY with your actual API key",tip2:"The event_name must match exactly: {eventName}",tip3:"Include a timestamp for accurate tracking",moreInfo:"For more information, see our",apiDocs:"API documentation"},products:{count:"{count} associated products",create:"Create product",created:"Product created successfully",createPrompt:"Enter product name:",manage:"Manage",empty:"No products",title:"Products",emptyTip:"No products are associated with this meter yet.",meterService:"Meter Service",creditCharge:"Credit Charge"},creditProducts:{emptyTip:"No credit products are associated with this meter yet."},rechargePackage:{priceId:"Top-up Package",tooltip:"The top-up package is used to recharge {name}, and users can get the corresponding {name} after purchase."}},creditProduct:{create:"Create Credit Product",defaultName:"{name} Top-up Package",defaultDescription:"{name} Top-up Package",defaultNickname:"Credit Recharge",unitLabel:"units",settings:"Credit Settings",configTitle:"Credit Configuration",expirationTime:{label:"Expiration",expireWithNextGrant:"Expire with Next Grant"},name:{placeholder:"Enter Credit product name"},description:{placeholder:"Describe the purpose and value of this Credit product"},priceNotice:"Credit products are used to provide consumable credits to users, supporting both one-time purchase and package pricing models.",creditAmount:{label:"Credit Amount",placeholder:"Amount of credits users receive when purchasing this price",help:"Leave empty for pay-per-unit pricing, enter a number for fixed package deals",description:"Purchase quantity determines the amount of Credits received"},validDuration:{label:"Valid Duration",help:"Credit validity period, calculated from purchase time",description:"Set to 0 for permanent validity",hours:"hours",days:"days",weeks:"weeks",months:"months",years:"years"},associatedPrices:{label:"Associated Prices",placeholder:"Select service prices this Credit can be used for",help:"When selected, purchased Credits can only be used for specified services",description:"No selection means Credits can be used for all services"},priority:{label:"Usage Priority",help:"Usage order when user has multiple Credits, lower numbers have higher priority",description:"Range: 0-100, 0 is highest priority, 50 is default value"},deliveryMode:{label:"Delivery Mode",once:"One-time",periodic:"Periodic"},schedule:{interval:{label:"Grant Frequency",hour:"hours",day:"days",week:"weeks",month:"months"},amountPerGrant:{label:"Amount per Grant",description:"Fixed Credit amount per grant"},expireWithNextGrant:{label:"Expire with Next Grant",description:"This Credit expires when the next grant is issued (refresh mode)"}}},meterEvent:{title:"Meter Event Details",id:"Event ID",totalEvents:"Total events: {count}",noEvents:"No events found",noEventsHint:"You can manually add test events in test mode.",identifier:"Identifier",customer:"Customer",customerId:"Customer ID",value:"Value",subscription:"Subscription",creditConsumed:"Credit Consumed",usageValue:"Usage Value",settlementAmount:"Settlement Amount",reportedAmount:"Reported Amount",overdueAmount:"Overdue Amount",reportedAt:"Reported At",processedAt:"Processed At",eventIdentifier:"Event Identifier",usageDetails:"Usage Details",chart:{eventCount:"Daily Event Count",totalValue:"Daily Total Value"},filter:{customer:"Filter by Customer"},add:{button:"Add usage",title:"Add usage",customerId:"Customer",customerIdPlaceholder:"Select customer",value:"Value",valuePlaceholder:"Enter usage value",subscriptionId:"Subscription",subscriptionIdPlaceholder:"Enter subscription ID (optional)",subscriptionIdHint:"Optional - link this usage to a specific subscription",timestamp:"Timestamp",timestampHint:"When this usage occurred",validation:"Customer and value are required",success:"Usage event added successfully",submit:"Submit"}},developers:"Developers",webhooks:"Webhooks",events:{title:"Events",dailyEventCount:"Daily Event Count",dailyTotalValue:"Daily Total Value",eventName:"Event Name",value:"Value",customer:"Customer",subscription:"Subscription",reportTime:"Report Time",count:"{count} events total",empty:"No event data",emptyTip:"Data will appear here when events are reported",filterByCustomer:"Filter by customer",eventCount:"Event Count",totalValue:"Total Value",hourly:"Hourly",totalEvents:"Total Events",timeRange:"Time Range",hourlyView:"Hourly View",dailyView:"Daily View"},refunds:"Refunds",payouts:"Payouts",logs:"Logs",passports:"Passports",details:"Details",settings:"Settings",branding:"Branding",business:"Business",summary:"Summary",product:{empty:"No product",info:"Product information",add:"Add product",view:"View product details",save:"Save product",saved:"Product successfully saved",additional:"Additional options",edit:"Edit product",pricing:"Pricing",find:"Find a product",archive:"Archive product",archiveTip:"Archiving will hide this product from new purchases. Are you sure you want to archive this product?",unarchive:"Unarchive product",unarchiveTip:"Unarchiving will enable this product for new purchases. Are you sure you want to unarchive this product?",remove:"Remove product",removeTip:"Removing will hide this product from new purchases. Are you sure you want to remove this product?",archived:"This product has been archived",archivedTip:"This product can't be added to new invoices, subscriptions, payment links, or pricing tables. Any existing subscriptions with this product remain active until canceled and any existing payment links or pricing tables are deactivated.",locked:"This product is locked because at least one of its prices is used by a subscription or a payment.",currencyNotAligned:"All prices must have the same currency settings",image:{label:"Image",add:"Add image"},features:{label:"Features",add:"Add another feature"},name:{label:"Name",required:"Product name is required",placeholder:"Premium plan"},description:{label:"Description",required:"Product description is required",placeholder:"Product descriptions that appear on checkout, invoice pages"},statement_descriptor:{label:"Statement descriptor",placeholder:"ArcBlock"},unit_label:{label:"Unit label",placeholder:"Unit"},billingType:{label:"Billing type",standard:"Standard billing",standardDesc:"Charge a fixed amount on a recurring basis",metered:"Metered billing",meteredDesc:"Charge based on usage tracked by a meter",help:"Choose how customers will be charged for this product"},meter:{label:"Meter",placeholder:"Select a meter to track usage",required:"Please select a meter for metered billing",help:"Select the meter to track usage for this product",pricingNote:"For metered products, pricing is automatically based on usage tracked by the selected meter. You only need to set the unit price and billing period."},cross_sell:{title:"Cross-sells",to:"Cross-sells to",tip:""},type:{label:"Product Type",service:"Service",serviceDesc:"Digital services or subscriptions",credit:"Credit",creditDesc:"Credit top-up product for credit-based billing scenarios",creditDescLink:"Create meters first",good:"Good",goodDesc:"Physical products or tangible goods"},vendorConfig:{title:"Vendor Configuration",add:"Add Vendor",empty:'No vendors configured. Click "Add Vendor" to configure vendor services',vendor:"Vendor",vendorRequired:"Vendor is required",productCode:"Product Code",productCodeRequired:"Product code is required",commissionType:"Commission Type",commissionRate:"Commission Rate",commissionRateRequired:"Commission rate is required",commissionRateMin:"Commission rate must be at least 0",commissionRateMax:"Commission rate cannot exceed 100%",amount:"Fixed Amount",noVendor:"No vendor available",amountRequired:"Fixed amount is required",totalCommission:"Total commission rate: {total}%",totalCommissionExceeded:"Total commission rate exceeds 100%: {total}%"}},price:{name:"Price",type:"Usage type",plan:"Price plan",info:"Price information",count:"{count} prices",empty:"No price",addAnother:"Add another price",order:"Plan {order}",lookupKey:"Lookup key",setAsDefault:"Set as default price",detail:"Pricing details",add:"Add another price",view:"View price details",additional:"Additional options",model:"Pricing model",amount:"Price",amountDescription:"This is the tax-inclusive price that customers will pay.",locked:"This price is locked because it is used by a subscription or a payment.",amountTip:"Choose recurring for subscriptions and one-time for everything else.",duplicate:"Duplicate price",edit:"Edit price",find:"Find or add a price",archive:"Archive price",archiveTip:"Archiving will hide this price from new purchases. Are you sure you want to archive this price?",remove:"Remove price",removeTip:"Removing will hide this price from new purchases. Are you sure you want to remove this price?",unit_amount:{required:"Price is required",positive:"Price must be positive",stripeTip:"Stripe requires the price to be at least 0.5"},nickname:{label:"Price description",placeholder:""},lookup_key:{label:"Lookup key",placeholder:"",description:"Lookup key is used to identify the price in the API"},recurring:{interval:"Billing period",metered:"Usage is metered?",meteredTip:"Metered billing lets you charge customers based on reported usage at the end of each billing period.",aggregate:"Charge for metered usage by",intervalCountTip:"Billing interval must be a positive number",stripeTip:"Stripe requires the billing period to be at least 1 day"},currency:{add:"Add more currencies",list:"Currencies"},models:{standard:"Standard pricing",standardDesc:"A single, fixed price",package:"Package pricing",packageDesc:"Price by number of units",graduated:"Graduated Pricing",volume:"Volume pricing",custom:"Customer chooses price",usageBased:"Usage-based",creditMetered:"Credit metered"},creditMetered:{label:"Credit metered",placeholder:"Select a meter to track usage",required:"Please select a meter for metered billing",help:"Select the meter to track usage for this product",selectMeter:"Select meter",pricingNote:"For metered products, pricing is automatically based on usage tracked by the selected meter.",description:"Credit metered billing requires corresponding credit consumption. If credits are consumed, the corresponding service will stop."},credit:{saveAsBasePrice:"Set as Top-up Package",saveSuccess:"Successfully set as top-up package"},types:{onetime:"One time",onetimeDesc:"Charge a one-time fee",recurring:"Recurring",recurringDesc:"Charge an ongoing fee"},paymentType:"Payment Type",billingModel:"Billing Model",pricing:"Pricing",additionalCurrencies:"Additional Currencies",advanced:"Advanced Settings",customInterval:"Custom Interval",perUnit:"Per Unit",choosePricingModel:"Choose your pricing model",usage:"Usage",usageDesc:"Price by number of users, units, or seats. Requires a record for Stripe to track customer service usage.",meter:"Meter",billingPeriod:"Billing period",aggregate:{sum:"Sum of usage values during period",max:"Maximum usage value during period",last_during_period:"Most recent usage value during period",last_ever:"Most recent usage value"},upsell:{title:"Upsells",to:"Upsells to",tip:""},quantity:{tip:"Quantity must be at least 0"},quantityAvailable:{label:"Available quantity",placeholder:"0 means unlimited",format:"Available {num} pieces",noLimit:"No limit on available quantity",valid:"Available quantity must be at least the sold quantity",description:"Enter the number of units that can be sold, 0 means unlimited"},quantitySold:{label:"Sold quantity",format:"Sold {num} pieces"},quantityLimitPerCheckout:{label:"Limit per checkout quantity",placeholder:"0 means unlimited",format:"Limit {num} pieces per checkout",noLimit:"No limit on quantity per checkout",description:"Enter the number of units that can be purchased in a single checkout, 0 means unlimited"},inventory:"Inventory Settings",dynamicPricing:{label:"Enable Dynamic Pricing",description:"Price fluctuates based on real-time exchange rates",config:{title:"Dynamic Pricing Configuration",baseAmount:{label:"Base Price",description:"The base price in fiat currency",required:"Base price is required"}},validation:{checking:"Checking exchange rate availability...",rateLine:"Current rate: 1 {currency} ≈ ${rate}",usdLine:"USD estimate: ≈ ${amount}",error:"Failed to fetch exchange rate, currency not supported or data source exception",estimatedLine:"Estimated amount: ≈ {amount} {currency}",useAmount:"Fill amount"}},referencePricing:{label:"Reference Exchange Rate Pricing",description:"Use current exchange rates to estimate token amounts without enabling dynamic pricing"}},coupon:{create:"Create Coupon",view:"View coupon",description:"Coupons can be used to discount invoices, subscriptions, or entire customer accounts.",listTitle:"Coupon",terms:"Terms",tab:"Coupons",redemptions:"Redemptions",expires:"Expires",noDiscount:"No discount",name:"Name",nameHelp:"This will appear on customers' receipts and invoices.",desc:"Description",descriptionInternal:"This description is for internal use only and will not be shown to customers.",id:"ID",idOptional:"ID (Optional)",idHelp:"This will identify this coupon in the API. We recommend leaving this blank so we can generate an ID for you.",type:"Type",percentageOff:"Percentage off",fixedAmountOff:"Fixed amount off",percentageDiscount:"Percentage discount",fixedAmount:"Discount amount",currency:"Currency",applyToProducts:"Apply to specific products",duration:"Duration",once:"Once",forever:"Forever",repeating:"Repeating",durationHelp:'For subscriptions and customers, this determines how long this coupon will apply once redeemed. One-time invoices accept both "once" and "forever" coupons.',durationInMonths:"Duration in months",redemptionLimits:"Redemption limits",limitDateRange:"Limit the date range when customers can redeem this coupon",limitTotalNumber:"Limit the total number of times this coupon can be redeemed",codes:"Codes",useCustomerFacingCodes:"Use customer-facing coupon codes",promotionCodes:"Promotion Codes",promotionCodesHelp:"Promotion codes will be created after the coupon is saved.",addPromotionCode:"Add promotion code",eligibleFirstTime:"Eligible for first-time order only (each user can only use one coupon discount)",limitNumberRedemptions:"Limit the number of times this code can be redeemed",addExpirationDate:"Add an expiration date",requireMinimumOrder:"Require minimum order value",addAnotherCode:"Add another code",saved:"Coupon saved successfully",codeOptional:"Code (Optional)",codeHelp:"Leave blank to auto-generate upon creation",generate:"Generate",verificationType:"Verification Type",codeOnly:"Code Only",nftVerification:"NFT Verification",vcVerification:"Passport Verification",userWhitelist:"Specific Users",nftSettings:"NFT Verification Settings",vcSettings:"Passport Verification Settings",userWhitelistSettings:"Specific Users Settings",nftAddresses:"NFT Addresses",nftAddressesPlaceholder:"Enter NFT contract addresses",nftTags:"NFT Tags",nftTagsPlaceholder:"Enter NFT tags",trustedIssuers:"Trusted Issuers",trustedIssuersPlaceholder:"Enter trusted issuers",trustedParents:"Trusted Parents",trustedParentsPlaceholder:"Enter trusted parents",minBalance:"NFT Required Quantity",requiredRoles:"Required Roles",requiredRolesPlaceholder:"Enter required roles",trustedVcIssuers:"Trusted VC Issuers",trustedVcIssuersPlaceholder:"Enter trusted VC issuer DIDs",customerDids:"Customer DIDs",customerDidsPlaceholder:"Enter customer DIDs",customerDidsHelp:"You can select existing customers or enter DID manually",maxRedemptions:"Max Redemptions",expiresAt:"Expires At",pressEnterToAdd:"Press Enter to add",couponConfiguration:"Coupon Configuration",selectProducts:"Select Products",noProductsSelected:"No products selected",newCode:"New Code",createPromotionCode:"Create Promotion Code",promotionCodeDescription:"Create a promotion code for this coupon to allow customers to redeem the discount.",minimumAmount:"Minimum Amount",minimumAmountHelp:"Set minimum order amounts for different currencies",discountAmount:"Discount Amount",currencies:"Currencies",times:"times",months:"months",addProduct:"Add another product",unlimited:"Unlimited",inactive:"Coupon is inactive",inactiveTip:"This coupon is currently inactive and cannot be used.",discount:"Discount",updated:"Updated",timesRedeemed:"Times Redeemed",deletedSuccessfully:"Coupon deleted successfully",deleteConfirmTitle:"Delete Coupon",deleteConfirmMessage:"Are you sure you want to delete this coupon? This action cannot be undone.",cannotDeleteWithPromotionCodes:"Cannot delete coupon with existing promotion codes",couponTermsPercentage:"{percent}% off",couponTermsFixedAmount:"{amount} {symbol} off",couponTerms:{forever:"{couponOff} forever",once:"{couponOff} once",repeating:"{couponOff} for {months} months"},couponTermsDuration:{forever:"Forever",once:"Once",repeating:"For {months} months"},applicableProducts:"Applicable Products",noApplicableProducts:"This coupon applies to all products",activeRedemptions:"Active redemptions",customers:"Customers",subscriptions:"Subscriptions",noCustomersFound:"No customers found",noCustomersRedeem:"No customers currently redeem this coupon",noSubscriptionsFound:"No subscriptions found",noSubscriptionsRedeem:"No subscriptions currently redeem this coupon",rename:"Rename",renameCoupon:"Rename coupon",updateCouponDetails:"Update coupon details",nameWillAppear:"This will appear on customers' receipts and invoices.",updateCouponButton:"Update coupon",discountStart:"Discount Start",usageStats:"Usage Statistics",totalDiscounts:"Total Discounts",uniqueSessions:"Unique Sessions",uniqueSubscriptions:"Unique Subscriptions",promotionCodesUsed:"Promotion Codes Used",noExpiration:"No Expiration",usagePeriod:"Usage Period",firstUsed:"First Used",lastUsed:"Last Used",promotionCodeInfo:"Promotion Code Info",directCouponUsage:"Direct Coupon Usage",usageLimit:"Usage Limit",discountInfo:"Discount Info",discountPeriod:"Discount Period",couponExpires:"Coupon Expires",totalSavings:"Total Discounts",viewPromotionCode:"View Promotion Code"},discount:{totalSaved:"Total Saved",timesUsed:"Times Used",appliedDiscounts:"Applied Discounts"},promotionCode:{code:"Code",status:"Status",redemptions:"Redemptions",expires:"Expires",created:"Created",actions:"Actions",active:"Active",inactive:"Inactive",expired:"Expired",maxedOut:"Maxed Out",viewDetails:"View Details",edit:"Edit Promotion Code",delete:"Delete Promotion Code",archive:"Archive Promotion Code",archiveTip:"Archiving will prevent this promotion code from being used. Are you sure you want to archive this promotion code?",deleteTip:"Deleting will permanently delete this promotion code. Are you sure you want to delete this promotion code?",title:"Promotion Code",id:"ID",type:"Type",couponId:"Coupon ID",maxRedemptions:"Max Redemptions",timesRedeemed:"Times Redeemed",verificationType:"Verification Type",updated:"Updated",activate:"Activate",deactivate:"Deactivate",inactiveTitle:"Promotion code is inactive",inactiveTip:"This promotion code is currently inactive and cannot be used.",deleteSuccess:"Promotion code deleted successfully",activateSuccess:"Promotion code activated successfully",deactivateSuccess:"Promotion code deactivated successfully",verificationConfig:"Verification Configuration",nftAddresses:"NFT Addresses",nftTags:"NFT Tags",minBalance:"Min Balance",requiredRoles:"Required Roles",trustedIssuers:"Trusted Issuers",allowedUsers:"Allowed Users",noNftConfig:"No NFT configuration",noVcConfig:"No VC configuration",noUsersSpecified:"No users specified",codeVerificationOnly:"Code verification only",unlimited:"Unlimited",never:"Never",yes:"Yes",no:"No",verificationTypeMap:{code:"Code Only",nft:"NFT Verification",vc:"Passport Verification",user_restricted:"User Whitelist"}},paymentLink:{view:"View payment link",info:"Payment link information",add:"Create payment link",save:"Create link",openLink:"Open URL",copyLink:"Copy URL",saved:"Payment link successfully saved",additional:"Additional options",beforePay:"Payment page",afterPay:"After payment",products:"Products",addProduct:"Add another product",requireBillingAddress:"Collect customer billing addresses",requirePhoneNumber:"Collect customer phone numbers",allowPromotionCodes:"Allow promotion codes",enablePromotionCodes:"Enable promotion codes",disablePromotionCodes:"Disable promotion codes",enablePromotionCodesTip:"Enable promotion codes for this payment link. Customers will be able to apply discount codes during checkout.",disablePromotionCodesTip:"Disable promotion codes for this payment link. Customers will not be able to apply discount codes during checkout.",requireCrossSell:"Require cross-sell products to be selected if eligible",includeFreeTrial:"Include a free trial",noStakeRequired:"No stake required",showProductFeatures:"Show product features",allowSkipPaymentMethod:"Allow skipping payment method for $0 checkout",enableSkipPaymentMethod:"Allow skipping payment method",disableSkipPaymentMethod:"Require payment method",enableSkipPaymentMethodTip:"Allow customers to skip binding a payment method when the checkout amount is $0. The subscription will auto-cancel at the end of the current period if no payment method is added.",disableSkipPaymentMethodTip:"Require customers to provide a payment method even when the checkout amount is $0.",freeTrialDaysPositive:"Free trial days must be positive",includeCustomFields:"Add custom fields",confirmPage:"Confirmation Page",showConfirmPage:"Show confirmation page",customMessage:"Replace default with custom message",customMessageTip:"Include any details you see fit, such as delivery information.",noConfirmPage:"Do not show confirmation page",mintNft:"Mint NFT to user on payment",mintNftFrom:"Mint from following factory (collection)",createInvoice:"Creates invoices for related payments.",adjustable:"Adjustable quantity",adjustableQuantity:"Let customers adjust quantity",noProducts:"Payment link must have at least one product",noRedirectUrl:"Payment link must have a redirect url",noSubscriptionTrialDays:"You must specify a trial period for subscription",recurringNotAligned:"The prices on all line items must have the same recurring interval",currencyNotAligned:"The prices on all line items must have the same currency settings",edit:"Edit payment link",rename:"Change name",archive:"Archive payment link",archiveTip:"Archiving will hide this payment link from new purchases. Are you sure you want to archive this payment link?",remove:"Remove payment link",removeTip:"Removing will hide this payment link from new purchases. Are you sure you want to remove this payment link?",name:{label:"Name",placeholder:"Not consumer facing"},adjustableQuantityError:"Minimum must be less than maximum"},pricingTable:{view:"View pricing table",add:"Create pricing table",save:"Create",openLink:"Open URL",copyLink:"Copy URL",saved:"Pricing table successfully saved",edit:"Edit pricing table",rename:"Change name",archive:"Archive pricing table",archiveTip:"Archiving will hide this pricing table from new purchases. Are you sure you want to archive this pricing table?",remove:"Remove pricing table",removeTip:"Removing will hide this pricing table from new purchases. Are you sure you want to remove this pricing table?",name:{label:"Name",placeholder:"Not consumer facing"},display:"Display Settings",highlight:"Highlight product",customer:"Customer portal"},paymentIntent:{list:"Payments",name:"Payment",view:"View payment detail",empty:"No payment intent",refund:"Refund payment",status:{active:"Active",paid:"Paid",succeeded:"Succeeded"},received:"Received",attention:"Failed payments",refundError:"Failed to refund payment",refundSuccess:"Refund application has been successfully created",cancelRefund:"Cancel refund",refundCanceled:"Cancel refund successfully",refundCanceledError:"Failed to cancel refund",refundCanceledTip:"Are you sure you want to cancel the refund application? After cancellation, the refund will no longer be processed.",refundForm:{reason:"Refund reason",amount:"Refund amount",description:"Refund description",duplicate:"Duplicate payment",requestedByCustomer:"Requested by customer",requestedByAdmin:"Requested by admin",fraudulent:"Fraudulent",expiredUncapturedCharge:"Expired uncaptured charge",amountRange:"Refund amount must be between {min} and {max} {symbol}",amountHelper:"Refund amount must be less than or equal to {max} {symbol}",required:"Please fill in the refund information",empty:"The current order has been fully refunded"}},payout:{list:"Payouts",name:"Payout",view:"View payout",empty:"No payout",attention:"Failed payouts",requestRefund:"Request Refund",confirmRefund:"Are you sure you want to request a refund from the vendor?",refundRequested:"Refund request sent to vendor",refundReason:"Refund Reason",refundReasonPlaceholder:"Please enter the reason for refund (at least 5 characters)",refundReasonRequired:"Refund reason is required",refundReasonMinLength:"Refund reason must be at least {min} characters",refundReasonHelper:"Please enter at least {min} characters",status:{active:"Active",paid:"Paid",succeeded:"Succeeded"}},paymentMethod:{_name:"Payment Method",type:"Type",add:"Add payment method",edit:"Edit payment method",save:"Save payment method",saved:"Payment method successfully saved",settings:"Settings",gasTip:"Ensure your account on the {chain} network has sufficient balance to cover transaction fees when using {method}.",recharge:"Scan to add balance",props:{type:"Type",confirmation:"Confirmation",recurring:"Recurring support",refund:"Refund support",dispute:"Dispute support",currencies:"Currency support",explorer_host:"Explorer Host",balance:"Balance"},name:{label:"Name",tip:"Customer-facing"},description:{label:"Description",tip:"Not customer-facing"},stripe:{dashboard:{label:"Dashboard URL",tip:"Used to generate links to Stripe dashboard"},publishable_key:{label:"Publishable Key",tip:"Publishable Key, See Dashboard > Developers > API Keys"},secret_key:{label:"Secret Key",tip:"Secret Key, See Dashboard > Developers > API Keys"},webhook_signing_secret:{label:"Webhook Signing Secret",tip:"Webhook Signing Secret, See Dashboard > Developers > Webhooks > Signing Secret"},webhookHint:"If webhook events are not received, manually configure STRIPE_WEBHOOK_SECRET in environment variables",configureEnv:"Go to Settings"},arcblock:{chain_id:{label:"Chain ID",tip:"Just a name"},api_host:{label:"API Host",tip:"The GraphQL endpoint to send transactions to"},explorer_host:{label:"Explorer Host",tip:"The web app endpoint to view transaction details"}},ethereum:{chain_id:{label:"Chain ID",tip:"Must be a valid EVM chain id, usually an integer, https://chainlist.org"},api_host:{label:"RPC Endpoint",tip:"The RPC endpoint to send transactions to"},explorer_host:{label:"Explorer Host",tip:"The web app endpoint to view transaction details"},native_symbol:{label:"Native Symbol",tip:"The symbol for native token on this chain"},confirmation:{label:"Confirmation Count",tip:"Number of blocks required since transaction execution"}},evm:{checking:"Checking connection...",connected:"Connected",connectionError:"Connection failed",blockHeight:"Block Height",rpcStatus:"RPC Status"},base:{chain_id:{label:"Chain ID",tip:"Must be a valid EVM chain id, usually an integer, https://chainlist.org"},api_host:{label:"RPC Endpoint",tip:"The RPC endpoint to send transactions to"},explorer_host:{label:"Explorer Host",tip:"The web app endpoint to view transaction details"},native_symbol:{label:"Native Symbol",tip:"The symbol for native token on this chain"},confirmation:{label:"Confirmation Count",tip:"Number of blocks required since transaction execution"}},google_play:{package_name:{label:"Package Name",tip:"e.g. com.example.app, configured in Play Console"},service_account_json:{label:"Service Account JSON",tip:"Paste the full service account credentials JSON downloaded from Google Cloud Console",invalidJson:"Not valid JSON",missingFields:"JSON is missing client_email or private_key",detectedClient:"Detected client"},pubsub_topic_name:{label:"Pub/Sub Topic (optional)",tip:"projects/<project-id>/topics/<topic-name>, for receiving RTDN"}},app_store:{bundle_id:{label:"Bundle ID",tip:"e.g. com.example.app, configured in App Store Connect"},environment:{label:"Environment",tip:"StoreKit 2 JWS environment must match this setting",production:"Production",sandbox:"Sandbox"},shared_secret:{label:"Shared Secret (for StoreKit 1)",tip:"App-Specific Shared Secret for legacy receipt verification. Not needed for StoreKit 2 JWS. Find it at App Store Connect → App Information → App-Specific Shared Secret"},serverApi:{heading:"Server API Credentials (optional)",tip:"Not required for StoreKit 2 JWS verification. Only needed when querying App Store Server API for subscription status. Provide all three or none."},issuer_id:{label:"Issuer ID",tip:"App Store Connect API Issuer ID"},key_id:{label:"Key ID",tip:"App Store Connect API Key ID"},private_key_pem:{label:"Private Key (.p8 contents)",tip:"Paste the contents of the .p8 file downloaded from App Store Connect"}}},paymentCurrency:{name:"Payment Currency",add:"Add Currency",edit:"Edit Currency",save:"Save payment currency",saved:"Payment currency successfully saved",delete:"Delete payment currency",deleteConfirm:"Are you sure you want to delete this payment currency? Once deleted, it cannot be recovered",deleted:"Payment currency successfully deleted",quickAdd:"Quick add supported currency",searchToken:"Search currency",orManualInput:"Or manually fill in currency information below",logo:{label:"Logo",tip:"Displayed on payment page"},contract:{label:"Contract",tip:"Used to fetch token symbol, decimals and other info"}},event:{empty:"No events",view:"View event",data:"Event Data",webhooks:"Webhook Attempts",type:"Type",pendingWebhooks:"Pending Webhooks",noAttempts:"No Attempt",retry:"Retry",retrying:"Retrying...",retryOptions:{title:"Retry Webhook",confirmMessage:"Are you sure you want to retry this webhook? This will send another request to the webhook endpoint.",success:"Webhook scheduled for retry",error:"Failed to retry webhook"},response:"Response",request:"Request",eventData:"Event Data"},invoice:{view:"View invoice",attention:"Uncollectible invoices",metric:"Paid invoices",name:"Invoice",status:{active:"Active",paid:"Paid",succeeded:"Succeeded"},from:"Billed from",empty:"No invoices",number:"Invoice Number",description:"Billing Description",dueDate:"Due",finalizedAt:"Finalized At",paidAt:"Payment Date",summary:"Summary",billingContextNote:"Invoice amounts are calculated based on real-time prices at the time of billing.",dynamicPricingNote:"This invoice uses dynamic pricing with locked exchange rates.",billTo:"Billed to",billing:"Billing Method",download:"Download PDF",edit:"Edit Invoice",duplicate:"Duplicate Invoice",retryUncollectible:{title:"Retry collection",tip:"Are you sure you want to retry collecting this invoice? This will attempt to charge the customer again.",success:"Retry request submitted"},returnStake:{title:"Return Stake",tip:"Are you sure you want to return the stake? This action will return the stake to the customer immediately.",success:"Stake return application has been successfully created"},void:{title:"Void Invoice",tip:"Are you sure you want to void this invoice? This action will immediately void the invoice.",success:"Invoice voided"}},vendor:{create:"Create Vendor",edit:"Edit Vendor",delete:"Delete Vendor",save:"Save Vendor",saved:"Vendor saved successfully",test:"Test",testConnection:"Test Connection",testConnectionTip:'Are you sure you want to test the connection for vendor "{name}"?',testConnectionSuccess:"Connection test successful",testConnectionFailed:"Connection test failed",testSuccess:"Connection test successful",testAfterSave:"Vendor saved successfully. You can test the connection to verify the configuration.",testToEnable:"Vendor saved successfully. Test the connection to enable the vendor.",enabled:"Enabled",disabled:"Disabled",addressCheckFailed:"Address check failed, cannot save when enabled",updateSuccess:"Vendor updated successfully",testFailed:"Connection test failed (Status: {status})",testError:"Connection test failed - network error",vendorKeyInvalid:"Vendor type must contain only lowercase letters, numbers, and underscores",deleteTitle:"Delete Vendor",deleteContent:'Are you sure you want to delete vendor "{name}"? This action cannot be undone.',deleteTip:'Are you sure you want to delete vendor "{name}"? This action cannot be undone.',activate:"Activate Vendor",activateTip:'Are you sure you want to activate vendor "{name}"?',deactivate:"Deactivate Vendor",deactivateTip:'Are you sure you want to deactivate vendor "{name}"?',name:"Vendor Name",nameRequired:"Vendor name is required",vendorType:"Vendor Type",vendorTypeRequired:"Vendor type is required",didnames:"DID Names",launcher:"Launcher",vendorKey:"Vendor Key",vendorKeyRequired:"Vendor key is required",vendorKeyHelp:"Unique identifier for the vendor",description:"Description",displayNameRequired:"Display name is required",displayNameHelp:"This name will be displayed on the installation interface after successful payment",appUrl:"App URL",appUrlRequired:"App URL is required",appUrlInvalid:"Please enter a valid URL starting with http:// or https://",appUrlHelp:"The base URL of the vendor application",vendorDid:"Vendor DID",vendorDidInvalid:"Please enter a valid DID",vendorDidHelp:"Optional DID address for the vendor",webhookPath:"Webhook Path",webhookPathInvalid:"Please enter a valid path starting with /",webhookPathHelp:"Optional webhook callback path (e.g., /webhooks/status)",blockletMetaUrl:"Blocklet Meta URL",blockletMetaUrlRequired:"Blocklet Meta URL is required",blockletMetaUrlInvalid:"Please enter a valid URL starting with http:// or https://",blockletMetaUrlHelp:"Required blocklet metadata URL for application information",commission:"Commission",commissionRate:"Commission Rate",commissionRateRequired:"Commission rate is required",commissionRateMin:"Commission rate must be at least 0",commissionRateMax:"Commission rate is too high",commissionType:"Commission Type",commissionRateHelp:"Commission rate as percentage",commissionAmountHelp:"Fixed commission amount",percentage:"Percentage",fixedAmount:"Fixed Amount",active:"Active",inactive:"Inactive",basicInfo:"Basic Information",apiConfig:"API Configuration",commissionConfig:"Commission Configuration",status:"Status",brokerDID:"Broker DID",brokerPublicKey:"Broker Public Key"},subscription:{view:"View subscription",name:"Subscription",empty:"No subscriptions",status:{active:"Active",paid:"Paid",succeeded:"Succeeded"},viewAll:"View all subscriptions",noActiveEmpty:"You currently have no active subscriptions. You can choose to view your subscription history.",includedServices:"Included Services",serviceHome:"Visit Service Homepage",serviceDashboard:"Access Service Dashboard",attention:"Past due subscriptions",product:"Product",collectionMethod:"Billing",channel:"Channel",currentPeriod:"Current Period",iap:{googlePlayTitle:"Google Play Purchase",appStoreTitle:"App Store Purchase",purchaseToken:"Purchase Token",orderId:"Order ID",productId:"Product ID",originalTransactionId:"Original Transaction ID",transactionId:"Transaction ID",expiryTime:"Expires At",environment:"Environment"},trialingPeriod:"Trial Period",trialEnd:"Trial ends {prefix} {date}",willEnd:"Will end {prefix} {date}",ended:"Ended {prefix} {date}",renew:"Renew {prefix} {date}",discount:"Discount",activeDiscount:"Active Discount",startedAt:"Started",nextInvoice:"Next Invoice",nextInvoiceAmount:"Next Invoice Amount",nextInvoiceAmountTip:"The next invoice amount is estimated, the actual amount will be calculated based on actual usage.",itemId:"Subscription Item ID",update:"Update subscription",resume:"Resume payment collection",resumeTip:"Are you sure you want to resume collecting payments? Any future invoices for this subscription will resume payment collection.",paymentAddress:"Payment Address",currentBalance:"Current Balance",insufficientBalance:"Insufficient Balance, please add funds",cancel:{schedule:"Scheduled to cancel",title:"Cancel subscription",required:"Custom cancel time is required",will:"End {prefix} {date}",done:"Canceled",at:{title:"Cancel",now:"Immediately ({date})",current_period_end:"End of current period ({date})",custom:"On a custom date",timeError:"Cancel time must be within the current period"},refund:{title:"Refund",none:"No refund",last:"Last payment {total}{symbol}",proration:"Proration amount {unused}/{total}{symbol}"},staking:{title:"Stake",none:"No return or slash",proration:"Return Remaining Stake {unused}{symbol}",slash:"Slash Remaining Stake {unused}{symbol}",slashReason:"Slash Reason",slashTip:"The remaining stake of this subscription {unused}{symbol} will be slashed, please confirm to continue?",slashTitle:"Slash stake"},comment:{title:"Reason",placeholder:"Please provide the reason for cancellation"}},pause:{title:"Pause payment collection",required:"Custom resume time is required",type:{title:"Pause duration",never:"Indefinite",custom:"Until a custom date"},behavior:{title:"Invoice behavior",keep_as_draft:"Keep invoices as drafts",keep_as_draft_tip:"For businesses currently offering services but waiting to collect payments.",mark_uncollectible:"Mark invoices as uncollectible",mark_uncollectible_tip:"For businesses currently offering services for free.",void:"Void invoices",voidTip:"For businesses not currently offering services."},until:{never:"Collection paused",custom:"Collection paused until {date}"}},usage:{title:"Usage records",current:"Usage records for current period",range:"Usage records for {start} - {end}",view:"View usage",vary:"Varies with usage",used:"Unit used",cycle:"Usage cycle"},batchPay:{button:"Pay due invoices"},payerAddress:"Payment Address",noPaymentMethod:"Not bound",bindPaymentMethod:"Bind now",bindPaymentMethodFirst:"Please bind a payment method first before resuming the subscription",noPaymentMethodWarning:"No payment method is bound to this subscription. Please bind one to avoid cancellation at the end of the current period.",changePayer:{btn:"Change",stripe:{linkType:"Stripe Link",bankAccount:"Bank Account"},connect:{title:"Change Payment Address",success:"Payment Address changed successfully",error:"Failed to change payment Address"}}},customer:{view:"View customer",edit:"Edit information",spent:"Spent Amount",refund:"Refund Amount",dispute:"Dispute Amount",due:"Due Amount",stake:"Stake Amount",token:"Token Balance",name:"Name",email:"Email",phone:"Phone",invoicePrefix:"Invoice Prefix",googlePlayUuid:"Google Play UUID",appStoreUuid:"App Store UUID",balance:"Balance ({currency})",summary:{refund:"Refunds",spent:"Spent",due:"Due",stake:"Stake",stats:"Stats",balance:"Balance"},address:{label:"Address",country:"Country",state:"State or province",city:"City or town",line1:"Address",line2:"Line2",postal_code:"Postal Code"},creditGrants:{title:"Credit Grants",description:"View your available credit grants and usage history",grants:"Credit Grants",transactions:"Credit Usage",summary:"Credit Summary",noGrants:"No credit grants available",grantDetail:"Credit Grant Details",creditBalance:"Credit Balance",totalAmount:"Total Amount",status:{granted:"Active",pending:"Pending",expired:"Expired",depleted:"Depleted",voided:"Voided"},originalAmount:"Original Amount",usage:"Usage",viewInvoice:"View Invoice",grantId:"Grant ID",currency:"Currency",created:"Created",effectiveDate:"Effective Date",expirationDate:"Expiration Date",transactionHistory:"Transaction History",backToGrants:"Back to Credit Grants",viewDetails:"View Details",overview:"Overview",relatedGrants:"Credit Grants",category:"Category",overviewDescription:"Monitor all currency credit balances, usage, and outstanding debt.",availableBalance:"Available Balance",viewGrants:"View Grants",viewUsage:"View Usage",recentActivity:"Recent Activity",quickStats:"Quick Stats",activeGrants:"Active Grants",outstandingDebt:"Outstanding Debt",buyCredits:"Buy Credits",viewAllActivity:"View All Activity",pendingAmount:"Outstanding Charges",grantCount:"Grant Count",noGrantsDescription:"You don't have any credit grants yet.",addCredit:"Add Credit"}},passport:{intro:"Manage payment settings for blocklet passports, you should assign both product and payment entry to a passport to make it available for purchase.",payLink:"Payment entry",payPreview:"Payment preview",preview:"Preview payment page",assign:"Assign to passport",assignTip:"Assign this payment link to selected passport to make it available for purchase",unassign:"Reset purchase config",unassignTip:"Confirm to clear the payment entry and product config for this passport?",assignError:"Must select a passport to assign"},webhookEndpoint:{hosted:"Hosted endpoints",add:"Add endpoint",addTip:"Set up your webhook endpoint to receive live events from",listen:"Listen for",version:"API Version",attempts:"Webhook attempts",url:{label:"URL",description:"Endpoint URL"},description:{label:"Description",description:"An optional description of what this endpoint is used for."},events:{label:"Select events to listen to",description:""}},refund:{name:"Refunds",view:"View refund detail",attention:"Failed refunds",status:{active:"Active",paid:"Paid",succeeded:"Succeeded"}},usageRecord:{empty:"No usage records",add:{label:"Add usage record",success:"Successfully added usage record",quantity:"Quantity"}},donate:{title:"Donation Settings",mountLocation:"Mount Location",component:"Component",description:"Description",status:{title:"Status",active:"Enable",inactive:"Disable",inactiveTip:"After disabling donations, the donation button will no longer be displayed and users cannot use the donation feature. Are you sure you want to disable it?",inactiveTitle:"Disable Donation",activeSuccess:"Donation feature has been enabled",inactiveSuccess:"Donation feature has been disabled"},editTitle:"Edit Donation Settings",updateSuccess:"Donation settings have been updated",amountSettings:"Amount Settings",presets:"Preset Amounts",presetsHelper:"Enter preset amounts, separated by commas (e.g., 1,5,10)",preset:"Default Amount",presetHelper:"Default selected amount (must be one of the presets)",custom:"Allow Custom Amount",minimum:"Minimum Amount",maximum:"Maximum Amount",amountRange:"Amount Range: {min} - {max}",customAmount:"Custom Amount",buttonSettings:"Donation Button Settings",btn:{text:"Button Text",helper:"Set the text displayed on the donation button",preview:"Button Preview"},dialog:{preview:"Donation Dialog Preview",confirmButton:"Confirm Donation {amount}"},previewTitle:"Live Preview",validation:{invalidPreset:"Default amount must be one of the presets",invalidRange:"Minimum amount must be less than maximum amount",invalidAmount:"Amount must be within allowed range"},historyType:{title:"Donation History Display",avatar:"Avatar Wall",list:"List"},intro:"Configure the display effect of the donation button and donation dialog, and the donation feature will take effect after completion.",usage:{viewExample:"View Usage Example",title:"Donation Component Usage Example",description:"To use the donation feature, you need to correctly configure PaymentProvider and DonateProvider in the component. Here is a basic example:",note:"Note: mountLocation must be unique, used to identify the donation instance. After configuration, the instance will appear in the list, and you can make further settings."}},vaultConfig:{title:"Vault",learnMore:"Learn more about vault configuration",goToConfig:"Go to system configuration",description:"By enabling the vault wallet, you create a secure offline storage solution that automatically transfers excess funds when your hot wallet balance exceeds the threshold. This separation significantly enhances security by keeping the majority of your assets safely offline, protected from potential online threats.",notConfigured:"Vault wallet not configured",configureFirst:"Please #go to the dashboard# to configure the vault wallet address before setting up individual currencies.",ownerOnly:"Only administrators with owner permissions can modify vault wallet settings.",permissionRequired:"Owner permissions required",enabled:"Status",enabledYes:"Enabled",enabledNo:"Disabled",depositThreshold:"Deposit Threshold",withdrawThreshold:"Withdrawal Threshold",bufferThreshold:"Buffer Threshold",bufferThresholdHelp:"Only when the amount exceeding the deposit threshold reaches the buffer threshold will the collection operation be triggered.",bufferThresholdInvalid:"Buffer threshold must be at least 0",edit:"Configure",enable:"Enable",editTitle:"Configure {currency} Vault Settings",enableTitle:"Enable Vault Wallet for {currency}",enableVault:"Enable Vault Wallet",enableVaultHelp:"When enabled, excess funds automatically transfer to the vault wallet, and withdrawals exceeding the threshold require admin approval for security and risk control.",depositThresholdHelp:"When the hot wallet balance exceeds this amount, the excess funds will be automatically transferred to the vault wallet.",withdrawThresholdHelp:"For withdrawals exceeding this amount, approval from the vault wallet administrator is required.",notConfig:"Not configured",noLimit:"No limit",withdrawThresholdNoLimit:"0 means no withdrawal limit",depositThresholdRequired:"Deposit threshold must be greater than 0",withdrawThresholdInvalid:"Withdrawal threshold must be at least 0",enableSuccess:"Successfully enabled vault wallet for {currency}",disableSuccess:"Successfully disabled vault wallet for {currency}",updateSuccess:"Successfully updated vault wallet settings for {currency}",depositConfirmTitle:"Deposit to Vault",depositConfirmMessage:"{currency} balance has exceeded the threshold, do you want to deposit to vault immediately?",depositQueued:"Deposit to vault request queued, please check the result later",depositFailed:"Deposit to vault request failed",appBalance:"App Balance"},creditGrants:{tab:"Grants",title:"Credits",summary:"Credit Summary",noGrants:"No credit grants found",grantDetail:"Credit Grant Details",overview:"Overview",overviewDescription:"Monitor credit balances, usage, and outstanding debt across all currencies.",availableBalance:"Available Balance",usage:"Usage",viewGrants:"View Grants",viewUsage:"View Usage",recentActivity:"Recent Activity",quickStats:"Quick Stats",activeGrants:"Active Grants",totalCreditValue:"Total Credit Value",outstandingDebt:"Outstanding Debt",buyCredits:"Buy Credits",viewAllActivity:"View All Activity",creditBalance:"Credit Balance",totalAmount:"Total Amount",pendingAmount:"Pending Amount",grantCount:"Grant Count",noGrantsDescription:"You don't have any credit grants yet.",status:{granted:"Active",pending:"Pending",expired:"Expired",depleted:"Depleted",voided:"Voided"},originalAmount:"Original Amount",grantId:"Grant ID",grants:"Grants",addCredit:"Add Credit",viewDetails:"View Details"},creditTransactions:{tab:"Transactions",title:"Transactions",summary:"Transaction Summary",noTransactions:"No credit transactions found",totalTransactions:"Total Transactions",totalCreditUsed:"Total Credit Used",transactionDate:"Transaction Date"},exchangeRateProvider:{title:"Exchange Rate Providers",subtitle:"Manage exchange rate data sources for dynamic pricing",medianStrategyNote:"Exchange rates are calculated automatically using multiple data sources. You only need to manage this list when a provider is consistently failing or needs to be temporarily disabled.",disableConfirmTitle:"Disable Provider?",disableConfirmMessage:"Disabling this provider may affect dynamic pricing payments. Are you sure?",table:{name:"Name",participation:"Participation",health:"Health",recentActivity:"Recent Activity",trustLevel:"Trust Level",trustLevelTip:"Indicates confidence and eligibility for rate calculation. Higher values do not mean preferred or primary source.",enabled:"Enabled",lastUpdate:"Last update: {time}",failures24h:"Failures (24h): {count}"},participation:{included:"Included",excluded:"Excluded"},health:{active:"Healthy",degraded:"Unstable",paused:"Outlier",inactive:"Outlier"},status:{active:"Active",degraded:"Degraded",paused:"Paused",inactive:"Inactive"},create:{title:"Add Provider",primaryAction:"Add Exchange Rate Provider"},edit:{title:"Edit {name}",name:"Name",nameHelp:"Unique identifier for this data source",nameRequired:"Name is required",type:"Provider Type",typeHelp:"Data source type. Cannot be changed after creation.",baseUrl:"Base URL (Optional)",baseUrlHelp:"Custom base URL for proxy or self-hosted instance. Default: {defaultUrl}",apiKey:"API Key",apiKeyHelp:"API key for accessing the data source.",apiKeyLinkText:"Get your API key at",apiKeyLinkAction:"CoinMarketCap account",testConnection:"Test Connection",testing:"Testing...",testSuccess:"Connection successful ({symbol}/USD: {rate}, {time}ms)",testFailed:"Connection failed: {error}",enabled:"Enabled",priority:"Priority",priorityHelp:"Lower number = higher priority. Providers are used in priority order.",status:"Status",statusHelp:'Set to "paused" to temporarily disable this provider.',pausedReason:"Paused Reason",pausedReasonHelp:"Explain why this provider is paused (optional)."}}},empty:{image:"No Image",refunds:"No Refunds",invoices:"No Invoices",subscriptions:"No Subscriptions",customers:"No Customers",products:"No Products",invoiceItems:"No Invoice Items",payouts:"No Payouts",paymentLinks:"No Payment Links",paymentMethods:"No Payment Methods",pricingTables:"No Pricing Tables",paymentCurrencies:"No Payment Currencies",webhooks:"No Webhooks",events:"No Events",records:"No matching records found",payments:"No Payments",prices:"No Prices",pricing:"You haven't added any prices you can add it",summary:"No Summary"},customer:{subscription:{cancel:"Cancel Subscription",manage:"Manage Subscription",title:"Subscriptions"},invoiceHistory:"Invoice History",product:{empty:"No Products"},credit:{recharge:"Buy Credits",autoRecharge:"Auto Top-up",unsupported:"Not supported yet"},recharge:{title:"Add Funds",amount:"Amount",submit:"Submit",unsupported:"Unsupported currency, please select another one",receiveAddress:"Receive Address",view:"View Subscription",success:"Add funds successfully",custom:"Custom",estimatedDuration:"{duration} {unit} est.",intervals:"intervals",history:"Fund History",relatedSubscriptions:"Related Subscriptions",rechargeTooltip:"Click to add funds"},delegation:{title:"Seems your delegation to this blocklet is revoked or insufficient, which will cause automatic payment failures for your subscription.",btn:"Delegate Now",success:"Delegate successful",error:"Delegate failed"},overdraftProtection:{title:"SubGuard™",setting:"Set SubGuard™",learnMore:"Click to learn more about SubGuard™",tip:"To avoid service interruption due to unpaid invoices, you can enable SubGuard™ by staking. Timely payment will not incur additional fees. Please settle your invoices promptly. If your available stake is insufficient or payment is overdue, we will deduct the amount from your stake and charge a service fee.",enabled:"Enabled",disabled:"Disabled",returnRemaining:"Return Remaining Stake",returnRemainingTip:"Once the remaining stake is returned, the SubGuard™ will be automatically disabled. Please confirm the action.",applyRemainingSuccess:"Stake return application successful",remaining:"Your current remaining stake: {amount} {symbol}, estimated required stake per cycle: {estimateAmount} {symbol}.",noRemaining:"No remaining stake available. Please stake at least {estimateAmount} {symbol} as soon as possible to ensure SubGuard™ is enabled.",remainingNotEnough:"You have unpaid invoices totaling {due} {symbol}. If not paid, your remaining stake will be insufficient to cover the next invoice. Available stake: {unused} {symbol}. Please stake at least {min} {symbol}.",due:"Please pay the outstanding amount first",insufficient:"Insufficient Stake to cover the next invoice, please add stake",insufficientTip:"Insufficient Stake, please stake to ensure SubGuard™ is enabled.",intervals:"cycles",estimatedDuration:"{duration} {unit} est.",rule:"Rule: N * ( P + Fee )",ruleTip:"N is the number of cycles, P is the subscription bill amount, Fee is the SubGuard™ service fee, the single fee is {gas} {symbol}",min:"The amount must be greater or equal to {min} {symbol}",settingSuccess:"Settings Updated",settingError:"Failed to update SubGuard™ settings",openSuccess:"SubGuard™ Enabled",closeSuccess:"SubGuard™ Disabled",keepStake:"Keep Remaining Stake For SubGuard™",returnStake:"Return Remaining Stake",stake:"Stake",address:"Staking Address",total:"Total Stake: {total} {symbol}, ",disableConfirm:"You currently have unpaid invoices, please settle your invoices first.",open:"Enable SubGuard™",payerAddress:"Payer",stakingAddress:"Staking Address"},unpaidInvoicesWarning:"You currently have unpaid invoices, please settle your invoices first.",unpaidInvoicesWarningTip:"You currently have unpaid invoices, please settle your invoices promptly.",pendingAmountWarningTip:"You have {amount} {symbol} in unpaid usage charges due to insufficient credit balance. Please top up your account.",invoice:{relatedInvoice:"Related Invoice",donation:"Donation",creditsInfo:"Total {amount} included",appliedDiscounts:"Applied Discounts",priceChanged:"The exchange rate has changed by {percent}%. The payment amount will be updated. Do you want to continue?",paymentCancelled:"Payment cancelled",paymentMethodChanged:"Payment method changed",priceChangeTitle:"Price Changed",priceChangeDescription:"The exchange rate has {direction} by {percent}%. Your payment amount will be updated.",currentPaymentMethod:"Current Payment Method",otherPaymentMethods:"Or pay with another method",confirmAndPay:"Confirm & Pay",switchAndPay:"Switch & Pay",current:"current"},payout:{empty:"No Revenues",payer:"Payer",receiver:"Receiver",payTxHash:"Payment TxHash",viewReference:"View Reference",title:"Revenues"},pastDue:{warning:"You have due invoices, please pay them to keep your services active",invoices:"Due Invoices",payNow:"Pay Now",alert:"You have due invoices. Please pay them promptly to avoid service interruption.",title:"Settle Due Invoices"},quote:{title:"Price Quotes",noQuotes:"No price quotes for this invoice",id:"Quote ID",pricingDetails:"Pricing Details",baseAmount:"Base Amount",exchangeRate:"Exchange Rate",consensusMethod:"Consensus",referenceRate:"Reference Rate: 1 {symbol} ≈ ${rate}",quotedAmount:"Quoted Amount",providerInfo:"Rate Provider",provider:"Provider",rateTimestamp:"Rate Timestamp",slippage:"Slippage",lifecycle:"Lifecycle",expiresAt:"Expires At",riskInfo:"Risk Information",deviation:"Price Deviation",anomalyDetected:"Anomaly Detected",degraded:"Degraded",status:{active:"Active",used:"Used",paid:"Paid",expired:"Expired",cancelled:"Cancelled",failed:"Failed"}}},integrations:{description:"Configure and manage how Payment Kit integrates with your application.",basicFeatures:"Basic Features",advancedFeatures:"Advanced Features",features:{products:{title:"Create Products",intro:"Create and manage your products or services"},paymentLinks:{title:"Payment Links",intro:"Create shareable payment links for quick checkout"},pricingTables:{title:"Pricing Tables",intro:"Create beautiful pricing tables for your products"},metering:{title:"Usage Metering",intro:"Track usage with meters and sell credits as top-up packages",dialog:{title:"How to set up credit-based metering",description:"Credit-based metering allows you to track usage and charge customers based on consumption. Follow these steps to get started:",steps:{step1:{title:"Create a meter to track your usage events",description:"Set up meters to monitor API calls, data usage, or any measurable activity in your application."},step2:{title:"Create Credit top-up products and pricing",description:"Define credit packages that customers can purchase, with flexible pricing models and validity periods."},step3:{title:"Create a payment link and share it so users can buy Credits",description:"Generate shareable payment links that allow customers to easily purchase credit packages."},step4:{title:"Integrate and report Credit usage",description:"Use our SDK to report usage events and automatically deduct credits from customer balances."}},docText:"Read the credit billing guide"}},promotions:{title:"Promotions",intro:"Create coupons and promotion codes to drive conversions"},donate:{title:"Donation",intro:"Add donation button to your application with <CheckoutDonate />"},paymentMethods:{title:"Payment Methods",intro:"Configure multiple payment methods and currencies"},api:{title:"API Integration",intro:"Integrate with our JavaScript SDK for custom solutions",link:"https://www.npmjs.com/package/@blocklet/payment-js"}},viewDocs:"View docs"}}),NE=Wl({common:{redirecting:"跳转中...",title:"名称",estimated:"预估",total:"总量",active:"生效中",inactive:"未生效",enabled:"已启用",disabled:"已禁用",every:"每",metadata:{label:"元数据",description:"添加自定义键值对以存储有关此计量器的其他信息。",add:"添加更多元数据",edit:"编辑元数据",empty:"无元数据",emptyTip:"您还没有添加任何元数据,您可以添加它",formMode:"切换到表单模式",jsonMode:"切换到JSON模式",jsonPlaceholder:"输入JSON数据...",invalidJson:"JSON格式无效,请检查您的输入",formatJson:"格式化JSON"},price:"价格",add:"添加",fullscreen:"全屏",exit:"退出",maxLength:"最多输入{len}个字符",minLength:"最少输入{len}个字符",invalidCharacters:"无效字符",latinOnly:'至少包含一个字母,并且不能包含中文字符和特殊字符如 <, >、"、’ 或 \\',loading:"加载中...",loadMore:"加载更多",noMoreData:"没有更多数据",rechargeTime:"充值时间",submit:"提交",custom:"自定义",estimatedDuration:"预计可用 {duration}",detail:"详情",setting:"配置",slippage:"滑点下限",slippageMinRate:"最低可接受汇率 {rate} {currency}",slippageTooltip:"自动扣款时可接受的最低汇率,当汇率低于此值时将暂停扣款",welcome:"欢迎使用 Payment Kit",welcomeDesc:"从基础功能开始,轻松接入支付功能。选择下方任意功能,立即开始使用。",quickStart:"快速入门指南",advancedFeatures:"高级功能",quickStarts:"快速入门",homeTagline:"为 Blocklet 构建的去中心化支付解决方案",adminDashboard:"管理后台",customerPortal:"客户门户",copy:"复制",copied:"已复制",copySuccess:"复制成功",copyFailed:"复制失败",copyTip:"请手动复制",save:"保存",saving:"保存中...",saved:"保存成功",refresh:"刷新",cancel:"取消",back:"返回",know:"知道了",confirm:"确认",increased:"上涨",decreased:"下跌",edit:"编辑",view:"查看",select:"选择",clear:"清除",delete:"删除",deleting:"删除中...",activate:"启用",deactivate:"停用",yes:"是",no:"否",never:"永不",created:"创建时间",updated:"更新时间",valid:"有效",events:"事件",details:"详情",discount:"折扣",deleted:"已删除",days:{sunday:"星期日",monday:"星期一",tuesday:"星期二",wednesday:"星期三",thursday:"星期四",friday:"星期五",saturday:"星期六"},maxAmount:"最大金额为 {max}",name:"名称",type:"类型",status:"状态",remainingCredit:"剩余额度",scope:"适用范围",source:"来源",effectiveDate:"生效时间",expirationDate:"过期时间",creditGrant:"信用额度",date:"日期",subscription:"订阅",meter:"计量器",meterEvent:"计量事件",creditAmount:"额度",createdAt:"创建时间",expiresAt:"过期时间",general:"通用",specific:"指定使用范围",paid:"付费",promotional:"促销",viewInvoice:"查看账单",viewSourceData:"查看来源",goToConfigure:"前往配置",noData:"暂无数据"},notification:{preferences:{title:"邮件通知设置",button:"邮件设置",frequency:{label:"通知频率",default:"即时通知 (默认)",daily:"每日",weekly:"每周",monthly:"每月"},day:"日",timeFormatError:"请输入有效的时间,格式为24小时制 (HH:MM)",monthlyHelp:"如果所选日期在某月不存在,将使用该月的最后一天",subscriptionRenewalNote:"此设置适用于订阅续费通知。"}},admin:{description:"管理你的产品、定价、账单和支付流程。",balances:"余额",addresses:"地址",trends:"趋势",metrics:"指标",attention:"注意",overview:"总览",overviewPage:{financialIndicatorsTitle:"财务指标",businessMonitoringTitle:"业务监控",filters:{dateRange:"选择日期范围",currencyLabel:"币种",productLabel:"产品",regionLabel:"地区",allCurrencies:"全部币种",allProducts:"全部产品",allRegions:"全部地区"},financialIndicators:{totalIncome:{title:"总收入",subtitle:"用户实际支付"},refundAmount:{title:"退款金额",subtitle:"已退款总额"},costOfGoods:{title:"进货成本",subtitle:"供应商分成"},netRevenue:{title:"净收入",subtitle:"扣除供货成本后的收入"},promotionCost:{title:"促销成本",subtitle:"折扣"},taxedRevenue:{title:"含税收入",subtitle:"包含税费的收入"}},charts:{title:"交易趋势",payments:"付款",payouts:"出款",refunds:"退款",allCurrencies:"全部币种"},metrics:{transaction:"交易指标",essential:"关键指标"},overdue:{title:"欠费额度",subtitle:"待支付的额度",customers:"{count} 位用户",events:"{count} 笔欠费记录",viewAll:"查看全部",noOverdue:"暂无欠费"}},payments:"支付管理",connections:"连接",back:"返回",actions:"操作",create:"创建",creating:"创建中...",save:"保存",saving:"保存中...",cancel:"取消",paymentLinks:"支付链接",paymentMethods:"支付方式",customers:"客户管理",products:"产品定价",invoiceItems:"账单明细",coupons:"优惠券",tax:"税务",taxRates:"税率",taxRate:{create:"创建税率",createTitle:"新建税率",createAction:"添加税率",created:"税率创建成功",updated:"税率更新成功",deleted:"税率删除成功",label:"税率",view:"查看税率",displayName:"显示名称",displayNamePlaceholder:"显示在账单和报表上的名称",displayNameAuto:"留空则自动生成",displayNameRequired:"请填写显示名称",description:"描述",descriptionPlaceholder:"可选描述信息",country:"国家/地区",countryRequired:"请选择国家/地区",state:"州 / 省",postalCode:"邮政编码",taxCode:"产品税码",taxCodeDescription:"产品税码用于根据产品类型和地区自动计算税费。您可以",taxCodeDescriptionLink:"管理税率",taxCodeDescriptionSuffix:"以创建针对特定税码和地区的自定义税率。",selectTaxCode:"选择产品税码",percentage:"税率 (%)",percentageRequired:"请填写税率",percentageMin:"税率需大于或等于 0%",percentageMax:"税率需小于 100%",active:"默认启用",location:"适用区域",advanced:"高级选项",search:"搜索税率",searchCountry:"搜索国家/地区",back:"返回税率列表",associatedInvoices:"关联账单",deleteTitle:"删除税率",deleteMessage:"确定要删除税率“{name}”吗?该操作无法撤销。",deactivateTitle:"停用税率",deactivateMessage:"确定要停用“{name}”吗?停用后将不再自动应用。",activateTitle:"启用税率",activateMessage:'确定要启用"{name}"吗?启用后可用于新的账单。',edit:"编辑",editTitle:"编辑税率",selectTaxCodeHint:"税率将用于自动计算账单中的税费。",searchPlaceholder:"按产品或税码搜索",previewPlaceholder:"请选择税码以查看详情。",usePreset:"默认税码",noPreset:"暂无默认税码",noSuggestions:"没有符合搜索条件的税码。",relatedInvoiceNum:"关联账单数",notUsed:"未使用",taxCodeLabel:"税码:{code}",types:{general:"通用类别",digital:"数字产品",services:"服务类",physical:"实物商品"}},pricing:"定价",pricingTables:"定价表",vendors:"供应商",billing:"订阅和账单",invoices:"账单",subscriptions:"订阅",meters:"计量器",meterEvents:{title:"计量事件"},overdue:{title:"欠费额度",pendingAmount:"欠费额度",eventCount:"欠费笔数",noOverdue:"暂无欠费",selectCurrency:"币种"},meter:{add:"添加计量器",edit:"编辑计量器",save:"保存计量器",saved:"计量器保存成功",activate:"激活计量器",activated:"计量器激活成功",deactivate:"停用计量器",deactivated:"计量器停用成功",deleted:"计量器删除成功",deleteConfirm:"确定要删除此计量器吗?此操作无法撤销。",activateConfirm:"确定要激活此计量器吗?它将开始收集使用数据。",deactivateConfirm:"停用后,此计量器将无法接收更多事件。尝试为此计量器创建事件将返回错误。之前报告的使用数据将保留。您可以随时重新激活。",view:"查看计量器",basicInfo:"基本信息",basicInfoDescription:"配置计量器的核心设置以跟踪使用事件。",editDescription:"更新计量器名称、描述和元数据。事件名称和聚合方法等核心设置无法更改。",creditMode:{onchain:"OnChain",onChainDescription:"开启后你的 Credit 将作为 Token 发布在 ArcBlock 区块链上,用户的充值、退款和消费将在链上公开记录且不可篡改。",tokenConfiguration:"Token 配置",createNewToken:"创建新 Token",useExistingToken:"使用现有 Token",createTokenHint:"填写 Token 名称和符号以创建新 Token",tokenName:"Token 名称",tokenNamePlaceholder:"请输入 Token 名称",tokenNameRequired:"Token 名称不能为空",tokenSymbol:"Token 符号",tokenSymbolPlaceholder:"请输入 Token 符号",tokenSymbolRequired:"Token 符号不能为空",tokenSymbolFormat:"符号必须为 1-6 个大写字母或数字",createTokenButton:"创建 Token",creatingToken:"创建中...",tokenCreated:"Token 创建成功",tokenCreatedLabel:"Token 已创建",tokenAddress:"Token 地址",selectToken:"选择 Token",selectTokenPlaceholder:"请选择一个现有的 Token",tokenAddressRequired:"Token 地址不能为空",enabled:"已启用"},inactive:"计量器未激活",inactiveTip:"此计量器未收集使用数据。激活它以开始跟踪事件。",name:{label:"计量器名称",required:"计量器名称为必填项",placeholder:"API 请求",help:"此计量器的描述性名称,将在您的仪表板以及用户个人账单中显示。"},eventName:{label:"事件名称",required:"事件名称为必填项",placeholder:"api_request",help:"将发送到此计量器的事件名称",editHelp:"为保持数据一致性,计量器创建后无法更改事件名称。"},aggregationMethod:{label:"聚合方法",required:"聚合方法为必填项",sum:"求和",sumHint:"将所有事件值相加",sumDescription:"求和聚合方法将所有使用事件值相加,并报告事件摘要和计费的总计。",count:"计数",countHint:"计算事件数量",countDescription:"计数聚合方法计算接收到的事件数量,并报告事件摘要和计费的总计数。",last:"最后值",lastHint:"使用最近的事件值",lastDescription:"最后值聚合方法使用接收到的最近事件值,并报告该值用于事件摘要和计费。",editHelp:"为保持数据一致性,计量器创建后无法更改聚合方法。"},unit:{label:"计量单位",required:"计量单位为必填项",placeholder:"请求",help:"此计量器的测量单位",editHelp:"为保持数据一致性,计量器创建后无法更改计量单位。"},description:{label:"描述",placeholder:"跟踪 API 使用情况以进行计费",help:"可选描述,帮助您和您的团队了解此计量器跟踪的内容。"},events:{title:"事件",dailyEventCount:"每日事件数量",dailyTotalValue:"每日总使用量",eventName:"事件名称",value:"使用量",customer:"客户",subscription:"订阅",reportTime:"上报时间",count:"共 {count} 个事件",empty:"暂无事件数据",emptyTip:"当有事件上报时,数据将显示在这里",filterByCustomer:"按客户筛选",eventCount:"事件数量",totalValue:"总使用量",hourly:"按小时",totalEvents:"总事件数",timeRange:"时间粒度",hourlyView:"小时视图",dailyView:"日视图"},usageGuide:{title:"如何报告使用情况",description:'使用事件名称 "{eventName}" 向此计量器发送事件。计量器将{method}值并以{unit}为单位跟踪使用情况。',tip:'使用事件名称 "{eventName}" 向此计量器发送事件。计量器将{aggregationMethodHint},并以{unit}为单位跟踪使用情况。',apiEndpoint:"API 端点",curlExample:"cURL 示例",jsExample:"JavaScript 示例",pythonExample:"Python 示例",important:"重要提示",tip1:"将 YOUR_API_KEY 替换为您的实际 API 密钥",tip2:"事件名称必须完全匹配:{eventName}",tip3:"包含时间戳以进行准确跟踪",moreInfo:"更多信息,请参阅我们的",apiDocs:"API 文档"},products:{count:"{count} 个关联产品",create:"创建产品",created:"产品创建成功",createPrompt:"输入产品名称:",manage:"管理",empty:"无产品",title:"产品",emptyTip:"此计量器尚未关联任何产品。",meterService:"计量服务",creditCharge:"Credit 计费"},creditProducts:{emptyTip:"此计量器尚未关联任何 Credit 产品。"},rechargePackage:{priceId:"充值套餐",tooltip:"充值套餐是用于充值 {name} 的套餐,用户购买后可以获得对应的 {name}。"}},creditProduct:{create:"创建 Credit 产品",defaultName:"{name} 额度充值包",defaultDescription:"{name} 额度充值包",defaultNickname:"Credit 充值",unitLabel:"单位",settings:"Credit 设置",configTitle:"Credit 配置",expirationTime:{label:"过期时间",expireWithNextGrant:"随下次发放过期"},name:{placeholder:"输入 Credit 产品名称"},description:{placeholder:"描述此 Credit 产品的用途和价值"},priceNotice:"Credit 产品用于为用户提供可消费的额度,支持一次性购买和套餐包两种模式。",creditAmount:{label:"Credit 数量",placeholder:"用户购买此价格获得的 Credit 数量",help:"留空表示按单价售卖,填入数字表示固定套餐包",description:"用户购买数量决定获得的 Credit"},validDuration:{label:"可用时长",help:"Credit 的有效期限,从购买时开始计算",description:"设置为 0 表示永不过期",hours:"小时",days:"天",weeks:"周",months:"月",years:"年"},associatedPrices:{label:"关联价格",placeholder:"选择此 Credit 可用于的服务价格",help:"选择后,购买的 Credit 只能用于指定的服务",description:"不选择任何价格表示 Credit 可用于所有服务"},priority:{label:"使用优先级",help:"当用户有多个 Credit 时的使用顺序,数字越小优先级越高",description:"范围:0-100,0 为最高优先级,50 为默认值"},deliveryMode:{label:"发放模式",once:"一次性发放",periodic:"周期性发放"},schedule:{interval:{label:"发放频率",hour:"小时",day:"天",week:"周",month:"月"},amountPerGrant:{label:"每次发放数量",description:"每次发放固定数量的 Credit"},expireWithNextGrant:{label:"随下次发放过期",description:"本次 Credit 将在下一次发放时自动过期"}}},meterEvent:{title:"计量事件详情",id:"事件ID",totalEvents:"总事件数:{count}",noEvents:"暂无事件",noEventsHint:"您可以在测试模式下手动添加测试事件。",identifier:"标识符",customer:"客户",customerId:"客户ID",value:"数值",subscription:"订阅",creditConsumed:"消耗额度",usageValue:"使用量",settlementAmount:"结算额度",reportedAmount:"上报额度",overdueAmount:"欠费额度",reportedAt:"上报时间",processedAt:"处理时间",eventIdentifier:"事件标识符",usageDetails:"使用详情",chart:{eventCount:"每日事件数",totalValue:"每日用量总数"},filter:{customer:"筛选客户"},add:{button:"添加用量",title:"添加用量",customerId:"客户",customerIdPlaceholder:"选择客户",value:"数值",valuePlaceholder:"输入用量数值",subscriptionId:"订阅",subscriptionIdPlaceholder:"输入订阅ID(可选)",subscriptionIdHint:"可选 - 将此用量关联到特定订阅",timestamp:"时间",timestampHint:"此用量发生的时间",validation:"客户和数值为必填项",success:"用量事件添加成功",submit:"提交"}},developers:"开发者工具箱",webhooks:"钩子",events:"事件",refunds:"退款记录",payouts:"出款记录",logs:"日志",passports:"通行证",details:"详情",settings:"系统设置",branding:"品牌设置",business:"企业设置",summary:"摘要",product:{empty:"暂无产品",info:"产品信息",add:"添加产品",view:"查看产品详情",save:"保存产品",saved:"产品已成功保存",additional:"附加选项",edit:"编辑产品",pricing:"定价",find:"选择产品",archive:"存档产品",archiveTip:"存档将隐藏此产品不再允许新购买。确定要存档此产品吗?",unarchive:"取消存档产品",unarchiveTip:"取消存档将使此产品可以用于新的购买。确定要取消存档此产品吗?",remove:"删除产品",removeTip:"删除将隐藏此产品不再允许新购买。确定要删除此产品吗?",archived:"此产品已存档",archivedTip:"此产品无法添加到新的账单、订阅、支付链接或定价表。具有此产品的任何现有订阅将保持活动状态,直到取消,任何现有的支付链接或定价表将被停用。",locked:"此产品已锁定,因为至少有一个价格用于订阅或支付。",currencyNotAligned:"所有价格必须具有相同的货币设置",image:{label:"图片",add:"添加图片"},features:{label:"特点",add:"添加其他特点"},name:{label:"名称",required:"产品名称是必需的",placeholder:"高级套餐"},description:{label:"描述",required:"产品描述是必需的",placeholder:"在结账、账单页面显示的产品描述"},statement_descriptor:{label:"声明描述",placeholder:"ArcBlock"},unit_label:{label:"单位标签",placeholder:"单位"},billingType:{label:"计费类型",standard:"标准计费",metered:"计量计费",help:"选择如何向客户收费"},meter:{label:"计量器",placeholder:"选择计量器来跟踪使用情况",required:"计量计费需要选择一个计量器",help:"选择用于跟踪此产品使用情况的计量器",pricingNote:"对于计量产品,定价会自动基于所选计量器跟踪的使用情况。您只需要设置单价和计费周期。"},cross_sell:{title:"交叉销售",to:"交叉销售",tip:""},type:{label:"产品类型",service:"服务",serviceDesc:"数字服务或订阅",credit:"Credit",creditDesc:"用于基于 Credit 计费场景的充值产品",creditDescLink:"请先创建计量器",good:"商品",goodDesc:"实体商品或有形产品"},vendorConfig:{title:"供应商配置",add:"添加供应商",empty:'未配置供应商。点击"添加供应商"来配置供应商服务。',vendor:"供应商",vendorRequired:"供应商是必填项",productCode:"产品代码",productCodeRequired:"产品代码是必填项",commissionType:"分成类型",commissionRate:"分成比例",commissionRateRequired:"分成比例是必填项",commissionRateMin:"分成比例必须大于或等于0",commissionRateMax:"分成比例不能超过100%",amount:"固定金额",noVendor:"无供应商可选",amountRequired:"固定金额是必填项",totalCommission:"总分成比例:{total}%",totalCommissionExceeded:"总分成比例超过100%:{total}%"}},price:{name:"价格",type:"使用类型",info:"价格信息",plan:"价格方案",lookupKey:"查找键",setAsDefault:"设置为默认价格",detail:"定价详情",addAnother:"添加价格方案",order:"方案 {order}",add:"添加另一个价格",view:"查看价格详情",additional:"附加选项",model:"定价模型",amount:"价格",amountDescription:"这是客户将支付的含税价格。",locked:"此价格已锁定,因为它用于订阅或支付。",amountTip:"对于订阅选择周期,对于其他所有选择一次性。",duplicate:"复制价格",edit:"编辑价格",find:"选择或新建价格",archive:"存档价格",archiveTip:"存档将隐藏此价格不再允许新购买。确定要存档此价格吗?",remove:"删除价格",removeTip:"删除将隐藏此价格不再允许新购买。确定要删除此价格吗?",unit_amount:{required:"价格是必需的",positive:"价格必须是正数",stripeTip:"Stripe要求价格必须大于等于0.5"},nickname:{label:"价格描述",placeholder:""},lookup_key:{label:"查找键",placeholder:"",description:"查找键用于在API中识别价格"},recurring:{interval:"计费周期",metered:"使用量按计量收费?",meteredTip:"计量计费允许您根据每个计费周期结束时的报告的使用情况向客户收费。",aggregate:"按何种方式收费计量使用",intervalCountTip:"计费周期必须是正整数",stripeTip:"Stripe要求计费周期不能为小时"},currency:{add:"添加更多货币",list:"货币"},models:{standard:"标准定价",standardDesc:"单一固定价格",package:"套餐定价",packageDesc:"按单位数量定价",graduated:"毕业定价",volume:"量价定价",custom:"客户自定义价格",usageBased:"基于使用量",creditMetered:"Credit 计量计费"},creditMetered:{label:"Credit 计量计费",placeholder:"选择计量器来跟踪使用情况",required:"Credit 计量计费需要选择一个计量器",help:"选择用于跟踪此产品使用情况的计量器",selectMeter:"选择计量器",pricingNote:"对于计量产品,定价会自动基于所选计量器跟踪的使用情况。",description:"Credit 计量计费的订阅需要有对应的 Credit 消费,如果 Credit 消耗完,对应的服务会停止。"},credit:{saveAsBasePrice:"设为充值套餐",saveSuccess:"设置成功"},types:{onetime:"一次性",onetimeDesc:"收取一次性费用",recurring:"周期性",recurringDesc:"收取持续费用"},paymentType:"付费类型",billingModel:"计费模式",pricing:"定价",additionalCurrencies:"其他货币",advanced:"高级设置",customInterval:"自定义间隔",perUnit:"每单位",choosePricingModel:"选择定价模式",usage:"使用量",usageDesc:"根据用户数量、单位或席位定价。需要记录以便Stripe跟踪客户服务使用情况。",meter:"计量器",billingPeriod:"计费周期",aggregate:{sum:"在周期内的使用值总和",max:"周期内的最大使用值",last_during_period:"周期内的最近使用值",last_ever:"最近的使用值"},upsell:{title:"升级选项",to:"可升级至",tip:""},quantity:{tip:"数量必须是自然数"},quantityAvailable:{label:"可售数量",placeholder:"0表示无限制",format:"可售{num}件",noLimit:"不限制可售数量",valid:"可售数量不得少于已售数量",description:"输入可售数量,0表示不限制可售数量"},quantitySold:{label:"已售数量",format:"已售{num}件"},quantityLimitPerCheckout:{label:"单次购买最大数量",placeholder:"0表示无限制",format:"单次最多购买{num}件",noLimit:"不限制单次购买数量",description:"输入限制单次购买的最大数量, 0表示无限制"},inventory:"库存设置",dynamicPricing:{label:"启用动态定价",description:"价格根据实时汇率波动",config:{title:"动态定价配置",baseAmount:{label:"基准价格",description:"以法定货币计算的基准价格",required:"基准价格是必需的"}},validation:{checking:"正在检查汇率可用性...",rateLine:"当前汇率:1 {currency} ≈ ${rate}",usdLine:"参考 USD:≈ ${amount}",error:"获取汇率失败,货币不支持或者数据源异常",estimatedLine:"预估数量:≈ {amount} {currency}",useAmount:"填入"}},referencePricing:{label:"参考汇率定价",description:"仅用于参考并快速填充币种数量,不会开启动态定价"}},coupon:{create:"创建优惠券",view:"查看优惠券",description:"优惠券可用于对发票、订阅或整个客户账户提供折扣。",listTitle:"优惠券",terms:"优惠条款",tab:"优惠券",redemptions:"兑换次数",expires:"过期时间",noDiscount:"无折扣",name:"名称",nameHelp:"这将显示在客户的收据和发票上。",desc:"描述",descriptionInternal:"此描述仅供内部使用,不会向客户显示。",id:"ID",idOptional:"ID(可选)",idHelp:"这将在 API 中标识此优惠券。我们建议将此留空,以便我们为您生成 ID。",type:"类型",percentageOff:"百分比折扣",fixedAmountOff:"固定金额折扣",percentageDiscount:"百分比折扣",fixedAmount:"折扣金额",currency:"货币",applyToProducts:"应用于特定产品",duration:"持续时间",once:"一次",forever:"永久",repeating:"重复",durationHelp:'对于订阅和客户,这决定了此优惠券一旦兑换后的有效期。一次性发票接受"一次"和"永久"优惠券。',durationInMonths:"持续月数",redemptionLimits:"兑换限制",limitDateRange:"限制客户可以兑换此优惠券的日期范围",limitTotalNumber:"限制此优惠券可以被兑换的总次数",codes:"代码",useCustomerFacingCodes:"使用面向客户的优惠券代码",promotionCodes:"促销码",promotionCodesHelp:"促销码将在优惠券保存后创建。",addPromotionCode:"添加促销码",eligibleFirstTime:"仅限首次订单(每个用户只能享受一次优惠券折扣)",limitNumberRedemptions:"限制此代码可以被兑换的次数",addExpirationDate:"添加过期日期",requireMinimumOrder:"要求最小订单金额",addAnotherCode:"添加另一个代码",saved:"优惠券保存成功",codeOptional:"代码(可选)",codeHelp:"留空将在创建时自动生成",generate:"生成",verificationType:"验证类型",codeOnly:"仅代码",nftVerification:"NFT 验证",vcVerification:"通行证验证",userWhitelist:"限制特定用户",nftSettings:"NFT 验证设置",vcSettings:"通行证验证设置",userWhitelistSettings:"特定用户设置",nftAddresses:"NFT 地址",nftAddressesPlaceholder:"输入 NFT 合约地址",nftTags:"NFT 标签",nftTagsPlaceholder:"输入 NFT 标签",trustedIssuers:"可信发行者",trustedIssuersPlaceholder:"输入可信发行者",trustedParents:"可信 NFT 工厂",trustedParentsPlaceholder:"输入可信 NFT 工厂",minBalance:"NFT 所需数量",requiredRoles:"必需角色",requiredRolesPlaceholder:"输入必需角色",trustedVcIssuers:"可信 VC 发行者",trustedVcIssuersPlaceholder:"输入可信 VC 发行者 DID",customerDids:"客户 DID",customerDidsPlaceholder:"输入客户 DID",customerDidsHelp:"您可以选择现有客户或手动输入DID",maxRedemptions:"最大兑换次数",expiresAt:"过期时间",pressEnterToAdd:"按回车键添加",couponConfiguration:"优惠券配置",selectProducts:"选择产品",noProductsSelected:"未选择产品",newCode:"新代码",createPromotionCode:"创建促销码",promotionCodeDescription:"为此优惠券创建促销码,让客户兑换折扣。",minimumAmount:"最低金额",minimumAmountHelp:"为不同货币设置最低订单金额",discountAmount:"折扣金额",currencies:"货币",times:"次",months:"月",addProduct:"添加另一个产品",unlimited:"不限量",inactive:"优惠券已停用",inactiveTip:"此优惠券当前处于停用状态,无法使用。",discount:"折扣",updated:"更新时间",timesRedeemed:"已使用次数",deletedSuccessfully:"优惠券删除成功",deleteConfirmTitle:"删除优惠券",deleteConfirmMessage:"确定要删除此优惠券吗?此操作无法撤销。",cannotDeleteWithPromotionCodes:"存在促销码时无法删除优惠券",couponTermsPercentage:"{percent}%",couponTermsFixedAmount:"{amount} {symbol}",couponTerms:{forever:"永久享 {couponOff} 折扣",once:"单次享 {couponOff} 折扣",repeating:"{months} 个月内享 {couponOff} 折扣"},couponTermsDuration:{forever:"永久",once:"单次",repeating:"{months} 个月"},applicableProducts:"适用产品",noApplicableProducts:"此优惠券适用于所有产品",activeRedemptions:"兑换使用记录",customers:"客户",subscriptions:"订阅",noCustomersFound:"未找到客户",noCustomersRedeem:"当前没有客户使用此优惠券",noSubscriptionsFound:"未找到订阅",noSubscriptionsRedeem:"当前没有订阅使用此优惠券",rename:"重命名",renameCoupon:"重命名优惠券",updateCouponDetails:"更新优惠券详情",nameWillAppear:"此名称将显示在客户的收据和发票上。",updateCouponButton:"更新优惠券",discountStart:"折扣开始时间",usageStats:"使用统计",totalDiscounts:"总折扣记录",uniqueSessions:"独立会话",uniqueSubscriptions:"独立订阅",promotionCodesUsed:"使用的促销码",noExpiration:"无过期时间",usagePeriod:"使用时期",firstUsed:"首次使用",lastUsed:"最后使用",promotionCodeInfo:"促销码信息",directCouponUsage:"直接优惠券使用",usageLimit:"使用次数",discountInfo:"折扣信息",discountPeriod:"折扣有效期",couponExpires:"优惠券过期",totalSavings:"累计优惠",viewPromotionCode:"查看促销码"},discount:{totalSaved:"总共节省",timesUsed:"使用次数",appliedDiscounts:"应用的优惠"},promotionCode:{code:"代码",status:"状态",redemptions:"兑换次数",expires:"过期时间",created:"创建时间",actions:"操作",active:"生效中",inactive:"已停用",expired:"已过期",maxedOut:"已用尽",viewDetails:"查看详情",edit:"编辑促销码",delete:"删除促销码",archive:"存档促销码",archiveTip:"存档后,此促销码将不再允许新兑换。确定要存档此促销码吗?",deleteTip:"删除将永久删除此促销码。确定要删除此促销码吗?",title:"促销码",id:"ID",type:"类型",couponId:"优惠券ID",maxRedemptions:"最大兑换次数",timesRedeemed:"已兑换次数",verificationType:"验证类型",updated:"更新时间",activate:"激活",deactivate:"停用",inactiveTitle:"促销码已停用",inactiveTip:"此促销码目前已停用,无法使用。",deleteSuccess:"促销码删除成功",activateSuccess:"促销码激活成功",deactivateSuccess:"促销码停用成功",verificationConfig:"验证配置",nftAddresses:"NFT地址",nftTags:"NFT标签",minBalance:"最小余额",requiredRoles:"所需角色",trustedIssuers:"可信签发方",allowedUsers:"允许的用户",noNftConfig:"无NFT配置",noVcConfig:"无VC配置",noUsersSpecified:"未指定用户",codeVerificationOnly:"仅代码验证",unlimited:"无限制",never:"永不过期",yes:"是",no:"否",verificationTypeMap:{code:"仅代码",nft:"NFT验证",vc:"通行证验证",user_restricted:"限制特定用户"}},paymentLink:{view:"查看支付链接",info:"支付链接信息",add:"创建支付链接",save:"创建链接",openLink:"打开URL",copyLink:"复制URL",saved:"支付链接已成功保存",additional:"附加选项",beforePay:"支付页面",afterPay:"支付后",products:"产品",addProduct:"添加另一个产品",requireBillingAddress:"收集客户的账单地址",requirePhoneNumber:"收集客户的电话号码",allowPromotionCodes:"允许促销码",enablePromotionCodes:"启用促销码",disablePromotionCodes:"禁用促销码",enablePromotionCodesTip:"为此支付链接启用促销码功能。客户在结账时将能够使用折扣代码。",disablePromotionCodesTip:"为此支付链接禁用促销码功能。客户在结账时将无法使用折扣代码。",includeFreeTrial:"包含免费试用",noStakeRequired:"无需质押",showProductFeatures:"显示产品特性",allowSkipPaymentMethod:"允许 $0 结账时跳过绑定支付方式",enableSkipPaymentMethod:"允许跳过支付方式",disableSkipPaymentMethod:"要求绑定支付方式",enableSkipPaymentMethodTip:"当结账金额为 $0 时,允许客户跳过绑定支付方式。若未绑定,订阅将在当前周期结束时自动取消。",disableSkipPaymentMethodTip:"即使结账金额为 $0,也要求客户提供支付方式。",freeTrialDaysPositive:"免费试用天数必须是正数",includeCustomFields:"添加自定义字段",requireCrossSell:"用户必须选择交叉销售的商品(如果有的话)",confirmPage:"确认页面",showConfirmPage:"显示确认页面",customMessage:"用自定义消息替换默认消息",customMessageTip:"包括您认为合适的任何细节,如交付信息。",mintNft:"购买完成时铸造 NFT",mintNftFrom:"从下面的 NFT 集合铸造",noConfirmPage:"不显示确认页面",createInvoice:"为相关付款创建账单。",adjustable:"可调整数量",adjustableQuantity:"允许客户调整数量",noProducts:"支付链接必须至少有一个产品",noRedirectUrl:"支付链接必须有重定向URL",noSubscriptionTrialDays:"您必须为订阅指定试用期",recurringNotAligned:"所有行项目的价格必须具有相同的周期",currencyNotAligned:"所有行项目的价格必须具有相同的货币设置",edit:"编辑支付链接",rename:"更改名称",archive:"存档支付链接",archiveTip:"存档将隐藏此支付链接不再允许新购买。确定要存档此支付链接吗?",remove:"删除支付链接",removeTip:"删除将隐藏此支付链接不再允许新购买。确定要删除此支付链接吗?",name:{label:"名称",placeholder:"不向消费者展示"},adjustableQuantityError:"最小数量必须小于最大数量"},payout:{list:"对外支付",name:"对外支付",view:"查看对外支付",empty:"没有记录",attention:"失败的对外支付",requestRefund:"请求退款",confirmRefund:"确定要向供应商请求退款吗?",refundRequested:"退款请求已发送给供应商",refundReason:"退款原因",refundReasonPlaceholder:"请输入退款原因(至少 5 个字符)",refundReasonRequired:"退款原因为必填项",refundReasonMinLength:"退款原因至少需要 {min} 个字符",refundReasonHelper:"请输入至少 {min} 个字符",status:{active:"生效中",paid:"已支付",succeeded:"成功"}},pricingTable:{view:"查看定价表",add:"创建定价表",save:"创建",openLink:"打开URL",copyLink:"复制URL",saved:"定价表已成功保存",edit:"编辑定价表",rename:"更改名称",archive:"存档定价表",archiveTip:"存档将隐藏此定价表不再允许新购买。确定要存档此定价表吗?",remove:"删除定价表",removeTip:"删除将隐藏此定价表不再允许新购买。确定要删除此定价表吗?",name:{label:"名称",placeholder:"不向消费者展示"},display:"显示设置",highlight:"突出显示产品",customer:"客户门户"},paymentIntent:{list:"付款记录",name:"付款记录",view:"查看付款详情",empty:"没有付款记录",refund:"退款",status:{active:"生效中",paid:"已支付",succeeded:"成功"},received:"实收金额",attention:"失败的付款",refundError:"退款申请失败",refundSuccess:"退款申请已成功创建",cancelRefund:"取消退款",refundCanceled:"取消退款成功",refundCanceledError:"取消退款失败",refundCanceledTip:"您确定要取消退款申请吗?取消后,退款将不再进行。",refundForm:{reason:"退款原因",amount:"退款金额",description:"退款说明",duplicate:"订单因重复下单已被取消并退款",requestedByCustomer:"订单已被客户取消并退款",requestedByAdmin:"订单已被管理员取消并退款",fraudulent:"订单因涉嫌欺诈已被取消并退款",expiredUncapturedCharge:"订单因支付未完成已被取消并退款",amountRange:"退款金额必须在 {min} {symbol} 到 {max} {symbol} 之间",amountHelper:"目前最大退款金额为{max} {symbol}",required:"请完整填写退款信息",empty:"当前订单已全部退款完成"}},paymentMethod:{_name:"支付方式",type:"类型",add:"添加支付方式",edit:"编辑支付方式",save:"保存支付方式",saved:"支付方式已成功保存",settings:"设置",gasTip:"使用 {method} 支付需保证账户在 {chain} 链上有余额支付手续费",recharge:"扫码充值",props:{type:"类型",confirmation:"确认",recurring:"重复支持",refund:"退款支持",dispute:"纠纷支持",currencies:"货币支持",explorer_host:"区块浏览器",balance:"余额"},name:{label:"名称",tip:"面向消费者"},description:{label:"描述",tip:"不向消费者展示"},stripe:{dashboard:{label:"仪表板 URL",tip:"用于生成指向 Stripe 仪表板的链接"},publishable_key:{label:"可发布密钥",tip:"可发布密钥,请查看仪表板 > 开发人员 > API密钥"},secret_key:{label:"秘密密钥",tip:"秘密密钥,请查看仪表板 > 开发人员 > API密钥"},webhook_signing_secret:{label:"钩子签名密钥",tip:"钩子签名密钥,请查看仪表板 > 开发人员 > 钩子 > 签名密钥"},webhookHint:"若无法接收 Webhook 事件,可手动在环境变量配置 STRIPE_WEBHOOK_SECRET",configureEnv:"前往配置"},arcblock:{chain_id:{label:"链 ID",tip:"仅是名称"},api_host:{label:"API 地址",tip:"发送交易的 API 端点"},explorer_host:{label:"区块浏览器",tip:"查看交易详情的地址"}},ethereum:{chain_id:{label:"链 ID",tip:"必须是有效的EVM链ID,通常是一个整数,https://chainlist.org"},api_host:{label:"RPC 端点",tip:"发送交易的RPC端点"},explorer_host:{label:"区块浏览器",tip:"查看交易详情的区块浏览器"},native_symbol:{label:"货币符号",tip:"链上主货币符号"},confirmation:{label:"确认区块数",tip:"交易标记为确认需要的区块数"}},evm:{checking:"正在检查连接...",connected:"连接成功",connectionError:"连接失败",blockHeight:"区块高度",rpcStatus:"RPC 状态"},base:{chain_id:{label:"链 ID",tip:"必须是有效的EVM链ID,通常是一个整数,https://chainlist.org"},api_host:{label:"RPC 端点",tip:"发送交易的RPC端点"},explorer_host:{label:"区块浏览器",tip:"查看交易详情的区块浏览器"},native_symbol:{label:"货币符号",tip:"链上主货币符号"},confirmation:{label:"确认区块数",tip:"交易标记为确认需要的区块数"}},google_play:{package_name:{label:"应用包名",tip:"例如 com.example.app,在 Play Console 中配置"},service_account_json:{label:"服务账号 JSON",tip:"从 Google Cloud Console 下载的 service account credentials JSON,整段粘贴",invalidJson:"不是合法的 JSON",missingFields:"JSON 缺少 client_email 或 private_key 字段",detectedClient:"识别到客户端"},pubsub_topic_name:{label:"Pub/Sub 主题名(可选)",tip:"projects/<project-id>/topics/<topic-name>,用于接收 RTDN"}},app_store:{bundle_id:{label:"应用 Bundle ID",tip:"例如 com.example.app,在 App Store Connect 中配置"},environment:{label:"环境",tip:"StoreKit 2 JWS 中携带的 environment 必须与此匹配",production:"正式环境",sandbox:"沙盒环境"},shared_secret:{label:"Shared Secret(StoreKit 1 用)",tip:"App-Specific Shared Secret,用于 legacy receipt 校验。StoreKit 2 JWS 不需要。在 App Store Connect → App Information → App-Specific Shared Secret"},serverApi:{heading:"Server API 凭据(可选)",tip:"StoreKit 2 JWS 校验不需要凭据;只在调用 App Store Server API 查询订阅状态时使用。三项需同时填写。"},issuer_id:{label:"Issuer ID",tip:"App Store Connect API 的 Issuer ID"},key_id:{label:"Key ID",tip:"App Store Connect API 的 Key ID"},private_key_pem:{label:"私钥 (.p8 内容)",tip:"从 App Store Connect 下载的 .p8 文件内容,整段粘贴"}}},paymentCurrency:{name:"支付货币",add:"添加货币",edit:"编辑货币",save:"保存货币",saved:"货币已成功保存",delete:"删除货币",deleteConfirm:"确定要删除此货币吗?一旦删除,将无法恢复",deleted:"货币已成功删除",quickAdd:"快速添加已支持的货币",searchToken:"搜索货币",orManualInput:"或在下方手动填写货币信息",logo:{label:"Logo",tip:"在支付页面显示"},contract:{label:"合约地址",tip:"用于获取代币符号、小数位数和其他信息"}},event:{empty:"没有事件",view:"查看事件",data:"事件数据",webhooks:"钩子调用",type:"类型",pendingWebhooks:"待处理的钩子",noAttempts:"无调用记录",retry:"重试",retrying:"重试中...",retryOptions:{title:"重试 Webhook",confirmMessage:"确定要重试此 webhook 吗?这将向 webhook 端点发送另一个请求。",success:"Webhook 已安排重试",error:"重试 webhook 失败"},response:"响应",request:"请求",eventData:"事件数据",events:{dailyEventCount:"每日事件数量",dailyTotalValue:"每日总使用量",eventName:"事件名称",value:"值",customer:"客户",subscription:"订阅",reportTime:"上报时间",count:"共 {count} 个事件",empty:"暂无事件数据",emptyTip:"当有事件上报时,数据将显示在这里",filterByCustomer:"按客户筛选",eventCount:"事件数量",totalValue:"总使用量"}},invoice:{view:"查看账单",name:"账单",from:"账单来自",empty:"没有账单",status:{active:"生效中",paid:"已支付",succeeded:"成功"},number:"账单编号",description:"账单说明",dueDate:"截止日期",finalizedAt:"已完成时间",paidAt:"支付日期",summary:"摘要",billingContextNote:"本账单金额基于结算时的实时价格计算。",dynamicPricingNote:"本账单使用动态定价并锁定了汇率。",billTo:"开具给",billing:"计费方式",download:"下载PDF",edit:"编辑账单",duplicate:"复制账单",retryUncollectible:{title:"重新收款",tip:"确定要重新尝试收取该笔账单吗?系统将再次尝试向客户发起扣款。",success:"重新收款请求已提交"},attention:"未完成的账单",returnStake:{title:"退还质押",tip:"您确定要退还质押吗?此操作将立即退还质押给客户。",success:"质押退还申请已提交"},void:{title:"作废账单",tip:"您确定要作废此账单吗?此操作将立即作废账单。",success:"账单作废成功"}},vendor:{create:"创建供应商",edit:"编辑供应商",delete:"删除供应商",save:"保存供应商",saved:"供应商保存成功",test:"测试",testConnection:"测试连接",testConnectionTip:'确定要测试供应商 "{name}" 的连接吗?',testConnectionSuccess:"连接测试成功",testConnectionFailed:"连接测试失败",testSuccess:"连接测试成功",testAfterSave:"供应商保存成功。您可以测试连接以验证配置是否正确。",testToEnable:"供应商保存成功。请测试连接以启用供应商。",enabled:"已启用",disabled:"未启用",addressCheckFailed:"地址检测失败,启用状态下无法保存",updateSuccess:"供应商更新成功",testFailed:"连接测试失败 (状态码: {status})",testError:"连接测试失败 - 网络错误",vendorKeyInvalid:"供应商类型只能包含小写字母、数字和下划线",deleteTitle:"删除供应商",deleteContent:'确定要删除供应商 "{name}" 吗?此操作无法撤销。',deleteTip:'确定要删除供应商 "{name}" 吗?此操作无法撤销。',activate:"激活供应商",activateTip:'确定要激活供应商 "{name}" 吗?',deactivate:"停用供应商",deactivateTip:'确定要停用供应商 "{name}" 吗?',name:"供应商名称",nameRequired:"供应商名称是必填项",vendorType:"供应商类型",vendorTypeRequired:"供应商类型是必填项",didnames:"DID Names",launcher:"Launcher",vendorKey:"供应商标识",vendorKeyRequired:"供应商标识是必填项",vendorKeyHelp:"供应商的唯一标识符",description:"描述",displayNameRequired:"前台展示名称是必填项",displayNameHelp:"此数据会展示到付款成功后的安装界面",appUrl:"应用地址",appUrlRequired:"应用地址是必填项",appUrlInvalid:"请输入有效的 URL,以 http:// 或 https:// 开头",appUrlHelp:"供应商应用的基础 URL 地址",vendorDid:"供应商 DID",vendorDidInvalid:"请输入有效的 DID",vendorDidHelp:"供应商的可选 DID 地址",webhookPath:"Webhook路径",webhookPathInvalid:"请输入以/开头的有效路径",webhookPathHelp:"可选的webhook回调路径(如:/webhooks/status)",blockletMetaUrl:"Blocklet元数据URL",blockletMetaUrlRequired:"Blocklet元数据URL是必填项",blockletMetaUrlInvalid:"请输入有效的URL,以http://或https://开头",blockletMetaUrlHelp:"必填的blocklet元数据URL,用于获取应用信息",commission:"分成",commissionRate:"分成比例",commissionRateRequired:"分成比例是必填项",commissionRateMin:"分成比例必须大于或等于0",commissionRateMax:"分成比例过高",commissionType:"分成类型",commissionRateHelp:"分成比例,以百分比形式",commissionAmountHelp:"固定分成金额",percentage:"百分比",fixedAmount:"固定金额",active:"启用",inactive:"禁用",basicInfo:"基本信息",apiConfig:"API配置",commissionConfig:"分成配置",status:"状态",brokerDID:"平台 DID",brokerPublicKey:"平台公钥"},subscription:{view:"查看订阅",name:"订阅",empty:"没有订阅",status:{active:"生效中",paid:"已支付",succeeded:"成功"},viewAll:"查看历史订阅",noActiveEmpty:"您当前没有服务中的订阅,您可以选择查看历史订阅",includedServices:"包含的服务",serviceHome:"访问服务主页",serviceDashboard:"访问服务管理后台",product:"产品",attention:"将过期的订阅",collectionMethod:"计费",channel:"渠道",currentPeriod:"当前周期",iap:{googlePlayTitle:"Google Play 订阅详情",appStoreTitle:"App Store 订阅详情",purchaseToken:"购买令牌",orderId:"订单号",productId:"产品 ID",originalTransactionId:"原始交易 ID",transactionId:"本次交易 ID",expiryTime:"过期时间",environment:"环境"},trialingPeriod:"试用期",trialEnd:"试用期结束于 {date}",willEnd:"将于 {date} 结束",ended:"结束于 {date}",renew:"下次续费: {date}",discount:"折扣",activeDiscount:"当前优惠",startedAt:"开始于",nextInvoice:"下次账单时间",nextInvoiceAmount:"下次账单金额",nextInvoiceAmountTip:"下次账单金额为预估,最终金额会根据实际使用情况结算。",itemId:"订阅项目ID",update:"更新订阅",resume:"恢复付款",resumeTip:"您确定要继续收款吗?此订阅的未来账单将继续付款。",paymentAddress:"扣费地址",currentBalance:"扣款账户余额",insufficientBalance:"余额不足,立即充值",cancel:{schedule:"计划取消",title:"取消订阅",required:"必须指定自定义取消时间",will:"于 {date} 取消",done:"已取消",at:{title:"取消",now:"立即取消({date})",current_period_end:"本周期结束后({date})",custom:"自定义取消日期",timeError:"取消时间必须在当前周期内"},refund:{title:"退款",none:"仅取消不退款",last:"退款最近付款的全部 {total}{symbol}",proration:"退款最近付款的未使用部分 {unused}/{total}{symbol}"},staking:{title:"质押",none:"不退还 / 罚没质押",proration:"退还剩余部分 {unused}{symbol}",slash:"罚没剩余部分 {unused}{symbol}",slashReason:"罚没原因",slashTip:"该订阅剩余的质押部分 {unused}{symbol} 将被罚没, 请确认是否继续?",slashTitle:"罚没质押"},comment:{title:"原因",placeholder:"请填写取消订阅的原因"}},pause:{title:"暂停付款",required:"必须指定自定义恢复时间",type:{title:"持续时间",never:"无限期暂停",custom:"暂停到自定义日期"},behavior:{title:"账单行为",keep_as_draft:"保留账单为草稿",keep_as_draft_tip:"对于目前提供服务但等待收款的企业。",mark_uncollectible:"将账单标记为不可收款",mark_uncollectible_tip:"对于目前提供免费服务的企业。",void:"作废账单",voidTip:"对于目前不提供服务的企业。"},until:{never:"付款暂停",custom:"付款暂停直到{date}"}},usage:{title:"使用记录",current:"当前周期的使用记录",range:"周期使用记录({start} - {end})",view:"查看使用情况",vary:"随使用情况变化",used:"已使用单位",cycle:"统计周期"},batchPay:{button:"批量付款"},payerAddress:"扣费地址",noPaymentMethod:"未绑定",bindPaymentMethod:"立即绑定",bindPaymentMethodFirst:"请先绑定支付方式后再恢复订阅",noPaymentMethodWarning:"当前订阅未绑定支付方式,请尽快绑定,否则订阅将在当前周期结束时自动取消。",changePayer:{btn:"变更",stripe:{linkType:"Stripe Link",bankAccount:"银行账户"},connect:{title:"变更扣费地址",success:"扣费地址变更成功",error:"扣费地址变更失败"}}},customer:{view:"查看客户",edit:"编辑信息",spent:"花费金额",refund:"退款金额",stake:"质押金额",dispute:"争议金额",token:"链上余额",due:"欠款金额",name:"名称",email:"电子邮件",phone:"电话",invoicePrefix:"账单前缀",googlePlayUuid:"Google Play UUID",appStoreUuid:"App Store UUID",balance:"余额 ({currency})",summary:{refund:"退款金额",spent:"花费金额",due:"欠款金额",stake:"质押金额",stats:"统计",balance:"余额"},address:{label:"地址",country:"国家",state:"州或省份",city:"城市或城镇",line1:"地址",line2:"详细地址",postal_code:"邮政编码"},creditGrants:{tab:"信用额度",title:"信用额度",summary:"额度汇总",noGrants:"未找到信用额度",grantDetail:"信用额度详情",overview:"概览",overviewDescription:"监控所有货币的信用余额、使用情况和未偿债务。",availableBalance:"可用余额",usage:"使用情况",viewInvoice:"查看账单",viewGrants:"查看额度",viewUsage:"查看使用情况",recentActivity:"最近活动",quickStats:"快速统计",activeGrants:"活跃额度",totalCreditValue:"总信用价值",outstandingDebt:"未偿债务",buyCredits:"购买额度",viewAllActivity:"查看所有活动",creditBalance:"信用余额",totalAmount:"总额度",pendingAmount:"欠费额度",grantCount:"额度数量",noGrantsDescription:"您还没有任何信用额度",relatedGrants:"信用额度",category:"分类",status:{granted:"生效中",pending:"待生效",expired:"已过期",depleted:"已耗尽",voided:"已作废"},originalAmount:"原始金额",grantId:"额度ID",grants:"额度",addCredit:"添加额度",viewDetails:"查看详情"}},passport:{intro:"管理应用通行证的付款设置,必须同时设置商品和购买入口",payLink:"支付入口",payPreview:"支付预览",preview:"支付页面预览",assign:"分配给通行证",assignTip:"将此支付链接分配给所选通行证,以使其可供购买",unassign:"重置购买配置",unassignTip:"确认要将购买入口和关联商品配置清空?",assignError:"必须选择一个要分配的通行证"},webhookEndpoint:{hosted:"托管的钩子",add:"添加钩子",addTip:"设置钩子端点以接收来自",listen:"监听",version:"API版本",attempts:"钩子调用",url:{label:"URL",description:"端点URL"},description:{label:"描述",description:"此端点用于何种目的的可选描述。"},events:{label:"选择要监听的事件",description:""}},refund:{name:"退款",attention:"失败的退款",view:"查看退款详情",status:{active:"生效中",paid:"已支付",succeeded:"成功"}},usageRecord:{empty:"用量记录为空",add:{label:"添加用量记录",success:"添加用量记录成功",quantity:"数量"}},donate:{title:"打赏配置",mountLocation:"名称",component:"组件",description:"描述",status:{title:"启用状态",active:"启用",inactive:"关闭",inactiveTip:"关闭打赏后,打赏按钮将不再显示,用户无法使用打赏功能,请确认是否关闭?",inactiveTitle:"关闭打赏",activeSuccess:"打赏功能已启用",inactiveSuccess:"打赏功能已关闭"},editTitle:"编辑打赏配置",updateSuccess:"打赏配置已更新",amountSettings:"金额设置",presets:"预设金额",presetsHelper:"请输入预设金额,用英文逗号分隔(例如:1,5,10)",preset:"默认金额",presetHelper:"默认选中的金额(必须是预设金额之一)",custom:"允许自定义金额",minimum:"最小金额",maximum:"最大金额",amountRange:"金额范围:{min} - {max}",customAmount:"自定义金额",buttonSettings:"打赏按钮设置",btn:{text:"按钮文本",helper:"设置打赏按钮显示的文字",preview:"按钮预览"},dialog:{preview:"打赏弹窗预览",confirmButton:"确认打赏 {amount}"},previewTitle:"实时预览",validation:{invalidPreset:"默认金额必须是预设金额之一",invalidRange:"最小金额必须小于最大金额",invalidAmount:"金额必须在允许范围内"},historyType:{title:"打赏记录显示方式",avatar:"头像墙",list:"列表"},intro:"配置打赏按钮和打赏弹窗的展示效果,完成配置后打赏功能将自动生效。",usage:{viewExample:"查看使用示例",title:"打赏组件使用示例",description:"要使用打赏功能,您需要先在组件中正确配置 PaymentProvider 和 DonateProvider。以下是一个基本示例:",note:"注意:mountLocation 必须是唯一的,用于标识打赏实例。配置完成后,该实例将出现在列表中,您可以进行进一步的设置。"}},vaultConfig:{title:"冷钱包配置",description:"启用冷钱包后,系统会在热钱包余额超过阈值时,自动将多余资金转移至安全的离线存储。这种隔离机制将大部分资产与在线环境分离,有效抵御网络攻击,显著提升资金安全性。",learnMore:"了解更多",goToConfig:"前往系统配置",notConfigured:"冷钱包尚未配置",configureFirst:"请先#前往仪表盘#配置冷钱包地址,然后再设置各币种参数。",ownerOnly:"仅拥有所有者权限的管理员可修改冷钱包设置。",permissionRequired:"需要所有者权限",enabled:"状态",enabledYes:"已启用",enabledNo:"未启用",depositThreshold:"存入阈值",withdrawThreshold:"提取阈值",bufferThreshold:"差额阈值",bufferThresholdHelp:"只有当超出存入阈值的金额达到差额阈值时,才会触发归集操作.",bufferThresholdInvalid:"差额阈值不能小于0",edit:"配置",enable:"启用",editTitle:"配置 {currency} 冷钱包设置",enableTitle:"为 {currency} 启用冷钱包",enableVault:"启用冷钱包",enableVaultHelp:"启用冷钱包后,超额资金将自动转入冷钱包,提款超出阈值需管理员审核,确保资产安全与风控。",depositThresholdHelp:"当热钱包余额超过此金额时,多余资金将自动转入冷钱包。",withdrawThresholdHelp:"当单笔提款超过此金额时,需由冷钱包管理员审核并批准。",notConfig:"未配置",noLimit:"无限制",withdrawThresholdNoLimit:"0 表示无提款限制",depositThresholdRequired:"存入阈值必须大于0",withdrawThresholdInvalid:"提款阈值不能小于0",enableSuccess:"{currency} 冷钱包已启用",disableSuccess:"{currency} 冷钱包已关闭",updateSuccess:"{currency} 冷钱包设置已更新",depositConfirmTitle:"转入冷钱包",depositConfirmMessage:"{currency}余额已超过阈值,是否立即转入冷钱包?",depositQueued:"申请转入冷钱包成功,请稍后查看结果",depositFailed:"申请转入冷钱包失败",appBalance:"热钱包余额"},creditGrants:{tab:"信用额度",title:"额度",summary:"额度汇总",noGrants:"未找到信用额度",grantDetail:"信用额度详情",overview:"额度概览",overviewDescription:"监控所有货币的信用余额、使用情况和未偿债务。",availableBalance:"可用余额",usage:"使用情况",viewGrants:"查看额度",viewUsage:"查看使用情况",recentActivity:"最近活动",quickStats:"快速统计",activeGrants:"活跃额度",totalCreditValue:"总信用价值",outstandingDebt:"未偿债务",buyCredits:"购买额度",viewAllActivity:"查看所有活动",creditBalance:"信用余额",totalAmount:"总额度",pendingAmount:"欠费额度",grantCount:"额度数量",noGrantsDescription:"您还没有任何信用额度",status:{granted:"生效中",pending:"待生效",expired:"已过期",depleted:"已耗尽",voided:"已作废"},originalAmount:"原始金额",grantId:"额度ID",grants:"额度",addCredit:"添加额度",viewDetails:"查看详情"},creditTransactions:{tab:"账单",title:"额度账单",summary:"账单汇总",noTransactions:"未找到额度账单",totalTransactions:"总账单数",totalCreditUsed:"总使用额度",transactionDate:"交易时间"},exchangeRateProvider:{title:"汇率数据源",subtitle:"管理动态定价使用的汇率数据源",medianStrategyNote:"系统会自动从多个数据源计算汇率。只有当数据源长期异常或需要临时禁用时才需要在这里处理。",disableConfirmTitle:"确认停用该数据源?",disableConfirmMessage:"停用后可能影响动态计价支付流程,确定要停用吗?",table:{name:"名称",participation:"参与计算",health:"健康度",recentActivity:"最近活动",trustLevel:"可信度",trustLevelTip:"表示可信度与参与资格,不表示优先使用顺序",enabled:"启用",lastUpdate:"最近更新:{time}",failures24h:"24h 失败次数:{count}"},participation:{included:"已参与",excluded:"已排除"},health:{active:"健康",degraded:"不稳定",paused:"异常",inactive:"异常"},status:{active:"正常",degraded:"降级",paused:"已暂停",inactive:"停用"},create:{title:"新增数据源",primaryAction:"新增汇率数据源"},edit:{title:"编辑 {name}",name:"名称",nameHelp:"数据源的唯一标识",nameRequired:"名称必填",type:"数据源类型",typeHelp:"数据源类型。创建后不可修改。",baseUrl:"接口地址(可选)",baseUrlHelp:"自定义接口地址,用于代理或自建实例。默认:{defaultUrl}",apiKey:"API Key",apiKeyHelp:"访问数据源的 API 密钥。",apiKeyLinkText:"API Key 管理地址:",apiKeyLinkAction:"CoinMarketCap 账户",testConnection:"测试连接",testing:"测试中...",testSuccess:"连接成功({symbol}/USD:{rate},{time}ms)",testFailed:"连接失败:{error}",enabled:"启用",priority:"优先级",priorityHelp:"数字越小优先级越高。系统按优先级顺序使用数据源。",status:"状态",statusHelp:'设置为"已暂停"可临时禁用此数据源。',pausedReason:"暂停原因",pausedReasonHelp:"说明为何暂停此数据源(可选)。"}}},empty:{image:"无图片",refunds:"没有退款记录",invoices:"没有账单",invoiceItems:"没有账单明细",subscriptions:"没有订阅记录",customers:"没有客户",products:"没有产品",payouts:"没有出款记录",paymentLinks:"没有支付链接",paymentMethods:"没有支付方式",pricingTables:"没有定价表",paymentCurrencies:"没有货币",webhooks:"没有钩子",events:"没有事件",records:"没有找到匹配的记录",payments:"没有付款记录",prices:"没有价格",pricing:"您还没有设置定价,您可以添加它",summary:"没有摘要"},customer:{subscription:{manage:"管理订阅",cancel:"取消订阅",title:"订阅"},invoiceHistory:"历史账单",product:{empty:"没有订阅产品"},credit:{recharge:"购买额度",autoRecharge:"自动充值",unsupported:"暂不支持购买额度"},recharge:{title:"充值",amount:"金额",submit:"提交",unsupported:"暂不支持该货币充值,请选择其他货币",receiveAddress:"收款地址",view:"查看订阅",success:"充值成功",estimatedDuration:"预计可用 {duration} {unit}",custom:"自定义",intervals:"个周期",history:"充值记录",relatedSubscriptions:"关联订阅",rechargeTooltip:"点击充值余额"},delegation:{title:"检测到你未完成账户的授权,为了不影响订阅的扣费,请尽快完成授权",btn:"支付授权",success:"授权成功",error:"授权失败"},overdraftProtection:{title:"订阅守护",setting:"配置订阅守护",learnMore:"点击了解更多关于订阅守护",tip:"为避免因扣费失败中断服务,您可以通过质押开启订阅守护。按时付款不会收取额外费用,请及时付清账单,若可用质押不足或者超期未付,我们将从质押中扣除并收取服务费",enabled:"已启用",disabled:"未启用",returnRemaining:"退还剩余质押",returnRemainingTip:"退还剩余质押后,订阅守护服务将自动关闭,请确认操作。",applyRemainingSuccess:"质押退还申请成功",remaining:"您当前剩余可用质押:{amount} {symbol}, 每周期预计需质押:{estimateAmount} {symbol}。",noRemaining:"当前无质押,为确保订阅守护服务的正常使用,请至少质押 {estimateAmount} {symbol}。",remainingNotEnough:"当前存在未支付的账单,总计 {due} {symbol},如果不支付,您当前剩余质押将无法覆盖下期账单,剩余可用质押:{unused} {symbol},请质押至少 {min} {symbol}。",due:"请先支付欠款",insufficient:"额度不足,下期账单将无法使用订阅守护服务, 请添加额度",insufficientTip:"订阅守护服务额度不足,请尽快质押保证订阅守护服务的正常使用。",intervals:"个周期",estimatedDuration:"预计可用 {duration} {unit}",rule:"规则:N * ( P + Fee )",ruleTip:"N 为周期数, P 为订阅账单费用, Fee 为订阅守护服务费用,单次费用为 {gas} {symbol}",min:"质押金额不得小于 {min} {symbol}",settingSuccess:"配置更新成功",settingError:"配置更新失败",openSuccess:"订阅守护已开启",closeSuccess:"订阅守护已关闭",keepStake:"不退还质押",returnStake:"退还剩余质押",stake:"质押",address:"质押账户",total:"总质押:{total} {symbol},",disableConfirm:"您当前有未支付的账单,请先付清账单。",open:"开启订阅守护",payerAddress:"付款账户",stakingAddress:"质押地址"},unpaidInvoicesWarning:"您当前有未支付的账单,请先付清账单。",unpaidInvoicesWarningTip:"您当前有未支付的账单,请及时付清。",pendingAmountWarningTip:"您有 {amount} {symbol} 的使用费用因额度不足无法处理,请及时充值。",invoice:{relatedInvoice:"关联账单",donation:"打赏记录",creditsInfo:"总共包含 {amount}",appliedDiscounts:"已应用优惠",priceChanged:"汇率已变动 {percent}%。支付金额将会更新,是否继续?",paymentCancelled:"支付已取消",paymentMethodChanged:"支付方式已更换",priceChangeTitle:"价格已变动",priceChangeDescription:"汇率{direction}了 {percent}%,支付金额将会更新。",currentPaymentMethod:"当前支付方式",otherPaymentMethods:"或使用其他方式支付",confirmAndPay:"确认并支付",switchAndPay:"切换并支付",current:"当前"},payout:{empty:"没有收款记录",payer:"付款方",receiver:"收款方",payTxHash:"交易详情",viewReference:"查看打赏原文",title:"收款记录"},pastDue:{warning:"您有欠费账单,请及时付款以保持服务正常运行",invoices:"欠费账单",payNow:"立即付款",alert:"您有欠费账单需要处理,请及时付款以避免服务中断",title:"结清欠费账单"},quote:{title:"价格锁定记录",noQuotes:"此账单没有价格锁定记录",id:"报价 ID",pricingDetails:"定价详情",baseAmount:"基础金额",exchangeRate:"汇率",consensusMethod:"汇率算法",referenceRate:"参考汇率:1 {symbol} ≈ ${rate}",quotedAmount:"锁定金额",providerInfo:"汇率来源",provider:"数据源",rateTimestamp:"汇率时间",slippage:"滑点",lifecycle:"生命周期",expiresAt:"过期时间",riskInfo:"风险信息",deviation:"价格偏差",anomalyDetected:"检测到异常",degraded:"降级",status:{active:"活跃",used:"已使用",paid:"已支付",expired:"已过期",cancelled:"已取消",failed:"失败"}}},integrations:{description:"用于配置和管理 Payment Kit 与你应用之间的集成方式。",basicFeatures:"基础功能",advancedFeatures:"高级功能",features:{products:{title:"创建产品",intro:"创建和管理您的产品或服务"},paymentLinks:{title:"支付链接",intro:"创建可分享的支付链接,快速完成收款"},pricingTables:{title:"定价表",intro:"为您的产品创建美观的定价表"},metering:{title:"计量与额度",intro:"使用计量器跟踪用量,并通过额度套餐售卖 Credits",dialog:{title:"如何开启 Credit 计费",description:"Credit 计费模式让您可以跟踪用量并基于消费向客户收费。按照以下步骤开始配置:",steps:{step1:{title:"创建计量器用于跟踪用量事件",description:"设置计量器来监控 API 调用、数据使用量或应用中任何可测量的活动。"},step2:{title:"创建 Credits 购买套餐和定价",description:"定义客户可以购买的额度套餐,支持灵活的定价模式和有效期设置。"},step3:{title:"创建支付链接并分享给用户",description:"生成可分享的支付链接,让客户轻松购买额度套餐。"},step4:{title:"集成并上报 Credits 用量",description:"使用我们的 SDK 上报使用事件,自动从客户余额中扣除额度。"}},docText:"查看 Credit 计费指南"}},promotions:{title:"促销与优惠",intro:"创建优惠券与促销码,提升转化率"},donate:{title:"打赏功能",intro:"使用 <CheckoutDonate /> 组件为应用添加打赏按钮"},paymentMethods:{title:"支付方式",intro:"配置多种支付方式和货币支持"},api:{title:"API 集成",intro:"使用我们的 JavaScript SDK 实现自定义解决方案",link:"https://www.npmjs.com/package/@blocklet/payment-js"}},viewDocs:"查看文档"}}),kD=RE({zh:NE,en:ME},O0),BE=z0({fallbackLocale:"en"},kD),Ww=BE,ga=window.blocklet?.cloudflareWorker?kE:wE,UE=Ne.lazy(()=>Ht(()=>import("./home-_eX1aim8.js"),[])),OE=Ne.lazy(()=>Ht(()=>import("./index-EXZPddtw.js"),[])),no=Ne.lazy(()=>Ht(()=>import("./index-BBHMsIxJ.js"),[])),zE=Ne.lazy(()=>Ht(()=>import("./index-Kd_qCyRG.js"),[])),PE=Ne.lazy(()=>Ht(()=>import("./detail-C1FupF1D.js"),[])),qE=Ne.lazy(()=>Ht(()=>import("./past-due-CUXkxns0.js"),[])),LE=Ne.lazy(()=>Ht(()=>import("./detail-B8eOBVSQ.js"),[])),a0=Ne.lazy(()=>Ht(()=>import("./embed-rRKjDoHi.js"),[])),IE=Ne.lazy(()=>Ht(()=>import("./change-plan-C47wfWH8.js"),[])),$E=Ne.lazy(()=>Ht(()=>import("./change-payment-gAlRmJpv.js"),[])),VE=Ne.lazy(()=>Ht(()=>import("./detail-BO3zglCn.js"),[])),HE=Ne.lazy(()=>Ht(()=>import("./detail-wU4wNf4s.js"),[])),YE=Ne.lazy(()=>Ht(()=>import("./subscription-BYz_k9dq.js"),[])),GE=Ne.lazy(()=>Ht(()=>import("./detail-CMBRd4Ct.js"),[])),Rl=Ne.lazy(()=>Ht(()=>import("./index-BRENdB5m.js"),[])),KE=Ne.lazy(()=>Ht(()=>import("./account-Clbqiiw3.js"),[]));function QE(){const a=ds();V.useEffect(()=>{const r=o=>{if(o.button!==0||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey)return;const s=o.target?.closest("a");if(!s)return;const f=s.getAttribute("href");if(!f||s.target&&s.target!==""&&s.target!=="_self"||s.hasAttribute("download")||/^[a-z]+:/i.test(f)&&!/^https?:/i.test(f)||f.startsWith("#"))return;let m;try{m=new URL(f,window.location.href)}catch{return}if(m.origin!==window.location.origin)return;o.preventDefault();const c=window?.blocklet?.prefix||"/";let h=m.pathname+m.search+m.hash;c!=="/"&&h.startsWith(c.replace(/\/$/,""))&&(h=h.slice(c.replace(/\/$/,"").length)||"/"),a(h)};return document.addEventListener("click",r),()=>document.removeEventListener("click",r)},[a])}function ZE(){return QE(),u.jsx(FE,{children:u.jsx(mC,{FallbackComponent:SE,onReset:()=>window.location.reload(),children:u.jsx(V.Suspense,{fallback:u.jsx(x0,{children:u.jsx(gr,{})}),children:u.jsxs(aC,{children:[u.jsx(jt,{path:"/",element:u.jsx(UE,{})}),u.jsx(jt,{path:"/checkout/:action/:id",element:u.jsx(OE,{})}),u.jsx(jt,{path:"/admin",element:u.jsx(no,{})},"admin-index"),",",u.jsx(jt,{path:"/admin/:group",element:u.jsx(no,{})},"admin-tabs"),",",u.jsx(jt,{path:"/admin/:group/:page",element:u.jsx(no,{})},"admin-sub"),",",u.jsx(jt,{path:"/admin/:group/:page/:id",element:u.jsx(no,{})},"admin-detail"),",",u.jsx(jt,{path:"/admin/:group/:page/:subpage/:id",element:u.jsx(no,{})},"admin-nested"),",",u.jsx(jt,{path:"/admin/*",element:u.jsx(no,{})},"admin-fallback"),",",u.jsx(jt,{path:"/integrations",element:u.jsx(Rl,{})},"integrations-index"),u.jsx(jt,{path:"/integrations/:group",element:u.jsx(Rl,{})},"integrations-tabs"),u.jsx(jt,{path:"/integrations/:group/:page",element:u.jsx(Rl,{})},"integrations-sub"),u.jsx(jt,{path:"/integrations/*",element:u.jsx(Rl,{})},"integrations-fallback"),u.jsx(jt,{path:"/customer",element:u.jsx(ga,{children:u.jsx(zE,{})})},"customer-home"),u.jsx(jt,{path:"/customer/subscription/:id",element:u.jsx(ga,{children:u.jsx(LE,{})})},"customer-subscription"),u.jsx(jt,{path:"/customer/subscription/:id/change-plan",element:u.jsx(ga,{children:u.jsx(IE,{})})},"customer-subscription-change-plan"),u.jsx(jt,{path:"/customer/subscription/:id/change-payment",element:u.jsx(ga,{children:u.jsx($E,{})})},"customer-subscription-change-payment"),u.jsx(jt,{path:"/customer/subscription/:id/recharge",element:u.jsx(ga,{children:u.jsx(YE,{})})},"customer-recharge"),u.jsx(jt,{path:"/customer/recharge/:currencyId",element:u.jsx(ga,{children:u.jsx(KE,{})})},"customer-balance-recharge"),u.jsx(jt,{path:"/customer/embed/subscription",element:u.jsx(a0,{})},"customer-embed"),u.jsx(jt,{path:"/embed/customer/subscription",element:u.jsx(a0,{})},"subscription-embed"),u.jsx(jt,{path:"/customer/invoice/past-due",element:u.jsx(ga,{children:u.jsx(qE,{})})},"customer-due"),u.jsx(jt,{path:"/customer/invoice/:id",element:u.jsx(ga,{children:u.jsx(PE,{})})},"customer-invoice"),u.jsx(jt,{path:"/customer/payout/:id",element:u.jsx(ga,{children:u.jsx(GE,{})})},"customer-payout"),u.jsx(jt,{path:"/customer/credit-grant/:id",element:u.jsx(ga,{children:u.jsx(VE,{})})},"customer-credit-grant"),u.jsx(jt,{path:"/customer/credit-transaction/:id",element:u.jsx(ga,{children:u.jsx(HE,{})})},"customer-credit-transaction"),u.jsx(jt,{path:"/customer/*",element:u.jsx(Zy,{to:"/customer"})},"customer-fallback"),",",u.jsx(jt,{path:"*",element:u.jsx(Zy,{to:"/"})})]})})})})}const XE=Jx(ZE);function WE(){const a=window?.blocklet?.prefix||"/";return DD(),u.jsx(dC,{translations:kD,fallbackLocale:"en",children:u.jsx(eC,{children:u.jsx(vA,{children:u.jsx(AE,{serviceHost:_E(a),useSocket:!window.blocklet?.cloudflareWorker,protectedRoutes:["/admin/*","/customer/*","/integrations/*"].map(r=>Dt(a,r)),children:u.jsx(nC,{basename:a,children:u.jsx(XE,{})})})})})})}const JE=uC.createRoot(document.getElementById("app"));JE.render(u.jsx(WE,{}));export{M_ as $,Mw as A,bD as B,Yl as C,Lf as D,hs as E,K0 as F,jg as G,mw as H,Ul as I,dw as J,aw as K,hr as L,CS as M,gw as N,Gg as O,sD as P,yA as Q,Vf as R,Zg as S,tm as T,tu as U,AS as V,RS as W,ba as X,au as Y,US as Z,N_ as _,_n as a,ns as a$,fD as a0,lD as a1,UA as a2,dr as a3,BS as a4,uA as a5,uw as a6,vw as a7,Ja as a8,I0 as a9,wf as aA,Lw as aB,xS as aC,e0 as aD,Qg as aE,Kg as aF,pw as aG,vA as aH,Gw as aI,Aw as aJ,_w as aK,tA as aL,kw as aM,iu as aN,nu as aO,Rn as aP,rw as aQ,un as aR,zi as aS,X_ as aT,dA as aU,Il as aV,Nn as aW,Xa as aX,ii as aY,fr as aZ,Rw as a_,Bi as aa,Wa as ab,Nl as ac,J1 as ad,Nw as ae,Bw as af,nE as ag,aE as ah,rE as ai,oE as aj,sE as ak,Uw as al,iE as am,Ow as an,zw as ao,Pw as ap,Iw as aq,AD as ar,qw as as,Yf as at,Vw as au,$w as av,Hw as aw,Yw as ax,kl as ay,dD as az,Xw as b,ow as b0,hw as b1,Ww as b2,jS as b3,cw as b4,yw as b5,If as b6,Cw as b7,aD as b8,iD as b9,rD as ba,xw as bb,Tw as bc,lw as bd,Hg as be,O_ as bf,U_ as bg,Tf as bh,RE as bi,lC as bj,bw as bk,Zw as c,qi as d,ot as e,kg as f,fw as g,nD as h,Ui as i,SS as j,Pt as k,Qn as l,jw as m,Oi as n,sw as o,Fw as p,ln as q,em as r,Vl as s,NS as t,wD as u,Ca as v,bA as w,Hf as x,iw as y,Dw as z};