@anker-in/campaign-ui 0.2.0-beta.1 → 0.2.0-beta.10

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 (156) hide show
  1. package/dist/cjs/components/credits/context/provider.d.ts +2 -2
  2. package/dist/cjs/components/credits/context/provider.js +1 -1
  3. package/dist/cjs/components/credits/context/provider.js.map +3 -3
  4. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +1 -1
  5. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +3 -3
  6. package/dist/cjs/components/credits/creditsBenefits/index.js +3 -3
  7. package/dist/cjs/components/credits/creditsBenefits/index.js.map +3 -3
  8. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +1 -1
  9. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +3 -3
  10. package/dist/cjs/components/credits/creditsFaq/index.js +1 -1
  11. package/dist/cjs/components/credits/creditsFaq/index.js.map +3 -3
  12. package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +0 -2
  13. package/dist/cjs/components/credits/creditsInfoCard/index.js +1 -1
  14. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +3 -3
  15. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
  16. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
  17. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
  18. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
  19. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
  20. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +2 -2
  21. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
  22. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +2 -2
  23. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  24. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
  25. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  26. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
  27. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  28. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
  29. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  30. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +2 -2
  31. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
  32. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +3 -3
  33. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
  34. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +2 -2
  35. package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
  36. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +2 -2
  37. package/dist/cjs/components/credits/modal/activitiesModal.js +1 -1
  38. package/dist/cjs/components/credits/modal/activitiesModal.js.map +2 -2
  39. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  40. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  41. package/dist/cjs/components/credits/modal/modalContainer.js +1 -1
  42. package/dist/cjs/components/credits/modal/modalContainer.js.map +3 -3
  43. package/dist/cjs/components/credits/modal/subscribeModal.js +1 -1
  44. package/dist/cjs/components/credits/modal/subscribeModal.js.map +3 -3
  45. package/dist/cjs/components/credits/modal/tip.js +1 -1
  46. package/dist/cjs/components/credits/modal/tip.js.map +3 -3
  47. package/dist/cjs/components/credits/type.d.ts +3 -2
  48. package/dist/cjs/components/credits/type.js +1 -1
  49. package/dist/cjs/components/credits/type.js.map +1 -1
  50. package/dist/cjs/components/registration/authCodeActivate/Message.js +1 -1
  51. package/dist/cjs/components/registration/authCodeActivate/Message.js.map +2 -2
  52. package/dist/cjs/components/registration/authCodeActivate/index.js +1 -1
  53. package/dist/cjs/components/registration/authCodeActivate/index.js.map +3 -3
  54. package/dist/cjs/components/registration/authCodeActivate/type.d.ts +0 -1
  55. package/dist/cjs/components/registration/authCodeActivate/type.js.map +1 -1
  56. package/dist/cjs/components/registration/context/provider.d.ts +2 -0
  57. package/dist/cjs/components/registration/context/provider.js +1 -1
  58. package/dist/cjs/components/registration/context/provider.js.map +3 -3
  59. package/dist/cjs/components/registration/modalContainer.d.ts +1 -2
  60. package/dist/cjs/components/registration/modalContainer.js +1 -1
  61. package/dist/cjs/components/registration/modalContainer.js.map +3 -3
  62. package/dist/cjs/templates/credits.d.ts +9 -8
  63. package/dist/cjs/templates/credits.js +1 -1
  64. package/dist/cjs/templates/credits.js.map +3 -3
  65. package/dist/esm/components/credits/context/provider.d.ts +2 -2
  66. package/dist/esm/components/credits/context/provider.js +1 -1
  67. package/dist/esm/components/credits/context/provider.js.map +3 -3
  68. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +1 -1
  69. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +3 -3
  70. package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
  71. package/dist/esm/components/credits/creditsBenefits/index.js.map +3 -3
  72. package/dist/esm/components/credits/creditsCash/CreditsCash.js +1 -1
  73. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +3 -3
  74. package/dist/esm/components/credits/creditsFaq/index.js +1 -1
  75. package/dist/esm/components/credits/creditsFaq/index.js.map +3 -3
  76. package/dist/esm/components/credits/creditsInfoCard/index.d.ts +0 -2
  77. package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
  78. package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
  79. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
  80. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
  81. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
  82. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
  83. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
  84. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
  85. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
  86. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
  87. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  88. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
  89. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  90. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
  91. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  92. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
  93. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  94. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
  95. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
  96. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +3 -3
  97. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
  98. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +2 -2
  99. package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
  100. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
  101. package/dist/esm/components/credits/modal/activitiesModal.js +1 -1
  102. package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
  103. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  104. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  105. package/dist/esm/components/credits/modal/modalContainer.js +1 -1
  106. package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
  107. package/dist/esm/components/credits/modal/subscribeModal.js +1 -1
  108. package/dist/esm/components/credits/modal/subscribeModal.js.map +3 -3
  109. package/dist/esm/components/credits/modal/tip.js +1 -1
  110. package/dist/esm/components/credits/modal/tip.js.map +3 -3
  111. package/dist/esm/components/credits/type.d.ts +3 -2
  112. package/dist/esm/components/registration/authCodeActivate/Message.js +1 -1
  113. package/dist/esm/components/registration/authCodeActivate/Message.js.map +2 -2
  114. package/dist/esm/components/registration/authCodeActivate/index.js +1 -1
  115. package/dist/esm/components/registration/authCodeActivate/index.js.map +3 -3
  116. package/dist/esm/components/registration/authCodeActivate/type.d.ts +0 -1
  117. package/dist/esm/components/registration/context/provider.d.ts +2 -0
  118. package/dist/esm/components/registration/context/provider.js +1 -1
  119. package/dist/esm/components/registration/context/provider.js.map +3 -3
  120. package/dist/esm/components/registration/modalContainer.d.ts +1 -2
  121. package/dist/esm/components/registration/modalContainer.js +1 -1
  122. package/dist/esm/components/registration/modalContainer.js.map +3 -3
  123. package/dist/esm/templates/credits.d.ts +9 -8
  124. package/dist/esm/templates/credits.js +1 -1
  125. package/dist/esm/templates/credits.js.map +3 -3
  126. package/package.json +3 -3
  127. package/src/components/credits/context/provider.tsx +1 -4
  128. package/src/components/credits/creditsBenefits/benefitItem.tsx +2 -5
  129. package/src/components/credits/creditsBenefits/index.tsx +1 -4
  130. package/src/components/credits/creditsCash/CreditsCash.tsx +3 -6
  131. package/src/components/credits/creditsFaq/index.tsx +2 -3
  132. package/src/components/credits/creditsInfoCard/index.tsx +10 -12
  133. package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +3 -4
  134. package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +2 -3
  135. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +2 -3
  136. package/src/components/credits/creditsRedeemList/CreditsRedeemList.tsx +2 -4
  137. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +2 -3
  138. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +6 -4
  139. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +2 -3
  140. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +2 -3
  141. package/src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.tsx +5 -3
  142. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +4 -1
  143. package/src/components/credits/modal/MyRewardsModal.tsx +2 -3
  144. package/src/components/credits/modal/activitiesModal.tsx +2 -3
  145. package/src/components/credits/modal/creditsUploadReceiptModal.tsx +2 -3
  146. package/src/components/credits/modal/modalContainer.tsx +2 -3
  147. package/src/components/credits/modal/subscribeModal.tsx +9 -32
  148. package/src/components/credits/modal/tip.tsx +2 -3
  149. package/src/components/credits/type.ts +3 -2
  150. package/src/components/registration/authCodeActivate/Message.tsx +1 -1
  151. package/src/components/registration/authCodeActivate/index.tsx +141 -109
  152. package/src/components/registration/authCodeActivate/type.ts +0 -1
  153. package/src/components/registration/context/provider.tsx +9 -0
  154. package/src/components/registration/modalContainer.tsx +9 -7
  155. package/src/templates/credits.tsx +41 -31
  156. package/src/components/credits/const.ts +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";var u=Object.create;var n=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var h=(e,o)=>{for(var t in o)n(e,t,{get:o[t],enumerable:!0})},d=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of c(o))!C.call(e,p)&&p!==t&&n(e,p,{get:()=>o[p],enumerable:!(s=m(o,p))||s.enumerable});return e};var v=(e,o,t)=>(t=e!=null?u(g(e)):{},d(o||!e||!e.__esModule?n(t,"default",{value:e,enumerable:!0}):t,e)),w=e=>d(n({},"__esModule",{value:!0}),e);var y={};h(y,{default:()=>k});module.exports=w(y);var r=require("react/jsx-runtime"),i=require("@anker-in/lib"),a=v(require("classnames")),x=require("react"),b=require("../const");function N({info:e,index:o}){const[t,s]=(0,x.useState)(!1),{brand:p}=(0,i.useHeadlessContext)(),f=b.roundedBrands.includes(p);return(0,r.jsxs)("div",{className:"relative ml-[6px] cursor-pointer",onClick:()=>{s(!t)},role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&l.preventDefault()},onMouseOver:()=>{s(!0)},onFocus:()=>{s(!0)},onMouseLeave:()=>{s(!1)},onBlur:()=>{s(!1)},children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:(0,r.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18ZM9.765 10.7118H8.316C8.316 9.71658 8.95624 9.11788 9.5487 8.56386C10.0589 8.08679 10.5336 7.64285 10.5336 7.0074C10.5336 6.2766 9.9918 5.9112 9.1854 5.9112C8.3916 5.9112 7.7994 6.327 7.5474 7.0704L6.3 6.3648C6.7788 5.13 7.938 4.5 9.2232 4.5C10.6218 4.5 11.9826 5.3316 11.9826 6.9192C11.9826 7.95842 11.3297 8.58584 10.7324 9.15979C10.2289 9.64359 9.765 10.0894 9.765 10.7118ZM9.9918 12.69C9.9918 13.2066 9.5634 13.635 9.0468 13.635C8.5176 13.635 8.1018 13.2066 8.1018 12.69C8.1018 12.1608 8.5176 11.745 9.0468 11.745C9.5634 11.745 9.9918 12.1608 9.9918 12.69Z",fill:"#999999"})}),(0,r.jsxs)("div",{className:(0,a.default)("absolute -right-[14px] hidden min-w-[300px] shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",o===0?"top-[33px]":"bottom-[33px]",t&&"!block"),children:[(0,r.jsx)("i",{className:"absolute right-[8px] blur-[12px]",style:o===0?{top:"-9px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderBottom:"8px solid rgba(0,0,0,0.12)"}:{bottom:"-9px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderTop:"8px solid rgba(0,0,0,0.12)"}}),(0,r.jsx)("i",{className:"absolute right-[8px]",style:o===0?{top:"-7px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderBottom:"8px solid #fff "}:{bottom:"-7px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderTop:"8px solid #fff "}}),(0,r.jsx)("p",{className:(0,a.default)("relative block rounded-[4px] bg-white px-[14px] py-[12px]",!f&&"rounded-none"),children:(0,r.jsx)("span",{className:"block text-left text-[14px] font-semibold leading-[1.4] text-[#333]",children:e})})]})]})}var k=N;
1
+ "use strict";var f=Object.create;var l=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var C=(e,o)=>{for(var t in o)l(e,t,{get:o[t],enumerable:!0})},d=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of m(o))!g.call(e,p)&&p!==t&&l(e,p,{get:()=>o[p],enumerable:!(s=u(o,p))||s.enumerable});return e};var h=(e,o,t)=>(t=e!=null?f(c(e)):{},d(o||!e||!e.__esModule?l(t,"default",{value:e,enumerable:!0}):t,e)),v=e=>d(l({},"__esModule",{value:!0}),e);var k={};C(k,{default:()=>N});module.exports=v(k);var r=require("react/jsx-runtime"),n=require("@anker-in/lib"),i=h(require("classnames")),x=require("react");function w({info:e,index:o}){const[t,s]=(0,x.useState)(!1),{brand:p}=(0,n.useHeadlessContext)(),b=n.ROUNDED_BRANDS.includes(p);return(0,r.jsxs)("div",{className:"relative ml-[6px] cursor-pointer",onClick:()=>{s(!t)},role:"button",tabIndex:0,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&a.preventDefault()},onMouseOver:()=>{s(!0)},onFocus:()=>{s(!0)},onMouseLeave:()=>{s(!1)},onBlur:()=>{s(!1)},children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:(0,r.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18ZM9.765 10.7118H8.316C8.316 9.71658 8.95624 9.11788 9.5487 8.56386C10.0589 8.08679 10.5336 7.64285 10.5336 7.0074C10.5336 6.2766 9.9918 5.9112 9.1854 5.9112C8.3916 5.9112 7.7994 6.327 7.5474 7.0704L6.3 6.3648C6.7788 5.13 7.938 4.5 9.2232 4.5C10.6218 4.5 11.9826 5.3316 11.9826 6.9192C11.9826 7.95842 11.3297 8.58584 10.7324 9.15979C10.2289 9.64359 9.765 10.0894 9.765 10.7118ZM9.9918 12.69C9.9918 13.2066 9.5634 13.635 9.0468 13.635C8.5176 13.635 8.1018 13.2066 8.1018 12.69C8.1018 12.1608 8.5176 11.745 9.0468 11.745C9.5634 11.745 9.9918 12.1608 9.9918 12.69Z",fill:"#999999"})}),(0,r.jsxs)("div",{className:(0,i.default)("absolute -right-[14px] hidden min-w-[300px] shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",o===0?"top-[33px]":"bottom-[33px]",t&&"!block"),children:[(0,r.jsx)("i",{className:"absolute right-[8px] blur-[12px]",style:o===0?{top:"-9px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderBottom:"8px solid rgba(0,0,0,0.12)"}:{bottom:"-9px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderTop:"8px solid rgba(0,0,0,0.12)"}}),(0,r.jsx)("i",{className:"absolute right-[8px]",style:o===0?{top:"-7px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderBottom:"8px solid #fff "}:{bottom:"-7px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderTop:"8px solid #fff "}}),(0,r.jsx)("p",{className:(0,i.default)("relative block rounded-[4px] bg-white px-[14px] py-[12px]",!b&&"rounded-none"),children:(0,r.jsx)("span",{className:"block text-left text-[14px] font-semibold leading-[1.4] text-[#333]",children:e})})]})]})}var N=w;
2
2
  //# sourceMappingURL=tip.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/modal/tip.tsx"],
4
- "sourcesContent": ["import { useHeadlessContext } from '@anker-in/lib'\nimport classNames from 'classnames'\nimport { useState } from 'react'\nimport { roundedBrands } from '../const'\n\nfunction Tip({ info, index }: { info: string; index: number }) {\n const [show, setShow] = useState(false)\n\n const { brand } = useHeadlessContext()\n const rounded = roundedBrands.includes(brand)\n\n return (\n <div\n className=\"relative ml-[6px] cursor-pointer\"\n onClick={() => {\n setShow(!show)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n onMouseOver={() => {\n setShow(true)\n }}\n onFocus={() => {\n setShow(true)\n }}\n onMouseLeave={() => {\n setShow(false)\n }}\n onBlur={() => {\n setShow(false)\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18ZM9.765 10.7118H8.316C8.316 9.71658 8.95624 9.11788 9.5487 8.56386C10.0589 8.08679 10.5336 7.64285 10.5336 7.0074C10.5336 6.2766 9.9918 5.9112 9.1854 5.9112C8.3916 5.9112 7.7994 6.327 7.5474 7.0704L6.3 6.3648C6.7788 5.13 7.938 4.5 9.2232 4.5C10.6218 4.5 11.9826 5.3316 11.9826 6.9192C11.9826 7.95842 11.3297 8.58584 10.7324 9.15979C10.2289 9.64359 9.765 10.0894 9.765 10.7118ZM9.9918 12.69C9.9918 13.2066 9.5634 13.635 9.0468 13.635C8.5176 13.635 8.1018 13.2066 8.1018 12.69C8.1018 12.1608 8.5176 11.745 9.0468 11.745C9.5634 11.745 9.9918 12.1608 9.9918 12.69Z\"\n fill=\"#999999\"\n />\n </svg>\n <div\n className={classNames(\n 'absolute -right-[14px] hidden min-w-[300px] shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]',\n index === 0 ? 'top-[33px]' : 'bottom-[33px]',\n show && '!block'\n )}\n >\n <i\n className=\"absolute right-[8px] blur-[12px]\"\n style={\n index === 0\n ? {\n top: '-9px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderBottom: '8px solid rgba(0,0,0,0.12)',\n }\n : {\n bottom: '-9px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderTop: '8px solid rgba(0,0,0,0.12)',\n }\n }\n ></i>\n <i\n className=\"absolute right-[8px]\"\n style={\n index === 0\n ? {\n top: '-7px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderBottom: '8px solid #fff ',\n }\n : {\n bottom: '-7px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderTop: '8px solid #fff ',\n }\n }\n ></i>\n <p\n className={classNames(\n 'relative block rounded-[4px] bg-white px-[14px] py-[12px]',\n !rounded && 'rounded-none'\n )}\n >\n <span className=\"block text-left text-[14px] font-semibold leading-[1.4] text-[#333]\">{info}</span>\n </p>\n </div>\n </div>\n )\n}\n\nexport default Tip\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsCQ,IAAAI,EAAA,6BAtCRC,EAAmC,yBACnCC,EAAuB,yBACvBC,EAAyB,iBACzBC,EAA8B,oBAE9B,SAASC,EAAI,CAAE,KAAAC,E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"__toCommonJS", "import_jsx_runtime", "import_lib", "import_classnames", "import_react", "import_const", "Tip", "info", "index", "show", "setShow", "brand", "rounded", "e", "classNames"]
4
+ "sourcesContent": ["import { useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'\nimport classNames from 'classnames'\nimport { useState } from 'react'\n\nfunction Tip({ info, index }: { info: string; index: number }) {\n const [show, setShow] = useState(false)\n\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n return (\n <div\n className=\"relative ml-[6px] cursor-pointer\"\n onClick={() => {\n setShow(!show)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n onMouseOver={() => {\n setShow(true)\n }}\n onFocus={() => {\n setShow(true)\n }}\n onMouseLeave={() => {\n setShow(false)\n }}\n onBlur={() => {\n setShow(false)\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18ZM9.765 10.7118H8.316C8.316 9.71658 8.95624 9.11788 9.5487 8.56386C10.0589 8.08679 10.5336 7.64285 10.5336 7.0074C10.5336 6.2766 9.9918 5.9112 9.1854 5.9112C8.3916 5.9112 7.7994 6.327 7.5474 7.0704L6.3 6.3648C6.7788 5.13 7.938 4.5 9.2232 4.5C10.6218 4.5 11.9826 5.3316 11.9826 6.9192C11.9826 7.95842 11.3297 8.58584 10.7324 9.15979C10.2289 9.64359 9.765 10.0894 9.765 10.7118ZM9.9918 12.69C9.9918 13.2066 9.5634 13.635 9.0468 13.635C8.5176 13.635 8.1018 13.2066 8.1018 12.69C8.1018 12.1608 8.5176 11.745 9.0468 11.745C9.5634 11.745 9.9918 12.1608 9.9918 12.69Z\"\n fill=\"#999999\"\n />\n </svg>\n <div\n className={classNames(\n 'absolute -right-[14px] hidden min-w-[300px] shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]',\n index === 0 ? 'top-[33px]' : 'bottom-[33px]',\n show && '!block'\n )}\n >\n <i\n className=\"absolute right-[8px] blur-[12px]\"\n style={\n index === 0\n ? {\n top: '-9px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderBottom: '8px solid rgba(0,0,0,0.12)',\n }\n : {\n bottom: '-9px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderTop: '8px solid rgba(0,0,0,0.12)',\n }\n }\n ></i>\n <i\n className=\"absolute right-[8px]\"\n style={\n index === 0\n ? {\n top: '-7px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderBottom: '8px solid #fff ',\n }\n : {\n bottom: '-7px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderTop: '8px solid #fff ',\n }\n }\n ></i>\n <p\n className={classNames(\n 'relative block rounded-[4px] bg-white px-[14px] py-[12px]',\n !rounded && 'rounded-none'\n )}\n >\n <span className=\"block text-left text-[14px] font-semibold leading-[1.4] text-[#333]\">{info}</span>\n </p>\n </div>\n </div>\n )\n}\n\nexport default Tip\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqCQ,IAAAI,EAAA,6BArCRC,EAAmD,yBACnDC,EAAuB,yBACvBC,EAAyB,iBAEzB,SAASC,EAAI,CAAE,KAAAC,EAAM,MAAAC,CAAM,EAAoC,CAC7D,KAAM,CAACC,EAAMC,CAAO,KAAI,YAAS,EAAK,EAEhC,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,iBAAe,SAASD,CAAK,EAE7C,SACE,QAAC,OACC,UAAU,mCACV,QAAS,IAAM,CACbD,EAAQ,CAACD,CAAI,CACf,EACA,KAAK,SACL,SAAU,EACV,UAAWI,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EACA,YAAa,IAAM,CACjBH,EAAQ,EAAI,CACd,EACA,QAAS,IAAM,CACbA,EAAQ,EAAI,CACd,EACA,aAAc,IAAM,CAClBA,EAAQ,EAAK,CACf,EACA,OAAQ,IAAM,CACZA,EAAQ,EAAK,CACf,EAEA,oBAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OACtF,mBAAC,QACC,YAAU,UACV,YAAU,UACV,EAAE,8pBACF,KAAK,UACP,EACF,KACA,QAAC,OACC,aAAW,EAAAI,SACT,yFACAN,IAAU,EAAI,aAAe,gBAC7BC,GAAQ,QACV,EAEA,oBAAC,KACC,UAAU,mCACV,MACED,IAAU,EACN,CACE,IAAK,OACL,YAAa,0BACb,WAAY,0BACZ,aAAc,4BAChB,EACA,CACE,OAAQ,OACR,YAAa,0BACb,WAAY,0BACZ,UAAW,4BACb,EAEP,KACD,OAAC,KACC,UAAU,uBACV,MACEA,IAAU,EACN,CACE,IAAK,OACL,YAAa,0BACb,WAAY,0BACZ,aAAc,iBAChB,EACA,CACE,OAAQ,OACR,YAAa,0BACb,WAAY,0BACZ,UAAW,iBACb,EAEP,KACD,OAAC,KACC,aAAW,EAAAM,SACT,4DACA,CAACF,GAAW,cACd,EAEA,mBAAC,QAAK,UAAU,sEAAuE,SAAAL,EAAK,EAC9F,GACF,GACF,CAEJ,CAEA,IAAOP,EAAQM",
6
+ "names": ["tip_exports", "__export", "tip_default", "__toCommonJS", "import_jsx_runtime", "import_lib", "import_classnames", "import_react", "Tip", "info", "index", "show", "setShow", "brand", "rounded", "e", "classNames"]
7
7
  }
@@ -47,6 +47,7 @@ export interface ShippingZone {
47
47
  }
48
48
  export type CreditsPageCommon = {
49
49
  pointUnit?: string;
50
+ infoIcon?: string;
50
51
  ruleLabel?: string;
51
52
  soldOut?: string;
52
53
  copied?: string;
@@ -58,8 +59,8 @@ export type CreditsPageCommon = {
58
59
  url: string;
59
60
  };
60
61
  };
61
- activities?: MyActivitiesMetafields;
62
- rewards?: MyRewardsMetafields;
62
+ activitiesModal?: MyActivitiesMetafields;
63
+ rewardsModal?: MyRewardsMetafields;
63
64
  validatorInfo?: {
64
65
  addressInfo: {
65
66
  name: string;
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var g=(i,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!p.call(i,t)&&t!==s&&n(i,t,{get:()=>e[t],enumerable:!(r=o(e,t))||r.enumerable});return i};var c=i=>g(n({},"__esModule",{value:!0}),i);var d={};module.exports=c(d);
1
+ "use strict";var n=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var p=(i,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!g.call(i,t)&&t!==s&&n(i,t,{get:()=>e[t],enumerable:!(r=o(e,t))||r.enumerable});return i};var d=i=>p(n({},"__esModule",{value:!0}),i);var c={};module.exports=d(c);
2
2
  //# sourceMappingURL=type.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/credits/type.ts"],
4
- "sourcesContent": ["import type { Product, ProductVariant } from '@anker-in/lib'\nimport type { AlpcConsumeType, ConsumeType } from './context/const'\nimport { MyActivitiesMetafields } from './modal/activitiesModal'\nimport { MyRewardsMetafields } from './modal/MyRewardsModal'\n\nexport interface Subscription {\n preference: {\n subscribe: boolean\n brand: string\n }[]\n}\n\nexport type RedeemableItem = {\n config: {\n title: string\n desc: string\n rules: string[]\n image: {\n url: string\n }\n type: ConsumeType\n value: string\n }\n alpc: {\n id: string\n consumeCredits: number\n remainingInventory: number\n isLimited: boolean\n consumeType: AlpcConsumeType\n showCredit: boolean\n title: string\n }\n product: Product\n variant: ProductVariant\n}\n\nexport interface ShippingCountry {\n id: string\n name: string\n code: string\n provinces: {\n id: string\n name: string\n code: string\n }[]\n}\n\nexport interface ShippingZone {\n name: string\n countries: ShippingCountry[]\n}\n\nexport type CreditsPageCommon = {\n pointUnit?: string\n ruleLabel?: string\n soldOut?: string\n copied?: string\n off?: string\n copy?: string\n giftCardLabel?: string\n imageMapping?: {\n [key in ConsumeType]: {\n url: string\n }\n }\n activities?: MyActivitiesMetafields\n rewards?: MyRewardsMetafields\n validatorInfo?: {\n addressInfo: {\n name: string\n country: string\n province: string\n city: string\n address: string\n }\n }\n}\n"],
4
+ "sourcesContent": ["import type { Product, ProductVariant } from '@anker-in/lib'\nimport type { AlpcConsumeType, ConsumeType } from './context/const'\nimport { MyActivitiesMetafields } from './modal/activitiesModal'\nimport { MyRewardsMetafields } from './modal/MyRewardsModal'\n\nexport interface Subscription {\n preference: {\n subscribe: boolean\n brand: string\n }[]\n}\n\nexport type RedeemableItem = {\n config: {\n title: string\n desc: string\n rules: string[]\n image: {\n url: string\n }\n type: ConsumeType\n value: string\n }\n alpc: {\n id: string\n consumeCredits: number\n remainingInventory: number\n isLimited: boolean\n consumeType: AlpcConsumeType\n showCredit: boolean\n title: string\n }\n product: Product\n variant: ProductVariant\n}\n\nexport interface ShippingCountry {\n id: string\n name: string\n code: string\n provinces: {\n id: string\n name: string\n code: string\n }[]\n}\n\nexport interface ShippingZone {\n name: string\n countries: ShippingCountry[]\n}\n\nexport type CreditsPageCommon = {\n pointUnit?: string\n infoIcon?: string\n ruleLabel?: string\n soldOut?: string\n copied?: string\n off?: string\n copy?: string\n giftCardLabel?: string\n imageMapping?: {\n [key in ConsumeType]: {\n url: string\n }\n }\n activitiesModal?: MyActivitiesMetafields\n rewardsModal?: MyRewardsMetafields\n validatorInfo?: {\n addressInfo: {\n name: string\n country: string\n province: string\n city: string\n address: string\n }\n }\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["type_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var s in t)c(e,s,{get:t[s],enumerable:!0})},o=(e,t,s,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of a(t))!n.call(e,l)&&l!==s&&c(e,l,{get:()=>t[l],enumerable:!(h=r(t,l))||h.enumerable});return e};var p=e=>o(c({},"__esModule",{value:!0}),e);var w={};d(w,{Message:()=>g});module.exports=p(w);var i=require("react/jsx-runtime");const g=({status:e,message:t})=>e&&(0,i.jsxs)("div",{className:"absolute left-5 right-5 top-10 flex items-center gap-2 rounded-sm bg-white px-4 py-3 shadow-lg min-md:left-12 min-md:right-12",children:[(0,i.jsxs)("div",{className:"flex-shrink-0",children:[e==="success"&&(0,i.jsx)("span",{className:"inline-block h-5 w-5",children:(0,i.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsxs)("g",{clipPath:"url(#clip0_205_16388)",children:[(0,i.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"#1677FF"}),(0,i.jsx)("path",{d:"M10 16L10 10",stroke:"white",strokeWidth:"2",strokeLinecap:"round"}),(0,i.jsx)("circle",{cx:"10",cy:"6.5",r:"1.5",transform:"rotate(-180 10 6.5)",fill:"white"})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_205_16388",children:(0,i.jsx)("rect",{width:"20",height:"20",fill:"white"})})})]})}),e==="error"&&(0,i.jsx)("span",{className:"inline-block h-5 w-5",children:(0,i.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsxs)("g",{clipPath:"url(#clip0_205_16236)",children:[(0,i.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"#F84D4F"}),(0,i.jsx)("path",{d:"M10 5L10 11",stroke:"white",strokeWidth:"2",strokeLinecap:"round"}),(0,i.jsx)("circle",{cx:"10",cy:"14.5",r:"1.5",fill:"white"})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_205_16236",children:(0,i.jsx)("rect",{width:"20",height:"20",fill:"white"})})})]})})]}),(0,i.jsx)("p",{className:"text-sm font-semibold leading-[120%] text-[#333]",children:t})]});
1
+ "use strict";var c=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var s in t)c(e,s,{get:t[s],enumerable:!0})},o=(e,t,s,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of a(t))!n.call(e,l)&&l!==s&&c(e,l,{get:()=>t[l],enumerable:!(h=r(t,l))||h.enumerable});return e};var p=e=>o(c({},"__esModule",{value:!0}),e);var w={};d(w,{Message:()=>g});module.exports=p(w);var i=require("react/jsx-runtime");const g=({status:e,message:t})=>e&&(0,i.jsxs)("div",{className:"absolute left-5 right-5 top-2 flex items-center gap-2 rounded-sm bg-white px-4 py-3 shadow-lg min-md:left-12 min-md:right-12",children:[(0,i.jsxs)("div",{className:"flex-shrink-0",children:[e==="success"&&(0,i.jsx)("span",{className:"inline-block h-5 w-5",children:(0,i.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsxs)("g",{clipPath:"url(#clip0_205_16388)",children:[(0,i.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"#1677FF"}),(0,i.jsx)("path",{d:"M10 16L10 10",stroke:"white",strokeWidth:"2",strokeLinecap:"round"}),(0,i.jsx)("circle",{cx:"10",cy:"6.5",r:"1.5",transform:"rotate(-180 10 6.5)",fill:"white"})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_205_16388",children:(0,i.jsx)("rect",{width:"20",height:"20",fill:"white"})})})]})}),e==="error"&&(0,i.jsx)("span",{className:"inline-block h-5 w-5",children:(0,i.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsxs)("g",{clipPath:"url(#clip0_205_16236)",children:[(0,i.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"#F84D4F"}),(0,i.jsx)("path",{d:"M10 5L10 11",stroke:"white",strokeWidth:"2",strokeLinecap:"round"}),(0,i.jsx)("circle",{cx:"10",cy:"14.5",r:"1.5",fill:"white"})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_205_16236",children:(0,i.jsx)("rect",{width:"20",height:"20",fill:"white"})})})]})})]}),(0,i.jsx)("p",{className:"text-sm font-semibold leading-[120%] text-[#333]",children:t})]});
2
2
  //# sourceMappingURL=Message.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/registration/authCodeActivate/Message.tsx"],
4
- "sourcesContent": ["export const Message = ({ status, message }: { status: string; message: string }) => {\n return (\n status && (\n <div className=\"absolute left-5 right-5 top-10 flex items-center gap-2 rounded-sm bg-white px-4 py-3 shadow-lg min-md:left-12 min-md:right-12\">\n <div className=\"flex-shrink-0\">\n {status === 'success' && (\n <span className=\"inline-block h-5 w-5\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clipPath=\"url(#clip0_205_16388)\">\n <circle cx=\"10\" cy=\"10\" r=\"10\" fill=\"#1677FF\" />\n <path d=\"M10 16L10 10\" stroke=\"white\" strokeWidth=\"2\" strokeLinecap=\"round\" />\n <circle cx=\"10\" cy=\"6.5\" r=\"1.5\" transform=\"rotate(-180 10 6.5)\" fill=\"white\" />\n </g>\n <defs>\n <clipPath id=\"clip0_205_16388\">\n <rect width=\"20\" height=\"20\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n </span>\n )}\n {status === 'error' && (\n <span className=\"inline-block h-5 w-5\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clipPath=\"url(#clip0_205_16236)\">\n <circle cx=\"10\" cy=\"10\" r=\"10\" fill=\"#F84D4F\" />\n <path d=\"M10 5L10 11\" stroke=\"white\" strokeWidth=\"2\" strokeLinecap=\"round\" />\n <circle cx=\"10\" cy=\"14.5\" r=\"1.5\" fill=\"white\" />\n </g>\n <defs>\n <clipPath id=\"clip0_205_16236\">\n <rect width=\"20\" height=\"20\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n </span>\n )}\n </div>\n <p className=\"text-sm font-semibold leading-[120%] text-[#333]\">{message}</p>\n </div>\n )\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAQgB,IAAAI,EAAA,6BART,MAAMF,EAAU,CAAC,CAAE,OAAAG,EAAQ,QAAAC,CAAQ,IAEtCD,MACE,QAAC,OAAI,UAAU,gIACb,qBAAC,OAAI,UAAU,gBACZ,UAAAA,IAAW,cACV,OAAC,QAAK,UAAU,uBACd,oBAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,qBAAC,KAAE,SAAS,wBACV,oBAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,KAAK,UAAU,KAC9C,OAAC,QAAK,EAAE,eAAe,OAAO,QAAQ,YAAY,IAAI,cAAc,QAAQ,KAC5E,OAAC,UAAO,GAAG,KAAK,GAAG,MAAM,EAAE,MAAM,UAAU,sBAAsB,KAAK,QAAQ,GAChF,KACA,OAAC,QACC,mBAAC,YAAS,GAAG,kBACX,mBAAC,QAAK,MAAM,KAAK,OAAO,KAAK,KAAK,QAAQ,EAC5C,EACF,GACF,EACF,EAEDA,IAAW,YACV,OAAC,QAAK,UAAU,uBACd,oBAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,qBAAC,KAAE,SAAS,wBACV,oBAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,KAAK,UAAU,KAC9C,OAAC,QAAK,EAAE,cAAc,OAAO,QAAQ,YAAY,IAAI,cAAc,QAAQ,KAC3E,OAAC,UAAO,GAAG,KAAK,GAAG,OAAO,EAAE,MAAM,KAAK,QAAQ,GACjD,KACA,OAAC,QACC,mBAAC,YAAS,GAAG,kBACX,mBAAC,QAAK,MAAM,KAAK,OAAO,KAAK,KAAK,QAAQ,EAC5C,EACF,GACF,EACF,GAEJ,KACA,OAAC,KAAE,UAAU,mDAAoD,SAAAC,EAAQ,GAC3E",
4
+ "sourcesContent": ["export const Message = ({ status, message }: { status: string; message: string }) => {\n return (\n status && (\n <div className=\"absolute left-5 right-5 top-2 flex items-center gap-2 rounded-sm bg-white px-4 py-3 shadow-lg min-md:left-12 min-md:right-12\">\n <div className=\"flex-shrink-0\">\n {status === 'success' && (\n <span className=\"inline-block h-5 w-5\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clipPath=\"url(#clip0_205_16388)\">\n <circle cx=\"10\" cy=\"10\" r=\"10\" fill=\"#1677FF\" />\n <path d=\"M10 16L10 10\" stroke=\"white\" strokeWidth=\"2\" strokeLinecap=\"round\" />\n <circle cx=\"10\" cy=\"6.5\" r=\"1.5\" transform=\"rotate(-180 10 6.5)\" fill=\"white\" />\n </g>\n <defs>\n <clipPath id=\"clip0_205_16388\">\n <rect width=\"20\" height=\"20\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n </span>\n )}\n {status === 'error' && (\n <span className=\"inline-block h-5 w-5\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clipPath=\"url(#clip0_205_16236)\">\n <circle cx=\"10\" cy=\"10\" r=\"10\" fill=\"#F84D4F\" />\n <path d=\"M10 5L10 11\" stroke=\"white\" strokeWidth=\"2\" strokeLinecap=\"round\" />\n <circle cx=\"10\" cy=\"14.5\" r=\"1.5\" fill=\"white\" />\n </g>\n <defs>\n <clipPath id=\"clip0_205_16236\">\n <rect width=\"20\" height=\"20\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n </span>\n )}\n </div>\n <p className=\"text-sm font-semibold leading-[120%] text-[#333]\">{message}</p>\n </div>\n )\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAQgB,IAAAI,EAAA,6BART,MAAMF,EAAU,CAAC,CAAE,OAAAG,EAAQ,QAAAC,CAAQ,IAEtCD,MACE,QAAC,OAAI,UAAU,+HACb,qBAAC,OAAI,UAAU,gBACZ,UAAAA,IAAW,cACV,OAAC,QAAK,UAAU,uBACd,oBAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,qBAAC,KAAE,SAAS,wBACV,oBAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,KAAK,UAAU,KAC9C,OAAC,QAAK,EAAE,eAAe,OAAO,QAAQ,YAAY,IAAI,cAAc,QAAQ,KAC5E,OAAC,UAAO,GAAG,KAAK,GAAG,MAAM,EAAE,MAAM,UAAU,sBAAsB,KAAK,QAAQ,GAChF,KACA,OAAC,QACC,mBAAC,YAAS,GAAG,kBACX,mBAAC,QAAK,MAAM,KAAK,OAAO,KAAK,KAAK,QAAQ,EAC5C,EACF,GACF,EACF,EAEDA,IAAW,YACV,OAAC,QAAK,UAAU,uBACd,oBAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,qBAAC,KAAE,SAAS,wBACV,oBAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,KAAK,UAAU,KAC9C,OAAC,QAAK,EAAE,cAAc,OAAO,QAAQ,YAAY,IAAI,cAAc,QAAQ,KAC3E,OAAC,UAAO,GAAG,KAAK,GAAG,OAAO,EAAE,MAAM,KAAK,QAAQ,GACjD,KACA,OAAC,QACC,mBAAC,YAAS,GAAG,kBACX,mBAAC,QAAK,MAAM,KAAK,OAAO,KAAK,KAAK,QAAQ,EAC5C,EACF,GACF,EACF,GAEJ,KACA,OAAC,KAAE,UAAU,mDAAoD,SAAAC,EAAQ,GAC3E",
6
6
  "names": ["Message_exports", "__export", "Message", "__toCommonJS", "import_jsx_runtime", "status", "message"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var k=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var U=(e,i)=>{for(var m in i)k(e,m,{get:i[m],enumerable:!0})},W=(e,i,m,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let u of O(i))!Q.call(e,u)&&u!==m&&k(e,u,{get:()=>i[u],enumerable:!(r=J(i,u))||r.enumerable});return e};var X=e=>W(k({},"__esModule",{value:!0}),e);var Z={};U(Z,{AuthCodeActivate:()=>Y});module.exports=X(Z);var a=require("react/jsx-runtime"),l=require("@anker-in/headless-ui"),o=require("@anker-in/lib"),s=require("react"),R=require("./Message"),H=require("../context");const Y=({copy:e,autoSendEmail:i=!1})=>{const{locale:m}=(0,o.useHeadlessContext)(),{email:r,authCodeActivate:u}=(0,H.useRegistration)(),{activeToken:v,setActiveToken:L,setIsSendingActivateEmail:S,setIsActivateSuccess:V,onAuthSuccess:$}=u,{isMutating:j,trigger:B}=(0,o.useEmailValidation)(),{isMutating:C,trigger:x,data:_}=(0,o.useSendEmailValidation)(),[F,M]=(0,s.useState)(""),[P,E]=(0,s.useState)(""),{startCountDown:I,startAction:y,countDown:z}=(0,o.useCountDown)(60),[D,g]=(0,s.useState)(""),[N,f]=(0,s.useState)(0),[c,w]=(0,s.useState)(new Array(6).fill("")),A=(0,s.useRef)([]),h=c.join("");(0,s.useEffect)(()=>{A.current[N]&&A.current[N].focus()},[N]),(0,s.useEffect)(()=>{_.active_token&&L(_.active_token)},[_]),(0,s.useEffect)(()=>{S(C)},[C,S]),(0,s.useEffect)(()=>{i&&r&&x({email:r,data:{redirect_url:`${window?.location?.origin}${window?.location?.pathname}`}})},[i,r,x]);const K=(0,s.useCallback)(async()=>{r&&(await x({email:r,data:{redirect_url:`${window?.location?.origin}${window?.location?.pathname}`}},{onSuccess:()=>{E("success"),y()}}),(0,o.gaTrack)({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:"reg_sub_pop",position:"auth_code",button_name:"sent_again"}}))},[r,x]),q=(b,t)=>{const{value:n}=b.target;if(g(""),Number.isNaN(Number(n)))return;if(n.length>1){t<c.length-1&&(c[t+1]||(f(t+1),w(p=>{const T=[...p];return T[t]=n[0],n.length>1&&(T[t+1]=n[1]),T})));return}const d=[...c];d[t]=n,w(d),n?t<c.length-1&&!c[t+1]&&f(t+1):t>0&&f(t-1)},G=(0,s.useCallback)(async()=>{if(!h?.length){g(e?.codeEmptyError||"");return}if(h.length<6){g(e?.incorrectCodeError||"");return}v&&await B({token:v,code:h},{onSuccess:()=>{E("success"),M(e?.authSuccessMessage||""),V(!0),$?.()},onError:t=>{t?.errorCode==="104"||(t?.errorCode==="142"?g(e?.incorrectCodeError||"Invalid verification code."):t?.errorCode==="154"?g(e?.expiredCodeMessage||""):g(e?.sendEmailErrorMessage||""))}});let b=setTimeout(()=>{E(""),M(""),clearTimeout(b)},5e3);(0,o.gaTrack)({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:"reg_sub_pop",position:"auth_code",button_name:"check_and_active"}})},[h,e?.codeEmptyError,e?.authSuccessMessage,e?.incorrectCodeError,e?.expiredCodeMessage,e?.sendEmailErrorMessage,m,v]);return(0,a.jsxs)("div",{className:(0,o.classNames)("p-12 px-5 !pb-12 min-l:px-12"),children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(l.Text,{className:"text-[22px] font-extrabold leading-[120%] text-[#333] min-l:text-[24px] [&_abbr]:text-[#005d8e]",html:e?.authCodeTitle}),(0,a.jsx)(l.Text,{as:"p",className:"mt-3 text-[14px] font-semibold leading-[140%] text-[rgba(51,51,51,0.75)] min-l:text-base [&_abbr]:text-[#333]",html:e?.authCodeDesc?.replace("%email%",r||"")})]}),(0,a.jsxs)("div",{className:"mt-6",children:[(0,a.jsx)(l.Text,{className:"mt-4 text-[14px] !font-bold font-semibold leading-[140%] text-[#333] min-l:mt-6",html:e?.enterActiveCodeText}),(0,a.jsx)("div",{className:"my-3 flex justify-between",children:c.map((b,t)=>(0,a.jsx)("div",{className:"col-span-1 aspect-1 text-[#555]",children:(0,a.jsx)("input",{ref:n=>{n&&(A.current[t]=n)},type:"tel",className:"flex size-full items-center justify-center rounded-[12px] border border-[#333333]/20 bg-[#EEEEEE] text-center text-[24px] font-medium focus:border-[#333]/50 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&:focus-visible]:outline-none",value:b,autoComplete:"false",autoCorrect:"false",spellCheck:"false",autoCapitalize:"false",onChange:n=>q(n,t),onFocus:()=>{f(t)},onPaste:n=>{const d=n.clipboardData.getData("text");if(!Number.isNaN(Number(d))){const p=d.split("").slice(0,6);w(p.concat(Array(6-p.length).fill(""))),p.length<=c.length&&f(p.length-1)}},onKeyDown:n=>{const{value:d}=n.target;n.key==="Backspace"&&!d&&t>0&&f(t-1)}},t)},t))}),D&&(0,a.jsx)(l.Text,{className:"mb-3 text-[14px] font-semibold leading-[120%] text-[#f84d4f]",html:D}),e?.authCodeContent&&(0,a.jsx)("ul",{className:'flex flex-col gap-1 [&_li]:flex [&_li]:gap-2 [&_li]:text-[14px] [&_li]:font-semibold [&_li]:leading-[120%] [&_li]:text-[rgba(51,51,51,0.55)] [&_li]:before:content-["\u2022"]',dangerouslySetInnerHTML:{__html:e?.authCodeContent}})]}),(0,a.jsxs)("div",{className:"mt-4 min-l:mt-6",children:[(0,a.jsx)(l.Text,{className:"text-base font-semibold leading-[100%] text-[#333]",html:e?.authCodeReceiveText})," ",I?(0,a.jsx)(l.Text,{html:e?.retrieveText?.replace("%countdownTime%",z.toString()),className:"cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline"}):(0,a.jsx)(l.Text,{onClick:K,className:(0,o.classNames)("cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline",{"pointer-events-none":I||C}),html:e?.sendAgainText}),(0,a.jsx)(l.Button,{type:"submit",loading:j,className:"mt-6 flex h-[54px] w-full cursor-pointer items-center justify-center rounded-[40px] px-8 py-[15px] text-center text-base font-bold leading-[100%] text-white min-l:mt-8",onClick:G,children:e.buttonText})]}),(0,a.jsx)(R.Message,{status:P,message:F})]})};
1
+ "use strict";var M=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var Z=(e,i)=>{for(var m in i)M(e,m,{get:i[m],enumerable:!0})},y=(e,i,m,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let l of X(i))!Y.call(e,l)&&l!==m&&M(e,l,{get:()=>i[l],enumerable:!(r=W(i,l))||r.enumerable});return e};var ee=e=>y(M({},"__esModule",{value:!0}),e);var ae={};Z(ae,{AuthCodeActivate:()=>te});module.exports=ee(ae);var a=require("react/jsx-runtime"),c=require("@anker-in/headless-ui"),o=require("@anker-in/lib"),s=require("react"),V=require("./Message"),B=require("../context"),$=require("../modalContainer");const te=({copy:e})=>{const{locale:i,brand:m}=(0,o.useHeadlessContext)(),{email:r,authCodeActivate:l}=(0,B.useRegistration)(),F=o.ROUNDED_BRANDS.includes(m),{activeToken:E,setActiveToken:O,setIsSendingActivateEmail:k,setIsActivateSuccess:P,onAuthSuccess:D,autoSendEmail:I}=l,{isMutating:j,trigger:z}=(0,o.useEmailValidation)(),{isMutating:_,trigger:C,data:N}=(0,o.useSendEmailValidation)(),[K,g]=(0,s.useState)(""),[U,f]=(0,s.useState)(""),{startCountDown:R,startAction:H,countDown:q}=(0,o.useCountDown)(60),[L,p]=(0,s.useState)(""),[w,b]=(0,s.useState)(0),[u,S]=(0,s.useState)(new Array(6).fill("")),T=(0,s.useRef)([]),v=u.join("");(0,s.useEffect)(()=>{T.current[w]&&T.current[w].focus()},[w]),(0,s.useEffect)(()=>{N?.data?.data?.active_token&&O(N.data.data.active_token)},[N?.data?.data?.active_token]),(0,s.useEffect)(()=>{k(_)},[_,k]),(0,s.useEffect)(()=>{I&&r&&C({email:r,data:{redirect_url:`${window?.location?.origin}${window?.location?.pathname}`}},{onSuccess:()=>{f("success"),g(e?.sendEmailSuccessMessage||""),H(),setTimeout(()=>{f(""),g("")},5e3)}})},[I,r,C]);const G=(0,s.useCallback)(async()=>{r&&(await C({email:r,data:{redirect_url:`${window?.location?.origin}${window?.location?.pathname}`}},{onSuccess:()=>{f("success"),g(e?.sendEmailSuccessMessage||""),H(),setTimeout(()=>{f(""),g("")},5e3)}}),(0,o.gaTrack)({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:"reg_sub_pop",position:"auth_code",button_name:"sent_again"}}))},[r,C]),J=(x,t)=>{const{value:n}=x.target;if(p(""),Number.isNaN(Number(n)))return;if(n.length>1){t<u.length-1&&(u[t+1]||(b(t+1),S(h=>{const A=[...h];return A[t]=n[0],n.length>1&&(A[t+1]=n[1]),A})));return}const d=[...u];d[t]=n,S(d),n?t<u.length-1&&!u[t+1]&&b(t+1):t>0&&b(t-1)},Q=(0,s.useCallback)(async()=>{if(!v?.length){p(e?.codeEmptyError||"");return}if(v.length<6){p(e?.incorrectCodeError||"");return}E&&await z({token:E,code:v},{onSuccess:()=>{f("success"),g(e?.authSuccessMessage||""),P(!0),D?D():setTimeout(()=>{l.close()},3e3)},onError:t=>{t?.errorCode==="104"||(t?.errorCode==="142"?p(e?.incorrectCodeError||"Invalid verification code."):t?.errorCode==="154"?p(e?.expiredCodeMessage||""):p(e?.sendEmailErrorMessage||""))}});let x=setTimeout(()=>{f(""),g(""),clearTimeout(x)},5e3);(0,o.gaTrack)({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:"reg_sub_pop",position:"auth_code",button_name:"check_and_active"}})},[v,e?.codeEmptyError,e?.authSuccessMessage,e?.incorrectCodeError,e?.expiredCodeMessage,e?.sendEmailErrorMessage,i,E]);return(0,a.jsx)($.RegistrationModalContainer,{isOpen:l.isOpen,onClose:l.close,children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Text,{className:"text-[22px] font-extrabold leading-[120%] text-[#333] min-l:text-[24px] [&_abbr]:text-[#005d8e]",html:e?.authCodeTitle}),(0,a.jsx)(c.Text,{as:"p",className:"mt-3 text-[14px] font-semibold leading-[140%] text-[rgba(51,51,51,0.75)] min-l:text-base [&_abbr]:text-[#333]",html:e?.authCodeDesc?.replace("%email%",r||"")})]}),(0,a.jsxs)("div",{className:"mt-6",children:[(0,a.jsx)(c.Text,{className:"mt-4 text-[14px] !font-bold font-semibold leading-[140%] text-[#333] min-l:mt-6",html:e?.enterActiveCodeText}),(0,a.jsx)("div",{className:"my-3 grid grid-cols-6 gap-2",children:u.map((x,t)=>(0,a.jsx)("div",{className:"col-span-1 aspect-1 text-[#555]",children:(0,a.jsx)("input",{ref:n=>{n&&(T.current[t]=n)},type:"tel",className:(0,o.classNames)("flex size-full items-center justify-center border border-[#333333]/20 bg-[#EEEEEE] text-center text-[24px] font-medium focus:border-[#333]/50 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&:focus-visible]:outline-none",F&&"rounded-[12px]"),value:x,autoComplete:"false",autoCorrect:"false",spellCheck:"false",autoCapitalize:"false",onChange:n=>J(n,t),onFocus:()=>{b(t)},onPaste:n=>{const d=n.clipboardData.getData("text");if(!Number.isNaN(Number(d))){const h=d.split("").slice(0,6);S(h.concat(Array(6-h.length).fill(""))),h.length<=u.length&&b(h.length-1)}},onKeyDown:n=>{const{value:d}=n.target;n.key==="Backspace"&&!d&&t>0&&b(t-1)}},t)},t))}),L&&(0,a.jsx)(c.Text,{className:"mb-3 text-[14px] font-semibold leading-[120%] text-[#f84d4f]",html:L}),e?.authCodeContent&&(0,a.jsx)("ul",{className:'flex flex-col gap-1 [&_li]:flex [&_li]:gap-2 [&_li]:text-[14px] [&_li]:font-semibold [&_li]:leading-[120%] [&_li]:text-[rgba(51,51,51,0.55)] [&_li]:before:content-["\u2022"]',dangerouslySetInnerHTML:{__html:e?.authCodeContent}})]}),(0,a.jsxs)("div",{className:"mt-4 min-l:mt-6",children:[(0,a.jsx)(c.Text,{className:"text-base font-semibold leading-[100%] text-[#333]",html:e?.authCodeReceiveText})," ",R?(0,a.jsx)(c.Text,{html:e?.retrieveText?.replace("%countdownTime%",q.toString()),className:"cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline"}):(0,a.jsx)(c.Text,{onClick:G,className:(0,o.classNames)("cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline",{"pointer-events-none":R||_}),html:e?.sendAgainText}),(0,a.jsx)(c.Button,{type:"submit",loading:j,className:"mt-6 flex h-[54px] w-full cursor-pointer items-center justify-center px-8 py-[15px] text-center text-base font-bold leading-[100%] text-white min-l:mt-8",onClick:Q,children:e.buttonText})]}),(0,a.jsx)(V.Message,{status:U,message:K})]})})};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/registration/authCodeActivate/index.tsx"],
4
- "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport {\n useSendEmailValidation,\n gaTrack,\n classNames as cn,\n useHeadlessContext,\n useEmailValidation,\n useCountDown,\n} from '@anker-in/lib'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { Message } from './Message'\nimport { AuthCodeActivateProps } from './type'\nimport { useRegistration } from '../context'\n\nexport const AuthCodeActivate: React.FC<AuthCodeActivateProps> = ({ copy, autoSendEmail = false }) => {\n const { locale } = useHeadlessContext()\n const { email, authCodeActivate } = useRegistration()\n\n const { activeToken, setActiveToken, setIsSendingActivateEmail, setIsActivateSuccess, onAuthSuccess } =\n authCodeActivate\n\n const { isMutating: emailValidationLoading, trigger: triggerEmailValidation } = useEmailValidation()\n\n const {\n isMutating: isSendingEmail,\n trigger: triggerSendValidationEmail,\n data: sendEmailData,\n } = useSendEmailValidation()\n\n const [messageText, setMessageText] = useState('')\n const [resendStatus, setResendStatus] = useState('')\n const { startCountDown, startAction, countDown } = useCountDown(60)\n\n const [error, setError] = useState('')\n const [focusIndex, setFocusIndex] = useState(0)\n const [codeArray, setCodeArray] = useState(new Array(6).fill(''))\n\n const inputRefs = useRef<HTMLInputElement[]>([])\n const code = codeArray.join('')\n\n useEffect(() => {\n if (inputRefs.current[focusIndex]) {\n inputRefs.current[focusIndex].focus()\n }\n }, [focusIndex])\n\n useEffect(() => {\n if (sendEmailData.active_token) {\n setActiveToken(sendEmailData.active_token)\n }\n }, [sendEmailData])\n\n useEffect(() => {\n setIsSendingActivateEmail(isSendingEmail)\n }, [isSendingEmail, setIsSendingActivateEmail])\n\n // \u81EA\u52A8\u53D1\u9001\u90AE\u7BB1\u9A8C\u8BC1\u7801\n useEffect(() => {\n if (autoSendEmail && email) {\n triggerSendValidationEmail({\n email: email,\n data: {\n redirect_url: `${window?.location?.origin}${window?.location?.pathname}`,\n },\n })\n }\n }, [autoSendEmail, email, triggerSendValidationEmail])\n\n const handleSendAgain = useCallback(async () => {\n if (!email) return\n // \u53D1\u8D77\u7F51\u7EDC\u8BF7\u6C42\n await triggerSendValidationEmail(\n {\n email: email,\n data: {\n redirect_url: `${window?.location?.origin}${window?.location?.pathname}`,\n },\n },\n {\n onSuccess: () => {\n setResendStatus('success')\n startAction()\n },\n }\n )\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: 'reg_sub_pop',\n position: 'auth_code',\n button_name: 'sent_again',\n },\n })\n }, [email, triggerSendValidationEmail])\n\n const handleInputCodeChange = (event: React.ChangeEvent<HTMLInputElement>, index: number) => {\n const { value } = event.target\n\n setError('')\n\n if (Number.isNaN(Number(value))) {\n return\n }\n\n if (value.length > 1) {\n if (index < codeArray.length - 1) {\n if (!codeArray[index + 1]) {\n setFocusIndex(index + 1)\n setCodeArray(old => {\n const newCode = [...old]\n newCode[index] = value[0]\n if (value.length > 1) {\n newCode[index + 1] = value[1]\n }\n return newCode\n })\n }\n }\n return\n }\n const newCode = [...codeArray]\n newCode[index] = value\n setCodeArray(newCode)\n if (value) {\n if (index < codeArray.length - 1 && !codeArray[index + 1]) {\n setFocusIndex(index + 1)\n }\n } else if (index > 0) {\n setFocusIndex(index - 1)\n }\n }\n\n const handleAuthCodeSubmit = useCallback(async () => {\n if (!code?.length) {\n setError(copy?.codeEmptyError || '')\n return\n }\n\n if (code.length < 6) {\n setError(copy?.incorrectCodeError || '')\n return\n }\n\n if (activeToken) {\n await triggerEmailValidation(\n {\n token: activeToken,\n code: code,\n },\n {\n onSuccess: () => {\n setResendStatus('success')\n setMessageText(copy?.authSuccessMessage || '')\n setIsActivateSuccess(true)\n onAuthSuccess?.()\n },\n onError: (err: any) => {\n if (err?.errorCode === '104') {\n } else if (err?.errorCode === '142') {\n setError(copy?.incorrectCodeError || 'Invalid verification code.')\n } else if (err?.errorCode === '154') {\n setError(copy?.expiredCodeMessage || '')\n } else {\n setError(copy?.sendEmailErrorMessage || '')\n }\n },\n }\n )\n }\n\n // \u8BBE\u7F6E\u5B9A\u65F6\u5668\u6E05\u9664\u72B6\u6001\u4FE1\u606F\n let timer = setTimeout(() => {\n setResendStatus('')\n setMessageText('')\n clearTimeout(timer)\n }, 5000)\n\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: 'reg_sub_pop',\n position: 'auth_code',\n button_name: 'check_and_active',\n },\n })\n }, [\n code,\n copy?.codeEmptyError,\n copy?.authSuccessMessage,\n copy?.incorrectCodeError,\n copy?.expiredCodeMessage,\n copy?.sendEmailErrorMessage,\n locale,\n activeToken,\n ])\n\n return (\n <div className={cn('p-12 px-5 !pb-12 min-l:px-12')}>\n <div>\n <Text\n className=\"text-[22px] font-extrabold leading-[120%] text-[#333] min-l:text-[24px] [&_abbr]:text-[#005d8e]\"\n html={copy?.authCodeTitle}\n />\n <Text\n as=\"p\"\n className=\"mt-3 text-[14px] font-semibold leading-[140%] text-[rgba(51,51,51,0.75)] min-l:text-base [&_abbr]:text-[#333]\"\n html={copy?.authCodeDesc?.replace('%email%', email || '')}\n />\n </div>\n <div className=\"mt-6\">\n <Text\n className=\"mt-4 text-[14px] !font-bold font-semibold leading-[140%] text-[#333] min-l:mt-6\"\n html={copy?.enterActiveCodeText}\n />\n <div className=\"my-3 flex justify-between\">\n {codeArray.map((item, index) => (\n <div key={index} className=\"col-span-1 aspect-1 text-[#555]\">\n <input\n ref={inputRef => {\n if (inputRef) {\n inputRefs.current[index] = inputRef\n }\n }}\n key={index}\n type=\"tel\"\n className=\"flex size-full items-center justify-center rounded-[12px] border border-[#333333]/20 bg-[#EEEEEE] text-center text-[24px] font-medium focus:border-[#333]/50 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&:focus-visible]:outline-none\"\n value={item}\n autoComplete=\"false\"\n autoCorrect=\"false\"\n spellCheck=\"false\"\n autoCapitalize=\"false\"\n onChange={event => handleInputCodeChange(event, index)}\n onFocus={() => {\n setFocusIndex(index)\n }}\n onPaste={event => {\n const paste = event.clipboardData.getData('text')\n if (!Number.isNaN(Number(paste))) {\n const pastedCode = paste.split('').slice(0, 6)\n setCodeArray(pastedCode.concat(Array(6 - pastedCode.length).fill('')))\n if (pastedCode.length <= codeArray.length) {\n setFocusIndex(pastedCode.length - 1)\n }\n }\n }}\n onKeyDown={event => {\n const { value } = event.target as HTMLInputElement\n if (event.key === 'Backspace' && !value && index > 0) {\n setFocusIndex(index - 1)\n }\n }}\n />\n </div>\n ))}\n </div>\n\n {error && <Text className=\"mb-3 text-[14px] font-semibold leading-[120%] text-[#f84d4f]\" html={error} />}\n {copy?.authCodeContent && (\n <ul\n className='flex flex-col gap-1 [&_li]:flex [&_li]:gap-2 [&_li]:text-[14px] [&_li]:font-semibold [&_li]:leading-[120%] [&_li]:text-[rgba(51,51,51,0.55)] [&_li]:before:content-[\"\u2022\"]'\n dangerouslySetInnerHTML={{ __html: copy?.authCodeContent }}\n />\n )}\n </div>\n <div className=\"mt-4 min-l:mt-6\">\n <Text className=\"text-base font-semibold leading-[100%] text-[#333]\" html={copy?.authCodeReceiveText} />{' '}\n {startCountDown ? (\n <Text\n html={copy?.retrieveText?.replace('%countdownTime%', countDown.toString())}\n className=\"cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline\"\n />\n ) : (\n <Text\n onClick={handleSendAgain}\n className={cn(\n 'cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline',\n {\n 'pointer-events-none': startCountDown || isSendingEmail,\n }\n )}\n html={copy?.sendAgainText}\n />\n )}\n <Button\n type=\"submit\"\n loading={emailValidationLoading}\n className=\"mt-6 flex h-[54px] w-full cursor-pointer items-center justify-center rounded-[40px] px-8 py-[15px] text-center text-base font-bold leading-[100%] text-white min-l:mt-8\"\n onClick={handleAuthCodeSubmit}\n >\n {copy.buttonText}\n </Button>\n </div>\n <Message status={resendStatus} message={messageText} />\n </div>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAwMM,IAAAI,EAAA,6BAxMNC,EAA6B,iCAC7BC,EAOO,yBACPC,EAAgE,iBAChEC,EAAwB,qBAExBC,EAAgC,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GACvD,CAEJ",
6
- "names": ["authCodeActivate_exports", "__export", "AuthCodeActivate", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_lib", "import_react", "import_Message", "import_context", "copy", "autoSendEmail", "locale", "email", "authCodeActivate", "activeToken", "setActiveToken", "setIsSendingActivateEmail", "setIsActivateSuccess", "onAuthSuccess", "emailValidationLoading", "triggerEmailValidation", "isSendingEmail", "triggerSendValidationEmail", "sendEmailData", "messageText", "setMessageText", "resendStatus", "setResendStatus", "startCountDown", "startAction", "countDown", "error", "setError", "focusIndex", "setFocusIndex", "codeArray", "setCodeArray", "inputRefs", "code", "handleSendAgain", "handleInputCodeChange", "event", "index", "value", "old", "newCode", "handleAuthCodeSubmit", "err", "timer", "cn", "item", "inputRef", "paste", "pastedCode"]
4
+ "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport {\n useSendEmailValidation,\n gaTrack,\n classNames as cn,\n useHeadlessContext,\n useEmailValidation,\n useCountDown,\n ROUNDED_BRANDS,\n} from '@anker-in/lib'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { Message } from './Message'\nimport { AuthCodeActivateProps } from './type'\nimport { useRegistration } from '../context'\nimport { RegistrationModalContainer } from '../modalContainer'\n\nexport const AuthCodeActivate: React.FC<AuthCodeActivateProps> = ({ copy }) => {\n const { locale, brand } = useHeadlessContext()\n const { email, authCodeActivate } = useRegistration()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const { activeToken, setActiveToken, setIsSendingActivateEmail, setIsActivateSuccess, onAuthSuccess, autoSendEmail } =\n authCodeActivate\n\n const { isMutating: emailValidationLoading, trigger: triggerEmailValidation } = useEmailValidation()\n\n const {\n isMutating: isSendingEmail,\n trigger: triggerSendValidationEmail,\n data: sendEmailData,\n } = useSendEmailValidation()\n\n const [messageText, setMessageText] = useState('')\n const [messageStatus, setMessageStatus] = useState('')\n const { startCountDown: isStartCountDown, startAction: startCountDown, countDown } = useCountDown(60)\n\n const [error, setError] = useState('')\n const [focusIndex, setFocusIndex] = useState(0)\n const [codeArray, setCodeArray] = useState(new Array(6).fill(''))\n\n const inputRefs = useRef<HTMLInputElement[]>([])\n const code = codeArray.join('')\n\n useEffect(() => {\n if (inputRefs.current[focusIndex]) {\n inputRefs.current[focusIndex].focus()\n }\n }, [focusIndex])\n\n useEffect(() => {\n if (sendEmailData?.data?.data?.active_token) {\n setActiveToken(sendEmailData.data.data.active_token)\n }\n }, [sendEmailData?.data?.data?.active_token])\n\n useEffect(() => {\n setIsSendingActivateEmail(isSendingEmail)\n }, [isSendingEmail, setIsSendingActivateEmail])\n\n // \u81EA\u52A8\u53D1\u9001\u90AE\u7BB1\u9A8C\u8BC1\u7801\n useEffect(() => {\n if (autoSendEmail && email) {\n triggerSendValidationEmail(\n {\n email: email,\n data: {\n redirect_url: `${window?.location?.origin}${window?.location?.pathname}`,\n },\n },\n {\n onSuccess: () => {\n setMessageStatus('success')\n setMessageText(copy?.sendEmailSuccessMessage || '')\n startCountDown()\n setTimeout(() => {\n setMessageStatus('')\n setMessageText('')\n }, 5000)\n },\n }\n )\n }\n }, [autoSendEmail, email, triggerSendValidationEmail])\n\n const handleSendAgain = useCallback(async () => {\n if (!email) return\n // \u53D1\u8D77\u7F51\u7EDC\u8BF7\u6C42\n await triggerSendValidationEmail(\n {\n email: email,\n data: {\n redirect_url: `${window?.location?.origin}${window?.location?.pathname}`,\n },\n },\n {\n onSuccess: () => {\n setMessageStatus('success')\n setMessageText(copy?.sendEmailSuccessMessage || '')\n startCountDown()\n setTimeout(() => {\n setMessageStatus('')\n setMessageText('')\n }, 5000)\n },\n }\n )\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: 'reg_sub_pop',\n position: 'auth_code',\n button_name: 'sent_again',\n },\n })\n }, [email, triggerSendValidationEmail])\n\n const handleInputCodeChange = (event: React.ChangeEvent<HTMLInputElement>, index: number) => {\n const { value } = event.target\n\n setError('')\n\n if (Number.isNaN(Number(value))) {\n return\n }\n\n if (value.length > 1) {\n if (index < codeArray.length - 1) {\n if (!codeArray[index + 1]) {\n setFocusIndex(index + 1)\n setCodeArray(old => {\n const newCode = [...old]\n newCode[index] = value[0]\n if (value.length > 1) {\n newCode[index + 1] = value[1]\n }\n return newCode\n })\n }\n }\n return\n }\n const newCode = [...codeArray]\n newCode[index] = value\n setCodeArray(newCode)\n if (value) {\n if (index < codeArray.length - 1 && !codeArray[index + 1]) {\n setFocusIndex(index + 1)\n }\n } else if (index > 0) {\n setFocusIndex(index - 1)\n }\n }\n\n const handleAuthCodeSubmit = useCallback(async () => {\n if (!code?.length) {\n setError(copy?.codeEmptyError || '')\n return\n }\n\n if (code.length < 6) {\n setError(copy?.incorrectCodeError || '')\n return\n }\n\n if (activeToken) {\n await triggerEmailValidation(\n {\n token: activeToken,\n code: code,\n },\n {\n onSuccess: () => {\n setMessageStatus('success')\n setMessageText(copy?.authSuccessMessage || '')\n setIsActivateSuccess(true)\n if (onAuthSuccess) {\n onAuthSuccess()\n } else {\n setTimeout(() => {\n authCodeActivate.close()\n }, 3000)\n }\n },\n onError: (err: any) => {\n if (err?.errorCode === '104') {\n } else if (err?.errorCode === '142') {\n setError(copy?.incorrectCodeError || 'Invalid verification code.')\n } else if (err?.errorCode === '154') {\n setError(copy?.expiredCodeMessage || '')\n } else {\n setError(copy?.sendEmailErrorMessage || '')\n }\n },\n }\n )\n }\n\n // \u8BBE\u7F6E\u5B9A\u65F6\u5668\u6E05\u9664\u72B6\u6001\u4FE1\u606F\n let timer = setTimeout(() => {\n setMessageStatus('')\n setMessageText('')\n clearTimeout(timer)\n }, 5000)\n\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: 'reg_sub_pop',\n position: 'auth_code',\n button_name: 'check_and_active',\n },\n })\n }, [\n code,\n copy?.codeEmptyError,\n copy?.authSuccessMessage,\n copy?.incorrectCodeError,\n copy?.expiredCodeMessage,\n copy?.sendEmailErrorMessage,\n locale,\n activeToken,\n ])\n\n return (\n <RegistrationModalContainer isOpen={authCodeActivate.isOpen} onClose={authCodeActivate.close}>\n <div className=\"relative\">\n <div>\n <Text\n className=\"text-[22px] font-extrabold leading-[120%] text-[#333] min-l:text-[24px] [&_abbr]:text-[#005d8e]\"\n html={copy?.authCodeTitle}\n />\n <Text\n as=\"p\"\n className=\"mt-3 text-[14px] font-semibold leading-[140%] text-[rgba(51,51,51,0.75)] min-l:text-base [&_abbr]:text-[#333]\"\n html={copy?.authCodeDesc?.replace('%email%', email || '')}\n />\n </div>\n <div className=\"mt-6\">\n <Text\n className=\"mt-4 text-[14px] !font-bold font-semibold leading-[140%] text-[#333] min-l:mt-6\"\n html={copy?.enterActiveCodeText}\n />\n <div className=\"my-3 grid grid-cols-6 gap-2\">\n {codeArray.map((item, index) => (\n <div key={index} className=\"col-span-1 aspect-1 text-[#555]\">\n <input\n ref={inputRef => {\n if (inputRef) {\n inputRefs.current[index] = inputRef\n }\n }}\n key={index}\n type=\"tel\"\n className={cn(\n 'flex size-full items-center justify-center border border-[#333333]/20 bg-[#EEEEEE] text-center text-[24px] font-medium focus:border-[#333]/50 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&:focus-visible]:outline-none',\n rounded && 'rounded-[12px]'\n )}\n value={item}\n autoComplete=\"false\"\n autoCorrect=\"false\"\n spellCheck=\"false\"\n autoCapitalize=\"false\"\n onChange={event => handleInputCodeChange(event, index)}\n onFocus={() => {\n setFocusIndex(index)\n }}\n onPaste={event => {\n const paste = event.clipboardData.getData('text')\n if (!Number.isNaN(Number(paste))) {\n const pastedCode = paste.split('').slice(0, 6)\n setCodeArray(pastedCode.concat(Array(6 - pastedCode.length).fill('')))\n if (pastedCode.length <= codeArray.length) {\n setFocusIndex(pastedCode.length - 1)\n }\n }\n }}\n onKeyDown={event => {\n const { value } = event.target as HTMLInputElement\n if (event.key === 'Backspace' && !value && index > 0) {\n setFocusIndex(index - 1)\n }\n }}\n />\n </div>\n ))}\n </div>\n\n {error && <Text className=\"mb-3 text-[14px] font-semibold leading-[120%] text-[#f84d4f]\" html={error} />}\n {copy?.authCodeContent && (\n <ul\n className='flex flex-col gap-1 [&_li]:flex [&_li]:gap-2 [&_li]:text-[14px] [&_li]:font-semibold [&_li]:leading-[120%] [&_li]:text-[rgba(51,51,51,0.55)] [&_li]:before:content-[\"\u2022\"]'\n dangerouslySetInnerHTML={{ __html: copy?.authCodeContent }}\n />\n )}\n </div>\n <div className=\"mt-4 min-l:mt-6\">\n <Text className=\"text-base font-semibold leading-[100%] text-[#333]\" html={copy?.authCodeReceiveText} />{' '}\n {isStartCountDown ? (\n <Text\n html={copy?.retrieveText?.replace('%countdownTime%', countDown.toString())}\n className=\"cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline\"\n />\n ) : (\n <Text\n onClick={handleSendAgain}\n className={cn(\n 'cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline',\n {\n 'pointer-events-none': isStartCountDown || isSendingEmail,\n }\n )}\n html={copy?.sendAgainText}\n />\n )}\n <Button\n type=\"submit\"\n loading={emailValidationLoading}\n className=\"mt-6 flex h-[54px] w-full cursor-pointer items-center justify-center px-8 py-[15px] text-center text-base font-bold leading-[100%] text-white min-l:mt-8\"\n onClick={handleAuthCodeSubmit}\n >\n {copy.buttonText}\n </Button>\n </div>\n <Message status={messageStatus} message={messageText} />\n </div>\n </RegistrationModalContainer>\n )\n}\n"],
5
+ "mappings": "0aAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,sBAAAE,KAAA,eAAAC,GAAAH,IAoOQ,IAAAI,EAAA,6BApORC,EAA6B,iCAC7BC,EAQO,yBACPC,EAAgE,iBAChEC,EAAwB,qBAExBC,EAAgC,sBAChCC,EAA2C,6BAEpC,MAAMR,GAAoD,CAAC,CAAE,KAAAS,CAAK,IAAM,CAC7E,KAAM,CAAE,OAAAC,EAAQ,MAAAC,CAAM,KAAI,sBAAmB,EACvC,CAAE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AqD,KAAMA,GAAM,oBAAqB,EAAG,IACxGqB,KACC,OAAC,QACC,KAAMrB,GAAM,cAAc,QAAQ,kBAAmBuB,EAAU,SAAS,CAAC,EACzE,UAAU,yGACZ,KAEA,OAAC,QACC,QAASS,EACT,aAAW,EAAAY,YACT,yGACA,CACE,sBAAuBvB,GAAoBP,CAC7C,CACF,EACA,KAAMd,GAAM,cACd,KAEF,OAAC,UACC,KAAK,SACL,QAASY,EACT,UAAU,2JACV,QAAS2B,EAER,SAAAvC,EAAK,WACR,GACF,KACA,OAAC,WAAQ,OAAQmB,EAAe,QAASF,EAAa,GACxD,EACF,CAEJ",
6
+ "names": ["authCodeActivate_exports", "__export", "AuthCodeActivate", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_lib", "import_react", "import_Message", "import_context", "import_modalContainer", "copy", "locale", "brand", "email", "authCodeActivate", "rounded", "activeToken", "setActiveToken", "setIsSendingActivateEmail", "setIsActivateSuccess", "onAuthSuccess", "autoSendEmail", "emailValidationLoading", "triggerEmailValidation", "isSendingEmail", "triggerSendValidationEmail", "sendEmailData", "messageText", "setMessageText", "messageStatus", "setMessageStatus", "isStartCountDown", "startCountDown", "countDown", "error", "setError", "focusIndex", "setFocusIndex", "codeArray", "setCodeArray", "inputRefs", "code", "handleSendAgain", "handleInputCodeChange", "event", "index", "value", "old", "newCode", "handleAuthCodeSubmit", "err", "timer", "item", "inputRef", "cn", "paste", "pastedCode"]
7
7
  }
@@ -19,5 +19,4 @@ export type AuthCodeActivateCopy = {
19
19
  };
20
20
  export type AuthCodeActivateProps = {
21
21
  copy: AuthCodeActivateCopy;
22
- autoSendEmail?: boolean;
23
22
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/registration/authCodeActivate/type.ts"],
4
- "sourcesContent": ["export type AuthCodeActivateCopy = {\n authCodeTitle?: string\n authCodeDesc?: string\n enterActiveCodeText?: string\n authCodeContent?: string\n authCodeReceiveText?: string\n sendAgainText?: string\n buttonText?: string\n note?: string\n codeEmptyError?: string\n incorrectCodeError?: string\n retrieveText?: string\n authSuccessMessage?: string\n sendEmailSuccessMessage?: string\n sendEmailErrorMessage?: string\n beenActivatedMessage?: string\n invalidCodeMessage?: string\n expiredCodeMessage?: string\n}\n\nexport type AuthCodeActivateProps = {\n copy: AuthCodeActivateCopy\n autoSendEmail?: boolean\n}\n"],
4
+ "sourcesContent": ["export type AuthCodeActivateCopy = {\n authCodeTitle?: string\n authCodeDesc?: string\n enterActiveCodeText?: string\n authCodeContent?: string\n authCodeReceiveText?: string\n sendAgainText?: string\n buttonText?: string\n note?: string\n codeEmptyError?: string\n incorrectCodeError?: string\n retrieveText?: string\n authSuccessMessage?: string\n sendEmailSuccessMessage?: string\n sendEmailErrorMessage?: string\n beenActivatedMessage?: string\n invalidCodeMessage?: string\n expiredCodeMessage?: string\n}\n\nexport type AuthCodeActivateProps = {\n copy: AuthCodeActivateCopy\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["type_exports", "__toCommonJS"]
7
7
  }
@@ -14,6 +14,8 @@ interface RegistrationContextType {
14
14
  setActiveToken: Dispatch<SetStateAction<string | undefined>>;
15
15
  setIsActivateSuccess: Dispatch<SetStateAction<boolean>>;
16
16
  setOnAuthSuccess: Dispatch<SetStateAction<(() => void) | undefined>>;
17
+ autoSendEmail: boolean;
18
+ setAutoSendEmail: Dispatch<SetStateAction<boolean>>;
17
19
  };
18
20
  }
19
21
  export declare const RegistrationContext: import("react").Context<RegistrationContextType>;
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var m=(e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})},x=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of g(t))!C.call(e,s)&&s!==n&&c(e,s,{get:()=>t[s],enumerable:!(o=f(t,s))||o.enumerable});return e};var R=e=>x(c({},"__esModule",{value:!0}),e);var E={};m(E,{RegistrationContext:()=>a,RegistrationProvider:()=>y,useRegistration:()=>T});module.exports=R(E);var d=require("react/jsx-runtime"),i=require("react");const a=(0,i.createContext)({email:void 0,copy:void 0,authCodeActivate:{activeToken:void 0,setActiveToken:()=>{},isOpen:!1,open:()=>{},close:()=>{},isActivateSuccess:!1,isSendingActivateEmail:!1,setIsSendingActivateEmail:()=>{},setIsActivateSuccess:()=>{},setOnAuthSuccess:()=>{},onAuthSuccess:void 0}}),T=()=>{const e=(0,i.useContext)(a);if(!e)throw new Error("useRegistration must be used within a RegistrationProvider");return e},y=({children:e,email:t,copy:n})=>{const[o,s]=(0,i.useState)(!1),[u,r]=(0,i.useState)(void 0),[v,A]=(0,i.useState)(!1),[S,l]=(0,i.useState)(),[p,h]=(0,i.useState)(!1);return(0,d.jsx)(a.Provider,{value:{email:t,copy:n,authCodeActivate:{activeToken:S,isOpen:o,open:()=>s(!0),close:()=>s(!1),isActivateSuccess:v,setIsActivateSuccess:A,onAuthSuccess:u,setOnAuthSuccess:r,isSendingActivateEmail:p,setIsSendingActivateEmail:h,setActiveToken:l}},children:e})};
1
+ "use strict";var c=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})},R=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of E(t))!x.call(e,s)&&s!==n&&c(e,s,{get:()=>t[s],enumerable:!(o=C(t,s))||o.enumerable});return e};var T=e=>R(c({},"__esModule",{value:!0}),e);var y={};b(y,{RegistrationContext:()=>d,RegistrationProvider:()=>k,useRegistration:()=>P});module.exports=T(y);var a=require("react/jsx-runtime"),i=require("react"),u=require("../authCodeActivate");const d=(0,i.createContext)({email:void 0,copy:void 0,authCodeActivate:{activeToken:void 0,setActiveToken:()=>{},isOpen:!1,open:()=>{},close:()=>{},isActivateSuccess:!1,isSendingActivateEmail:!1,setIsSendingActivateEmail:()=>{},setIsActivateSuccess:()=>{},setOnAuthSuccess:()=>{},onAuthSuccess:void 0,autoSendEmail:!1,setAutoSendEmail:()=>{}}}),P=()=>{const e=(0,i.useContext)(d);if(!e)throw new Error("useRegistration must be used within a RegistrationProvider");return e},k=({children:e,email:t,copy:n})=>{const[o,s]=(0,i.useState)(!1),[r,A]=(0,i.useState)(void 0),[l,S]=(0,i.useState)(!1),[v,h]=(0,i.useState)(),[p,f]=(0,i.useState)(!1),[g,m]=(0,i.useState)(!1);return(0,a.jsxs)(d.Provider,{value:{email:t,copy:n,authCodeActivate:{activeToken:v,isOpen:o,open:()=>s(!0),close:()=>s(!1),isActivateSuccess:l,setIsActivateSuccess:S,onAuthSuccess:r,setOnAuthSuccess:A,isSendingActivateEmail:p,setIsSendingActivateEmail:f,setActiveToken:h,autoSendEmail:g,setAutoSendEmail:m}},children:[e,n?.authCodeActivate&&(0,a.jsx)(u.AuthCodeActivate,{copy:n.authCodeActivate})]})};
2
2
  //# sourceMappingURL=provider.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/registration/context/provider.tsx"],
4
- "sourcesContent": ["import { createContext, Dispatch, PropsWithChildren, SetStateAction, useContext, useState } from 'react'\n\ninterface RegistrationContextType {\n email?: string\n copy?: any\n authCodeActivate: {\n isOpen: boolean\n open: () => void\n close: () => void\n isActivateSuccess: boolean\n activeToken?: string\n onAuthSuccess: (() => void) | undefined\n isSendingActivateEmail: boolean\n setIsSendingActivateEmail: Dispatch<SetStateAction<boolean>>\n setActiveToken: Dispatch<SetStateAction<string | undefined>>\n setIsActivateSuccess: Dispatch<SetStateAction<boolean>>\n setOnAuthSuccess: Dispatch<SetStateAction<(() => void) | undefined>>\n }\n}\n\nexport const RegistrationContext = createContext<RegistrationContextType>({\n email: undefined,\n copy: undefined,\n authCodeActivate: {\n activeToken: undefined,\n setActiveToken: () => {},\n isOpen: false,\n open: () => {},\n close: () => {},\n isActivateSuccess: false,\n isSendingActivateEmail: false,\n setIsSendingActivateEmail: () => {},\n setIsActivateSuccess: () => {},\n setOnAuthSuccess: () => {},\n onAuthSuccess: undefined,\n },\n})\n\nexport const useRegistration = () => {\n const context = useContext(RegistrationContext)\n if (!context) {\n throw new Error('useRegistration must be used within a RegistrationProvider')\n }\n return context\n}\n\nexport const RegistrationProvider = ({ children, email, copy }: PropsWithChildren<{ email?: string; copy?: any }>) => {\n const [popAuthCode, setPopAuthCode] = useState(false)\n const [onAuthSuccess, setOnAuthSuccess] = useState<(() => void) | undefined>(undefined)\n const [isActivateSuccess, setIsActivateSuccess] = useState(false)\n const [activeToken, setActiveToken] = useState<string>()\n const [isSendingActivateEmail, setIsSendingActivateEmail] = useState(false)\n\n return (\n <RegistrationContext.Provider\n value={{\n email,\n copy,\n authCodeActivate: {\n activeToken,\n isOpen: popAuthCode,\n open: () => setPopAuthCode(true),\n close: () => setPopAuthCode(false),\n isActivateSuccess,\n setIsActivateSuccess,\n onAuthSuccess,\n setOnAuthSuccess,\n isSendingActivateEmail,\n setIsSendingActivateEmail,\n setActiveToken,\n },\n }}\n >\n {children}\n </RegistrationContext.Provider>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,yBAAAC,EAAA,oBAAAC,IAAA,eAAAC,EAAAL,GAsDI,IAAAM,EAAA,6BAtDJC,EAAiG,iBAoB1F,MAAML,KAAsB,iBAAuC,CACxE,MAAO,OACP,KAAM,OACN,iBAAkB,CAChB,YAAa,OACb,eAAgB,IAAM,CAAC,EACvB,OAAQ,GACR,KAAM,IAAM,CAAC,EACb,MAAO,IAAM,CAAC,EACd,kBAAmB,GACnB,uBAAwB,GACxB,0BAA2B,IAAM,CAAC,EAClC,qBAAsB,IAAM,CAAC,EAC7B,iBAAkB,IAAM,CAAC,EACzB,cAAe,MACjB,CACF,CAAC,EAEYE,EAAkB,IAAM,CACnC,MAAMI,KAAU,cAAWN,CAAmB,EAC9C,GAAI,CAACM,EACH,MAAM,IAAI,MAAM,4DAA4D,EAE9E,OAAOA,CACT,EAEaL,EAAuB,CAAC,CAAE,SAAAM,EAAU,MAAAC,EAAO,KAAAC,CAAK,IAAyD,CACpH,KAAM,CAACC,EAAaC,CAAc,KAAI,YAAS,EAAK,EAC9C,CAACC,EAAeC,CAAgB,KAAI,YAAmC,MAAS,EAChF,CAACC,EAAmBC,CAAoB,KAAI,YAAS,EAAK,EAC1D,CAACC,EAAaC,CAAc,KAAI,YAAiB,EACjD,CAACC,EAAwBC,CAAyB,KAAI,YAAS,EAAK,EAE1E,SACE,OAACnB,EAAoB,SAApB,CACC,MAAO,CACL,MAAAQ,EACA,KAAAC,EACA,iBAAkB,CAChB,YAAAO,EACA,OAAQN,EACR,KAAM,IAAMC,EAAe,EAAI,EAC/B,MAAO,IAAMA,EAAe,EAAK,EACjC,kBAAAG,EACA,qBAAAC,EACA,cAAAH,EACA,iBAAAC,EACA,uBAAAK,EACA,0BAAAC,EACA,eAAAF,CACF,CACF,EAEC,SAAAV,EACH,CAEJ",
6
- "names": ["provider_exports", "__export", "RegistrationContext", "RegistrationProvider", "useRegistration", "__toCommonJS", "import_jsx_runtime", "import_react", "context", "children", "email", "copy", "popAuthCode", "setPopAuthCode", "onAuthSuccess", "setOnAuthSuccess", "isActivateSuccess", "setIsActivateSuccess", "activeToken", "setActiveToken", "isSendingActivateEmail", "setIsSendingActivateEmail"]
4
+ "sourcesContent": ["import { createContext, Dispatch, PropsWithChildren, SetStateAction, useContext, useState } from 'react'\nimport { AuthCodeActivate } from '../authCodeActivate'\n\ninterface RegistrationContextType {\n email?: string\n copy?: any\n authCodeActivate: {\n isOpen: boolean\n open: () => void\n close: () => void\n isActivateSuccess: boolean\n activeToken?: string\n onAuthSuccess: (() => void) | undefined\n isSendingActivateEmail: boolean\n setIsSendingActivateEmail: Dispatch<SetStateAction<boolean>>\n setActiveToken: Dispatch<SetStateAction<string | undefined>>\n setIsActivateSuccess: Dispatch<SetStateAction<boolean>>\n setOnAuthSuccess: Dispatch<SetStateAction<(() => void) | undefined>>\n autoSendEmail: boolean\n setAutoSendEmail: Dispatch<SetStateAction<boolean>>\n }\n}\n\nexport const RegistrationContext = createContext<RegistrationContextType>({\n email: undefined,\n copy: undefined,\n authCodeActivate: {\n activeToken: undefined,\n setActiveToken: () => {},\n isOpen: false,\n open: () => {},\n close: () => {},\n isActivateSuccess: false,\n isSendingActivateEmail: false,\n setIsSendingActivateEmail: () => {},\n setIsActivateSuccess: () => {},\n setOnAuthSuccess: () => {},\n onAuthSuccess: undefined,\n autoSendEmail: false,\n setAutoSendEmail: () => {},\n },\n})\n\nexport const useRegistration = () => {\n const context = useContext(RegistrationContext)\n if (!context) {\n throw new Error('useRegistration must be used within a RegistrationProvider')\n }\n return context\n}\n\nexport const RegistrationProvider = ({ children, email, copy }: PropsWithChildren<{ email?: string; copy?: any }>) => {\n const [popAuthCode, setPopAuthCode] = useState(false)\n const [onAuthSuccess, setOnAuthSuccess] = useState<(() => void) | undefined>(undefined)\n const [isActivateSuccess, setIsActivateSuccess] = useState(false)\n const [activeToken, setActiveToken] = useState<string>()\n const [isSendingActivateEmail, setIsSendingActivateEmail] = useState(false)\n const [autoSendEmail, setAutoSendEmail] = useState(false)\n\n return (\n <RegistrationContext.Provider\n value={{\n email,\n copy,\n authCodeActivate: {\n activeToken,\n isOpen: popAuthCode,\n open: () => setPopAuthCode(true),\n close: () => setPopAuthCode(false),\n isActivateSuccess,\n setIsActivateSuccess,\n onAuthSuccess,\n setOnAuthSuccess,\n isSendingActivateEmail,\n setIsSendingActivateEmail,\n setActiveToken,\n autoSendEmail,\n setAutoSendEmail,\n },\n }}\n >\n {children}\n {copy?.authCodeActivate && <AuthCodeActivate copy={copy.authCodeActivate} />}\n </RegistrationContext.Provider>\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EA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Ad,EACAE,GAAM,qBAAoB,OAAC,oBAAiB,KAAMA,EAAK,iBAAkB,GAC5E,CAEJ",
6
+ "names": ["provider_exports", "__export", "RegistrationContext", "RegistrationProvider", "useRegistration", "__toCommonJS", "import_jsx_runtime", "import_react", "import_authCodeActivate", "context", "children", "email", "copy", "popAuthCode", "setPopAuthCode", "onAuthSuccess", "setOnAuthSuccess", "isActivateSuccess", "setIsActivateSuccess", "activeToken", "setActiveToken", "isSendingActivateEmail", "setIsSendingActivateEmail", "autoSendEmail", "setAutoSendEmail"]
7
7
  }
@@ -6,10 +6,9 @@ export type ModalContainerProps = {
6
6
  title?: string;
7
7
  titleClassName?: string;
8
8
  useAnimation?: boolean;
9
- animationClassName?: string;
10
9
  isOpen: boolean;
11
10
  children?: any;
12
11
  onClose: () => void;
13
12
  onScrollEnd?: (event: UIEvent<HTMLDivElement>) => void;
14
13
  };
15
- export declare const CreditsModalContainer: ({ isOpen, title, className, overlayClassName, scrollClassName, onClose, onScrollEnd, children, useAnimation, animationClassName, titleClassName, ...props }: ModalContainerProps) => React.ReactElement;
14
+ export declare const RegistrationModalContainer: ({ isOpen, title, className, overlayClassName, scrollClassName, onClose, onScrollEnd, children, useAnimation, titleClassName, ...props }: ModalContainerProps) => React.ReactElement;
@@ -1,2 +1,2 @@
1
- "use strict";var b=Object.create;var m=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var l in t)m(e,l,{get:t[l],enumerable:!0})},C=(e,t,l,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of y(t))!E.call(e,i)&&i!==l&&m(e,i,{get:()=>t[i],enumerable:!(r=N(t,i))||r.enumerable});return e};var H=(e,t,l)=>(l=e!=null?b(M(e)):{},C(t||!e||!e.__esModule?m(l,"default",{value:e,enumerable:!0}):l,e)),k=e=>C(m({},"__esModule",{value:!0}),e);var S={};R(S,{CreditsModalContainer:()=>D});module.exports=k(S);var n=require("react/jsx-runtime"),s=require("@anker-in/lib"),d=require("react"),f=H(require("react-modal"));const D=({isOpen:e,title:t,className:l="",overlayClassName:r="",scrollClassName:i="",onClose:c,onScrollEnd:p,children:v,useAnimation:x,animationClassName:h,titleClassName:L="",...g})=>{const[u,w]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{x&&requestAnimationFrame(()=>{w(e??!1)})},[e,x]),(0,n.jsxs)(f.default,{isOpen:e??!1,overlayClassName:(0,s.classNames)("fixed inset-0 z-[999] flex items-center justify-center bg-black/70 leading-[1.2] md:items-end",r),className:(0,s.classNames)("min-md:max-h-[calc(100vh-96px)] relative flex min-h-[200px] flex-col overflow-hidden rounded-[16px] bg-white outline-none transition-all duration-300 md:h-[88.27vh] md:w-full md:rounded-b-none",u?"":h,l),onRequestClose:c,...g,children:[(0,n.jsxs)("div",{className:(0,s.classNames)("flex w-full shrink-0 items-center justify-between",t?"min-l:px-[32px] h-[70px] border-b border-[#e2e2e2] px-[24px]":"h-[48px] px-[16px]",L),children:[(0,n.jsx)("div",{className:"text-[18px] font-bold",children:t}),(0,n.jsx)("div",{className:"size-[22px] cursor-pointer",onClick:c,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),c?.())},role:"button",tabIndex:0,children:(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.8525 5.31015C16.4558 4.91337 15.8125 4.91338 15.4157 5.31015L11.1268 9.5991L6.83815 5.31049C6.44138 4.91372 5.79808 4.91372 5.40131 5.31049C5.00454 5.70726 5.00455 6.35055 5.40131 6.74732L9.68993 11.0359L5.40105 15.3248C5.00428 15.7216 5.00428 16.3649 5.40105 16.7616C5.79782 17.1584 6.44111 17.1584 6.83788 16.7616L11.1268 12.4728L15.416 16.762C15.8128 17.1588 16.456 17.1588 16.8528 16.762C17.2496 16.3652 17.2496 15.7219 16.8528 15.3252L12.5636 11.0359L16.8525 6.74698C17.2493 6.35021 17.2493 5.70692 16.8525 5.31015ZM16.921 6.02856C16.921 6.22992 16.8441 6.43127 16.6905 6.5849L14.465 8.8104L12.2395 11.0359L12.2395 11.0359L16.6905 6.58493C16.8441 6.43129 16.921 6.22993 16.921 6.02856ZM5.34966 6.19087C5.37992 6.3354 5.45115 6.47307 5.56336 6.58528L10.014 11.0359L10.014 11.0359L5.56336 6.58524C5.45116 6.47304 5.37992 6.33539 5.34966 6.19087ZM5.35087 16.2121C5.38193 16.3541 5.45267 16.4891 5.56309 16.5996C5.87037 16.9068 6.36856 16.9068 6.67583 16.5996L11.1268 12.1486L15.578 16.5999C15.8853 16.9072 16.3835 16.9072 16.6908 16.5999C16.8498 16.4409 16.9265 16.2307 16.9209 16.0223C16.9265 16.2307 16.8498 16.4409 16.6908 16.5999C16.3835 16.9072 15.8853 16.9072 15.578 16.5999L11.1268 12.1487L6.67583 16.5996C6.36856 16.9069 5.87037 16.9069 5.56309 16.5996C5.45267 16.4892 5.38192 16.3541 5.35087 16.2121Z",fill:"#333333"})})})]}),(0,n.jsx)("div",{className:(0,s.classNames)("my-[32px] flex-1 overflow-auto overscroll-contain px-[24px] md:mb-[48px]",!t&&"mt-0","min-l:px-[32px]",i),onScroll:o=>{const a=o.target;a.scrollHeight<=a.clientHeight||a.scrollTop+a.clientHeight>=a.scrollHeight-50&&p&&p(o)},children:v})]})};
1
+ "use strict";var y=Object.create;var d=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})},f=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of M(t))!E.call(e,a)&&a!==n&&d(e,a,{get:()=>t[a],enumerable:!(r=N(t,a))||r.enumerable});return e};var H=(e,t,n)=>(n=e!=null?y(R(e)):{},f(t||!e||!e.__esModule?d(n,"default",{value:e,enumerable:!0}):n,e)),k=e=>f(d({},"__esModule",{value:!0}),e);var Z={};D(Z,{RegistrationModalContainer:()=>S});module.exports=k(Z);var l=require("react/jsx-runtime"),o=require("@anker-in/lib"),m=require("react"),v=H(require("react-modal"));const S=({isOpen:e,title:t,className:n="",overlayClassName:r="",scrollClassName:a="",onClose:c,onScrollEnd:x,children:C,useAnimation:p=!0,titleClassName:u="",...h})=>{const{brand:L}=(0,o.useHeadlessContext)(),g=o.ROUNDED_BRANDS.includes(L),[w,b]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{p&&requestAnimationFrame(()=>{b(e??!1)})},[e,p]),(0,l.jsxs)(v.default,{isOpen:e??!1,overlayClassName:(0,o.classNames)("fixed inset-0 z-[999] flex items-center justify-center bg-black/70 leading-[1.2] md:items-end",r),className:(0,o.classNames)("min-md:max-h-[calc(100vh-96px)] w-[540px] relative flex min-h-[200px] flex-col overflow-hidden bg-white outline-none transition-all duration-300 md:h-auto md:w-full",g&&"rounded-[16px] md:rounded-b-none",p&&"md:translate-y-[100vh]",w&&"md:translate-y-0",n),onRequestClose:c,...h,children:[(0,l.jsxs)("div",{className:(0,o.classNames)("flex w-full shrink-0 items-center justify-between",t?"min-l:px-[32px] h-[70px] border-b border-[#e2e2e2] px-[24px]":"h-[48px] px-[16px]",u),children:[(0,l.jsx)("div",{className:"text-[18px] font-bold",children:t}),(0,l.jsx)("div",{className:"size-[22px] cursor-pointer",onClick:c,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),c?.())},role:"button",tabIndex:0,children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.8525 5.31015C16.4558 4.91337 15.8125 4.91338 15.4157 5.31015L11.1268 9.5991L6.83815 5.31049C6.44138 4.91372 5.79808 4.91372 5.40131 5.31049C5.00454 5.70726 5.00455 6.35055 5.40131 6.74732L9.68993 11.0359L5.40105 15.3248C5.00428 15.7216 5.00428 16.3649 5.40105 16.7616C5.79782 17.1584 6.44111 17.1584 6.83788 16.7616L11.1268 12.4728L15.416 16.762C15.8128 17.1588 16.456 17.1588 16.8528 16.762C17.2496 16.3652 17.2496 15.7219 16.8528 15.3252L12.5636 11.0359L16.8525 6.74698C17.2493 6.35021 17.2493 5.70692 16.8525 5.31015ZM16.921 6.02856C16.921 6.22992 16.8441 6.43127 16.6905 6.5849L14.465 8.8104L12.2395 11.0359L12.2395 11.0359L16.6905 6.58493C16.8441 6.43129 16.921 6.22993 16.921 6.02856ZM5.34966 6.19087C5.37992 6.3354 5.45115 6.47307 5.56336 6.58528L10.014 11.0359L10.014 11.0359L5.56336 6.58524C5.45116 6.47304 5.37992 6.33539 5.34966 6.19087ZM5.35087 16.2121C5.38193 16.3541 5.45267 16.4891 5.56309 16.5996C5.87037 16.9068 6.36856 16.9068 6.67583 16.5996L11.1268 12.1486L15.578 16.5999C15.8853 16.9072 16.3835 16.9072 16.6908 16.5999C16.8498 16.4409 16.9265 16.2307 16.9209 16.0223C16.9265 16.2307 16.8498 16.4409 16.6908 16.5999C16.3835 16.9072 15.8853 16.9072 15.578 16.5999L11.1268 12.1487L6.67583 16.5996C6.36856 16.9069 5.87037 16.9069 5.56309 16.5996C5.45267 16.4892 5.38192 16.3541 5.35087 16.2121Z",fill:"#333333"})})})]}),(0,l.jsx)("div",{className:(0,o.classNames)("my-[32px] flex-1 overflow-auto overscroll-contain px-[24px] md:mb-[48px]",!t&&"mt-0","min-l:px-[32px]",a),onScroll:i=>{const s=i.target;s.scrollHeight<=s.clientHeight||s.scrollTop+s.clientHeight>=s.scrollHeight-50&&x&&x(i)},children:C})]})};
2
2
  //# sourceMappingURL=modalContainer.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/registration/modalContainer.tsx"],
4
- "sourcesContent": ["import { classNames as cn } from '@anker-in/lib'\nimport { useEffect, useState, type UIEvent } from 'react'\nimport ReactModal from 'react-modal'\n\nexport type ModalContainerProps = {\n overlayClassName?: string\n className?: string\n scrollClassName?: string\n title?: string\n titleClassName?: string\n useAnimation?: boolean // \u4F7F\u7528\u52A8\u753B\u5C55\u793A\n animationClassName?: string // \u52A8\u753B\u5C55\u793A\u63A7\u5236\u7684classname\n isOpen: boolean\n children?: any\n onClose: () => void\n onScrollEnd?: (event: UIEvent<HTMLDivElement>) => void\n}\n\nexport const CreditsModalContainer = ({\n isOpen,\n title,\n className = '',\n overlayClassName = '',\n scrollClassName = '',\n onClose,\n onScrollEnd,\n children,\n useAnimation,\n animationClassName,\n titleClassName = '',\n ...props\n}: ModalContainerProps): React.ReactElement => {\n const [animationShow, setAnimationShow] = useState(false)\n\n useEffect(() => {\n if (!useAnimation) {\n return\n }\n requestAnimationFrame(() => {\n setAnimationShow(isOpen ?? false)\n })\n }, [isOpen, useAnimation])\n\n return (\n <ReactModal\n isOpen={isOpen ?? false}\n overlayClassName={cn(\n 'fixed inset-0 z-[999] flex items-center justify-center bg-black/70 leading-[1.2] md:items-end',\n overlayClassName\n )}\n className={cn(\n 'min-md:max-h-[calc(100vh-96px)] relative flex min-h-[200px] flex-col overflow-hidden rounded-[16px] bg-white outline-none transition-all duration-300 md:h-[88.27vh] md:w-full md:rounded-b-none',\n animationShow ? '' : animationClassName,\n className\n )}\n onRequestClose={onClose}\n {...props}\n >\n <div\n className={cn(\n 'flex w-full shrink-0 items-center justify-between',\n title ? 'min-l:px-[32px] h-[70px] border-b border-[#e2e2e2] px-[24px]' : 'h-[48px] px-[16px]',\n titleClassName\n )}\n >\n <div className=\"text-[18px] font-bold\">{title}</div>\n <div\n className=\"size-[22px] cursor-pointer\"\n onClick={onClose}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n onClose?.()\n }\n }}\n role=\"button\"\n tabIndex={0}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" viewBox=\"0 0 22 22\" fill=\"none\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16.8525 5.31015C16.4558 4.91337 15.8125 4.91338 15.4157 5.31015L11.1268 9.5991L6.83815 5.31049C6.44138 4.91372 5.79808 4.91372 5.40131 5.31049C5.00454 5.70726 5.00455 6.35055 5.40131 6.74732L9.68993 11.0359L5.40105 15.3248C5.00428 15.7216 5.00428 16.3649 5.40105 16.7616C5.79782 17.1584 6.44111 17.1584 6.83788 16.7616L11.1268 12.4728L15.416 16.762C15.8128 17.1588 16.456 17.1588 16.8528 16.762C17.2496 16.3652 17.2496 15.7219 16.8528 15.3252L12.5636 11.0359L16.8525 6.74698C17.2493 6.35021 17.2493 5.70692 16.8525 5.31015ZM16.921 6.02856C16.921 6.22992 16.8441 6.43127 16.6905 6.5849L14.465 8.8104L12.2395 11.0359L12.2395 11.0359L16.6905 6.58493C16.8441 6.43129 16.921 6.22993 16.921 6.02856ZM5.34966 6.19087C5.37992 6.3354 5.45115 6.47307 5.56336 6.58528L10.014 11.0359L10.014 11.0359L5.56336 6.58524C5.45116 6.47304 5.37992 6.33539 5.34966 6.19087ZM5.35087 16.2121C5.38193 16.3541 5.45267 16.4891 5.56309 16.5996C5.87037 16.9068 6.36856 16.9068 6.67583 16.5996L11.1268 12.1486L15.578 16.5999C15.8853 16.9072 16.3835 16.9072 16.6908 16.5999C16.8498 16.4409 16.9265 16.2307 16.9209 16.0223C16.9265 16.2307 16.8498 16.4409 16.6908 16.5999C16.3835 16.9072 15.8853 16.9072 15.578 16.5999L11.1268 12.1487L6.67583 16.5996C6.36856 16.9069 5.87037 16.9069 5.56309 16.5996C5.45267 16.4892 5.38192 16.3541 5.35087 16.2121Z\"\n fill=\"#333333\"\n />\n </svg>\n </div>\n </div>\n <div\n className={cn(\n 'my-[32px] flex-1 overflow-auto overscroll-contain px-[24px] md:mb-[48px]',\n !title && 'mt-0',\n 'min-l:px-[32px]',\n scrollClassName\n )}\n onScroll={event => {\n const targetElement = event.target as HTMLDivElement\n\n if (targetElement.scrollHeight <= targetElement.clientHeight) {\n return\n }\n\n if (targetElement.scrollTop + targetElement.clientHeight >= targetElement.scrollHeight - 50) {\n onScrollEnd && onScrollEnd(event)\n }\n }}\n >\n {children}\n </div>\n </ReactModal>\n )\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,IAAA,eAAAC,EAAAH,GA0DM,IAAAI,EAAA,6BA1DNC,EAAiC,yBACjCC,EAAkD,iBAClDC,EAAuB,0BAgBhB,MAAML,EAAwB,CAAC,CACpC,OAAAM,EACA,MAAAC,EACA,UAAAC,EAAY,GACZ,iBAAAC,EAAmB,GACnB,gBAAAC,EAAkB,GAClB,QAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,eAAAC,EAAiB,GACjB,GAAGC,CACL,IAA+C,CAC7C,KAAM,CAACC,EAAeC,CAAgB,KAAI,YAAS,EAAK,EAExD,sBAAU,IAAM,CACTL,GAGL,sBAAsB,IAAM,CAC1BK,EAAiBb,GAAU,EAAK,CAClC,CAAC,CACH,EAAG,CAACA,EAAQQ,CAAY,CAAC,KAGvB,QAAC,EAAAM,QAAA,CACC,OAAQd,GAAU,GAClB,oBAAkB,EAAAe,YAChB,gGACAZ,CACF,EACA,aAAW,EAAAY,YACT,mMACAH,EAAgB,GAAKH,EACrBP,CACF,EACA,eAAgBG,EACf,GAAGM,EAEJ,qBAAC,OACC,aAAW,EAAAI,YACT,oDACAd,EAAQ,+DAAiE,qBACzES,CACF,EAEA,oBAAC,OAAI,UAAU,wBAAyB,SAAAT,EAAM,KAC9C,OAAC,OACC,UAAU,6BACV,QAASI,EACT,UAAWW,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,OACjCA,EAAE,eAAe,EACjBX,IAAU,EAEd,EACA,KAAK,SACL,SAAU,EAEV,mBAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OACtF,mBAAC,QACC,SAAS,UACT,SAAS,UACT,EAAE,syCACF,KAAK,UACP,EACF,EACF,GACF,KACA,OAAC,OACC,aAAW,EAAAU,YACT,2EACA,CAACd,GAAS,OACV,kBACAG,CACF,EACA,SAAUa,GAAS,CACjB,MAAMC,EAAgBD,EAAM,OAExBC,EAAc,cAAgBA,EAAc,cAI5CA,EAAc,UAAYA,EAAc,cAAgBA,EAAc,aAAe,IACvFZ,GAAeA,EAAYW,CAAK,CAEpC,EAEC,SAAAV,EACH,GACF,CAEJ",
6
- "names": ["modalContainer_exports", "__export", "CreditsModalContainer", "__toCommonJS", "import_jsx_runtime", "import_lib", "import_react", "import_react_modal", "isOpen", "title", "className", "overlayClassName", "scrollClassName", "onClose", "onScrollEnd", "children", "useAnimation", "animationClassName", "titleClassName", "props", "animationShow", "setAnimationShow", "ReactModal", "cn", "e", "event", "targetElement"]
4
+ "sourcesContent": ["import { classNames as cn, useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'\nimport { useEffect, useState, type UIEvent } from 'react'\nimport ReactModal from 'react-modal'\n\nexport type ModalContainerProps = {\n overlayClassName?: string\n className?: string\n scrollClassName?: string\n title?: string\n titleClassName?: string\n useAnimation?: boolean // \u4F7F\u7528\u52A8\u753B\u5C55\u793A\n isOpen: boolean\n children?: any\n onClose: () => void\n onScrollEnd?: (event: UIEvent<HTMLDivElement>) => void\n}\n\nexport const RegistrationModalContainer = ({\n isOpen,\n title,\n className = '',\n overlayClassName = '',\n scrollClassName = '',\n onClose,\n onScrollEnd,\n children,\n useAnimation = true,\n titleClassName = '',\n ...props\n}: ModalContainerProps): React.ReactElement => {\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const [animationShow, setAnimationShow] = useState(false)\n\n useEffect(() => {\n if (!useAnimation) {\n return\n }\n requestAnimationFrame(() => {\n setAnimationShow(isOpen ?? false)\n })\n }, [isOpen, useAnimation])\n\n return (\n <ReactModal\n isOpen={isOpen ?? false}\n overlayClassName={cn(\n 'fixed inset-0 z-[999] flex items-center justify-center bg-black/70 leading-[1.2] md:items-end',\n overlayClassName\n )}\n className={cn(\n 'min-md:max-h-[calc(100vh-96px)] w-[540px] relative flex min-h-[200px] flex-col overflow-hidden bg-white outline-none transition-all duration-300 md:h-auto md:w-full',\n rounded && 'rounded-[16px] md:rounded-b-none',\n useAnimation && 'md:translate-y-[100vh]',\n animationShow && 'md:translate-y-0',\n className\n )}\n onRequestClose={onClose}\n {...props}\n >\n <div\n className={cn(\n 'flex w-full shrink-0 items-center justify-between',\n title ? 'min-l:px-[32px] h-[70px] border-b border-[#e2e2e2] px-[24px]' : 'h-[48px] px-[16px]',\n titleClassName\n )}\n >\n <div className=\"text-[18px] font-bold\">{title}</div>\n <div\n className=\"size-[22px] cursor-pointer\"\n onClick={onClose}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n onClose?.()\n }\n }}\n role=\"button\"\n tabIndex={0}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" viewBox=\"0 0 22 22\" fill=\"none\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16.8525 5.31015C16.4558 4.91337 15.8125 4.91338 15.4157 5.31015L11.1268 9.5991L6.83815 5.31049C6.44138 4.91372 5.79808 4.91372 5.40131 5.31049C5.00454 5.70726 5.00455 6.35055 5.40131 6.74732L9.68993 11.0359L5.40105 15.3248C5.00428 15.7216 5.00428 16.3649 5.40105 16.7616C5.79782 17.1584 6.44111 17.1584 6.83788 16.7616L11.1268 12.4728L15.416 16.762C15.8128 17.1588 16.456 17.1588 16.8528 16.762C17.2496 16.3652 17.2496 15.7219 16.8528 15.3252L12.5636 11.0359L16.8525 6.74698C17.2493 6.35021 17.2493 5.70692 16.8525 5.31015ZM16.921 6.02856C16.921 6.22992 16.8441 6.43127 16.6905 6.5849L14.465 8.8104L12.2395 11.0359L12.2395 11.0359L16.6905 6.58493C16.8441 6.43129 16.921 6.22993 16.921 6.02856ZM5.34966 6.19087C5.37992 6.3354 5.45115 6.47307 5.56336 6.58528L10.014 11.0359L10.014 11.0359L5.56336 6.58524C5.45116 6.47304 5.37992 6.33539 5.34966 6.19087ZM5.35087 16.2121C5.38193 16.3541 5.45267 16.4891 5.56309 16.5996C5.87037 16.9068 6.36856 16.9068 6.67583 16.5996L11.1268 12.1486L15.578 16.5999C15.8853 16.9072 16.3835 16.9072 16.6908 16.5999C16.8498 16.4409 16.9265 16.2307 16.9209 16.0223C16.9265 16.2307 16.8498 16.4409 16.6908 16.5999C16.3835 16.9072 15.8853 16.9072 15.578 16.5999L11.1268 12.1487L6.67583 16.5996C6.36856 16.9069 5.87037 16.9069 5.56309 16.5996C5.45267 16.4892 5.38192 16.3541 5.35087 16.2121Z\"\n fill=\"#333333\"\n />\n </svg>\n </div>\n </div>\n <div\n className={cn(\n 'my-[32px] flex-1 overflow-auto overscroll-contain px-[24px] md:mb-[48px]',\n !title && 'mt-0',\n 'min-l:px-[32px]',\n scrollClassName\n )}\n onScroll={event => {\n const targetElement = event.target as HTMLDivElement\n\n if (targetElement.scrollHeight <= targetElement.clientHeight) {\n return\n }\n\n if (targetElement.scrollTop + targetElement.clientHeight >= targetElement.scrollHeight - 50) {\n onScrollEnd && onScrollEnd(event)\n }\n }}\n >\n {children}\n </div>\n </ReactModal>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,IAAA,eAAAC,EAAAH,GA4DM,IAAAI,EAAA,6BA5DNC,EAAqE,yBACrEC,EAAkD,iBAClDC,EAAuB,0BAehB,MAAML,EAA6B,CAAC,CACzC,OAAAM,EACA,MAAAC,EACA,UAAAC,EAAY,GACZ,iBAAAC,EAAmB,GACnB,gBAAAC,EAAkB,GAClB,QAAAC,EACA,YAAAC,EACA,SAAAC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", "__toCommonJS", "import_jsx_runtime", "import_lib", "import_react", "import_react_modal", "isOpen", "title", "className", "overlayClassName", "scrollClassName", "onClose", "onScrollEnd", "children", "useAnimation", "titleClassName", "props", "brand", "rounded", "animationShow", "setAnimationShow", "ReactModal", "cn", "e", "event", "targetElement"]
7
7
  }
@@ -8,20 +8,21 @@ import { CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysTo
8
8
  import { CreditsRedeemListCopy } from '../components/credits/creditsRedeemList';
9
9
  import { CreditsCashCopy } from '../components/credits/creditsCash';
10
10
  import { CreditsFaqCopy } from '../components/credits/creditsFaq';
11
+ import { AuthCodeActivateCopy } from 'src/components/registration/authCodeActivate/type';
11
12
  export declare enum ComponentKey {
12
- Banner = "banner",
13
- InfoCard = "infoCard",
14
- Benefits = "benefits",
15
- WaysToGetCredits = "waysToGetCredits",
16
- RedeemList = "redeemList",
17
- SpendCreditsLikeCash = "spendCreditsLikeCash",
18
- Faqs = "faqs"
13
+ Banner = "creditsBanner",
14
+ InfoCard = "creditsInfoCard",
15
+ Benefits = "creditsBenefits",
16
+ WaysToGetCredits = "creditsWaysToGetCredits",
17
+ RedeemList = "creditsRedeemList",
18
+ SpendCreditsLikeCash = "creditsCash",
19
+ Faqs = "creditsFaq"
19
20
  }
20
21
  export type CreditsTemplateProps = {
21
22
  headlessConfig: HeadlessConfig;
22
23
  siteConfig: {
23
24
  registrationsSettings: {
24
- authCodeActivate: any;
25
+ authCodeActivate: AuthCodeActivateCopy;
25
26
  };
26
27
  taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
27
28
  };
@@ -1,2 +1,2 @@
1
- "use strict";var p=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var S=(s,i)=>{for(var r in i)p(s,r,{get:i[r],enumerable:!0})},k=(s,i,r,d)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of v(i))!B.call(s,t)&&t!==r&&p(s,t,{get:()=>i[t],enumerable:!(d=L(i,t))||d.enumerable});return s};var G=s=>k(p({},"__esModule",{value:!0}),s);var b={};S(b,{ComponentKey:()=>T,CreditsTemplate:()=>R});module.exports=G(b);var e=require("react/jsx-runtime"),n=require("@anker-in/lib"),a=require("../components/registration/context/provider"),C=require("../components/credits/context/provider"),m=require("../components/credits/creditsBanner"),f=require("../components/credits/creditsInfoCard"),y=require("../components/credits/creditsBenefits"),c=require("../components/credits/creditsWaysToGetCredits"),l=require("../components/credits/creditsRedeemList"),g=require("../components/credits/creditsCash"),P=require("../components/credits/creditsFaq"),T=(o=>(o.Banner="banner",o.InfoCard="infoCard",o.Benefits="benefits",o.WaysToGetCredits="waysToGetCredits",o.RedeemList="redeemList",o.SpendCreditsLikeCash="spendCreditsLikeCash",o.Faqs="faqs",o))(T||{});const R=({headlessConfig:s,siteConfig:i,userContext:r,pageConfig:d,registrationContext:t,gtm:u})=>(0,e.jsx)(n.HeadlessProvider,{headlessConfig:s,children:(0,e.jsx)(a.RegistrationProvider,{copy:i.registrationsSettings,email:r?.profile?.email,children:(0,e.jsx)(C.CreditsProvider,{profile:r?.profile,removeProfile:r?.removeProfile,isLoadingProfile:r?.isLoadingProfile,openSignInPopup:t.openSignInPopup,openSignUpPopup:t.openSignUpPopup,creditInfo:r?.creditInfo,taskIdToTypeMapping:i.taskIdToTypeMapping,customer:r?.customer,fetchCreditInfo:r?.fetchCreditInfo,customerLoading:r?.customerLoading,gtm:u,pageCommon:d.common,children:(0,e.jsx)("div",{className:(0,n.classNames)("bg-[#f5f5f7] leading-[1.2]"),children:d.order.map(h=>{const o=d.components?.[h];return o?(0,e.jsxs)(e.Fragment,{children:[I=>{switch(I){case"banner":return(0,e.jsx)(m.CreditsBanner,{copy:o});case"infoCard":return(0,e.jsx)(f.CreditsInfoCard,{copy:o});case"benefits":return(0,e.jsx)(y.CreditsBenefits,{copy:o});case"waysToGetCredits":return(0,e.jsx)(c.CreditsWaysToGetCredits,{copy:o});case"redeemList":return(0,e.jsx)(l.CreditsRedeemList,{copy:o});case"spendCreditsLikeCash":return(0,e.jsx)(g.CreditsCash,{copy:o});case"faqs":return(0,e.jsx)(P.CreditsFaq,{copy:o});default:return null}},(0,e.jsx)("div",{className:"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16"})]}):null})})})})});
1
+ "use strict";var a=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var L=(r,i)=>{for(var t in i)a(r,t,{get:i[t],enumerable:!0})},S=(r,i,t,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let d of u(i))!B.call(r,d)&&d!==t&&a(r,d,{get:()=>i[d],enumerable:!(n=v(i,d))||n.enumerable});return r};var F=r=>S(a({},"__esModule",{value:!0}),r);var R={};L(R,{ComponentKey:()=>h,CreditsTemplate:()=>K});module.exports=F(R);var e=require("react/jsx-runtime"),p=require("@anker-in/lib"),C=require("../components/registration/context/provider"),m=require("../components/credits/context/provider"),f=require("../components/credits/creditsBanner"),y=require("../components/credits/creditsInfoCard"),c=require("../components/credits/creditsBenefits"),l=require("../components/credits/creditsWaysToGetCredits"),g=require("../components/credits/creditsRedeemList"),T=require("../components/credits/creditsCash"),P=require("../components/credits/creditsFaq"),h=(o=>(o.Banner="creditsBanner",o.InfoCard="creditsInfoCard",o.Benefits="creditsBenefits",o.WaysToGetCredits="creditsWaysToGetCredits",o.RedeemList="creditsRedeemList",o.SpendCreditsLikeCash="creditsCash",o.Faqs="creditsFaq",o))(h||{});const K=({headlessConfig:r,siteConfig:i,userContext:t,pageConfig:n,registrationContext:d,gtm:I})=>(0,e.jsx)(p.HeadlessProvider,{headlessConfig:r,children:(0,e.jsx)(C.RegistrationProvider,{copy:i.registrationsSettings,email:t?.profile?.email,children:(0,e.jsx)(m.CreditsProvider,{profile:t?.profile,removeProfile:t?.removeProfile,isLoadingProfile:t?.isLoadingProfile,openSignInPopup:d.openSignInPopup,openSignUpPopup:d.openSignUpPopup,creditInfo:t?.creditInfo,taskIdToTypeMapping:i.taskIdToTypeMapping,customer:t?.customer,fetchCreditInfo:t?.fetchCreditInfo,customerLoading:t?.customerLoading,gtm:I,pageCommon:n.common,children:(0,e.jsx)("div",{className:(0,p.classNames)("bg-[#f5f5f7] leading-[1.2]"),children:n.order.map(s=>{const o=n.components?.[s];return o?(0,e.jsxs)(e.Fragment,{children:[s==="creditsBanner"&&(0,e.jsx)(f.CreditsBanner,{copy:o}),s==="creditsInfoCard"&&t?.profile&&(0,e.jsx)(y.CreditsInfoCard,{copy:o}),s==="creditsBenefits"&&(0,e.jsx)(c.CreditsBenefits,{copy:o}),s==="creditsWaysToGetCredits"&&(0,e.jsx)(l.CreditsWaysToGetCredits,{copy:o,classNames:r.brand==="anker"?{subtitle:"text-white",equalCreditsText:"bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent"}:{subtitle:"text-[#D1D1D1]",equalCreditsText:"text-[#F6EAD0]"}}),s==="creditsRedeemList"&&(0,e.jsx)(g.CreditsRedeemList,{copy:o}),s==="creditsCash"&&(0,e.jsx)(T.CreditsCash,{copy:o}),s==="creditsFaq"&&(0,e.jsx)(P.CreditsFaq,{copy:o}),s!=="creditsBanner"&&(0,e.jsx)("div",{className:"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16"})]}):null})})})})});
2
2
  //# sourceMappingURL=credits.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/templates/credits.tsx"],
4
- "sourcesContent": ["import { classNames, HeadlessConfig, HeadlessProvider } from '@anker-in/lib'\nimport { RegistrationProvider } from '../components/registration/context/provider'\n\nimport { DTC_TASK_TYPE } from '../components/credits/context/const'\nimport { CreditsProvider } from '../components/credits/context/provider'\nimport { CreditsPageCommon } from '../components/credits/type'\n\nimport { CreditsBanner, CreditsBannerCopy } from '../components/credits/creditsBanner'\nimport { CreditsInfoCard, CreditsInfoCardCopy } from '../components/credits/creditsInfoCard'\nimport { CreditsBenefits, CreditsBenefitsCopy } from '../components/credits/creditsBenefits'\nimport { CreditsWaysToGetCredits, CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysToGetCredits'\nimport { CreditsRedeemList, CreditsRedeemListCopy } from '../components/credits/creditsRedeemList'\nimport { CreditsCash, CreditsCashCopy } from '../components/credits/creditsCash'\nimport { CreditsFaq, CreditsFaqCopy } from '../components/credits/creditsFaq'\n\nexport enum ComponentKey {\n Banner = 'banner',\n InfoCard = 'infoCard',\n Benefits = 'benefits',\n WaysToGetCredits = 'waysToGetCredits',\n RedeemList = 'redeemList',\n SpendCreditsLikeCash = 'spendCreditsLikeCash',\n Faqs = 'faqs',\n}\nexport type CreditsTemplateProps = {\n headlessConfig: HeadlessConfig\n siteConfig: {\n registrationsSettings: {\n authCodeActivate: any\n }\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n }\n pageConfig: {\n order: ComponentKey[]\n common: CreditsPageCommon\n components: {\n [ComponentKey.Banner]?: CreditsBannerCopy\n [ComponentKey.InfoCard]?: CreditsInfoCardCopy\n [ComponentKey.Benefits]?: CreditsBenefitsCopy\n [ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy\n [ComponentKey.RedeemList]?: CreditsRedeemListCopy\n [ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy\n [ComponentKey.Faqs]?: CreditsFaqCopy\n }\n }\n userContext: {\n profile: any\n removeProfile: () => void\n isLoadingProfile: boolean\n creditInfo: any\n customer: any\n customerLoading: boolean\n fetchCreditInfo: () => void\n }\n registrationContext: {\n openSignUpPopup: () => void\n openSignInPopup: () => void\n }\n gtm: {\n pageGroup: string\n }\n}\n\nexport const CreditsTemplate = ({\n headlessConfig,\n siteConfig,\n userContext,\n pageConfig,\n registrationContext,\n gtm,\n}: CreditsTemplateProps) => {\n return (\n <HeadlessProvider headlessConfig={headlessConfig}>\n <RegistrationProvider copy={siteConfig.registrationsSettings} email={userContext?.profile?.email}>\n <CreditsProvider\n profile={userContext?.profile}\n removeProfile={userContext?.removeProfile}\n isLoadingProfile={userContext?.isLoadingProfile}\n openSignInPopup={registrationContext.openSignInPopup}\n openSignUpPopup={registrationContext.openSignUpPopup}\n creditInfo={userContext?.creditInfo}\n taskIdToTypeMapping={siteConfig.taskIdToTypeMapping}\n customer={userContext?.customer}\n fetchCreditInfo={userContext?.fetchCreditInfo}\n customerLoading={userContext?.customerLoading}\n gtm={gtm}\n pageCommon={pageConfig.common}\n >\n <div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>\n {pageConfig.order.map(item => {\n const componentCopy = pageConfig.components?.[item]\n if (!componentCopy) return null\n return (\n <>\n {(item: ComponentKey) => {\n switch (item) {\n case 'banner':\n return <CreditsBanner copy={componentCopy as CreditsBannerCopy} />\n case 'infoCard':\n return <CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} />\n case 'benefits':\n return <CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} />\n case 'waysToGetCredits':\n return <CreditsWaysToGetCredits copy={componentCopy as CreditsWaysToGetCreditsCopy} />\n case 'redeemList':\n return <CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} />\n case 'spendCreditsLikeCash':\n return <CreditsCash copy={componentCopy as CreditsCashCopy} />\n case 'faqs':\n return <CreditsFaq copy={componentCopy as CreditsFaqCopy} />\n default:\n return null\n }\n }}\n <div className=\"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16\" />\n </>\n )\n })}\n </div>\n </CreditsProvider>\n </RegistrationProvider>\n </HeadlessProvider>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,oBAAAC,IAAA,eAAAC,EAAAJ,GA6FgB,IAAAK,EAAA,6BA7FhBC,EAA6D,yBAC7DC,EAAqC,uDAGrCA,EAAgC,kDAGhCC,EAAiD,+CACjDC,EAAqD,iDACrDC,EAAqD,iDACrDC,EAAq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AO,IACX,CACF,KACA,OAAC,OAAI,UAAU,qEAAqE,GACtF,EAxByB,IA0B7B,CAAC,EACH,EACF,EACF,EACF",
6
- "names": ["credits_exports", "__export", "ComponentKey", "CreditsTemplate", "__toCommonJS", "import_jsx_runtime", "import_lib", "import_provider", "import_creditsBanner", "import_creditsInfoCard", "import_creditsBenefits", "import_creditsWaysToGetCredits", "import_creditsRedeemList", "import_creditsCash", "import_creditsFaq", "headlessConfig", "siteConfig", "userContext", "pageConfig", "registrationContext", "gtm", "item", "componentCopy"]
4
+ "sourcesContent": ["import { classNames, HeadlessConfig, HeadlessProvider } from '@anker-in/lib'\nimport { RegistrationProvider } from '../components/registration/context/provider'\n\nimport { DTC_TASK_TYPE } from '../components/credits/context/const'\nimport { CreditsProvider } from '../components/credits/context/provider'\nimport { CreditsPageCommon } from '../components/credits/type'\n\nimport { CreditsBanner, CreditsBannerCopy } from '../components/credits/creditsBanner'\nimport { CreditsInfoCard, CreditsInfoCardCopy } from '../components/credits/creditsInfoCard'\nimport { CreditsBenefits, CreditsBenefitsCopy } from '../components/credits/creditsBenefits'\nimport { CreditsWaysToGetCredits, CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysToGetCredits'\nimport { CreditsRedeemList, CreditsRedeemListCopy } from '../components/credits/creditsRedeemList'\nimport { CreditsCash, CreditsCashCopy } from '../components/credits/creditsCash'\nimport { CreditsFaq, CreditsFaqCopy } from '../components/credits/creditsFaq'\nimport { AuthCodeActivateCopy } from 'src/components/registration/authCodeActivate/type'\n\nexport enum ComponentKey {\n Banner = 'creditsBanner',\n InfoCard = 'creditsInfoCard',\n Benefits = 'creditsBenefits',\n WaysToGetCredits = 'creditsWaysToGetCredits',\n RedeemList = 'creditsRedeemList',\n SpendCreditsLikeCash = 'creditsCash',\n Faqs = 'creditsFaq',\n}\nexport type CreditsTemplateProps = {\n headlessConfig: HeadlessConfig\n siteConfig: {\n registrationsSettings: {\n authCodeActivate: AuthCodeActivateCopy\n }\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n }\n pageConfig: {\n order: ComponentKey[]\n common: CreditsPageCommon\n components: {\n [ComponentKey.Banner]?: CreditsBannerCopy\n [ComponentKey.InfoCard]?: CreditsInfoCardCopy\n [ComponentKey.Benefits]?: CreditsBenefitsCopy\n [ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy\n [ComponentKey.RedeemList]?: CreditsRedeemListCopy\n [ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy\n [ComponentKey.Faqs]?: CreditsFaqCopy\n }\n }\n userContext: {\n profile: any\n removeProfile: () => void\n isLoadingProfile: boolean\n creditInfo: any\n customer: any\n customerLoading: boolean\n fetchCreditInfo: () => void\n }\n registrationContext: {\n openSignUpPopup: () => void\n openSignInPopup: () => void\n }\n gtm: {\n pageGroup: string\n }\n}\n\nexport const CreditsTemplate = ({\n headlessConfig,\n siteConfig,\n userContext,\n pageConfig,\n registrationContext,\n gtm,\n}: CreditsTemplateProps) => {\n return (\n <HeadlessProvider headlessConfig={headlessConfig}>\n <RegistrationProvider copy={siteConfig.registrationsSettings} email={userContext?.profile?.email}>\n <CreditsProvider\n profile={userContext?.profile}\n removeProfile={userContext?.removeProfile}\n isLoadingProfile={userContext?.isLoadingProfile}\n openSignInPopup={registrationContext.openSignInPopup}\n openSignUpPopup={registrationContext.openSignUpPopup}\n creditInfo={userContext?.creditInfo}\n taskIdToTypeMapping={siteConfig.taskIdToTypeMapping}\n customer={userContext?.customer}\n fetchCreditInfo={userContext?.fetchCreditInfo}\n customerLoading={userContext?.customerLoading}\n gtm={gtm}\n pageCommon={pageConfig.common}\n >\n <div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>\n {pageConfig.order.map(key => {\n const componentCopy = pageConfig.components?.[key]\n if (!componentCopy) return null\n return (\n <>\n {key === ComponentKey.Banner && <CreditsBanner copy={componentCopy as CreditsBannerCopy} />}\n {key === ComponentKey.InfoCard && userContext?.profile && (\n <CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} />\n )}\n {key === ComponentKey.Benefits && <CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} />}\n {key === ComponentKey.WaysToGetCredits && (\n <CreditsWaysToGetCredits\n copy={componentCopy as CreditsWaysToGetCreditsCopy}\n classNames={\n headlessConfig.brand === 'anker'\n ? {\n subtitle: 'text-white',\n equalCreditsText:\n 'bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent',\n }\n : {\n subtitle: 'text-[#D1D1D1]',\n equalCreditsText: 'text-[#F6EAD0]',\n }\n }\n />\n )}\n {key === ComponentKey.RedeemList && (\n <CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} />\n )}\n {key === ComponentKey.SpendCreditsLikeCash && <CreditsCash copy={componentCopy as CreditsCashCopy} />}\n {key === ComponentKey.Faqs && <CreditsFaq copy={componentCopy as CreditsFaqCopy} />}\n {key !== ComponentKey.Banner && (\n <div className=\"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16\" />\n )}\n </>\n )\n })}\n </div>\n </CreditsProvider>\n </RegistrationProvider>\n </HeadlessProvider>\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,oBAAAC,IAAA,eAAAC,EAAAJ,GA8FgB,IAAAK,EAAA,6BA9FhBC,EAA6D,yBAC7DC,EAAqC,uDAGrCA,EAAgC,kDAGhCC,EAAiD,+CACjDC,EAAqD,iDACrDC,EAAqD,iDACrDC,EAAqE,yDACrEC,EAAyD,mDACzDC,EAA6C,6CAC7CC,EAA2C,4CAG/BZ,OACVA,EAAA,OAAS,gBACTA,EAAA,SAAW,kBACXA,EAAA,SAAW,kBACXA,EAAA,iBAAmB,0BACnBA,EAAA,WAAa,oBACbA,EAAA,qBAAuB,cACvBA,EAAA,KAAO,aAPGA,OAAA,IAgDL,MAAMC,EAAkB,CAAC,CAC9B,eAAAY,EACA,WAAAC,EACA,YAAAC,EACA,WAAAC,EACA,oBAAAC,EACA,IAAAC,CACF,OAEI,OAAC,oBAAiB,eAAgBL,EAChC,mBAAC,wBAAqB,KAAMC,EAAW,sBAAuB,MAAOC,GAAa,SAAS,MACzF,mBAAC,mBACC,QAASA,GAAa,QACtB,cAAeA,GAAa,cAC5B,iBAAkBA,GAAa,iBAC/B,gBAAiBE,EAAoB,gBACrC,gBAAiBA,EAAoB,gBACrC,WAAYF,GAAa,WACzB,oBAAqBD,EAAW,oBAChC,SAAUC,GAAa,SACvB,gBAAiBA,GAAa,gBAC9B,gBAAiBA,GAAa,gBAC9B,IAAKG,EACL,WAAYF,EAAW,OAEvB,mBAAC,OAAI,aAAW,cAAW,4BAA4B,EACpD,SAAAA,EAAW,MAAM,IAAIG,GAAO,CAC3B,MAAMC,EAAgBJ,EAAW,aAAaG,CAAG,EACjD,OAAKC,KAEH,oBACG,UAAAD,IAAQ,oBAAuB,OAAC,iBAAc,KAAMC,EAAoC,EACxFD,IAAQ,mBAAyBJ,GAAa,YAC7C,OAAC,mBAAgB,KAAMK,EAAsC,EAE9DD,IAAQ,sBAAyB,OAAC,mBAAgB,KAAMC,EAAsC,EAC9FD,IAAQ,8BACP,OAAC,2BACC,KAAMC,EACN,WACEP,EAAe,QAAU,QACrB,CACE,SAAU,aACV,iBACE,4EACJ,EACA,CACE,SAAU,iBACV,iBAAkB,gBACpB,EAER,EAEDM,IAAQ,wBACP,OAAC,qBAAkB,KAAMC,EAAwC,EAElED,IAAQ,kBAAqC,OAAC,eAAY,KAAMC,EAAkC,EAClGD,IAAQ,iBAAqB,OAAC,cAAW,KAAMC,EAAiC,EAChFD,IAAQ,oBACP,OAAC,OAAI,UAAU,qEAAqE,GAExF,EAjCyB,IAmC7B,CAAC,EACH,EACF,EACF,EACF",
6
+ "names": ["credits_exports", "__export", "ComponentKey", "CreditsTemplate", "__toCommonJS", "import_jsx_runtime", "import_lib", "import_provider", "import_creditsBanner", "import_creditsInfoCard", "import_creditsBenefits", "import_creditsWaysToGetCredits", "import_creditsRedeemList", "import_creditsCash", "import_creditsFaq", "headlessConfig", "siteConfig", "userContext", "pageConfig", "registrationContext", "gtm", "key", "componentCopy"]
7
7
  }
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  import type { DTC_TASK_TYPE } from './const';
3
3
  import type { CreditInfoResponse } from './response';
4
4
  import { CreditsPageCommon } from '../type';
@@ -18,7 +18,7 @@ type Context = {
18
18
  };
19
19
  pageCommon: CreditsPageCommon;
20
20
  };
21
- export declare const CreditsContext: React.Context<Context>;
21
+ export declare const CreditsContext: import("react").Context<Context>;
22
22
  export declare function CreditsProvider({ children, profile, removeProfile, isLoadingProfile, openSignInPopup, openSignUpPopup, taskIdToTypeMapping, creditInfo, customer, customerLoading, fetchCreditInfo, gtm, pageCommon, }: PropsWithChildren<Context>): import("react/jsx-runtime").JSX.Element;
23
23
  export declare function useCreditsContext(): Context;
24
24
  export {};