1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[28237],{8252:(e,s,l)=>{l.d(s,{u:()=>o});var t=l(66280),a=l(86091),r=l(75507),n=l(66942),d=l(96199),i=l(12115),x=l(22544);let c={dayOfUse:1,quantity:1,protocolType:"HTTP",user:"random",password:"",rotateInterval:0,isAutoRotate:!1,isCdk:!0};function o(e){var s;let{product:l}=e,{data:o,status:m}=(0,d.wV)(),[p,u]=(0,i.useState)("1"),[h,f]=(0,i.useState)("1"),j=(0,x.mN)({resolver:(0,n.u)(a._m),values:c,mode:"onChange",reValidateMode:"onChange"}),{formState:{isSubmitting:b}}=j,g=j.watch("quantity"),N=j.watch("dayOfUse"),y=j.watch("isAutoRotate");(0,i.useEffect)(()=>{y?j.setValue("rotateInterval",1):j.setValue("rotateInterval",0)},[y,j]);let{rulesByCategory:w}=(0,t.S1)(),v=(null==l||null==(s=l.category)?void 0:s.id)?w[l.category.id]:void 0,_=(0,r.Zz)({price:l.price,quantity:g,days:N,discountRules:v}),E=(0,r.Zz)({price:l.originPrice,quantity:g,days:N,hasDiscountConfig:!1}),[C,k]=(0,i.useState)(!1),[D,S]=(0,i.useState)({}),[I,V]=(0,i.useState)(!1),F=async e=>{var s;if(!(null==o||null==(s=o.user)?void 0:s.accessToken))return void k(!0);let t={...e};t.password&&"random"!==t.password.toLowerCase()||(t.password=btoa(Math.random().toString()).substring(12).toLowerCase()),S({products:[{...t,provider:l.provider,product:{id:l.id}}],total:_}),V(!0)};return(0,i.useEffect)(()=>{"authenticated"===m&&k(!1)},[m,k]),{form:j,isSubmitting:b,dayOfUseInputValue:p,setDayOfUseInputValue:u,quantityInputValue:h,setQuantityInputValue:f,totalPrice:_,originTotalPrice:E,openLogin:C,payload:D,paymentModal:I,setPaymentModal:V,onSubmit:F}}},25597:(e,s,l)=>{l.d(s,{A:()=>i});var t=l(95155),a=l(20243);function r(){return(0,t.jsxs)("div",{className:"mx-auto hidden w-full min-w-0 max-w-full px-3 sm:px-4 md:px-6 xl:block",children:[(0,t.jsx)(a.E,{className:"mb-4 h-8 w-32"}),(0,t.jsx)("div",{className:"overflow-x-auto bg-(--background) px-6",children:(0,t.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"w-[180px] p-4 text-left font-medium"}),[1,2,3].map(e=>(0,t.jsx)("th",{className:"bg-(--background) p-4 text-center",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[200px] flex-col items-center justify-start gap-2",children:[(0,t.jsx)(a.E,{className:"h-6 w-24"}),(0,t.jsx)(a.E,{className:"h-9 w-32"}),(0,t.jsx)(a.E,{className:"h-12 w-full"})]})},e))]})}),(0,t.jsxs)("tbody",{children:[(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:4,className:"bg-(--background) p-3 text-left text-base font-semibold",children:(0,t.jsx)(a.E,{className:"h-6 w-24"})})}),[1,2,3,4,5,6].map(e=>(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b p-4",children:(0,t.jsx)(a.E,{className:"h-5 w-32"})}),[1,2,3].map(e=>(0,t.jsx)("td",{className:"border-t border-b p-4 text-start",children:(0,t.jsx)(a.E,{className:"h-5 w-full"})},e))]},e)),(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:4,className:"bg-(--background) p-4 pt-6 text-left text-base font-semibold",children:(0,t.jsx)(a.E,{className:"h-6 w-20"})})}),[1,2,3,4,5,6].map(e=>(0,t.jsxs)("tr",{className:"border-t border-b",children:[(0,t.jsx)("td",{className:"p-4",children:(0,t.jsx)(a.E,{className:"h-5 w-28"})}),[1,2,3].map(e=>(0,t.jsx)("td",{className:"p-4 text-center",children:(0,t.jsx)(a.E,{className:"mx-auto h-10 w-24"})},e))]},e)),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"p-4"}),[1,2,3].map(e=>(0,t.jsx)("td",{className:"p-4 text-start",children:(0,t.jsx)(a.E,{className:"mx-2 mt-5 h-10 w-[254px]"})},e))]})]})]})})]})}var n=l(86948);function d(){return(0,t.jsx)(n.Zp,{className:"relative w-full gap-0 overflow-hidden rounded-lg border-none pt-0",children:(0,t.jsx)(n.Wu,{className:"px-0",children:(0,t.jsxs)("div",{className:"grid grid-cols-1",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,t.jsx)(a.E,{className:"h-7 w-32"}),(0,t.jsx)(a.E,{className:"h-9 w-28"})]}),(0,t.jsx)(a.E,{className:"mt-2 h-10 w-full"})]}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsx)(a.E,{className:"h-6 w-24"})}),[1,2,3,4,5,6].map(e=>(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("div",{className:"flex w-full justify-between",children:[(0,t.jsx)(a.E,{className:"h-5 w-32"}),(0,t.jsx)(a.E,{className:"h-5 w-40"})]})},e)),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsx)(a.E,{className:"h-6 w-20"})}),[1,2,3,4,5,6].map(e=>(0,t.jsxs)("div",{className:"grid grid-flow-col grid-cols-[180px_1fr] gap-4 px-2 py-[14px] shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsx)(a.E,{className:"h-5 w-28"}),(0,t.jsx)(a.E,{className:"h-10 w-full"})]},e)),(0,t.jsx)(a.E,{className:"mx-2 mt-5 h-10 w-full"})]})})})}function i(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r,{}),(0,t.jsxs)("div",{className:"mx-auto flex w-full min-w-0 max-w-[480px] flex-col items-center gap-4 py-2 sm:gap-5 sm:py-4 xl:hidden",children:[(0,t.jsx)(a.E,{className:"h-8 w-32"}),(0,t.jsxs)("div",{className:"flex w-full min-w-0 justify-center gap-2 rounded-lg bg-[color-mix(in_oklab,var(--primary),white_94%)] p-2 sm:max-w-[400px] sm:gap-3 sm:px-3 sm:py-2.5",children:[(0,t.jsx)(a.E,{className:"h-9 flex-1"}),(0,t.jsx)(a.E,{className:"h-9 flex-1"}),(0,t.jsx)(a.E,{className:"h-9 flex-1"})]}),(0,t.jsx)("div",{className:"flex w-full justify-center",children:(0,t.jsx)(d,{})})]})]})}},28237:(e,s,l)=>{l.r(s),l.d(s,{default:()=>V});var t=l(95155),a=l(51030),r=l(49008),n=l(25597),d=l(12115),i=l(64269),x=l(3998),c=l(15239),o=l(23117),m=l(10951),p=l(86091),u=l(13744),h=l(75507),f=l(66280),j=l(22544),b=l(96199),g=l(41052),N=l(66942),y=l(61145),w=l(91708);function v(e){let{products:s}=e,{data:l,status:a}=(0,b.wV)(),[r,n]=(0,d.useState)(!1),[i,v]=(0,d.useState)({}),[_,E]=(0,d.useState)(!1),[C,k]=(0,d.useState)({}),[D,S]=(0,d.useState)({});(0,d.useEffect)(()=>{"authenticated"===a&&n(!1)},[a]),(0,d.useEffect)(()=>{k(e=>(0,p.UU)(s.map(e=>e.id),e)),S(e=>(0,p.UU)(s.map(e=>e.id),e))},[s]);let I={dayOfUse:{},quantity:{},protocolType:{},user:{},password:{},rotateInterval:{},isAutoRotate:{},isCdk:{}};
1s.forEach(e=>{I.dayOfUse[e.id]=1,I.quantity[e.id]=1,I.protocolType[e.id]="HTTP",I.user[e.id]="random",I.password[e.id]="",I.isAutoRotate[e.id]=!1,I.rotateInterval[e.id]=0,I.isCdk[e.id]=!0});let V=(0,j.mN)({resolver:(0,N.u)(p.EC),defaultValues:I,mode:"onChange",reValidateMode:"onChange"}),{formState:{isSubmitting:F}}=V,A=V.watch("dayOfUse"),T=V.watch("isAutoRotate"),{rulesByCategory:U}=(0,f.S1)();async function q(e,s){var t,a,r,d;if(!(null==l||null==(t=l.user)?void 0:t.accessToken))return void n(!0);let i=null!=(r=e.quantity[s.id])?r:1,x=null!=(d=e.dayOfUse[s.id])?d:1;for(let s in e.password)e.password[s]&&"random"!==e.password[s].toLowerCase()||(e.password[s]=btoa(Math.random().toString()).substring(12).toLowerCase());let c=(null==(a=s.category)?void 0:a.id)?U[s.category.id]:void 0,o=(0,h.Zz)({price:s.price,quantity:i,days:x,discountRules:c});v({products:[{provider:s.provider,product:{id:s.id},protocolType:e.protocolType[s.id],user:e.user[s.id],password:e.password[s.id],rotateInterval:e.rotateInterval[s.id],isAutoRotate:e.isAutoRotate[s.id],isCdk:e.isCdk[s.id],quantity:i,dayOfUse:x,total:o}],total:o}),E(!0)}return(0,d.useEffect)(()=>{s.forEach(e=>{(null==T?void 0:T[e.id])===!0?V.setValue("rotateInterval.".concat(e.id),1):V.setValue("rotateInterval.".concat(e.id),0)})},[JSON.stringify(T),s,V]),(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"hidden w-full xl:block",children:[(0,t.jsx)("p",{className:"sr-only",children:"Key xoay"}),(0,t.jsx)(g.lV,{...V,children:(0,t.jsx)("form",{children:(0,t.jsx)("div",{className:"flex w-full justify-center",children:(0,t.jsx)("div",{className:"mx-auto w-full overflow-x-auto rounded-xl bg-(--background) px-5 py-3 shadow-sm xl:max-w-[1232px]",children:(0,t.jsxs)("table",{className:"w-full min-w-[1040px] table-fixed border-collapse text-sm",children:[(0,t.jsxs)("colgroup",{children:[(0,t.jsx)("col",{className:"w-[240px]"}),s.map(e=>(0,t.jsx)("col",{style:{width:"calc((100% - 240px) / ".concat(s.length,")")}},e.id))]}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"w-[280px] p-3 text-left font-medium"}),s.map(e=>{var s,l,a,r,n,d,i,x;let c=(null==(s=e.category)?void 0:s.id)?U[e.category.id]:void 0,o=null!=(n=null==A?void 0:A[e.id])?n:1,m=null==c?void 0:c.find(e=>{let s="Infinity"===e.maxDay?1/0:Number(e.maxDay);return o>=e.minDay&&o<=s}),p=Math.round(Number(null!=(d=null==e?void 0:e.price)?d:0)*(null!=(i=null==m?void 0:m.discount)?i:1));return(0,t.jsx)("th",{className:"bg-(--background) px-3 py-4 text-center",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[260px] flex-col items-start justify-start",children:[(0,t.jsx)("div",{className:"flex w-full justify-start text-base font-semibold text-(--text-normal)",children:null!=(x=null==e||null==(a=e.category)||null==(l=a.name)?void 0:l.replace("Proxy","Key"))?x:""}),(0,t.jsxs)("div",{className:"text-primary flex w-full flex-wrap items-baseline justify-start gap-1 text-3xl font-semibold",children:[u.A.formatNum(p),"Ä",(0,t.jsxs)("span",{className:"text-base font-normal",children:["/",null==e||null==(r=e.category)?void 0:r.unit]})]})]})},null==e?void 0:e.id)})]})}),(0,t.jsxs)("tbody",{children:[(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:(null==s?void 0:s.length)+1,className:"bg-(--background) px-3 py-3 text-left text-base font-semibold",children:"Tá»ng quan"})}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t-2 border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Kiá»u mạng"}),s.map(e=>(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-start text-(--primary)",children:"C\xe1p quang"},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"IPv4 sạch"}),s.map(e=>(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-start",children:"Unlimited Bandwidth"},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Nh\xe0 mạng"}),s.map(e=>(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-start",children:(0,t.jsxs)("div",{className:"flex items-center gap-5",children:[(0,t.jsx)(c.default,{src:"/images/viettelTemplate.png",width:59,height:32,alt:"viettel",className:"h-5 w-auto object-contain"}),(0,t.jsx)(c.default,{src:"/images/fptTemplate.png",width:59,height:32,alt:"fpt",className:"h-5 w-auto object-contain"}),(0,t.jsx)(c.default,{src:"/images/vnptTemplate.png",width:59,height:32,alt:"vnpt",className:"h-5 w-auto object-contain"})]})},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Thá»i gian Äá»i IP tá»i thiá»u"}),s.map(e=>(0,t.jsxs)("td",{className:"border-t border-b px-3 py-3 text-start",children:[(0,t.jsx)("span",{className:"text-(--primary)",children:"60"})," gi\xe2y / lần"]},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Thá»i gian giữ IP tá»i Äa"}),s.map(e=>(0,t.jsxs)("td",{className:"border-t border-b px-3 py-3 text-start",children:[(0,t.jsx)("span",{className:"text-(--primary)",children:"30"})," ph\xfat"]},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Vá» tr\xed"}),s.map(e=>(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-start text-(--success)",children:"Ngẫu nhi\xean"},e.id))]}),(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:s.length+1,className:"bg-(--background) px-3 py-4 pt-6 text-left text-base font-semibold",children:"T\xf9y chá»nh"})}),(0,t.jsxs)("tr",{className:"border-t border-b",children:[(0,t.jsx)("td",{className:"px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Sá» dụng theo"}),s.map(e=>(0,t.jsx)("td",{className:"px-3 py-3 text-center",children:(0,t.jsx)(g.zB,{control:V.control,name:"dayOfUse.".concat(e.id),render:s=>{var l,a;let{field:r,fieldState:n}=s;return(0,t.jsx)(g.eI,{children:(0,t.jsx)(g.MJ,{children:(0,t.jsxs)("div",{className:"space-y-1 text-start",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(o.p,{step:1,min:1,type:"number",useCustomStepper:!0,className:"focus-visible:ring-primary/50 h-10 w-28 border pl-3 text-black focus-visible:ring-[3px]",placeholder:"Ng\xe0y sá» dụng",...r,value:null!=(a=C[e.id])?a:"",onKeyDown:p.Y$,onCh
1ange:s=>{(0,p.Av)({form:V,name:"dayOfUse.".concat(e.id),nextValue:s.target.value,rowId:e.id,setInputValues:k,onValueChange:r.onChange})}}),(0,t.jsx)("span",{children:null==e||null==(l=e.category)?void 0:l.unit})]}),n.error?(0,t.jsx)(g.C5,{}):null]})})})}})},e.id))]}),(0,t.jsxs)("tr",{className:"border-b",children:[(0,t.jsx)("td",{className:"px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Sá» lượng"}),s.map(e=>(0,t.jsx)("td",{className:"px-3 py-3 text-center",children:(0,t.jsx)(g.zB,{control:V.control,name:"quantity.".concat(e.id),render:s=>{var l;let{field:a,fieldState:r}=s;return(0,t.jsx)(g.eI,{children:(0,t.jsx)(g.MJ,{children:(0,t.jsxs)("div",{className:"space-y-1 text-start",children:[(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsx)(o.p,{step:1,min:1,type:"number",useCustomStepper:!0,className:"focus-visible:ring-primary/50 h-10 w-28 border pl-3 text-black focus-visible:ring-[3px]",placeholder:"Sá» lượng",...a,value:null!=(l=D[e.id])?l:"",onKeyDown:p.Y$,onChange:s=>{(0,p.Av)({form:V,name:"quantity.".concat(e.id),nextValue:s.target.value,rowId:e.id,setInputValues:S,onValueChange:a.onChange})}})}),r.error?(0,t.jsx)(g.C5,{}):null]})})})}})},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"w-full px-3 py-3 font-medium"}),s.map(e=>(0,t.jsx)("td",{className:"px-3 py-3 text-start",children:(0,t.jsxs)(x.$,{type:"button",onClick:()=>V.handleSubmit(s=>q(s,e))(),disabled:F,className:"group/menubutton bg-background border-primary h-12 w-full max-w-[288px] cursor-pointer border",children:[(0,t.jsx)(m.F.CartIcon,{className:"text-primary group-hover/menubutton:text-primary-foreground mr-2 h-5 w-5"}),(0,t.jsx)("div",{className:"group-hover/menubutton:text-primary-foreground text-primary font-semibold",children:"Mua h\xe0ng"})]})},e.id))]})]})]})})})})}),r&&(0,t.jsx)(w.A,{onCallBack:()=>n(!1)}),(0,t.jsx)(y.A,{open:_,onClose:()=>E(!1),payload:i,formParent:V,redirect:"/keys-xoay"})]})})}var _=l(86948),E=l(65142),C=l(8252);function k(e){var s,l,a,r;let{product:n}=e,{form:d,isSubmitting:i,dayOfUseInputValue:o,setDayOfUseInputValue:m,quantityInputValue:h,setQuantityInputValue:f,totalPrice:j,originTotalPrice:b,openLogin:N,payload:v,paymentModal:k,setPaymentModal:D,onSubmit:S}=(0,C.u)({product:n});return(0,t.jsxs)(_.Zp,{className:"relative w-full gap-0 overflow-hidden rounded-lg border-none pt-0",children:[(0,t.jsx)(_.Wu,{className:"px-0",children:(0,t.jsx)(g.lV,{...d,children:(0,t.jsx)("form",{onSubmit:d.handleSubmit(S),children:(0,t.jsxs)("div",{className:"grid grid-cols-1",children:[(0,t.jsx)("div",{className:"flex flex-1 flex-col gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,t.jsx)("p",{className:"text-xl font-semibold",children:null!=(r=null==n||null==(l=n.category)||null==(s=l.name)?void 0:s.replace("Proxy","Key"))?r:""}),(0,t.jsxs)("p",{className:"text-primary text-3xl font-semibold",children:[(0,t.jsxs)("p",{className:"text-primary font-bold",children:[u.A.formatNum(null!=j?j:""),"Ä"]}),b&&j&&Number(b)>Number(j)?(0,t.jsxs)("span",{className:"text-sm font-bold text-[#9C9C9C] line-through",children:[u.A.formatNum(b),"Ä"]}):null,(0,t.jsxs)("span",{className:"text-base",children:["/",null==n||null==(a=n.category)?void 0:a.unit]})]})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsx)("p",{className:"text-base font-semibold",children:"Tá»ng quan"})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("p",{className:"flex w-full justify-between",children:[(0,t.jsx)("span",{className:"block",children:"Kiá»u mạng:"}),(0,t.jsx)("span",{className:"text-primary block",children:"C\xe1p quang"})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("p",{className:"flex w-full justify-between",children:[(0,t.jsx)("span",{className:"text-text-blur block",children:"IPv4 sạch"}),(0,t.jsx)("span",{className:"block",children:"Unlimited Bandwidth"})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("div",{className:"flex w-full justify-between",children:[(0,t.jsx)("p",{className:"text-text-blur my-auto flex-none",children:"Nh\xe0 mạng:"}),(0,t.jsxs)("div",{className:"grid grid-cols-3",children:[(0,t.jsx)(c.default,{src:"/images/viettel.png",width:0,height:0,sizes:"100vw",className:"my-auto w-full max-w-12",alt:""}),(0,t.jsx)(c.default,{src:"/images/fpt.png",width:0,height:0,sizes:"100vw",className:"my-auto w-full max-w-12",alt:""}),(0,t.jsx)(c.default,{src:"/images/vnpt.png",width:0,height:0,sizes:"100vw",className:"my-auto w-full max-w-12",alt:""})]})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("p",{className:"flex w-full justify-between",children:[(0,t.jsxs)("span",{className:"text-text-blur block",children:["Thá»i gian Äá»i IP tá»i thiá»u"," "]}),(0,t.jsxs)("span",{className:"block",children:[(0,t.jsx)("span",{className:"text-primary",children:"60"})," gi\xe2y / lần"]})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("p",{className:"flex w-full justify-between",children:[(0,t.jsx)("span",{className:"text-text-blur block",children:"Giữ IP tá»i Äa"}),(0,t.jsxs)("span",{className:"block",children:[(0,t.jsx)("span",{className:"text-primary",children:"30"}),"ph\xfat"]})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("p",{className:"text-text-blur flex w-full justify-between",children:["Vá» tr\xed ",(0,t.jsx)("span",{className:"text-blue-500",children:"Ngẫu nhi\xean"})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsx)("p",{className:"text-base font-semibold",children:"T\xf9y chá»nh"})}),(0,t.jsx)(g.zB,{control:d.control,name:"dayOfUse",render:e=>{var s,l;let{field:a}=e;return(0,t.jsxs)(g.eI,{className:"grid grid-cols-[180px_1fr] gap-4 px-2 py-[14px] shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsx)(g.lR,{className:"text-text-blur flex items-center gap-2",children:"Sá» dụng theo"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.MJ,{children:(0,t.jsx)(E.p,{step:1,min:1,type:"number",placeholder:"Ng\xe0y sá» dụng",...a,value:o,onKeyDown:p.Y$,onCh
1ange:e=>(0,p.Wj)({form:d,name:"dayOfUse",nextValue:e.target.value,setInputValue:m,onValueChange:a.onChange})})}),(0,t.jsx)("span",{children:(null!=(l=null==(s=n.category)?void 0:s.unit)?l:"ng\xe0y").replace(/^./,e=>e.toUpperCase())})]}),(0,t.jsx)(g.C5,{className:"col-start-2"})]})}}),(0,t.jsx)(g.zB,{control:d.control,name:"quantity",render:e=>{let{field:s}=e;return(0,t.jsxs)(g.eI,{className:"grid grid-cols-[180px_1fr] gap-4 px-2 py-[14px] shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsx)(g.lR,{className:"text-text-blur flex items-center gap-2",children:"SỠlượng"}),(0,t.jsx)(g.MJ,{children:(0,t.jsx)(E.p,{type:"number",step:1,min:1,placeholder:"SỠlượng",...s,value:h,onKeyDown:p.Y$,onChange:e=>(0,p.Wj)({form:d,name:"quantity",nextValue:e.target.value,setInputValue:f,onValueChange:s.onChange})})}),(0,t.jsx)(g.C5,{className:"col-start-2"})]})}}),(0,t.jsx)(x.$,{type:"submit",disabled:i,className:"mx-2 mt-5 h-12 cursor-pointer",children:"Mua h\xe0ng"})]})})})}),N&&(0,t.jsx)(w.A,{}),(0,t.jsx)(y.A,{open:k,onClose:()=>D(!1),payload:v,formParent:d,redirect:"/keys-xoay"})]})}let D=[{id:"day",label:"G\xf3i 1 ng\xe0y"},{id:"week",label:"G\xf3i 1 tuần"},{id:"month",label:"G\xf3i 1 th\xe1ng"}];function S(e){let{products:s}=e,[l,a]=(0,d.useState)("day"),r={day:s[0],week:s[1],month:s[2]};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{products:s}),(0,t.jsxs)("div",{className:"mx-auto flex w-full min-w-0 max-w-[480px] flex-col items-center gap-4 py-2 sm:gap-5 sm:py-4 xl:hidden",children:[(0,t.jsx)("p",{className:"text-text-normal w-full text-center text-xl font-semibold sm:text-2xl",children:"Key xoay"}),(0,t.jsx)("div",{className:"flex w-full min-w-0 justify-center gap-2 overflow-x-auto rounded-lg bg-[color-mix(in_oklab,var(--primary),white_94%)] p-2 sm:max-w-[400px] sm:gap-3 sm:px-3 sm:py-2.5",children:D.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a(e.id),className:(0,i.cn)("flex min-w-0 flex-1 items-center justify-center whitespace-nowrap rounded-sm px-2 py-2 text-xs hover:cursor-pointer sm:px-3 sm:py-2.5 sm:text-sm",l===e.id?"bg-primary text-primary-foreground font-semibold":"text-text-normal font-normal"),children:e.label},e.id))}),(0,t.jsx)("div",{className:"flex w-full justify-center",children:(0,t.jsx)(k,{product:r[l]})})]})]})}let I="flex w-full min-w-0 max-w-full flex-col gap-3 px-3 sm:gap-4 sm:px-4 md:px-6";function V(e){let{searchParams:s,appConfig:l,initialProducts:d}=e,{products:i,isLoading:x}=(0,a.g)(void 0!==d||null==l?void 0:l.merchantId),c=null!=d?d:i;return x?(0,t.jsx)(r.A,{className:"over-table bg-background-blur",children:(0,t.jsx)("div",{className:I,children:(0,t.jsx)(n.A,{})})}):0===c.length?(0,t.jsx)(r.A,{className:"over-table bg-background-blur",children:(0,t.jsx)("div",{className:I,children:(0,t.jsx)("p",{className:"text-center",children:"Kh\xf4ng c\xf3 sản phẩm"})})}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(r.A,{className:"over-table bg-background-blur",children:(0,t.jsx)("div",{className:I,children:(0,t.jsx)(S,{products:c})})})})}},51030:(e,s,l)=>{l.d(s,{g:()=>n});var t=l(35389),a=l(85400);let r={revalidateOnFocus:!1,revalidateOnReconnect:!1,dedupingInterval:3e5,revalidateIfStale:!1};function n(e){let{data:s,isLoading:l}=(0,a.Ay)(e?["products-key-rotate",e]:null,e=>{let[,s]=e;return(0,t.UF)(s)},r);return{products:null!=s?s:[],isLoading:null!=l&&l}}}}]);
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.