1import{R as x,h as R,a as r,F as q,j as e,H as O}from"./app.627af7b6.js";import{H as Y}from"./WhatsAppButton.6afccb9c.js";import{F as G}from"./Footer.39693726.js";import{m as H}from"./index.2dd88f64.js";import{F as K,z as k}from"./index.416bb544.js";import{u as X,F as U}from"./Fade.71c08766.js";import{u as Z}from"./useMediaQuery.d8f69e14.js";import{G as h}from"./Grid2.d7aa8bb3.js";import{P as v}from"./Paper.b8eebb90.js";import{B as n}from"./Box.b2a60e9a.js";import{T as M}from"./TextField.342a6981.js";import{B as b}from"./Modal.95957054.js";import{S as F,E as z}from"./Search.ce20d672.js";import{T as i}from"./Typography.a1637358.js";import{C as P}from"./Card.84379b0a.js";import"./jsx-runtime_commonjs-proxy.3ae32752.js";import"./isMuiElement.68ecd9af.js";import"./DefaultPropsProvider.fe5a72c1.js";import"./Slide.d2b1515b.js";import"./List.596aa30a.js";import"./listItemTextClasses.a7a0b0ec.js";import"./index.252b9187.js";import"./LocationOn.e90743a4.js";import"./Phone.15ed17b9.js";import"./IconButton.1e7dab2f.js";import"./YouTube.1bfe797b.js";import"./getThemeProps.da735222.js";import"./useFormControl.64d8fff3.js";const Q="_reservationContainerActive_xifkq_1",N={reservationContainerActive:Q};function J(){const w=x.useRef(!0),C=x.useCallback(()=>w.current,[]);return x.useEffect(()=>()=>void(w.current=!1),[]),x.useEffect(()=>{window.sessionStorage.clear();const S="https://app.midtrans.com/snap/snap.js",m="Mid-client-lYBi_CM3a6fBcx3w";let g=document.createElement("script");return g.src=S,g.setAttribute("data-client-key",m),document.body.appendChild(g),()=>{document.body.removeChild(g)}},[]),C}function We(w){const C=X(),S=Z(C.breakpoints.up("laptop")),m=J(),[g,E]=x.useState(),[c,L]=x.useState([]),[s,y]=x.useState({id:0,bill:0,status:""}),[V,A]=x.useState(),W=Array.from(Array(c.length).keys()),j=t=>{E(t.target.value)},T=()=>{R.post("https://servicereservasi.salokapark.app/api/get-reservation-by-email",{email:g}).then(t=>{let d=t.data.reservations,a=t.data.reservationsGroup,l=t.data.reservationsZeals,p=[];for(let o=0;o<d.length;o++)p.push({id:d[o].id,type:"reguler",order_id:d[o].order_id,bill:d[o].bill,arrival_date:d[o].arrival_date});for(let o=0;o<a.length;o++)p.push({id:a[o].id,type:"group",order_id:a[o].order_id,bill:a[o].bill,arrival_date:a[o].arrival_date});for(let o=0;o<l.length;o++)p.push({id:l[o].id,type:"zeals",order_id:l[o].order_id,bill:l[o].bill,arrival_date:l[o].arrival_date});L(p),p.length<1&&D({message:"data tidak ditemukan",status:"error"})}).catch(t=>{console.log(t),D({message:t})})},_=(t,d)=>{y({id:t,bill:0,status:""}),R.post("https://servicereservasi.salokapark.app/api/get-reservation-detail",{id:t,type:d}).then(a=>{let l=a.data.reservation,p=a.data.customer,o=a.data.reservationDetail,f=[];y({id:l.id,snap_token:l.snap_token,order_id:l.order_id,arrival_date:l.arrival_date,bill:l.bill,status:l.status,name:p.name});for(let u=0;u<o.length;u++)f.push({name:o[u].name,qty:o[u].qty,subtotal:o[u].subtotal});A(f)}).catch(a=>{console.log(a)})},I=t=>{switch(t){case"created":return e(n,{children:e(i,{sx:{fontSize:"28px",fontWeight:600,textAlign:"center"},children:"Created"})});case"payment":return e(n,{children:e(i,{sx:{fontSize:"28px",fontWeight:600,textAlign:"center"},children:"Payments"})});case"pending":return e(n,{children:e(i,{sx:{fontSize:"28px",fontWeight:600,textAlign:"center"},children:"Pending"})});case"settlement":return e(n,{children:e(i,{sx:{fontSize:"28px",fontWeight:600,textAlign:"center",color:"primary.light"},children:"Success"})});case"capture":return e(n,{children:e(i,{sx:{fontSize:"28px",fontWeight:600,textAlign:"center",color:"primary.light"},children:"Captured"})});case"deny":return e(n,{children:e(i,{sx:{fontSize:"28px",fontWeight:600,textAlign:"center",color:"red.main"},children:"Denied"})});case"cancle":return e(n,{children:e(i,{sx:{fontSize:"28px",fontWeight:600,textAlign:"center",color:"red.main"},children:"Canceled"})});case"expire":return e(n,{children:e(i,{sx:{fontSize:"28px",fontWeight:600,textAlign:"center",color:"red.main"},children:"Expired"})});case"failure":return e(n,{children:e(i,{sx:{fontSize:"28px",fontWeight:600,textAlign:"center",color:"red.main"},children:"Failure"})});default:return null}};x.useEffect(()=>{let t=window.location.search,a=new URLSearchParams(t).get("order_id");if(a)try{$(a)}catch(l){console.log(l)}},[]);const $=t=>{y({id:0,bill:0,status:""}),R.post("https://servicereservasi.salokapark.app/api/get-reservation-by-order-id",{orderID:t}).then(d=>{let a=d.data.reservation,l=d.data.customer,p=d.data.reservationDetail,o=[];y({id:a.id,snap_token:a.snap_token,order_id:a.order_id,arrival_date:a.arrival_date,bill:a.bill,status:a.status,name:l.name});for(let f=0;f<p.length;f++)o.push({name:p[f].name,qty:p[f].qty,subtotal:p[f].subtotal});A(o)}).catch(d=>{console.log(d)})},B=t=>{window.snap.pay(t)},D=t=>{t.status==="error"?k(t.message,{duration:4e3,position:"top-center",style:{background:"#f45049",color:"#eee"},className:"toastNotification",icon:e(z,{}),iconTheme:{primary:"#000",secondary:"#fff"},ariaProps:{role:"status","aria-live":"polite"}}):t.status==="success"?k(t.message,{duration:4e3,position:"top-center",style:{background:"#45ad8d",color:"#eee"},className:"toastNotification",icon:e(z,{}),iconTheme:{primary:"#000",secondary:"#fff"},ariaProps:{role:"status","aria-live":"polite"}}):t.status==="info"&&k(t.message,{duration:4e3,position:"top-center",style:{background:"#4b78bf",color:"#eee"},className:"toastNotification",icon:e(z,{}),iconTheme:{primary:"#000",secondary:"#fff"},ariaProps:{role:"status","aria-live":"polite"}})};return r(q,{children:[e(O,{title:"Check Status"}),e(U,{in:m,timeout:1e3,style:{transitionDelay:m?"500ms":"0ms"},children:r("div",{children:[e(K,{}),e(Y,{}),S?e("div",{children:e(h,{container:!0,direction:"column",spacing:0,sx:{marginTop:"100px",display:"flex",maxWidth:"100%",justifyContent:"center",alignItems:"center"},children:r(h,{container:!0,direction:"row",spacing:0,sx:{display:"flex",width:"100%",justifyContent:"center",alignItems:"flex-start"},children:[r(v,{elevation:3,sx:{marginX:"2%",width:"50%",height:"100%",borderRadius:"30px"},children:[e(n,{sx:{marginTop:"20px",width:"100%",display:"flex",justifyContent:"center"},children:e(M,{placeholder:"email",onChange:t=>j(t),sx:{width:"50%",margin:0,padding:0,backgroundColor:"#eee",border:"solid 0px",borderBottomLeftRadius:"50px",borderTopLeftRadius:"50px",borderBottomRightRadius:"50px",borderTopRightRadius:"50px","&:hover fieldset":{border:"solid 0px"},fieldset:{border:"solid 0px"},"& .MuiOutlinedInput-root.Mui-focused":{"& > fieldset":{border:"solid 0px"}},"& .MuiOutlinedInput-root":{paddingRight:"0px",fontFamily:"AlrightSans",fontSize:"16px",fontWeight:600}},InputProps:{endAdornment:r(b,{onClick:()=>T(),variant:"contained",color:"secondary",sx:{margin:0,padding:0,width:"100%",height:"100%",borderBottomLeftRadius:"50px",borderTopLeftRadius:"50px",borderBottomRightRadius:"50px",borderTopRightRadius:"50px"},children:[e(F,{sx:{color:"#eee"}}),e(i,{sx:{marginX:"5px",fontSize:"18px",fontWeight:400,color:"#eee"},children:"Search"})]})}})}),e(n,{sx:{marginTop:"20px",width:"100%",display:"flex",justifyContent:"center"},children:e(i,{sx:{fontSize:"24px",fontWeight:600},children:"Reservations:"})}),e(n,{sx:{marginTop:"20px",paddingBottom:"20px",width:"100%",display:"flex",justifyContent:"center"},children:e(h,{container:!0,direction:"column",spacing:0,sx:{display:"flex",width:"100%",justifyContent:"center"},children:W.map(t=>e(n,{sx:{marginY:"5px",width:"100%",display:"flex",justifyContent:"center"},children:e(P,{elevation:2,className:`reservation-container ${s.id===c[t].id?N.reservationContainerActive:""} `,onClick:()=>_(c[t].id,c[t].type),sx:{display:"flex",width:"80%",height:"100px",justifyContent:"center",borderRadius:"30px",cursor:"pointer","&:hover":{backgroundColor:"secondary.lightest"}},children:r(h,{container:!0,direction:"row",spacing:0,sx:{display:"flex",width:"90%",justifyContent:"space-between",alignItems:"center"},children:[r(n,{sx:{width:"60%",display:"flex",flexDirection:"column"},children:[e(i,{sx:{fontSize:"18px",fontWeight:600,color:"#333"},children:c[t].order_id}),r(i,{sx:{fontSize:"12px",fontWeight:400,color:"#555"},children:["tanggal kedatangan: ",c[t].arrival_date]})]}),e(n,{sx:{width:"40%",display:"flex",flexDirection:"column"},children:r(i,{sx:{fontSize:"18px",fontWeight:600,color:"#333",textAlign:"right"},children:["Rp. ",c[t].bill.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")]})})]})})}))})})]}),e(v,{elevation:3,sx:{marginX:"2%",width:"30%",height:"500px",borderRadius:"30px"},children:s.id!==0?r(h,{container:!0,direction:"column",spacing:0,sx:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center"},children:[r(n,{sx:{marginTop:"20px",width:"50%",height:"100px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:"#eee",borderRadius:"30px"},children:[e(i,{sx:{fontSize:"14px",fontWeight:600,textAlign:"center"},children:"status:"}),I(s.status)]}),r(n,{sx:{marginTop:"40px",width:"70%",display:"flex",justifyContent:"space-between"},children:[e(i,{sx:{fontSize:"14px",fontWeight:600,textAlign:"left"},children:"order ID:"}),e(i,{sx:{fontSize:"14px",fontWeight:400,textAlign:"right"},children:s.order_id})]}),r(n,{sx:{marginTop:"20px",width:"70%",display:"flex",justifyContent:"space-between"},children:[e(i,{sx:{fontSize:"14px",fontWeight:600,textAlign:"left"},children:"name:"}),e(i,{sx:{fontSize:"14px",fontWeight:400,textAlign:"right"},children:s.name})]}),r(n,{sx:{marginTop:"20px",width:"70%",display:"flex",justifyContent:"space-between"},children:[e(i,{sx:{fontSize:"14px",fontWeight:600,textAlign:"left"},children:"arrival date:"}),e(i,{sx:{fontSize:"14px",fontWeight:400,textAlign:"right"},children:s.arrival_date})]}),r(n,{sx:{marginTop:"20px",width:"70%",display:"flex",justifyContent:"space-between"},children:[e(i,{sx:{fontSize:"14px",fontWeight:600,textAlign:"left"},children:"bill:"}),r(i,{sx:{fontSize:"14px",fontWeight:400,textAlign:"right"},children:["Rp. ",s.bill.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")]})]}),e(n,{sx:{width:"70%",marginTop:"20px"},children:e(i,{sx:{fontSize:"12px",fontWeight:400,textAlign:"justify"},children:"Kode Booking akan dikirim secepatnya paling lambat 1x24 jam melalui email anda. Terima kasih."})}),s.status!=="settlement"?e(n,{sx:{marginY:"20px"},children:e(b,{onClick:()=>B(s.snap_token),className:"payButton",id:"pay-button",variant:"contained",sx:{borderRadius:"30px"},children:"Bayar"})}):null]}):e(n,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:r(n,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[e(i,{sx:{fontSize:"24px",fontWeight:600,color:"#aaa"},children:"ID Reservasi Belum Dipilih"}),e(i,{sx:{fontSize:"18px",fontWeight:400,color:"#aaa"}
1,children:"Silahkan masukkan email reservasi anda lalu pilih ID reservasi!"})]})})})]})})}):e("div",{children:e(h,{container:!0,direction:"column",spacing:0,sx:{marginTop:"100px",display:"flex",maxWidth:"100%",justifyContent:"center",alignItems:"center"},children:r(h,{container:!0,direction:"column",spacing:0,sx:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center"},children:[r(v,{elevation:3,sx:{width:"90%",height:"100%",borderRadius:"30px"},children:[e(n,{sx:{marginTop:"20px",width:"100%",display:"flex",justifyContent:"center"},children:e(M,{placeholder:"email",onChange:t=>j(t),sx:{width:"80%",margin:0,padding:0,backgroundColor:"#eee",border:"solid 0px",borderBottomLeftRadius:"50px",borderTopLeftRadius:"50px",borderBottomRightRadius:"50px",borderTopRightRadius:"50px","&:hover fieldset":{border:"solid 0px"},fieldset:{border:"solid 0px"},"& .MuiOutlinedInput-root.Mui-focused":{"& > fieldset":{border:"solid 0px"}},"& .MuiOutlinedInput-root":{paddingRight:"0px",fontFamily:"AlrightSans",fontSize:"16px",fontWeight:600}},InputProps:{endAdornment:e(b,{onClick:()=>T(),variant:"contained",color:"secondary",sx:{margin:0,padding:0,width:"10%",height:"100%",borderBottomLeftRadius:"50px",borderTopLeftRadius:"50px",borderBottomRightRadius:"50px",borderTopRightRadius:"50px"},children:e(F,{sx:{color:"#eee"}})})}})}),e(n,{sx:{marginTop:"20px",width:"100%",display:"flex",justifyContent:"center"},children:e(i,{sx:{fontSize:"18px",fontWeight:600},children:"Reservations:"})}),e(n,{sx:{marginTop:"20px",width:"100%",display:"flex",justifyContent:"center"},children:e(h,{container:!0,direction:"column",spacing:0,sx:{paddingBottom:"20px",display:"flex",width:"100%",justifyContent:"center"},children:W.map(t=>e(n,{sx:{marginY:"5px",width:"100%",display:"flex",justifyContent:"center"},children:e(P,{elevation:2,className:`reservation-container ${s.id===c[t].id?N.reservationContainerActive:""} `,onClick:()=>_(c[t].id,c[t].type),sx:{display:"flex",width:"80%",height:"100px",justifyContent:"center",borderRadius:"30px",cursor:"pointer","&:hover":{backgroundColor:"secondary.lightest"}},children:e(h,{container:!0,direction:"row",spacing:0,sx:{display:"flex",width:"90%",justifyContent:"",alignItems:"center"},children:r(n,{sx:{width:"100%",display:"flex",flexDirection:"column"},children:[e(i,{sx:{fontSize:"18px",fontWeight:600,color:"#333",textAlign:"center"},children:c[t].order_id}),r(i,{sx:{fontSize:"12px",fontWeight:400,color:"#555",textAlign:"center"},children:["tanggal kedatangan: ",c[t].arrival_date]})]})})})}))})})]}),e(v,{elevation:3,sx:{marginTop:"20px",width:"90%",height:"500px",borderRadius:"30px"},children:s.id!==0?r(h,{container:!0,direction:"column",spacing:0,sx:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center"},children:[r(n,{sx:{marginTop:"20px",width:"50%",height:"100px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:"#eee",borderRadius:"30px"},children:[e(i,{sx:{fontSize:"14px",fontWeight:600,textAlign:"center"},children:"status:"}),I(s.status)]}),r(n,{sx:{marginTop:"40px",width:"70%",display:"flex",justifyContent:"space-between"},children:[e(i,{sx:{fontSize:"14px",fontWeight:600,textAlign:"left"},children:"order ID:"}),e(i,{sx:{fontSize:"14px",fontWeight:400,textAlign:"right"},children:s.order_id})]}),r(n,{sx:{marginTop:"20px",width:"70%",display:"flex",justifyContent:"space-between"},children:[e(i,{sx:{fontSize:"14px",fontWeight:600,textAlign:"left"},children:"name:"}),e(i,{sx:{fontSize:"14px",fontWeight:400,textAlign:"right"},children:s.name})]}),r(n,{sx:{marginTop:"20px",width:"70%",display:"flex",justifyContent:"space-between"},children:[e(i,{sx:{fontSize:"14px",fontWeight:600,textAlign:"left"},children:"arrival date:"}),e(i,{sx:{fontSize:"14px",fontWeight:400,textAlign:"right"},children:s.arrival_date})]}),r(n,{sx:{marginTop:"20px",width:"70%",display:"flex",justifyContent:"space-between"},children:[e(i,{sx:{fontSize:"14px",fontWeight:600,textAlign:"left"},children:"bill:"}),r(i,{sx:{fontSize:"14px",fontWeight:400,textAlign:"right"},children:["Rp. ",s.bill.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")]})]}),e(n,{sx:{width:"70%",marginTop:"20px"},children:e(i,{sx:{fontSize:"12px",fontWeight:400,textAlign:"justify"},children:"Kode Booking akan dikirim secepatnya paling lambat 1x24 jam melalui email anda. Terima kasih."})}),s.status!=="settlement"?e(n,{sx:{marginY:"20px"},children:e(b,{onClick:()=>B(s.snap_token),className:"payButton",id:"pay-button",variant:"contained",sx:{borderRadius:"30px"},children:"Bayar"})}):null]}):e(n,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:r(n,{sx:{width:"80%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[e(i,{sx:{fontSize:"20px",fontWeight:600,color:"#aaa",textAlign:"center"},children:"ID Reservasi Belum Dipilih"}),e(i,{sx:{fontSize:"14px",fontWeight:400,color:"#aaa",textAlign:"center"}
1,children:"Silahkan masukkan email reservasi anda lalu pilih ID reservasi!"})]})})})]})})}),e(n,{sx:{marginTop:"50px",width:"100%",height:"100%",backgroundImage:`url(${H[2]})`,backgroundRepeat:"no-repeat",backgroundSize:"cover"},children:e(G,{})})]})})]})}export{We as default,J as useIsMounted};
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.