1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[12516],{9901:(e,t,a)=>{a.d(t,{R:()=>c});var l=a(13744),n=a(96199),r=a(12115),s=a(85400);let o={revalidateOnFocus:!1,revalidateOnReconnect:!1,dedupingInterval:3e5,revalidateIfStale:!1};function i(e){return"/api/v1/users/proxies?limit=1&filter=".concat(encodeURIComponent(e))}function c(){var e,t,a;let{data:c,status:d}=(0,n.wV)(),x=(0,r.useMemo)(()=>Date.now(),[]),u="status.id:$eq:number:".concat(6,";expiredAt:$gt:number:").concat(x),h="".concat(u,";expiredAt:$lte:number:").concat(x+216e5),p=e=>{let[t]=e;return l.A.fetchApi(t,null==c?void 0:c.accessToken).then(e=>null!=e?e:{}).catch(()=>({}))},{data:m,isLoading:f}=(0,s.Ay)("authenticated"===d?[i(u)]:null,p,o),{data:g,isLoading:b}=(0,s.Ay)("authenticated"===d?[i(h)]:null,p,o);return{active:null!=(e=null==m?void 0:m.total)?e:0,expiringSoon:null!=(t=null==g?void 0:g.total)?t:0,isLoading:null!=(a=f||b)&&a}}},10512:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(71847).A)("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]])},18206:(e,t,a)=>{a.d(t,{bq:()=>u,eb:()=>f,gC:()=>m,l6:()=>d,yv:()=>x});var l=a(95155),n=a(47887),r=a(12108),s=a(24033),o=a(12115),i=a(34513),c=a(64269);let d=n.bL;n.YJ;let x=n.WT,u=o.forwardRef((e,t)=>{let{className:a,children:r,...s}=e;return(0,l.jsxs)(n.l9,{ref:t,className:(0,c.cn)("border-border-template-5 ring-offset-background data-[placeholder]:text-muted-foreground [&>span]:text-sidebar-foreground flex h-10 w-full items-center justify-between gap-2 rounded-lg border bg-white px-3 py-2.5 text-sm whitespace-nowrap shadow-[4px_4px_8px_0_var(--shadow-proxy-input))] focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","data-[state=open]:border-primary data-[state=open]:ring-primary/20 data-[state=open]:ring-[3px]","[&>*:first-child]:min-w-0 [&>*:first-child]:flex-1 [&>*:first-child]:overflow-hidden [&>*:first-child]:text-ellipsis [&>*:first-child]:whitespace-nowrap",a),...s,children:[r,(0,l.jsx)(n.In,{asChild:!0,className:"hover:cursor-pointer",children:(0,l.jsx)(i.F.ChevronsDownIcon,{className:"h-[24px] w-[24px] text-[rgb(from_var(--sidebar-foreground)_calc(r_-_73)_calc(g_-_73)_calc(b_-_72))]"})})]})});u.displayName=n.l9.displayName,o.forwardRef((e,t)=>{let{className:a,children:r,...s}=e;return(0,l.jsxs)(n.l9,{ref:t,className:(0,c.cn)("border-input ring-offset-background data-[placeholder]:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 rounded-lg border px-3 py-2.5 text-sm whitespace-nowrap shadow-[4px_4px_8px_0_var(--shadow-proxy-input))] focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","data-[state=open]:border-primary data-[state=open]:ring-primary/20 data-[state=open]:ring-[3px]",a),...s,children:[r,(0,l.jsx)(n.In,{asChild:!0,className:"hover:cursor-pointer",children:(0,l.jsx)(i.F.ChevronsDownIcon,{className:"h-[20px] w-[20px] text-[#161616]"})})]})}).displayName=n.l9.displayName;let h=o.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(n.PP,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,l.jsx)(r.A,{className:"h-4 w-4"})})});h.displayName=n.PP.displayName;let p=o.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,l.jsx)(n.wn,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...r,children:(0,l.jsx)(s.A,{className:"h-4 w-4"})})});p.displayName=n.wn.displayName;let m=o.forwardRef((e,t)=>{let{className:a,children:r,position:s="popper",...o}=e;return(0,l.jsx)(n.ZL,{children:(0,l.jsxs)(n.UC,{ref:t,className:(0,c.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] origin-[--radix-select-content-transform-origin] overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:s,...o,children:[(0,l.jsx)(h,{}
1),(0,l.jsx)(n.LM,{className:(0,c.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,l.jsx)(p,{})]})})});m.displayName=n.UC.displayName,o.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,l.jsx)(n.JU,{ref:t,className:(0,c.cn)("px-2 py-1.5 text-sm font-semibold",a),...r})}).displayName=n.JU.displayName;let f=o.forwardRef((e,t)=>{let{className:a,children:r,...s}=e;return(0,l.jsx)(n.q7,{ref:t,className:(0,c.cn)("focus:bg-accent relative flex w-full cursor-default items-center rounded-lg py-1.5 pr-8 pl-2 text-sm outline-none select-none focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...s,children:(0,l.jsx)(n.p4,{children:r})})});f.displayName=n.q7.displayName,o.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,l.jsx)(n.wv,{ref:t,className:(0,c.cn)("bg-muted -mx-1 my-1 h-px",a),...r})}).displayName=n.wv.displayName},20305:(e,t,a)=>{a.d(t,{A:()=>l});var l=(0,a(30313).A)("outline","command","IconCommand",[["path",{d:"M7 9a2 2 0 1 1 2 -2v10a2 2 0 1 1 -2 -2h10a2 2 0 1 1 -2 2v-10a2 2 0 1 1 2 2h-10",key:"svg-0"}]])},30030:(e,t,a)=>{a.d(t,{q:()=>l});let l=[{name:"HTTP",value:"HTTP"},{name:"SOCKS5",value:"SOCKS"}
1]},30313:(e,t,a)=>{a.d(t,{A:()=>r});var l=a(12115),n={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};let r=(e,t,a,r)=>{let s=(0,l.forwardRef)((a,s)=>{let{color:o="currentColor",size:i=24,stroke:c=2,title:d,className:x,children:u,...h}=a;return(0,l.createElement)("svg",{ref:s,...n[e],width:i,height:i,className:["tabler-icon","tabler-icon-".concat(t),x].join(" "),..."filled"===e?{fill:o}:{strokeWidth:c,stroke:o},...h},[d&&(0,l.createElement)("title",{key:"svg-title"},d),...r.map(e=>{let[t,a]=e;return(0,l.createElement)(t,a)}),...Array.isArray(u)?u:[u]])});return s.displayName="".concat(a),s}},42716:(e,t,a)=>{a.r(t),a.d(t,{default:()=>H});var l=a(95155),n=a(96199),r=a(71105),s=a(75746),o=a(12115),i=a(64269),c=a(13744),d=a(9901),x=a(55635);function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#141327",[a,l]=(0,o.useState)(t);return(0,o.useEffect)(()=>{let t=getComputedStyle(document.documentElement).getPropertyValue(e).trim();t&&l(t)},[e]),a}function h(e,t){let a=function(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}(e);if(!a)return e;let l=Math.min(255,a.r+t),n=Math.min(255,a.g+t),r=Math.min(255,a.b+t);return"rgb(".concat(l,", ").concat(n,", ").concat(r,")")}function p(e){let{label:t,value:a,gradient:n,shadowBg:r,cardBg:s}=e;return(0,l.jsxs)("div",{className:"relative h-14 w-full min-w-0 lg:h-20 lg:w-[183.33px]",children:[(0,l.jsx)("div",{className:"absolute -top-3 left-[35.78px] hidden h-[60px] w-[112px] rounded-[8px] lg:block",style:{background:"rgba(77, 77, 77, 0.2)"}}),(0,l.jsx)("div",{className:"absolute -top-1 left-[19.78px] hidden h-[54px] w-[144px] rounded-[8px] lg:block",style:{background:s}}),(0,l.jsxs)("div",{className:"flex h-full w-full min-w-0 flex-col justify-center gap-1 rounded-lg px-2 py-2 sm:px-3 lg:absolute lg:top-[9px] lg:left-0 lg:h-[62px] lg:w-[183.33px] lg:gap-2 lg:px-4",style:{background:n},children:[(0,l.jsx)("span",{className:"font-mulish truncate text-[10px] leading-[13px] font-normal text-[#2B2958] sm:text-[11px] sm:leading-[14px] lg:text-sm lg:leading-[18px]",children:t}),(0,l.jsx)("span",{className:"font-mulish truncate text-[11px] leading-[14px] font-bold text-white sm:text-xs sm:leading-[15px] lg:text-base lg:leading-5",children:a})]})]})}function m(e){let{isAuthenticated:t,balance:a,className:n}=e,[r,s]=(0,o.useState)("..."),m=u("--sidebar","#141327"),f=u("--primary","#6026FF"),g={base:m,light:h(m,28),accent:"#720095"},b={light:h(f,100),dark:h(f,60)};(0,o.useEffect)(()=>{(0,x.T1)().then(e=>s(e)).catch(()=>s("N/A"))},[]);let{active:w,expiringSoon:v}=(0,d.R)();return(0,l.jsxs)("div",{className:(0,i.cn)("flex w-full min-w-0 flex-col gap-3",n),children:[(0,l.jsx)("h2",{className:"font-mulish text-base leading-5 font-bold text-white",children:"Tá»ng quan"}),(0,l.jsxs)("div",{className:"relative flex w-full min-w-0 flex-col gap-3 overflow-hidden rounded-lg bg-[rgb(from_var(--sidebar)_calc(r_+_9)_calc(g_+_10)_calc(b_+_10))] p-3 lg:h-28 lg:flex-row lg:items-center lg:gap-6 lg:p-0",children:[(0,l.jsxs)("svg",{width:"441",height:"96",viewBox:"0 0 441 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"absolute bottom-0 left-20 hidden lg:block",children:[(0,l.jsx)("path",{d:"M0 91.5162C8.46155 78.0887 15.4554 68.186 25.3824 48.8054C29.979 39.831 38.6184 21.4593 47.9083 21.1923C50.2674 21.1242 52.5769 22.2389 54.5983 23.8481C60.9079 28.8693 64.4217 38.1842 67.3615 47.1263C73.3987 65.4926 84.4557 87.5308 102.043 84.7012C113.971 82.7819 122.201 68.5462 129.543 55.9448C136.886 43.3434 146.698 30.0896 158.669 31.4785C175.275 33.4031 184.59 62.2867 201.222 63.7723C210.569 64.6074 218.767 56.3659 226.762 49.9003C234.76 43.4348 245.396 38.5784 253.077 45.6873C262.067 54.0094 262.619 75.1086 273.252 78.6585C285.721 82.8196 292.766 62.0824 296.467 50.0043C300.636 36.4011 303.7 0 314.318 0C330.736 0 326.554 83.8123 347.124 83.8123C367.694 83.8123 362.109 40.6518 381.812 40.6518C401.515 40.6518 410.17 87.3946 441 87.3946V101.091H0V91.5162Z",fill:"url(#paint0_linear_46_682)",fillOpacity:"0.5"}),(0,l.jsx)("defs",{children:(0,l.jsxs)("linearGradient",{id:"paint0_linear_46_682",x1:"441.003",y1:"50.5447",x2:"0.000473145",y2:"50.5447",gradientUnits:"userSpaceOnUse",children:[(0,l.jsx)("stop",{stopColor:g.base}),(0,l.jsx)("stop",{offset:"0.346154",stopColor:g.accent,stopOpacity:"0.4"}),(0,l.jsx)("stop",{offset:"0.711538",stopColor:g.light}),(0,l.jsx)("stop",{offset:"1",stopColor:g.base})]})})]}),(0,l.jsxs)("svg",{width:"369",height:"96",viewBox:"0 0 369 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"absolute top-0 left-19.5 hidden lg:block",children:[(0,l.jsx)("path",{d:"M263 0.5C264.427 0.5 265.746 1.58521 266.979 3.84082C268.199 6.07268 269.245 9.29468 270.179 13.2119C272.045 21.0406 273.429 31.4861 274.928 41.9766C276.424 52.4459 278.034 62.9594 280.353 70.8574C281.511 74.8037 282.858 78.1373 284.481 80.4941C286.105 82.8512 288.065 84.3124 290.45 84.3125C295.017 84.3125 298.087 81.4285 300.366 77.3105C302.64 73.2036 304.198 67.7476 305.716 62.3682C307.243 56.9546 308.728 51.6184 310.847 47.6299C312.962 43.6477 315.629 41.1514 319.476 41.1514C321.384 41.1515 323.19 41.9607 324.957 43.4443C326.728 44.9316 328.433 47.0754 330.121 49.6855C333.502 54.913 336.739 61.88 340.3 68.915C343.848 75.9243 347.711 82.9844 352.319 88.293C356.816 93.4719 362.075 97.0422 368.5 97.2188V100.591H0.821289C4.229 93.9845 7.36304 86.0036 10.627 77.3574C14.016 68.3798 17.5507 58.6792 21.6982 49.002C23.6278 44.4996 26.3829 37.6976 29.625 31.9805C31.2461 29.1219 32.9738 26.5606 34.7627 24.7041C36.5609 22.8379 38.3543 21.7525 40.1035 21.6924C41.879 21.6311 43.6865 22.6369 45.3398 24.21C47.9
1068 26.6514 49.929 30.163 51.6201 34.21C53.3094 38.2525 54.6526 42.7903 55.8818 47.2588C58.4117 56.4567 62.0029 66.6168 66.8281 74.1328C71.6395 81.6272 77.802 86.6683 85.4775 85.1924C90.669 84.194 94.9833 80.0126 98.7373 74.6143C102.501 69.2023 105.775 62.4552 108.843 56.1641C111.911 49.8711 115.477 43.4557 119.505 38.792C123.545 34.1147 127.947 31.3153 132.695 31.9736C136.005 32.4321 139.001 34.5039 141.873 37.4746C144.743 40.4435 147.432 44.2469 150.15 48.0791C152.857 51.8949 155.595 55.7407 158.533 58.7217C161.47 61.7011 164.669 63.8801 168.316 64.2695C172.424 64.7081 176.226 62.7572 179.787 59.9678C183.343 57.1824 186.773 53.4627 190.087 50.2598C193.409 47.0497 197.238 44.284 200.989 43.1836C202.858 42.6354 204.691 42.5053 206.431 42.9238C208.166 43.3413 209.841 44.3124 211.387 46.0225C213.205 48.0343 214.618 50.845 215.852 54.0312C217.085 57.2168 218.118 60.7197 219.207 64.1152C220.291 67.4943 221.43 70.7653 222.866 73.418C224.301 76.0663 226.07 78.1718 228.454 79.123C231.246 80.2366 233.753 79.672 235.94 78.0352C238.099 76.4198 239.953 73.7609 241.548 70.6494C244.742 64.419 247.002 56.1632 248.549 50.1289C249.428 46.7022 250.245 41.8521 251.113 36.5332C251.984 31.2035 252.908 25.3888 253.999 20C255.092 14.6054 256.346 9.67156 257.869 6.0957C258.631 4.30657 259.448 2.88946 260.321 1.92676C261.191 0.967637 262.079 0.500155 263 0.5Z",stroke:"url(#paint0_linear_46_684)",strokeOpacity:"0.2"}),(0,l.jsx)("defs",{children:(0,l.jsxs)("linearGradient",{id:"paint0_linear_46_684",x1:"184.5",y1:"0",x2:"184.5",y2:"101.091",gradientUnits:"userSpaceOnUse",children:[(0,l.jsx)("stop",{stopColor:b.light}),(0,l.jsx)("stop",{offset:"1",stopColor:b.dark})]})})]}),(0,l.jsxs)("div",{className:"z-10 flex min-w-0 flex-col justify-center gap-1 lg:flex-1 lg:gap-2 lg:px-6",children:[(0,l.jsx)("span",{className:"font-mulish text-xs leading-[15px] font-normal text-[#F5F5F6] sm:text-sm sm:leading-[18px]",children:"V\xed cá»§a bạn"}),(0,l.jsxs)("span",{className:"font-mulish text-primary text-xl leading-6 font-bold sm:text-2xl sm:leading-[30px]",children:[t?c.A.formatNum2(a):"-"," Ä"]})]}),(0,l.jsxs)("div",{className:"z-10 grid min-w-0 grid-cols-3 gap-2 lg:flex lg:flex-row lg:items-center lg:gap-6 lg:px-6 lg:pt-4",children:[(0,l.jsx)(p,{label:"Äá»a chá» IP",value:t?r:"-",gradient:"linear-gradient(82.09deg, #0594F8 4.93%, #00B5DD 97.42%)",shadowBg:"rgba(77, 77, 77, 0.2)",cardBg:"#322E3E"}),(0,l.jsx)(p,{label:"Proxy hoạt Äá»ng",value:t?"".concat(w," Proxy"):"-",gradient:"linear-gradient(260.74deg, #00BDA1 1.19%, #00C75F 100.16%)",shadowBg:"rgba(77, 77, 77, 0.2)",cardBg:"#3B443A"}),(0,l.jsx)(p,{label:"Proxy sắp hết hạn",value:t?"".concat(v," Proxy"):"-",gradient:"linear-gradient(80.63deg, #FF7500 0.16%, #F1AF00 98.73%)",shadowBg:"rgba(77, 77, 77, 0.2)",cardBg:"#3F3C39"})]})]})]})}var f=a(39180),g=a(86091),b=a(75507),w=a(77128),v=a(15239),j=a(72712),_=a(93154),y=a(7125),N=a(6191),C=a(10512),k=a(22544),B=a(66942),S=a(7392),V=a(30418),M=a(18206),A=a(91757),T=a(66280),D=a(12700),I=a(96787),F=a(30030);function q(e){let t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"0":t.toLocaleString("vi-VN")}let P={viettel:"/images/images-template-7/viettel.png",fpt:"/images/images-template-7/fpt.png",vnpt:"/images/images-template-7/vnpt.png"};function R(e){let{label:t,isActive:a,onClick:n}=e;return(0,l.jsx)("button",{type:"button",onClick:n,className:(0,i.cn)("flex cursor-pointer items-center justify-center rounded-lg px-2 py-1 sm:px-3",a?"bg-[rgb(from_var(--sidebar)_calc(r_+_9)_calc(g_+_10)_calc(b_+_10))]":"bg-transparent"),children:(0,l.jsx)("span",{className:(0,i.cn)("font-mulish text-xs leading-[15px] sm:text-sm sm:leading-[18px]",a?"font-bold text-white":"font-normal text-[#989898]"),children:t})})}function z(e){let{logoSrc:t,product:a,locations:n,onSubmitPayment:r,onLoginRequired:s}=e,{form:i,totalPrice:c,originTotalPrice:d,wQuantity:x,onSubmit:u}=(0,D.k)({product:a,defaultValues:{user:"",password:""},onAuthRequired:s,onPayloadBuilt:r,openPaymentOnSubmit:!1}),[h,p]=(0,o.useState)("1");(0,o.useEffect)(()=>{var e;p(String(null!=(e=i.getValues("quantity"))?e:""))},[i]);let m=e=>{let t=Math.max(1,x+e);p(String(t)),i.setValue("quantity",t,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})};return(0,l.jsx)(S.lV,{...i,children:(0,l.jsxs)("form",{onSubmit:i.handleSubmit(u),className:"flex w-full min-w-0 flex-col gap-3 rounded-2xl border border-white/10 bg-[rgb(from_var(--sidebar)_calc(r_+_9)_calc(g_+_10)_calc(b_+_10))] p-3 md:flex-row md:p-4",children:[(0,l.jsx)("div",{className:"hidden h-[46px] w-16 flex-shrink-0 items-center justify-center rounded-lg bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] md:flex",children:(0,l.jsx)(v.default,{src:t,alt:"Provider logo",width:48,height:19,className:"h-auto w-12 object-contain"})}),(0,l.jsxs)("div",{className:"flex flex-1 flex-col gap-3",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row",children:[(0,l.jsx)(S.zB,{control:i.control,name:"location",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex flex-1 flex-col gap-1.5",children:[(0,l.jsx)(S.lR,{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"Äá»a Äiá»m"}),(0,l.jsxs)(M.l6,{onValueChange:t.onChange,value:t.value,children:[(0,l.jsx)(S.MJ,{children:(0,l.jsx)(M.bq,{className:"h-[31px] rounded border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] px-3 py-2 text-xs",children:(0,l.jsx)(M.yv,{placeholder:"random"})})}),(0,l.jsxs)(M.gC,{children:[(0,l.jsx)(M.eb,{value:"random",children:"Random"}),n.length>0?n.map(e=>(0,l.jsx)(M.eb,{value:e.slug,children:e.name},e.id)):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(M.eb,{value:"HCM",children:"TP. Há» Ch\xed Minh"}),(0,l.jsx)(M.eb,{value:"HN",children:"H\xe0 Ná»i"}),(0,l.jsx)(M.eb,{value:"BDG",children:"B\xecnh Dương"})]})]})]}),(0,l.jsx)(S.C5,{})]})}}),(0,l.jsx)(S.zB,{control:i.control,name:"prefix_ip",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex flex-1 flex-col gap-1.5",children:[(0,l.jsx)(S.lR,{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"Äầu IP"}),(0,l.jsxs)(M.l6,{onValueChange:t.onChange,value:t.value||"random",children:[(0,l.jsx)(S.MJ,{children:(0,l.jsx)(M.bq,{className:"h-[31px] rounded border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] px-3 py-2 text-xs text-white",children:(0,l.jsx)(M.yv,{placeholder:"random"})})}),(0,l.jsx)(M.gC,{children:(0,l.jsx)(M.eb,{value:"random",children:"random"})})]}),(0,l.jsx)(S.C5,{})]})}})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row",children:[(0,l.jsx)(S.zB,{control:i.control,name:"dayOfUse",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex flex-1 flex-col gap-1.5",children:[(0,l.jsx)(S.lR,{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"Ng\xe0y sá» dụng"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{type:"number",min:1,placeholder:"nháºp sá» ng\xe0y",useCustomStepper:!0,value:t.value>0?t.value:"",onKeyDown:g.Y$,onChange:e=>{let a=e.target.value;if(""===a)return void t.onChange("");
1t.onChange(+a)},onBlur:()=>{(!t.value||t.value<1)&&t.onChange(1)},className:"h-[31px] rounded border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] px-3 py-2 text-xs text-white placeholder:text-[#B6B6B7]"})}),(0,l.jsx)(S.C5,{})]})}}),(0,l.jsx)(S.zB,{control:i.control,name:"protocolType",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex flex-1 flex-col gap-1.5",children:[(0,l.jsx)(S.lR,{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"Giao thức"}),(0,l.jsxs)(M.l6,{onValueChange:t.onChange,value:t.value,children:[(0,l.jsx)(S.MJ,{children:(0,l.jsx)(M.bq,{className:"h-[31px] rounded border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] px-3 py-2 text-xs text-white",children:(0,l.jsx)(M.yv,{placeholder:"HTTP"})})}),(0,l.jsx)(M.gC,{children:F.q.map(e=>(0,l.jsx)(M.eb,{value:e.value,children:e.name},e.value))})]}),(0,l.jsx)(S.C5,{})]})}})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row",children:[(0,l.jsx)(S.zB,{control:i.control,name:"user",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex flex-1 flex-col gap-1.5",children:[(0,l.jsx)(S.lR,{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"T\xe0i khoản"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{type:"text",placeholder:"random",value:"random"===t.value?"":t.value,onChange:e=>t.onChange(e.target.value.trim()||"random"),className:"h-[31px] rounded border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] px-3 py-2 text-xs text-[#B6B6B7] placeholder:text-[#B6B6B7]"})}),(0,l.jsx)(S.C5,{})]})}}),(0,l.jsx)(S.zB,{control:i.control,name:"password",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex flex-1 flex-col gap-1.5",children:[(0,l.jsx)(S.lR,{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"Máºt khẩu"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{type:"text",placeholder:"random",value:"random"===t.value?"":t.value,onChange:e=>t.onChange(e.target.value||"random"),className:"h-[31px] rounded border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] px-3 py-2 text-xs text-white placeholder:text-[#B6B6B7]"})}),(0,l.jsx)(S.C5,{})]})}})]}),(0,l.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,l.jsx)("span",{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"Sá» lượng"}),(0,l.jsxs)("div",{className:"flex flex-row items-center gap-3 sm:gap-5",children:[(0,l.jsx)("button",{type:"button",onClick:()=>m(-1),className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded-full bg-white/20",children:(0,l.jsx)(y.A,{className:"h-3.5 w-3.5 text-[#DBDBDC]"})}),(0,l.jsx)(V.p,{type:"text",value:""===h?"":h.padStart(2,"0"),onKeyDown:g.Y$,onChange:e=>(0,g.Wj)({form:i,name:"quantity",nextValue:e.target.value.replace(/\D/g,""),setInputValue:p,onValueChange:e=>i.setValue("quantity",e,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),onBlur:()=>(0,g.xf)({form:i,name:"quantity",setInputValue:p,onValueChange:e=>i.setValue("quantity",e,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),min:1}),style:{width:"".concat(Math.max(2,h.length||1)+1,"ch")},className:"no-spinner flex h-[34px] min-w-[41px] items-center justify-center rounded-[8px] border border-[#462E90] bg-transparent p-0 text-center text-sm leading-[18px] font-normal text-white shadow-none focus-visible:ring-0"}),(0,l.jsx)("button",{type:"button",onClick:()=>m(1),className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded-full bg-white/20",children:(0,l.jsx)(N.A,{className:"h-3.5 w-3.5 text-[#DBDBDC]"})})]})]}),(0,l.jsxs)("div",{className:"flex flex-row flex-wrap items-center justify-between gap-3 sm:flex-nowrap",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-row items-center gap-2",children:[(0,l.jsx)("span",{className:"font-mulish text-xs leading-[15px] font-bold whitespace-nowrap text-white",children:"Tá»ng tiá»n"}),(0,l.jsxs)("span",{className:"font-mulish text-sm leading-5 font-bold whitespace-nowrap sm:text-base",style:{background:"var(--primary-gradient-template-9)",WebkitBackgroun
1dClip:"text",WebkitTextFillColor:"transparent"},children:[c?q(c):"","Ä"]}),d&&c&&Number(d)>Number(c)?(0,l.jsxs)("span",{className:"text-[18px] font-bold whitespace-nowrap text-[#6D7175] line-through",children:[q(d),"Ä"]}):null]}),(0,l.jsx)("button",{type:"submit",className:"flex h-8 min-w-[86px] flex-1 cursor-pointer items-center justify-center gap-2 rounded-full px-5 py-2",style:{background:"var(--primary-gradient-template-9)",boxShadow:"0px 5px 6px rgba(43, 0, 128, 0.35)"},children:(0,l.jsx)(C.A,{className:"h-4 w-4 text-white"})})]})]})]})})}function L(e){let{label:t,totalPrice:a,isActive:n,onClick:r}=e;return(0,l.jsxs)("button",{type:"button",onClick:r,className:(0,i.cn)("flex h-[58px] w-full cursor-pointer flex-col items-start justify-center gap-1 rounded-lg px-4 py-2",n?"":"bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))]"),style:n?{background:"var(--primary-gradient-template-9)"}:void 0,children:[(0,l.jsx)("span",{className:(0,i.cn)("font-mulish text-sm leading-[18px] font-normal",n?"text-[#F5F5F6]":"text-[#B6B6B7]"),children:t}),(0,l.jsx)("span",{className:"font-mulish text-base leading-5 font-bold",style:n?{color:"#FFFFFF"}:{background:"var(--primary-gradient-template-9)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:a})]})}function U(e){let{label:t,value:a,isPrimaryValue:n=!1,children:r}=e;return r?(0,l.jsx)("div",{className:"flex flex-row items-center gap-2",children:r}):(0,l.jsxs)("div",{className:"flex flex-row items-center gap-1",children:[t&&(0,l.jsx)("span",{className:"font-mulish text-[13px] leading-4 font-normal text-white",children:t}),a&&(0,l.jsx)("span",{className:(0,i.cn)("font-mulish text-[13px] leading-4 font-normal",n?"text-[rgb(from_var(--primary)_calc(r_+_80)_calc(g_+_105)_calc(b_-_44))]":"text-white"),children:a})]})}function E(e){var t;let{products:a,onSubmitPayment:n,isAuthenticated:r,onLoginRequired:s,isCdk:i=!1}=e,c={ngà y:1,tuần:2,tháng:3},d=[...a].sort((e,t)=>{var a,l;let n=((null==(a=e.category)?void 0:a.unit)||"").toLowerCase().trim(),r=((null==(l=t.category)?void 0:l.unit)||"").toLowerCase().trim();return(c[n]||999)-(c[r]||999)}),[x,u]=(0,o.useState)(0),h=d[x]||d[0],p=(0,k.mN)({resolver:(0,B.u)(g._m),defaultValues:{dayOfUse:1,quantity:1,protocolType:"HTTP",user:"random",password:"",rotateInterval:0,isAutoRotate:!1,isCdk:i},mode:"onChange",reValidateMode:"onChange"}),m=p.watch("quantity"),f=p.watch("dayOfUse"),w=Number(m),j=Number(f),_=Number.isFinite(w)&&Number.isFinite(j)&&w>=1&&j>=1,M=_?w:0,D=_?j:0,I=p.watch("isAutoRotate");(0,o.useEffect)(()=>{I?0===p.getValues("rotateInterval")&&p.setValue("rotateInterval",1):p.setValue("rotateInterval",0)},[I,p]);let{rulesByCategory:F}=(0,T.S1)(),R=(null==h||null==(t=h.category)?void 0:t.id)?F[h.category.id]:void 0,z=(0,b.Zz)({price:Number(null==h?void 0:h.price),quantity:M,days:D,discountRules:R}),E=(0,b.Zz)({price:Number(null==h?void 0:h.originPrice),quantity:M,days:D,hasDiscountConfig:!1}),[J,O]=(0,o.useState)("1"),K=e=>{let t=Math.max(1,m+e);O(String(t)),p.setValue("quantity",t,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})};async function H(e){if(!r)return void s();e.password=btoa(Math.random().toString()).substring(12).toLowerCase(),n({products:[{...e,provider:null==h?void 0:h.provider,product:{id:null==h?void 0:h.id}}],total:z})}async function W(e){if(!r)return void s();let t={...e};t.user&&"random"!==t.user.toLowerCase()||(t.user=btoa(Math.random().toString()).substring(10,18).toLowerCase()),t.password&&"random"!==t.password.toLowerCase()||(t.password=btoa(Math.random().toString()).substring(12).toLowerCase()),n({products:[{...t,provider:null==h?void 0:h.provider,product:{id:null==h?void 0:h.id}}],total:z})}(0,o.useEffect)(()=>{var e;O(String(null!=(e=p.getValues("quantity"))?e:""))},[p]);let $=i?H:W;return d.length?(0,l.jsx)(S.lV,{...p,children:(0,l.jsxs)("form",{onSubmit:p.handleSubmit($),className:"flex w-full flex-col gap-6 lg:flex-row lg:gap-6",children:[(0,l.jsxs)("div",{className:"flex w-full flex-col gap-4 roun
1ded-2xl border border-white/10 bg-[rgb(from_var(--sidebar)_calc(r_+_9)_calc(g_+_10)_calc(b_+_10))] p-4 lg:w-[270px] lg:px-6",children:[(0,l.jsx)("h3",{className:"font-mulish text-sm leading-[18px] font-bold text-white",children:"Chá»n g\xf3i"}),(0,l.jsx)("div",{className:"flex flex-col gap-4",children:d.slice(0,3).map((e,t)=>(0,l.jsx)(L,{label:(e=>{var t;switch(((null==(t=e.category)?void 0:t.unit)||"ng\xe0y").toLowerCase().trim()){case"ng\xe0y":default:return"G\xf3i theo ng\xe0y";case"tuần":return"G\xf3i theo tuần";case"th\xe1ng":return"G\xf3i theo th\xe1ng"}})(e),totalPrice:(e=>{var t;let a=((null==(t=e.category)?void 0:t.unit)||"ng\xe0y").toLowerCase().trim(),l=i?"key":"proxy";return"".concat(q(e.price||0),"Ä/").concat(l,"/").concat(a)})(e),isActive:x===t,onClick:()=>u(t)},e.id))})]}),(0,l.jsxs)("div",{className:"flex flex-1 flex-col gap-4 rounded-2xl border border-white/10 bg-[rgb(from_var(--sidebar)_calc(r_+_9)_calc(g_+_10)_calc(b_+_10))] p-4",children:[(0,l.jsx)("h3",{className:"font-mulish text-sm leading-[18px] font-bold text-white",children:i?"Cấu h\xecnh Key xoay":"Cấu h\xecnh Proxy xoay"}),(0,l.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:gap-4",children:[(0,l.jsxs)("div",{className:"bg-sidebar flex flex-col gap-2.5 rounded-2xl p-4 lg:w-[248px]",children:[(0,l.jsx)(U,{label:"Kiá»u mạng:",value:"C\xe1p quang",isPrimaryValue:!0}),(0,l.jsx)(U,{label:"IPv4 sạch - Unlimited Bandwidth"}),(0,l.jsxs)(U,{children:[(0,l.jsx)("span",{className:"font-mulish text-[13px] leading-4 font-normal whitespace-nowrap text-white",children:"Nh\xe0 mạng:"}),(0,l.jsx)(v.default,{src:P.viettel,alt:"Viettel",width:30,height:16,className:"h-2 w-auto"}),(0,l.jsx)(v.default,{src:P.fpt,alt:"FPT",width:30,height:16,className:"h-4 w-auto"}),(0,l.jsx)(v.default,{src:P.vnpt,alt:"VNPT",width:30,height:16,className:"h-4 w-auto"})]}),(0,l.jsx)(U,{label:"Thá»i gian Äá»i IP tá»i thiá»u 60 gi\xe2y/lần"}),(0,l.jsx)(U,{label:"Giữ IP tá»i Äa 30 ph\xfat"}),(0,l.jsx)(U,{label:"Kiá»u:",value:"Ngẫu nhi\xean",isPrimaryValue:!0}),i&&(0,l.jsx)(U,{label:"HTTP / SOCKS5"}),i&&(0,l.jsx)(U,{label:"Kết ná»i qua username/password"})]}),(0,l.jsxs)("div",{className:"flex flex-1 flex-col gap-3 ".concat(i&&"py-8"),children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row",children:[!i&&(0,l.jsx)(S.zB,{control:p.control,name:"user",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex flex-1 flex-col gap-1.5",children:[(0,l.jsx)(S.lR,{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"T\xe0i khoản"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{type:"text",placeholder:"random",disabled:!0,value:"random"===t.value?"":t.value,onChange:e=>t.onChange(e.target.value.trim()||"random"),className:"h-[31px] rounded border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] px-3 py-2 text-xs text-[#B6B6B7] placeholder:text-[#B6B6B7] disabled:opacity-50"})}),(0,l.jsx)(S.C5,{})]})}}),!i&&(0,l.jsx)(S.zB,{control:p.control,name:"password",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex flex-1 flex-col gap-1.5",children:[(0,l.jsx)(S.lR,{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"Máºt khẩu"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{type:"text",placeholder:"random",value:"random"===t.value?"":t.value,onChange:e=>t.onChange(e.target.value||"random"),className:"h-[31px] rounded border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] px-3 py-2 text-xs text-white placeholder:text-[#B6B6B7]"})}),(0,l.jsx)(S.C5,{})]})}}),(0,l.jsx)(S.zB,{control:p.control,name:"dayOfUse",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex flex-1 flex-col gap-1.5",children:[(0,l.jsx)(S.lR,{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:h?(e=>{var t;switch(((null==(t=e.category)?void 0:t.unit)||"ng\xe0y").toLowerCase().trim()){case"ng\xe0y":default:return"Ng\xe0y sá» dụng";case"tuần":return"Tuần sá» dụng";case"th\xe1ng":return"Th\xe1ng sá» dụng"}})(h):"Ng\xe0y sá» dụng"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{type:"number",min:1,placeholder:"Nháºp sá» ng\xe0y",useCustomStepper:!0,value:t.value>0?t.value:"",onKeyDown:g.Y$,onChange:e=>{let a=e.target.value;if(""===a)return void t.onChange("");
1t.onChange(+a)},onBlur:()=>{(!t.value||t.value<1)&&t.onChange(1)},className:"h-[31px] rounded border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] px-3 py-2 text-xs text-white"})}),(0,l.jsx)(S.C5,{})]})}})]}),!i&&(0,l.jsx)("div",{className:"flex flex-row items-center justify-between",children:(0,l.jsx)(S.zB,{control:p.control,name:"isAutoRotate",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex flex-row items-center justify-between gap-2",children:[(0,l.jsx)(S.lR,{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"Tá»± Äá»ng xoay"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(A.S,{checked:!!t.value,onCheckedChange:t.onChange,className:"h-6 w-6"})})]})}})}),!i&&(0,l.jsx)("div",{className:"flex flex-row items-center justify-between",children:(0,l.jsx)(S.zB,{control:p.control,name:"rotateInterval",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex w-full flex-row items-center justify-between",children:[(0,l.jsx)(S.lR,{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"Thá»i gian xoay (ph\xfat)"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)("div",{className:"flex h-[23px] w-fit items-center justify-center border-b border-[#4A4A55]",children:(0,l.jsx)(V.p,{type:"number",min:1,placeholder:"0",disabled:!I,value:t.value&&t.value>0?t.value:"",onKeyDown:g.Y$,onChange:e=>{let a=e.target.value;if(""===a)return void t.onChange("");t.onChange(Math.max(1,+a))},onBlur:()=>{I&&(!t.value||t.value<1)&&t.onChange(1)},className:"h-[15px] w-12 [appearance:textfield] border-none bg-transparent pr-4 text-center text-xs font-bold text-white placeholder:text-[#616766] focus-visible:ring-0 disabled:opacity-50 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"})})})]})}})}),(0,l.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,l.jsx)("span",{className:"font-mulish text-xs leading-[15px] font-bold text-white",children:"Sá» lượng"}),(0,l.jsxs)("div",{className:"flex flex-row items-center gap-5",children:[(0,l.jsx)("button",{type:"button",onClick:()=>K(-1),className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded-full bg-white/20",children:(0,l.jsx)(y.A,{className:"h-3.5 w-3.5 text-[#DBDBDC]"})}),(0,l.jsx)(V.p,{type:"text",value:""===J?"":J.padStart(2,"0"),onKeyDown:g.Y$,onChange:e=>(0,g.Wj)({form:p,name:"quantity",nextValue:e.target.value.replace(/\D/g,""),setInputValue:O,onValueChange:e=>p.setValue("quantity",e,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),onBlur:()=>(0,g.xf)({form:p,name:"quantity",setInputValue:O,onValueChange:e=>p.setValue("quantity",e,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),min:1}),style:{width:"".concat(Math.max(2,J.length||1)+1,"ch")},className:"no-spinner flex h-[34px] min-w-[41px] items-center justify-center rounded-lg border border-[#462E90] bg-transparent p-0 text-center text-sm leading-[18px] font-normal text-white shadow-none focus-visible:ring-0"}),(0,l.jsx)("button",{type:"button",onClick:()=>K(1),className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded-full bg-white/20",children:(0,l.jsx)(N.A,{className:"h-3.5 w-3.5 text-[#DBDBDC]"})})]})]}),(0,l.jsxs)("div",{className:"flex flex-row flex-wrap items-center justify-between gap-3 sm:flex-nowrap",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-row items-center gap-2",children:[(0,l.jsx)("span",{className:"font-mulish text-xs leading-[15px] font-bold whitespace-nowrap text-white",children:"Tá»ng tiá»n"}),(0,l.jsxs)("span",{className:"font-mulish text-base leading-5 font-bold whitespace-nowrap",style:{background:"var(--primary-gradient-template-9)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:[z?q(z):"","Ä"]}),E&&z&&Number(E)>Number(z)?(0,l.jsxs)("span",{className:"text-[18px] font-bold whitespace-nowrap text-[#6D7175] line-through",children:[q(E),"Ä"]}):null]}),(0,l.jsx)("button",{type:"submit",className:"flex h-8 min-w-[86px] flex-1 cursor-pointer items-center justify-center gap-2 rounded-full px-5 py-2",style:{background:"var(--primary-gradient-template-9)",boxShadow:"0px 5px 6px rgba(43, 0, 128, 0.35)"},children:(0,l.jsx)(C.A,{className:"h-4 w-4 text-white"})})]})]})]})]})]})}):null}function J(e){let{product:t,providerType:a="US"}=e;return t?(0,l.jsx)(O,{product:t,providerType:a}):(0,l.jsx)("div",{className:"p-10 text-center text-white",children:"CMC"===a?"Äang tải sản phẩm Datacenter VN...":"Äang tải sản phẩm US..."})}function O(e){let{product:t,providerType:a}=e,{form:n,wQuantity:r,totalPrice:s,originTotalPrice:i,discountPercent:c,onSubmit:d,openLogin:x,payload:u,paymentModal:h,setPaymentModal:p}=(0,I.C)({product:t,provider:t.provider}),{formState:{errors:m}}=n,[f,b]=(0,o.useState)("1"),w=e=>{let t=Math.max(1,r+e);b(String(t)),n.setValue("quantity",t,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})};return(0,o.useEffect)(()=>{var e;b(String(null!=(e=n.getValues("quantity"))?e:""))},[n]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(S.lV,{...n,children:(0,l.jsxs)("form",{onSubmit:n.handleSubmit(d),className:"relative flex w-full min-w-0 flex-col gap-3 rounded-2xl border border-white/10 bg-[rgb(from_var(--sidebar)_calc(r_+_9)_calc(g_+_10)_calc(b_+_10))] p-4 md:flex-row",children:[c?(0,l.jsxs)("span",{className:"font-mulish absolute -top-3 left-4 rounded-full bg-[#FE0000] px-2 font-bold text-white",children:["- ",c," %"]}):null,(0,l.jsx)("div",{className:"hidden h-11 w-16 flex-shrink-0 items-center justify-center rounded-lg bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] md:flex",children:(0,l.jsx)(v.default,{src:"CMC"===a?"/images/images-template-7/vn.png":"/images/images-template-7/usa.png",alt:"CMC"===a?"VN":"USA",width:34,he
1ight:24,className:"object-contain"})}),(0,l.jsxs)("div",{className:"flex flex-1 flex-col gap-3",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row",children:[(0,l.jsx)(S.zB,{control:n.control,name:"location",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex-1",children:[(0,l.jsx)(S.lR,{className:"text-xs font-bold text-white",children:"Äá»a Äiá»m"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{...t,className:"h-[31px] border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] text-xs text-white"})}),(0,l.jsx)(S.C5,{})]})}}),(0,l.jsx)(S.zB,{control:n.control,name:"prefix_ip",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex-1",children:[(0,l.jsx)(S.lR,{className:"text-xs font-bold text-white",children:"Äầu IP"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{...t,className:"h-[31px] border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] text-xs text-white"})}),(0,l.jsx)(S.C5,{})]})}})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row",children:[(0,l.jsx)(S.zB,{control:n.control,name:"dayOfUse",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex-1",children:[(0,l.jsx)(S.lR,{className:"text-xs font-bold text-white",children:"Th\xe1ng sá» dụng"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{type:"number",min:1,value:t.value>0?t.value:"",onKeyDown:g.Y$,onChange:e=>{let a=e.target.value;if(""===a)return void t.onChange("");t.onChange(+a)},onBlur:()=>{(!t.value||t.value<1)&&t.onChange(1)},className:"h-[31px] border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] text-xs text-white"})}),(0,l.jsx)(S.C5,{})]})}}),(0,l.jsx)(S.zB,{control:n.control,name:"protocolType",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex-1",children:[(0,l.jsx)(S.lR,{className:"text-xs font-bold text-white",children:"Giao thức"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{...t,className:"h-[31px] border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] text-xs text-white"})}),(0,l.jsx)(S.C5,{})]})}})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row",children:[(0,l.jsx)(S.zB,{control:n.control,name:"user",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex-1",children:[(0,l.jsx)(S.lR,{className:"text-xs font-bold text-white",children:"T\xe0i khoản"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{placeholder:"random",value:"random"===t.value?"":t.value,className:"h-[31px] border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] text-xs text-white placeholder:text-[#B6B6B7]",onChange:e=>t.onChange(e.target.value.trim()||"random")})}),(0,l.jsx)(S.C5,{})]})}}),(0,l.jsx)(S.zB,{control:n.control,name:"password",render:e=>{let{field:t}=e;return(0,l.jsxs)(S.eI,{className:"flex-1",children:[(0,l.jsx)(S.lR,{className:"text-xs font-bold text-white",children:"Máºt khẩu"}),(0,l.jsx)(S.MJ,{children:(0,l.jsx)(V.p,{value:"random"===t.value?"":t.value,placeholder:"random",className:"h-[31px] border-none bg-[rgb(from_var(--sidebar)_calc(r_+_23)_calc(g_+_22)_calc(b_+_49))] text-xs text-white placeholder:text-[#B6B6B7]",onChange:e=>t.onChange(e.target.value||"random")})}),(0,l.jsx)(S.C5,{})]})}})]}),(0,l.jsxs)("div",{className:"mt-1 flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-xs font-bold text-white",children:"Sá» lượng"}),(0,l.jsxs)("div",{className:"flex items-center gap-5",children:[(0,l.jsx)("button",{type:"button",onClick:()=>w(-1),className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded-full bg-white/20",children:(0,l.jsx)(y.A,{size:14,className:"text-[#FFFF]"})}),(0,l.jsx)(V.p,{type:"text",value:""===f?"":f.padStart(2,"0"),onKeyDown:g.Y$,onChange:e=>(0,g.Wj)({form:n,name:"quantity",nextValue:e.target.value.replace(/\D/g,""),setInputValue:b,onValueChange:e=>n.setValue("quantity",e,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),onBlur:()=>(0,g.xf)({form:n,name:"quantity",setInputValue:b,onValueChange:e=>n.setValue("quantity",e,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),min:1}),style:{width:"".concat(Math.max(2,f.length||1)+1,"ch")},className:"no-spinner flex h-[34px] min-w-[41px] items-center justify-center rounded-lg border border-[#462E90] bg-transparent p-0 text-center text-sm text-white shadow-none focus-visible:ring-0"}),(0,l.jsx)("button",{type:"button",onClick:()=>w(1),className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded-full bg-white/20",children:(0,l.jsx)(N.A,{size:14,className:"text-[#FFFF]"})})]})]}),m.quantity?(0,l.jsx)("p",{className:"-mt-1 text-xs text-red-400",children:m.quantity.message}):null,(0,l.jsxs)("div",{className:"mt-2 flex flex-row flex-wrap items-center justify-between gap-3 sm:flex-nowrap",children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-bold whitespace-nowrap text-white",children:"Tá»ng tiá»n"}),(0,l.jsxs)("span",{className:"text-base font-bold whitespace-nowrap text-blue-400",children:[s?q(s):"","Ä"]}),i&&s&&Number(i)>Number(s)?(0,l.jsxs)("span",{className:"text-[18px] font-bold whitespace-nowrap text-[#6D7175] line-through",children:[q(i),"Ä"]}
1):null]}),(0,l.jsx)("button",{type:"submit",className:"flex h-8 min-w-[86px] flex-1 cursor-pointer items-center justify-center rounded-full bg-gradient-to-r from-blue-400 to-purple-500 px-5 shadow-lg",children:(0,l.jsx)(C.A,{size:18,className:"text-white"})})]})]})]})}),x&&(0,l.jsx)(_.A,{}),(0,l.jsx)(j.A,{open:h,onClose:()=>p(!1),payload:u,redirect:"/proxies-datacenter"})]})}function K(e){let{className:t}=e,a=(0,f.r)(e=>{var t;return null==(t=e.config)?void 0:t.merchantId}),r=(0,f.r)(e=>e.config),{status:s}=(0,n.wV)(),d=(0,o.useMemo)(()=>(0,w.h)(null==r?void 0:r.hostName),[null==r?void 0:r.hostName]),[x,u]=(0,o.useState)("static"),[h,p]=(0,o.useState)(!1),[m,g]=(0,o.useState)(!1),[b,v]=(0,o.useState)({}),[y,N]=(0,o.useState)([]),[C,k]=(0,o.useState)([]),[B,S]=(0,o.useState)(!0),[V,M]=(0,o.useState)([]),[A,T]=(0,o.useState)(!0);(0,o.useEffect)(()=>{c.A.fetchApi("/api/v1/locations").then(e=>{var t;return N(null!=(t=null==e?void 0:e.data)?t:[])}).catch(()=>N([]))},[]),(0,o.useEffect)(()=>{"authenticated"===s&&g(!1)},[s]);let D=e=>{v(e),p(!0)},I=()=>{g(!0)};(0,o.useEffect)(()=>{let e=!0;return(async()=>{if(!a){e&&(k([]),S(!1));return}e&&S(!0);try{let t=await c.A.fetchApi('/api/v1/products?filters={"category":{"categorytype":{"id":1}}}',"",{headers:{"x-merchant-id":a}}).then(e=>{var t;return null!=(t=null==e?void 0:e.data)?t:[]}).catch(()=>[]);e&&k(t)}finally{e&&S(!1)}})(),()=>{e=!1}},[a]),(0,o.useEffect)(()=>{let e=!0;return(async()=>{if(!a){e&&(M([]),T(!1));return}e&&T(!0);try{let t=await c.A.fetchApi('/api/v1/products?filters={"category":{"categorytype":{"id":2}}}',"",{headers:{"x-merchant-id":a}}).then(e=>{var t;return null!=(t=null==e?void 0:e.data)?t:[]}).catch(()=>[]);e&&M(t)}finally{e&&T(!1)}})(),()=>{e=!1}},[a]);let F=e=>{let t=null==e?void 0:e.trim().toUpperCase();return"US"===t||"USA"===t},q=o.useMemo(()=>(C||[]).find(e=>F(e.provider))||null,[C]),L=o.useMemo(()=>(C||[]).find(e=>{var t;return(null==(t=e.provider)?void 0:t.trim().toUpperCase())==="CMC"})||null,[C]),U=o.useMemo(()=>(C||[]).filter(e=>{var t;let a=null==(t=e.provider)?void 0:t.trim().toUpperCase();return!F(e.provider)&&"CMC"!==a}).slice(0,3),[C]);return B||A?(0,l.jsxs)("div",{className:(0,i.cn)("flex w-full min-w-0 flex-col gap-3",t),children:[(0,l.jsx)("h2",{className:"font-mulish text-base leading-5 font-bold text-white",children:"Mua sản phẩm"}),(0,l.jsx)("div",{className:"flex min-w-0 flex-col gap-4 md:flex-row md:flex-wrap",children:[1,2,3].map(e=>(0,l.jsx)("div",{className:"h-[280px] w-full min-w-0 max-w-full animate-pulse rounded-2xl bg-[rgb(from_var(--sidebar)_calc(r_+_9)_calc(g_+_10)_calc(b_+_10))] md:h-[302px] md:max-w-[368px]"},e))})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:(0,i.cn)("flex w-full min-w-0 flex-col gap-3",t),children:[(0,l.jsx)("h2",{className:"font-mulish text-base leading-5 font-bold text-white",children:"Mua sản phẩm"}),(0,l.jsxs)("div",{className:"no-scrollbar flex min-w-0 flex-row flex-wrap items-start gap-2 sm:gap-3",children:[(0,l.jsx)(R,{label:"Proxy tĩnh",isActive:"static"===x,onClick:()=>u("static")}),d&&(0,l.jsx)(R,{label:"Proxy Datacenter",isActive:"Proxy Datacenter"===x,onClick:()=>u("Proxy Datacenter")}),(0,l.jsx)(R,{label:"Proxy xoay",isActive:"rotate"===x,onClick:()=>u("rotate")}),(0,l.jsx)(R,{label:"Key xoay",isActive:"key"===x,onClick:()=>u("key")})]}),"static"===x&&(0,l.jsx)("div",{className:"flex min-w-0 flex-col gap-4 md:flex-row md:flex-wrap md:gap-6 xl:flex-nowrap",children:U.map((e,t)=>{var a;let n=P[(null==(a=e.provider)?void 0:a.toLowerCase())||["viettel","fpt","vnpt"][t]||"viettel"]||P.viettel;return(0,l.jsx)(z,{logoSrc:n,product:e,locations:y,onSubmitPayment:D,onLoginRequired:I},e.id)})}),"Proxy Datacenter"===x&&(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 lg:flex-row",children:[(0,l.jsx)(J,{product:q,providerType:"US"}),(0,l.jsx)(J,{product:L,providerType:"CMC"})]}),("rotate"===x||"key"===x)&&(0,l.jsx)(E,{products:V||[],onSubmitPayment:D,isAuthenticated:"authenticated"===s,onLoginRequired:I,isCdk:"key"===x},x)]}),(0,l.jsx)(j.A,{open:h,onClose:()=>p(!1),payload:b,redirect:"static"===x?"/proxies":"Proxy Datacenter"===x?"/proxies-datacenter":"rotate"===x?"/proxies-xoay":"/keys-xoay"}),m&&(0,l.jsx)(_.A,{onCallBack:()=>g(!1)})]})}function H(){var e,t,a,o;let{status:i}=(0,n.wV)(),c=(0,s.k)(e=>e.user);return(0,l.jsx)(r.A,{openMarqueeTop:!0,children:(0,l.jsxs)("div",{className:"flex w-full min-w-0 max-w-full flex-col gap-6",children:[(0,l.jsx)(m,{isAuthenticated:"authenticated"===i,balance:Number((null==c?void 0:c.coin)||0)+(null!=(o=null!=(a=null==c||null==(e=c.merchant)?void 0:e.promotionAmountRemaining)?a:null==c||null==(t=c.merchant)?void 0:t.amountRemaining)?o:0)}),(0,l.jsx)(K,{})]})})}},55635:(e,t,a)=>{a.d(t,{KB:()=>l,T1:()=>s,oX:()=>r,p8:()=>n}),a(53279),a(87358).env.NEXT_PUBLIC_DEMO_MODE;let l=(e,t)=>
1{if(!e)return"https://api.homeproxy.vn/api/v1".concat(t);let a=e.replace(/^https?:\/\//,"");return"https://".concat(a,"/api/v2").concat(t)},n=(e,t)=>{if(!e)return"https://api.homeproxy.vn/api/v3".concat(t);let a=e.replace(/^https?:\/\//,"");return"https://".concat(a,"/api/v3").concat(t)},r=(e,t)=>{let a=l(e,"/products"),n=JSON.stringify({category:{categorytype:{id:t}}});return"".concat(a,"?filters=").concat(n)},s=async()=>{try{let e=await fetch("https://api.ipify.org?format=json",{cache:"no-store"});if(!e.ok)return"N/A";return(await e.json()).ip||"N/A"}catch(e){return"N/A"}}},77128:(e,t,a)=>{a.d(t,{h:()=>l});function l(e){return(e||"").split(":")[0].toLowerCase().trim(),!0}},96787:(e,t,a)=>{a.d(t,{C:()=>p});var l=a(2030),n=a(66280),r=a(86091),s=a(75507),o=a(66942),i=a(46671),c=a.n(i),d=a(96199),x=a(12115),u=a(22544);let h={dayOfUse:1,quantity:1,prefix_ip:"random",protocolType:"HTTP",user:"random",password:"random",payment:"",isCdk:!1,rotateInterval:0,location:"random"};function p(e){var t,a,i,p,m;let{product:f,provider:g,defaultValues:b}=e,{data:w,status:v}=(0,d.wV)(),[j,_]=(0,x.useState)("1"),[y,N]=(0,x.useState)("1"),C=(0,u.mN)({resolver:(0,o.u)(r.vH),defaultValues:{...h,...b},mode:"onChange",reValidateMode:"onChange"}),{formState:{isSubmitting:k}}=C,{rulesByCategory:B}=(0,n.S1)(),S=(null==f||null==(t=f.category)?void 0:t.id)?B[f.category.id]:void 0,V=C.watch("quantity"),M=C.watch("dayOfUse"),A=Number(V),T=Number(M),D=Number.isFinite(A)&&A>=1?A:0,I=Number.isFinite(T)&&T>=1?T:0,F=(0,s.Zz)({price:Number(null!=(a=null==f?void 0:f.price)?a:0),quantity:D,days:I,discountRules:S}),q=(0,s.Zz)({price:Number(null!=(i=null==f?void 0:f.originPrice)?i:0),quantity:D,days:I,hasDiscountConfig:!1}),P=(0,s.zJ)(Number(null!=(p=null==f?void 0:f.originPrice)?p:0),Number(null!=(m=null==f?void 0:f.price)?m:0)),[R,z]=(0,x.useState)(!1),[L,U]=(0,x.useState)({}),[E,J]=(0,x.useState)(!1),O=async e=>{var t,a;if(!(null==w||null==(t=w.user)?void 0:t.accessToken))return void z(!0);let n={...e};n.isCdk=!!n.isCdk,n.rotateInterval=n.rotateInterval||0,"random"===n.prefix_ip&&(n.prefix_ip=""),"random"===n.location&&delete n.location,n.user&&"random"!==n.user.toLowerCase()||(n.user=(null!=(a=c().sample(l.Gb))?a:"admin")+Math.floor(1e3*Math.random())),n.password&&"random"!==n.password.toLowerCase()||(n.password=btoa(Math.random().toString()).substring(12).toLowerCase()),U({products:[{...n,provider:g,product:{id:f.id}}],total:F}),J(!0)};return(0,x.useEffect)(()=>{"authenticated"===v&&z(!1)},[v,z]),{session:w,status:v,form:C,isSubmitting:k,dayOfUseInputValue:j,setDayOfUseInputValue:_,quantityInputValue:y,setQuantityInputValue:N,wQuantity:V,wDayOfUse:M,totalPrice:F,originTotalPrice:q,discountPercent:P,openLogin:R,setOpenLogin:z,payload:L,paymentModal:E,setPaymentModal:J,onSubmit:O}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.