1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9328],{89150:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/gifts/[id]",function(){return r(6697)}])},83424:function(e,n,r){"use strict";var t=r(67294);n.Z=function(){let[e,n]=(0,t.useState)(null),r=async e=>{var r;if(!(null===(r=navigator)||void 0===r?void 0:r.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(e),n(e),!0}catch(e){return console.warn("Copy failed",e),n(null),!1}};return{copiedText:e,copy:r}}},4878:function(e,n,r){"use strict";r.d(n,{_e:function(){return d},wd:function(){return c},xJ:function(){return a}});var t=r(95591),l=r(44334),i=r(25598),o=r(11201),s=r(56948);function a(e,n){let{city:r}=(0,o.qR)(),{code:l,...s}=e;return(0,t.ZP)(r&&l?"/v1/cities/".concat(null==r?void 0:r.slug,"/gift/").concat(l).concat((0,i.V)({...s})):void 0,{revalidateIfStale:!1,...n})}function d(e){let{city:n}=(0,o.qR)();return(0,l.Z)("/v1/cities/".concat(null==n?void 0:n.slug,"/gift"),async(e,n)=>{let{arg:r}=n;return await (0,s.Z)(e,{method:"POST",data:r})},{throwOnError:!1,revalidate:!1,...e})}function c(e){let{city:n}=(0,o.qR)();return(0,l.Z)("/gift/redeem",async(e,r)=>{let{arg:t}=r;return(0,s.Z)("/v1/cities/".concat(null==n?void 0:n.slug,"/gift/").concat(t.gift_code,"/redeem").concat((0,i.V)({...t})),{method:"POST"})},{throwOnError:!1,revalidate:!1,...e})}},8562:function(e,n,r){"use strict";r.d(n,{$F:function(){return d},EW:function(){return s},er:function(){return a}});var t=r(95591),l=r(44593),i=r(25598),o=r(11201);function s(e,n){var r,t,s,a,d,c,u,m;let v=null!==(s=null==e?void 0:e.limit)&&void 0!==s?s:10,{city:h}=(0,o.qR)(),{data:f,size:x,setSize:g,isValidating:p,isLoading:b}=(0,l.ZP)((e,n)=>n&&!n.past.length?null:h?"/v1/cities/".concat(null==h?void 0:h.slug,"/reservations").concat((0,i.V)({city_id:h.id,filter:"past",limit:v,page:e+1})):void 0,{revalidateIfStale:!1,revalidateFirstPage:!1,...n}),j=null!==(a=null==f?void 0:f.reduce((e,n)=>[...e,...n.past],[]))&&void 0!==a?a:[],N=null!==(d=b||x>0&&f&&void 0===f[x-1])&&void 0!==d&&d,y=(null==f?void 0:null===(r=f[0])||void 0===r?void 0:r.past.length)===0,w=null!==(u=y||f&&(null===(t=f[f.length-1])||void 0===t?void 0:t.past.length)<v)&&void 0!==u&&u,_=null!==(m=p&&f&&f.length===x)&&void 0!==m&&m;return{results:j,size:x,setSize:g,isLoadingMore:N,isReachingEnd:w,isEmpty:y,isRefreshing:_}}function a(e,n){var r,t,s,a,d,c,u,m;let v=null!==(s=null==e?void 0:e.limit)&&void 0!==s?s:10,{city:h}=(0,o.qR)(),{data:f,size:x,setSize:g,isValidating:p,isLoading:b}=(0,l.ZP)((e,n)=>n&&!n.current.length?null:h?"/v1/cities/".concat(null==h?void 0:h.slug,"/reservations").concat((0,i.V)({city_id:h.id,filter:"current",limit:v,page:e+1})):void 0,{revalidateIfStale:!1,revalidateFirstPage:!1,...n}),j=null!==(a=null==f?void 0:f.reduce((e,n)=>[...e,...n.current],[]))&&void 0!==a?a:[],N=null!==(d=b||x>0&&f&&void 0===f[x-1])&&void 0!==d&&d,y=(null==f?void 0:null===(r=f[0])||void 0===r?void 0:r.current.length)===0,w=null!==(u=y||f&&(null===(t=f[f.length-1])||void 0===t?void 0:t.current.length)<v)&&void 0!==u&&u,_=null!==(m=p&&f&&f.length===x)&&void 0!==m&&m;return{results:j,size:x,setSize:g,isLoadingMore:N,isReachingEnd:w,isEmpty:y,isRefreshing:_}}function d(e,n){let{city:r}=(0,o.qR)(),{id:l,...s}=e;return(0,t.ZP)(r&&l?"/v1/cities/".concat(null==r?void 0:r.slug,"/reservations/").concat(l).concat((0,i.V)({...s})):void 0,{revalidateIfStale:!1,...n})}},89639:function(e,n,r){"use strict";r.d(n,{X:function(){return s}});var t=r(85893),l=r(67294),i=r(57574);let o=(0,l.forwardRef)((e,n)=>{let{className:r,...l}=e;return(0,t.jsx)("input",{type:"checkbox",className:(0,i.cn)("form-checkbox cursor-pointer rounded text-primary ring-offset-2 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),...l,ref:n})});var s=o;o.displayName="Checkbox"},65503:function(e,n,r){"use strict";r.d(n,{l0:function(){return b},NI:function(){return d},Wi:function(){return N},xJ:function(){return _},lX:function(){return f},zG:function(){return p},YV:function(){return y}});var t=r(85893),l=r(67294),i=r(87536),o=r(57574),s=r(40634);
1let a=l.forwardRef((e,n)=>{let{...r}=e,{error:l,formItemId:i,formDescriptionId:o,formMessageId:a}=y();return(0,t.jsx)(s.g7,{ref:n,id:i,"aria-describedby":l?"".concat(o," ").concat(a):"".concat(o),"aria-invalid":!!l,...r})});a.displayName="FormControl";var d=a,c=r(45139);let u=(0,c.j)("text-sm text-muted-foreground"),m=l.forwardRef((e,n)=>{let{className:r,...l}=e,{formDescriptionId:i}=y();return(0,t.jsx)("p",{ref:n,id:i,className:(0,o.cn)(u(),r),...l})});m.displayName="FormDescription";let v=(0,c.j)("text-sm font-extrabold leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{variant:{default:"text-muted-foreground"}},defaultVariants:{variant:"default"}}),h=l.forwardRef((e,n)=>{let{className:r,variant:l,...i}=e,{formItemId:s}=y();return(0,t.jsx)("label",{ref:n,className:(0,o.cn)(v({variant:l}),r),htmlFor:s,...i})});h.displayName="FormLabel";var f=h;let x=(0,c.j)("text-sm text-semantic-danger"),g=l.forwardRef((e,n)=>{let{className:r,...l}=e,{formMessageId:i}=y();return(0,t.jsx)("p",{ref:n,id:i,className:(0,o.cn)(x(),r),...l})});g.displayName="FormMessage";var p=g;let b=i.RV,j=l.createContext({}),N=e=>{let{...n}=e;return(0,t.jsx)(j.Provider,{value:{name:n.name},children:(0,t.jsx)(i.Qr,{...n})})},y=()=>{let e=l.useContext(j),n=l.useContext(w),{getFieldState:r,formState:t}=(0,i.Gc)(),o=r(e.name,t);if(!e)throw Error("useFormField should be used within <FormField>");let{id:s}=n;return{id:s,name:e.name,formItemId:"".concat(s,"-form-item"),formDescriptionId:"".concat(s,"-form-item-description"),formMessageId:"".concat(s,"-form-item-message"),...o}},w=l.createContext({}),_=l.forwardRef((e,n)=>{let{className:r,...i}=e,s=l.useId();return(0,t.jsx)(w.Provider,{value:{id:s},children:(0,t.jsx)("div",{ref:n,className:(0,o.cn)("space-y-1",r),...i})})});_.displayName="FormItem"},6697:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return E}});var t=r(85893),l=r(25675),i=r.n(l),o=r(11163),s=r(25609),a=r(2962),d=r(86501),c=r(83424),u=r(8562),m={src:"/_next/static/media/gifting.49b034d0.svg",height:60,width:375,blurWidth:0,blurHeight:0},v=r(56312),h=r(87536),f=r(95591),x=r(1604),g=r(4878),p=r(52739),b=r(89639),j=r(65503),N=r(44027);let y=x.z.object({name:x.z.string({required_error:"Recipient must not be blank."}).min(2,{message:"Recipient must not be blank."}).trim(),message:x.z.string().trim().optional(),isScheduled:x.z.boolean(),delivery_time:x.z.string().optional().or(x.z.literal(""))}).refine(e=>!0!==e.isScheduled||""!==e.delivery_time,{message:"Please input a delivery time.",path:["delivery_time"]}),w=x.z.object({email:x.z.string().email().trim().optional().or(x.z.literal("")),phoneNumber:x.z.object({country_code:x.z.string({required_error:"Required."}).trim(),phone_number:x.z.string({required_error:"Required."}).trim().min(7,{message:"The number that you provided is invalid."}).max(13,{message:"The number that you provided is invalid."}).or(x.z.literal(""))}).optional()}).refine(e=>{var n,r;let t=e.email&&(null===(n=e.email)||void 0===n?void 0:n.length)>0,l=(null==e?void 0:e.phoneNumber)&&(null==e?void 0:null===(r=e.phoneNumber)||void 0===r?void 0:r.phone_number.length)>0;return(!t||!l)&&(!!t||!!l)},{message:"Please input either email or phone number.",path:["phoneNumber"]}),_=x.z.intersection(y,w);var S=e=>{let{reservation_set_id:n}=e,r=(0,h.cI)({resolver:(0,v.F)(_),defaultValues:{name:"",email:"",isScheduled:!1,delivery_time:""}}),{isSubmitting:l,errors:i}=r.formState,o=r.watch("isScheduled",!1),{trigger:s,isMutating:a}=(0,g._e)();return(0,t.jsx)(j.l0,{...r,children:(0,t.jsxs)("form",{onSubmit:r.handleSubmit(function(e){var r,t,l;s({gift:{reservation_set_id:n,name:e.name,message:e.message,email:""===e.email?null:e.email,phone:(null===(r=e.phoneNumber)||void 0===r?void 0:r.phone_number)===""?null:"".concat(null===(t=e.phoneNumber)||void 0===t?void 0:t.country_code).concat(null===(l=e.phoneNumber)||void 0===l?void 0:l.phone_number),...e.delivery_time&&{delivery_time:new Date(e.delivery_time).toISOString()}}},{onSuccess:e=>{(0,f.JG)(e=>"string"==typeof e&&(e.includes("reservations")||e.includes("vouchers"))),d.Am.success("Your gift has been sent successfully.")},onError:e=>{let{data:n}=e;if(null==n?void 0:n.error){d.Am.error(null==n?void 0:n.error);return}d.Am.error("Something went wrong. Please try again later.")}})}),autoComplete:"off",className:"space-y-4",children:[(0,t.jsx)(j.Wi,{control:r.control,name:"name",render:e=>{var n;let{field:r}=e;return(0,t.jsxs)(j.xJ,{children:[(0,t.jsx)(j.lX,{children:"Recipient"}),(0,t.jsx)(j.NI,{children:(0,t.jsx)(N.II,{type:"text",...r})}),i.name&&(0,t.jsx)(j.zG,{children:null===(n=i.name)||void 0===n?void 0:n.message})]})}}),(0,t.jsx)(j.Wi,{control:r.control,name:"phoneNumber",render:e=>{var n,r;let{field:l}=e;return(0,t.jsxs)(j.xJ,{children:[(0,t.jsx)(j.lX,{children:"Phone number"}),(0,t.jsx)(j.NI,{children:(0,t.jsx)(N.zz,{handleChange:l.onChange})}),i.phoneNumber&&(0,t.jsx)(j.zG,{children:i.phoneNumber.message||(null===(r=i.phoneNumber)||void 0===r?void 0:null===(n=r.phone_number)||void 0===n?void 0:n.message)})]})}}),(0,t.jsx)(j.Wi,{control:r.control,name:"email",render:e=>{var n;let{field:r}=e;return(0,t.jsxs)(j.xJ,{children:[(0,t.jsx)(j.lX,{children:"Email"}),(0,t.jsx)(j.NI,{children:(0,t.jsx)(N.II,{type:"email",...r})}),i.email&&(0,t.jsx)(j.zG,{children:null===(n=i.email)||void 0===n?void 0:n.message})]})}}),(0,t.jsx)(j.Wi,{control:r.control,name:"isScheduled",render:e=>{let{field:n}=e;return(0,t.jsxs)(j.xJ,{className:"flex flex-row items-start space-x-3 space-y-0",children:[(0,t.jsx)(j.NI,{children:(0,t.jsx)(b.X,{defaultChecked:n.value,onChange:n.onChange})}),(0,t.jsx)("div",{className:"space-y-1 leading-none",children:(0,t.jsx)(j.lX,{children:"Schedule this gift"})})]})}}),o&&(0,t.jsx)(j.Wi,{control:r.control,name:"delivery_time",render:e=>{var n;let{field:r}=e;return(0,t.jsxs)(j.xJ,{children:[(0,t.jsx)(j.lX,{children:"Schedule time"}),(0,t.jsx)(j.NI,{children:(0,t.jsx)(N.II,{type:"datetime-local",min:new Date().toISOString().slice(0,16),...r})}),i.delivery_time&&(0,t.jsx)(j.zG,{children:null===(n=i.delivery_time)||void 0===n?void 0:n.message})]})}}),(0,t.jsx)(j.Wi,{control:r.control,name:"message",render:e=>{var n;let{field:r}=e;return(0,t.jsxs)(j.xJ,{children:[(0,t.jsx)(j.lX,{children:"Add a personal note"}),(0,t.jsx)(j.NI,{children:(0,t.jsx)(N.Kx,{rows:3,...r})}),i.message&&(0,t.jsx)(j.zG,{children:null===(n=i.message)||void 0===n?void 0:n.message})]})}}),(0,t.jsx)(p.zx,{type:"submit",className:"mt-4",fullWidth:!0,loading:l||a,disabled:a,children:"Send"})]})})},C=r(57574),I=e=>{let{isLoading:n=!0,className:r}=e;return(0,t.jsxs)("div",{className:(0,C.cn)("relative sm:rounded-3xl sm:border",r),children:[(0,t.jsx)("div",{className:"mx-auto h-28 w-full rounded-t-lg bg-neutral-200"}),(0,t.jsxs)("div",{className:" p-6",children:[(0,t.jsxs)("div",{className:"my-10",children:[(0,t.jsx)("div",{className:"mt-6 h-3 w-8/12 rounded-lg bg-neutral-200"}),(0,t.jsx)("div",{className:"mt-6 h-3 w-8/12 rounded-lg bg-neutral-200"}),(0,t.jsx)("div",{className:"mt-6 h-3 w-8/12 rounded-lg bg-neutral-200"})]}),(0,t.jsx)("div",{className:"mx-auto mt-4 h-24 w-full rounded-lg bg-neutral-200"})]}),(0,t.jsx)("div",{className:(0,C.cn)("absolute inset-0",{"overflow-hidden before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:bg-gradient-to-r before:from-transparent before:via-white/30 before:to-transparent":n})})]})};let z=()=>{var e,n,r,l,v,h,f,x,g,p,b,j;let N=(0,o.useRouter)(),{id:y}=N.query,{copy:w}=(0,c.Z)(),{data:_,isLoading:C,isValidating:z}=(0,u.$F)({id:y}),E=null==_?void 0:null===(e=_.reservation)||void 0===e?void 0:e.gift_details,R=null!==(g=null==_?void 0:null===(r=_.reservation)||void 0===r?void 0:null===(n=r.gift_details)||void 0===n?void 0:n.url)&&void 0!==g?g:"",k=e=>{w(e).then(()=>d.Am.success('copied."'),()=>d.Am.error("Something went wrong. Please try again later."))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.PB,{nofollow:!0,noindex:!0,title:"Gift - ".concat(null==_?void 0:null===(v=_.reservation)||void 0===v?void 0:null===(l=v.listing)||void 0===l?void 0:l.name)}),(0,t.jsx)(s.aG,{crumbsList:[],goBack:{href:"/profile/vouchers?ctx=metab"},pageTitle:"Send Gift",className:"mt-[64px] md:mt-[74px] lg:mt-[82px]",contentWidth:"max-w-screen-lg"}),(0,t.jsx)(s.W2,{className:"!mt-10 max-w-screen-xs",children:C||z||!_?(0,t.jsx)(I,{}):(0,t.jsxs)("section",{className:"mx-4 mb-10 overflow-hidden rounded-xl shadow-xl",children:[(0,t.jsx)("div",{className:"relative h-28 w-full bg-[#47CCDD]",children:(0,t.jsx)(i(),{alt:" ",src:m,fill:!0})}),E?(0,t.jsxs)("div",{className:"p-6",children:[(0,t.jsx)("h2",{className:"text-xl font-bold",children:"Awesome! We've sent your gift through"}),(0,t.jsxs)("section",{className:"mt-6 space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block text-sm font-semibold text-muted-foreground",children:"Recipient:"}),(0,t.jsx)("span",{className:"block text-base font-bold",children:null!==(p=null===(h=_.reservation.gift_details)||void 0===h?void 0:h.name)&&void 0!==p?p:"-"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block text-sm font-semibold text-muted-foreground",children:"Email Address:"}),(0,t.jsx)("span",{className:"block text-base font-bold",children:null!==(b=null===(f=_.reservation.gift_details)||void 0===f?void 0:f.email)&&void 0!==b?b:"-"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block text-sm font-semibold text-muted-foreground",children:"Message:"}),(0,t.jsx)("span",{className:"block text-base font-bold",children:null!==(j=null===(x=_.reservation.gift_details)||void 0===x?void 0:x.message)&&void 0!==j?j:"-"})]})]}),(0,t.jsxs)("div",{className:"mt-8 rounded-lg border border-border bg-muted p-6",children:[(0,t.jsxs)("div",{className:"mb-4 text-center font-medium",children:["Want to share the gift yourself?",(0,t.jsx)("br",{})," Copy and share this link with your recipient"]}),(0,t.jsxs)("div",{className:"relative truncate rounded-lg border bg-white px-2 py-2.5 text-sm font-bold",children:[R,(0,t.jsx)("button",{onClick:()=>k(R),className:"absolute right-2 top-2 rounded-md border bg-muted px-2 py-0.5 text-sm",children:"Copy"})]})]})]}):(0,t.jsxs)("div",{className:"p-6",children:[(0,t.jsx)("h2",{className:"text-xl font-bold",children:"Send as Gift"}),(0,t.jsx)("p",{className:"mb-6",children:"We will send a deal link to the recipient"}),(0,t.jsx)(S,{reservation_set_id:_.reservation.reservation_set_id})]})]})})]})};var E=z;z.authOnly=!0,z.getLayout=function(e){return(0,t.jsx)(s.Zn,{Header:(0,t.jsx)(s.h4,{hideSearch:!0,screenName:"web_me"}),Footer:(0,t.jsx)(s.$_,{showFullFooter:!1}),children:e})}},40634:function(e,n,r){"use strict";function t(){return(t=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}r.d(n,{g7:function(){return i}});var l=r(67294);let i=(0,l.forwardRef)((e,n)=>{let{children:r,...i}=e,s=l.Children.toArray(r),d=s.find(a);if(d){let e=d.props.children,r=s.map(n=>n!==d?n:l.Children.count(e)>1?l.Children.only(null):(0,l.isValidElement)(e)?e.props.children:null);return(0,l.createElement)(o,t({},i,{ref:n}),(0,l.isValidElement)(e)?(0,l.cloneElement)(e,void 0,r):null)}return(0,l.createElement)(o,t({},i,{ref:n}),r)});i.displayName="Slot";let o=(0,l.forwardRef)((e,n)=>{let{children:r,...t}=e;return(0,l.isValidElement)(r)?(0,l.cloneElement)(r,{...function(e,n){let r={...n};for(let t in n){let l=e[t],i=n[t],o=/^on[A-Z]/.test(t);o?l&&i?r[t]=(...e)=>{i(...e),l(...e)}:l&&(r[t]=l):"style"===t?r[t]={...l,...i}
1:"className"===t&&(r[t]=[l,i].filter(Boolean).join(" "))}return{...e,...r}}(t,r.props),ref:n?function(...e){return n=>e.forEach(e=>{"function"==typeof e?e(n):null!=e&&(e.current=n)})}(n,r.ref):r.ref}):l.Children.count(r)>1?l.Children.only(null):null});o.displayName="SlotClone";let s=({children:e})=>(0,l.createElement)(l.Fragment,null,e);function a(e){return(0,l.isValidElement)(e)&&e.type===s}}},function(e){e.O(0,[8730,2986,7536,3760,5609,4027,9774,2888,179],function(){return e(e.s=89150)}),_N_E=e.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.