1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8470],{48470:function(e,i,t){t.d(i,{Ee:function(){return $},Fj:function(){return X},LB:function(){return B},Md:function(){return H},Nh:function(){return S},Oi:function(){return E},VA:function(){return G},VD:function(){return _},Wc:function(){return I},Yd:function(){return J},e9:function(){return R},fx:function(){return V},l2:function(){return Q},l_:function(){return q},ls:function(){return U},nS:function(){return Y},nh:function(){return F},vh:function(){return P},yR:function(){return ee},zm:function(){return K}});var r=t(57437),a=t(55229),s=t(69722),n=t(22202),l=t(37062),o=t(91793),c=t(13612),d=t(64850),u=t(6986),h=t(9043),m=t(35515),x=t(5405),p=t(91443),v=t(99376),g=t(2265),f=t(45021),j=t(5488),b=t(44641),y=t(92283),w=t(81375),N=t(26047),k=t(46142),C=t(3679),Z=t(16552),M=t(27648);function P(e){let{width:i=60,capacity:t=null,type:a="washer"}=e;return(0,r.jsxs)("div",{className:"relative w-fit h-fit",children:[(0,r.jsx)("img",{src:{washer:"/assets/machines/washer.svg",dryer:"/assets/machines/dryer.svg",washerDisabled:"/assets/machines/washer-disabled.svg",washerReady:"/assets/machines/washer-ready.svg",washerUpdate:"/assets/machines/washer-update.svg",blaztapSerialNumber:"/assets/machines/blaztap-serial-number.svg"}[a],alt:"",style:{width:"".concat(i,"px"),height:"auto",maxWidth:"100%"}}),t&&(0,r.jsx)("div",{className:"absolute bottom-0 right-0 rounded-tl-xl bg-orange-500",style:{padding:"1px ".concat(1.5*Math.max(4,.1*i),"px")},children:(0,r.jsxs)(b.Z,{color:"white",size:"small",children:[t," Kg"]})})]})}function _(e){var i;let{width:t=100,capacity:a=null,machineData:s=null}=e,n=d.Y_.module[null==s?void 0:null===(i=s.jenis)||void 0===i?void 0:i.toLowerCase()],l="";switch(null==s?void 0:s.status){case"ready":case"off":default:l=null==n?void 0:n.inactiveImg;break;case"idle":l=null==n?void 0:n.activeImg;break;case"process":l=null==n?void 0:n.activeAnimation;break;case"paused":l=null==n?void 0:n.pausedImg;break;case"update":l=null==n?void 0:n.udateAnimation}return s?(0,r.jsxs)("div",{className:"relative w-fit h-fit",children:[l&&(0,r.jsx)("img",{src:l,alt:"Washer Machine",style:{width:"".concat(t,"px"),height:"auto",maxWidth:"100%"}}),a&&(0,r.jsx)("div",{className:"absolute bottom-0 right-0 rounded-tl-xl bg-orange-500",children:(0,r.jsxs)(b.Z,{color:"white",style:{fontSize:"".concat(12,"px"),lineHeight:1},children:[a," Kg"]})})]}):(0,r.jsx)("div",{className:"relative w-fit h-fit",children:(0,r.jsx)("img",{src:"/assets/machines/washer-disabled.svg",alt:"Washer Machine",style:{width:"".concat(t,"px"),height:"auto",maxWidth:"100%"}})})}function S(e){let{width:i=14,className:t=""}=e;return(0,r.jsx)("div",{className:(0,l.cn)("relative w-fit h-fit",t),children:(0,r.jsx)("img",{src:"/assets/machines/module-icon.svg",alt:"Washer Machine",style:{width:"".concat(i,"px"),height:"auto",maxWidth:"100%"}})})}function D(e){let{width:i=16,className:t=""}=e;return(0,r.jsx)("div",{className:(0,l.cn)("relative w-fit h-fit",t),children:(0,r.jsx)("img",{src:"/assets/machines/start-icon.svg",alt:"Washer Machine",style:{width:"".concat(i,"px"),height:"auto"}})})}function I(e){let{width:i=16,className:t="",color:a="blue"}=e;return(0,r.jsx)("div",{className:(0,l.cn)("relative w-fit h-fit",t),children:(0,r.jsx)("img",{src:"/assets/machines/extra-time-icon-".concat(a,".svg"),alt:"Washer Machine",style:{width:"".concat(i,"px"),height:"auto"}})})}function T(e){let{width:i=16,className:t=""}=e;return(0,r.jsx)("div",{className:(0,l.cn)("relative w-fit h-fit",t),children:(0,r.jsx)("img",{src:"/assets/machines/power-icon.svg",alt:"Washer Machine",style:{width:"".concat(i,"px"),height:"auto"}})})}function W(e){let{width:i=16}=e;return(0,r.jsx)("div",{className:"relative w-fit h-fit",children:(0,r.jsx)("img",{src:"/assets/machines/resume-icon.svg",alt:"Washer Machine",style:{width:"".concat(i,"px"),height:"auto"}})})}function A(e){let{width:i=16,className:t=""}=e;return(0,r.jsx)("div",{className:(0,l.cn)("relative w-fit h-fit",t),children:(0,r.jsx)("img",{src:"/assets/machines/pause-icon.svg",alt:"Washer Machine",style:{width:"".concat(i,"px"),height:"auto"}})})}function L(e){let{width:i=16}=e;return(0,r.jsx)("div",{className:"relative w-fit h-fit",children:(0,r.jsx)("img",{src:"/assets/machines/check-icon.svg",alt:"Washer Machine",style:{width:"".concat(i,"px"),height:"auto"}})})}function O(e){let{width:i=16}=e;return(0,r.jsx)("div",{className:"relative w-fit h-fit",children:(0,r.jsx)("img",{src:"/assets/machines/non-module-icon.svg",alt:"Washer Machine",style:{width:"".concat(i,"px"),height:"auto"}})})}function z(e){let{width:i=16}=e;return(0,r.jsx)("div",{className:"relative w-fit h-fit",children:(0,r.jsx)("img",{src:"/assets/machines/disconnected-module-icon.svg",alt:"Washer Machine",style:{width:"".concat(i,"px"),height:"auto"}})})}function E(e){let{width:i=16,className:t=""}=e;return(0,r.jsx)("div",{className:(0,l.cn)("relative w-fit h-fit",t),children:(0,r.jsx)("img",{src:"/assets/machines/module.svg",alt:"",style:{width:"".concat(i,"px"),height:"auto"}})})}let F=e=>{let{variant:i,machineData:t,transactionConfigs:a={}
1,isCustomableDuration:n=!1}=e,{handleOpenModal:l,handleCloseModal:o}=(0,s.QX)(),{mutate:c,isPending:d}=(0,s.vy)(),u=e=>{if(e.stopPropagation(),n){l("extra_time_form",{onClose:()=>o("extra_time_form"),machineData:t});return}c({machineData:t,actionType:"On_Start",transactionConfigs:a})};return"primary"===i?(0,r.jsx)(y.Z,{className:"w-full",type:"button",onClick:u,disabled:d,loading:d,children:(0,r.jsxs)("div",{className:"flex items-center justify-center gap-x-2",children:[(0,r.jsx)(D,{width:12,className:"flex-shrink-0"}),(0,r.jsx)(b.Z,{color:"white",children:"Start"})]})}):"icon"===i?(0,r.jsx)("button",{type:"button",onClick:u,disabled:d,className:"cursor-pointer bg-primary-light w-9 h-9 rounded-full flex items-center justify-center disabled:opacity-50",children:(0,r.jsx)(D,{width:12,className:"ml-1"})}):"extra"===i?(0,r.jsx)("button",{type:"button",onClick:u,disabled:d,className:"cursor-pointer bg-white w-9 h-9 border border-primary-light rounded-full flex items-center justify-center disabled:opacity-50",children:(0,r.jsx)(I,{width:16,color:"blue"})}):void 0},q=e=>{let{machineData:i,variant:t,transactionConfigs:a={}}=e,{mutate:n,isPending:l}=(0,s.vy)(),o=e=>{e.stopPropagation(),n({machineData:i,actionType:"Finish",transactionConfigs:a})};return"primary"===t?(0,r.jsx)(y.Z,{type:"button",className:"w-full",onClick:o,disabled:l,variant:"outline",loading:l,children:(0,r.jsx)(b.Z,{color:"blue",children:"Finish"})}):"icon"===t?(0,r.jsx)("button",{type:"button",onClick:o,disabled:l,className:"cursor-pointer border border-primary-light w-9 h-9 rounded-full flex items-center justify-center disabled:opacity-50",children:(0,r.jsx)(T,{width:18})}):void 0},H=e=>{let{machineData:i,variant:t,machineType:a,transactionConfigs:n={}}=e,{mutate:l,isPending:o}=(0,s.vy)(),c=e=>{e.stopPropagation(),l({machineData:i,actionType:"Power_On",transactionConfigs:n})};return"primary"===t?(0,r.jsx)(y.Z,{type:"button",className:"w-full",onClick:c,disabled:o,variant:"outline",loading:o,children:(0,r.jsx)(b.Z,{color:"blue",children:"Power On"})}):"icon"===t?(0,r.jsx)("button",{type:"button",onClick:c,disabled:o,className:"cursor-pointer border border-primary-light w-9 h-9 rounded-full flex items-center justify-center disabled:opacity-50",children:(0,r.jsx)(T,{width:18})}):void 0},B=e=>{let{className:i,iconClassName:t}=e;return(0,r.jsx)("div",{className:(0,l.cn)("w-9 h-9 rounded-full flex items-center justify-center bg-success-light",i),children:(0,r.jsx)(L,{className:(0,l.cn)("w-4 h-4",t)})})},R=e=>{let{className:i,iconClassName:t}=e;return(0,r.jsx)("div",{className:(0,l.cn)("w-9 h-9 rounded-full flex items-center justify-center bg-disable-light",i),children:(0,r.jsx)(O,{className:(0,l.cn)("w-4 h-4",t)})})},K=e=>{let{className:i,iconClassName:t}=e;return(0,r.jsx)("div",{className:(0,l.cn)("w-9 h-9 rounded-full flex items-center justify-center bg-disable-light",i),children:(0,r.jsx)(z,{className:(0,l.cn)("w-4 h-4",t)})})},Q=e=>{let{variant:i="icon",machineData:t,transactionConfigs:a={}}=e,{mutate:n,isPending:l}=(0,s.vy)(),o=e=>{e.stopPropagation(),n({machineData:t,actionType:"Resume",transactionConfigs:a})};return"primary"===i?(0,r.jsx)(y.Z,{type:"button",className:"w-full",onClick:o,disabled:l,variant:"outline",loading:l,children:(0,r.jsxs)("div",{className:"flex items-center gap-x-1.5",children:[(0,r.jsx)(W,{width:12}),(0,r.jsx)(b.Z,{color:"blue",children:"Resume"})]})}):"icon"===i?(0,r.jsx)("button",{type:"button",onClick:o,disabled:l,className:"cursor-pointer border border-primary-light w-9 h-9 rounded-full flex items-center justify-center disabled:opacity-50",children:(0,r.jsx)(W,{width:12,className:"ml-1"})}):(0,r.jsx)("button",{onClick:o,disabled:l,className:"w-full cursor-pointer w-9 h-9 rounded-full flex items-center justify-center border border-primary-light disabled:opacity-50",children:(0,r.jsx)(W,{size:16,className:"ml-1"})})},V=e=>{let{variant:i="icon",machineData:t,transactionConfigs:a={}}=e,{mutate:n,isPending:l}=(0,s.vy)(),o=e=>{e.stopPropagation(),n({machineData:t,actionType:"Pause",transactionConfigs:a})};return"primary"===i?(0,r.jsxs)(y.Z,{className:"w-full gap-x-1.5",type:"button",onClick:o,disabled:l,variant:"outline",loading:l,children:[(0,r.jsx)(A,{width:12}),(0,r.jsx)(b.Z,{color:"blue",children:"Pause"})]}):"icon"===i?(0,r.jsx)("button",{type:"button",onClick:o,disabled:l,className:"cursor-pointer border border-primary-light w-9 h-9 rounded-full flex items-center justify-center",children:(0,r.jsx)(A,{width:12})}):void 0},U=e=>{let{id:i}=e,t=(0,v.useRouter)();return(0,r.jsx)("button",{onClick:()=>t.push("/kelola-mesin/".concat(i)),className:"cursor-pointer px-2 w-9 h-9 rounded-full flex items-center justify-center border custom-border",children:(0,r.jsx)(h.Z,{size:16})})},X=e=>{let{targetTime:i,className:t}=e,{data:a}=(0,n.pA)(),[s,o]=(0,g.useState)((0,u.VA)({targetTime:i,outletTimeZone:null==a?void 0:a.zonawaktu,useLocaleFormatter:!0}));return(0,g.useEffect)(()=>{let e=setInterval(()=>{o((0,u.VA)({targetTime:i,outletTimeZone:null==a?void 0:a.zonawaktu,useLocaleFormatter:!0,additionalSeconds:5}))},1e3);return()=>clearInterval(e)},[i]),(0,r.jsx)(b.Z,{className:(0,l.cn)("",t),children:s})},Y=e=>{let{text:i}=e;return(0,r.jsx)(b.Z,{align:"center",color:"danger",children:i})},G=e=>{let{variant:i}=e,t=(0,N.Z)(),a=()=>
1{t.open({title:"Informasi",message:"Fitur penambahan Modul IOTIC hanya tersedia di aplikasi Bilas Mobile.",cancelBtnText:"Tutup",confirmBtnText:"Download Bilas",onConfirm:()=>{window.open("https://play.google.com/store/apps/details?id=com.bilas.admin","_blank")},onCancel:()=>{t.close()}})};return"primary"===i?(0,r.jsxs)(y.Z,{type:"button",className:"gap-x-2",variant:"flat",onClick:a,children:[(0,r.jsx)(m.Z,{color:"blue",size:16}),(0,r.jsx)(b.Z,{color:"blue",children:"Modul"})]}):"secondary"===i?(0,r.jsxs)(y.Z,{type:"button",className:"gap-x-2",onClick:a,children:[(0,r.jsx)(m.Z,{color:"white",size:16}),(0,r.jsx)(b.Z,{color:"white",children:"Modul"})]}):void 0},J=e=>{let{isOpen:i,onClose:t,machineData:n,detailTransactionData:l,extra:d=!1}=e,[u,h]=(0,g.useState)((null==n?void 0:n.timer)||""),[m,x]=(0,g.useState)(null),{selectedMachines:p,setSelectedMachines:v}=(0,c.Z)(),{authData:N}=(0,o.Z)(),{mutate:k}=(0,s.vy)(t),{data:C}=(0,a.Z)({page:"reguler"});return(0,r.jsxs)(w.Z,{isOpen:i,onClose:t,title:"Atur Durasi",className:"w-11/12 max-w-md",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,r.jsx)(j.Z,{htmlFor:"timer",required:!0,children:"Durasi"}),(0,r.jsx)(f.Z,{id:"timer",name:"timer",inputMode:"numeric",value:u||"",placeholder:"45",errorMsg:m,onChange:e=>h(String(e.target.value))})]}),(0,r.jsxs)("div",{className:"w-full flex items-center justify-end",children:[(0,r.jsx)(y.Z,{onClick:t,variant:"flat",children:(0,r.jsx)(b.Z,{children:"Batal"})}),(0,r.jsx)(y.Z,{type:"button",onClick:e=>{if(e.stopPropagation(),!u){x("Durasi tidak boleh kosong");return}k({machineData:n,actionType:"On_Start",machineType:"dryer",transactionConfigs:{extra:d,timer:u,transactionId:null==C?void 0:C.id,detailId:null==l?void 0:l.uid,userId:null==N?void 0:N.id,userNama:null==N?void 0:N.nama,qty:null==l?void 0:l.qty,uid:null==k?void 0:k.uid,no_nota:null==C?void 0:C.no_nota,satuan:null==l?void 0:l.satuan,id_product:k.id_product}}),(null==p?void 0:p.includes(null==n?void 0:n.id))&&v(e=>e.filter(e=>e!==(null==n?void 0:n.id)))},children:(0,r.jsx)(b.Z,{color:"white",children:"Simpan"})})]})]})},$=e=>{let{isOpen:i,onClose:t,machineData:n,detailTransactionData:l}=e,[d,u]=(0,g.useState)((null==n?void 0:n.mode)||""),[h,m]=(0,g.useState)(null),{selectedMachines:x,setSelectedMachines:p}=(0,c.Z)(),{authData:v}=(0,o.Z)(),{mutate:N}=(0,s.vy)(t),{data:k}=(0,a.Z)({page:"reguler"});return(0,r.jsxs)(w.Z,{isOpen:i,onClose:t,title:"Mode",className:"w-11/12 max-w-md",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,r.jsx)(j.Z,{htmlFor:"mode",required:!0,children:"Mode"}),(0,r.jsx)(f.Z,{id:"mode",name:"mode",inputMode:"numeric",value:d||"",placeholder:"1",errorMsg:h,onChange:e=>u(String(e.target.value))})]}),(0,r.jsxs)("div",{className:"w-full flex items-center justify-end",children:[(0,r.jsx)(y.Z,{onClick:t,variant:"flat",children:(0,r.jsx)(b.Z,{children:"Batal"})}),(0,r.jsx)(y.Z,{type:"button",onClick:e=>{if(e.stopPropagation(),!d){m("Mode tidak boleh kosong");return}N({machineData:n,actionType:"On_Start",machineType:"washer",transactionConfigs:{mode:d,transactionId:null==k?void 0:k.id,detailId:null==l?void 0:l.uid,userId:null==v?void 0:v.id,userNama:null==v?void 0:v.nama,qty:null==l?void 0:l.qty,uid:null==N?void 0:N.uid,no_nota:null==k?void 0:k.no_nota,satuan:null==l?void 0:l.satuan,id_product:N.id_product}}),(null==x?void 0:x.includes(null==n?void 0:n.id))&&p(e=>e.filter(e=>e!==(null==n?void 0:n.id)))},children:(0,r.jsx)(b.Z,{color:"white",children:"Simpan"})})]})]})},ee=e=>{var i,t,a,n,l;let{onClose:c,isOpen:d,machineData:u}=e,{activeOutlet:h}=(0,o.Z)(),m=(0,s.AQ)(u,c),{data:v,isLoading:y}=(0,s.XD)(null==u?void 0:u.serial),{data:N}=(0,s.E2)(null==u?void 0:u.id),{data:P,isLoading:_}=(0,C.UA)("iotqris"),S=(null==u?void 0:u.jenis)||"Washer",D=(null==u?void 0:u.varian)||"Analog",I="IOTIC Qris"===(null!==(l=null==v?void 0:v.jenis_produk)&&void 0!==l?l:null),T=null==P?void 0:P.some(e=>e.id_outlet===(null==h?void 0:h.id)&&"iotqris"===e.source_system),W=I&&T,A=I&&!T,{handleSubmitForm:L,formState:{errors:O},isPending:z,setValue:E,watch:F}=m,q=F(),[H,B]=(0,g.useState)([{timer:"0",price:0}]),[R,K]=(0,g.useState)({active:!1,pricePerMinute:0,minCustomDuration:"0"}),[Q,V]=(0,g.useState)({}),[U,X]=(0,g.useState)([]);return(0,g.useEffect)(()=>
1{if(N){if((null==S?void 0:S.toLowerCase())==="washer"){let e=N.find(e=>"static"===e.type);B([{timer:"0",price:(null==e?void 0:e.price)||0}])}else{let e=N.filter(e=>"static"===e.type),i=N.find(e=>"custom"===e.type);e.length>0?B(e.map(e=>({timer:String(e.timer||"0"),price:e.price||0}))):B([{timer:"0",price:0}]),i?K({active:!0,pricePerMinute:i.pricePerMinute||0,minCustomDuration:String(i.minCustomDuration||"0")}):K({active:!1,pricePerMinute:0,minCustomDuration:"0"})}}else B([{timer:"0",price:0}]),K({active:!1,pricePerMinute:0,minCustomDuration:"0"})},[N,S]),(0,g.useEffect)(()=>{let e=[];if(W){if((null==D?void 0:D.toLowerCase())==="digital"){var i;e.push({type:"static",slot:1,price:Number(null===(i=H[0])||void 0===i?void 0:i.price)||0,timer:"0",pricePerMinute:0,minCustomDuration:"0",isActive:!0})}else H.forEach((i,t)=>{e.push({type:"static",slot:t+1,price:Number(i.price)||0,timer:i.timer||"0",pricePerMinute:0,minCustomDuration:"0",isActive:!0})}),R.active&&e.push({type:"custom",slot:1,price:0,timer:"0",pricePerMinute:Number(R.pricePerMinute)||0,minCustomDuration:R.minCustomDuration||"0",isActive:!0})}E("priceConfig",W?e:void 0)},[H,R,D,E,W]),(0,r.jsx)(w.Z,{isOpen:d,onClose:c,title:"Edit Modul",className:"flex flex-col min-h-[400px] max-h-[700px] overflow-y-auto",children:(0,r.jsx)("div",{className:"flex-1 w-full flex flex-col gap-y-4",children:(0,r.jsxs)("form",{className:"flex-1 space-y-4 flex flex-col justify-between -mb-4",onSubmit:e=>{e.preventDefault();let i=!1,t={},r=[];if(W&&!A){if((null==D?void 0:D.toLowerCase())==="digital"){let e=H[0];(!(null==e?void 0:e.price)||0>=Number(e.price))&&(r[0]={price:"Harga harus lebih dari 0"},i=!0)}else(null==D?void 0:D.toLowerCase())==="analog"&&(H.forEach((e,t)=>{let a={};(!e.timer||0>=Number(e.timer))&&(a.timer="Durasi harus > 0",i=!0),(!e.price||0>=Number(e.price))&&(a.price="Harga harus > 0",i=!0),Object.keys(a).length>0&&(r[t]=a)}),R.active&&((!R.pricePerMinute||0>=Number(R.pricePerMinute))&&(t.pricePerMinute="Harga per menit harus lebih dari 0",i=!0),(!R.minCustomDuration||0>=Number(R.minCustomDuration))&&(t.minCustomDuration="Minimal custom durasi harus lebih dari 0",i=!0)))}V(t),X(r),i||L(e)},children:[(null==D?void 0:D.toLowerCase())==="analog"&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(b.Z,{semibold:!0,children:"Pengaturan Proses Produksi"}),(0,r.jsx)(b.Z,{children:"Konfigurasi mesin untuk operasional laundry oleh pegawai."})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(j.Z,{children:"Durasi"}),(0,r.jsx)(f.Z,{id:"timer",name:"timer",inputMode:"numeric",errorMsg:null===(i=O.timer)||void 0===i?void 0:i.message,onChange:e=>E("timer",Number(e.target.value)),value:q.timer})]}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(j.Z,{children:"Extra Time"}),(0,r.jsx)(f.Z,{id:"extra_timer",name:"extra_timer",inputMode:"numeric",errorMsg:null===(t=O.extra_timer)||void 0===t?void 0:t.message,onChange:e=>
1E("extra_timer",Number(e.target.value)),value:q.extra_timer})]})]})]}),!(y||_)&&I&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(b.Z,{semibold:!0,children:"Pengaturan Self-Service"}),(0,r.jsx)(b.Z,{children:"Konfigurasi mesin untuk layanan laundry mandiri oleh pelanggan."})]}),A&&(0,r.jsxs)("div",{className:"p-3 border border-primary-light rounded-lg flex flex-col gap-y-2 bg-primary-soft",children:[(0,r.jsxs)("div",{className:"w-full flex gap-x-1.5",children:[(0,r.jsx)(x.Z,{className:"text-primary-light text-3xl"}),(0,r.jsx)(b.Z,{color:"blue",children:"Untuk menggunakan fitur ini, pastikan Anda telah menggunakan dan menghubungkan Modul IOTIC Layar QRIS ke aplikasi Bilas."})]}),(0,r.jsxs)("div",{className:"w-full flex gap-x-2 justify-end",children:[(0,r.jsx)(M.default,{href:"https://iotic.id",target:"_blank",className:"border border-primary-light rounded-lg py-1 px-4",children:(0,r.jsx)(b.Z,{color:"blue",children:"Pelajari Produk"})}),(0,r.jsx)(M.default,{href:"/payment-gateway/qris",className:"border border-primary-light bg-primary-light rounded-lg py-1 px-4",children:(0,r.jsx)(b.Z,{color:"white",children:"Tautkan Sekarang"})})]})]}),!A&&(null==D?void 0:D.toLowerCase())==="digital"&&(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(j.Z,{children:"Harga per load"}),(0,r.jsx)(f.Z,{inputMode:"numeric",value:null===(a=H[0])||void 0===a?void 0:a.price,errorMsg:null===(n=U[0])||void 0===n?void 0:n.price,onChange:e=>B([{timer:"0",price:""===e.target.value?"":Number(e.target.value)}])})]}),!A&&(null==D?void 0:D.toLowerCase())==="analog"&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("div",{className:"space-y-1.5",children:H.map((e,i)=>{var t,a;return(0,r.jsxs)("div",{className:"flex gap-x-3 items-end",children:[(0,r.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,r.jsx)(j.Z,{children:"Durasi"}),(0,r.jsx)(f.Z,{inputMode:"numeric",value:e.timer,errorMsg:null===(t=U[i])||void 0===t?void 0:t.timer,onChange:e=>{let t=[...H];t[i].timer=""===e.target.value?"":e.target.value,B(t)}})]}),(0,r.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,r.jsx)(j.Z,{children:"Harga"}),(0,r.jsx)(f.Z,{inputMode:"numeric",value:e.price,errorMsg:null===(a=U[i])||void 0===a?void 0:a.price,onChange:e=>{let t=[...H];t[i].price=""===e.target.value?"":Number(e.target.value),B(t)}})]}),H.length>1&&(0,r.jsx)("button",{type:"button",onClick:()=>B(H.filter((e,t)=>t!==i)),className:"text-red-500 mb-2 font-medium text-sm",children:(0,r.jsx)(p.Z,{size:16})})]},i)})}),H.length<4&&(0,r.jsx)("button",{type:"button",onClick:()=>B([...H,{timer:"0",price:0}]),className:"text-blue-500 font-semibold text-sm",children:"+ Durasi & Harga"}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-x-3 mt-6",children:[(0,r.jsx)(Z.Z,{id:"custom-price",checked:R.active,onCheckedChange:e=>K({...R,active:e})}),(0,r.jsx)(j.Z,{htmlFor:"custom-price",children:"Custom Harga"})]}),R.active&&(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(j.Z,{children:"Harga per Menit"}),(0,r.jsx)(f.Z,{inputMode:"numeric",value:R.pricePerMinute,errorMsg:Q.pricePerMinute,onChange:e=>K({...R,pricePerMinute:""===e.target.value?"":Number(e.target.value)})})]}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(j.Z,{children:"Minimal Custom Durasi"}),(0,r.jsx)(f.Z,{inputMode:"numeric",value:R.minCustomDuration,errorMsg:Q.minCustomDuration,onChange:e=>K({...R,minCustomDuration:e.target.value})})]})]})]})]})]}),(0,r.jsx)("div",{className:"sticky bottom-0 bg-subbackground-light dark:bg-background-dark z-10 pb-4 pt-2",children:(0,r.jsx)(k.Z,{onCancel:c,isPending:z})})]})})})}},16552:function(e,i,t){var r=t(57437),a=t(2265),s=t(36760),n=t.n(s);let l=(0,a.forwardRef)((e,i)=>{let{className:t="",thumbClassName:s="",checked:l,defaultChecked:o=!1,onCheckedChange:c,onChange:d,disabled:u=!1,required:h=!1,name:m,value:x,id:p,...v}=e,g=void 0!==l,[f,j]=(0,a.useState)(g?!!l:!!o),b=g?!!l:f;(0,a.useEffect)(()=>{g&&j(!!l)},[l,g]);let y=e=>{if(u)return;let i=!b;if(g||j(i),null==c||c(i),d){let t=Object.create(e);t.target={...e.target,name:m,value:x,checked:i},d(t)}};return(0,r.jsxs)(r.Fragment,{children:[m&&(0,r.jsx)("input",{type:"checkbox",name:m,value:x,checked:b,onChange:()=>{},tabIndex:-1,"aria-hidden":"true",className:"sr-only",disabled:u,required:h}),(0,r.jsx)("button",{type:"button",role:"switch",id:p,ref:i,"aria-checked":b,"aria-required":h,"aria-disabled":u,"data-state":b?"checked":"unchecked","data-disabled":u?"":void 0,disabled:u,onClick:y,onKeyDown:e=>
1{(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),y(e))},className:n()("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",b?"bg-[#47C7F1] dark:bg-[#47C7F1]":"bg-slate-200 dark:bg-disable-dark",t),...v,children:(0,r.jsx)("span",{"data-state":b?"checked":"unchecked",className:n()("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform duration-200 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",s)})})]})});l.displayName="Switch",i.Z=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.