import{r as l,a as t,j as f,q as O,c as He,Y as je,F as H}from"./app-6e13b0c9.js";import{P as Ge}from"./PublicLayout-607372af.js";import{S as Ue,N as We,a as Ye}from"./navigation-ab7f9df8.js";import{P as Xe}from"./pagination-838169d0.js";/* empty css                      */import{c as me,u as pe,a as k,P as fe,d as qe}from"./index-7f804fb5.js";import{u as I,a as Je}from"./index-79a730ad.js";import{b as Ze,a as Qe,u as et}from"./index-783db250.js";import{u as tt}from"./index-11f42d6c.js";import{P as B}from"./index-1a7315b2.js";import{C as ot}from"./Checkbox-739dd831.js";import rt from"./VoucherPeopleAndPriceInfo-703b1cbb.js";import{R as nt,u as at,F as it,D as st,P as ct}from"./Combination-fdbb9ee2.js";import{c as he,A as ge,C as lt,a as dt,R as ut}from"./index-5edaf10f.js";import{h as mt}from"./component-d4324d4c.js";import Z from"./Button-f5a626a8.js";import pt from"./ButtonSecondary-c0939bbc.js";import{f as j}from"./utils-86ebd916.js";import{T as ft}from"./TextInput-4ac1fbba.js";import{T as ht,a as gt,b as re,c as ne}from"./tabs-97e1adf1.js";import vt from"./Footer-ddd686e1.js";import{c as Y}from"./utils-1edc855c.js";import xt from"./Header-948a6bfa.js";import{c as ve}from"./createLucideIcon-3aee90cc.js";import"./index-226bf8ef.js";import"./select-450bfaec.js";import"./react-icons.esm-de6204bf.js";import"./floating-ui.react-dom-ba88937d.js";import"./button-788b6fdc.js";import"./dialog-d1c6e3f2.js";import"./index-d49c792a.js";import"./x-4834f277.js";import"./LegalModalContent-66d73e8e.js";import"./gift-a3e92328.js";import"./transition-a7186a61.js";const bt=ve("Frown",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 16s-1.5-2-4-2-4 2-4 2",key:"epbg0q"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),wt=ve("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);function xe(e,[o,r]){return Math.min(r,Math.max(o,e))}var be=["PageUp","PageDown"],we=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ye={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},K="Slider",[X,yt,Pt]=Ze(K),[Pe,Do]=me(K,[Pt]),[St,W]=Pe(K),Se=l.forwardRef((e,o)=>{const{name:r,min:n=0,max:i=100,step:a=1,orientation:s="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[n],value:p,onValueChange:m=()=>{},onValueCommit:h=()=>{},inverted:g=!1,...C}=e,y=l.useRef(new Set),v=l.useRef(0),D=s==="horizontal"?Ct:Nt,[b=[],R]=pe({prop:p,defaultProp:d,onChange:P=>{var M;(M=[...y.current][v.current])==null||M.focus(),m(P)}}),A=l.useRef(b);function $(P){const E=Et(b,P);F(P,E)}function V(P){F(P,v.current)}function U(){const P=A.current[v.current];b[v.current]!==P&&h(b)}function F(P,E,{commit:M}={commit:!1}){const z=Tt(a),x=Ft(Math.round((P-n)/a)*a+n,z),w=xe(x,[n,i]);R((S=[])=>{const N=kt(S,w,E);if(Ot(N,u*a)){v.current=N.indexOf(w);const oe=String(N)!==String(S);return oe&&M&&h(N),oe?N:S}else return S})}return t(St,{scope:e.__scopeSlider,name:r,disabled:c,min:n,max:i,valueIndexToChangeRef:v,thumbs:y.current,values:b,orientation:s,children:t(X.Provider,{scope:e.__scopeSlider,children:t(X.Slot,{scope:e.__scopeSlider,children:t(D,{"aria-disabled":c,"data-disabled":c?"":void 0,...C,ref:o,onPointerDown:k(C.onPointerDown,()=>{c||(A.current=b)}),min:n,max:i,inverted:g,onSlideStart:c?void 0:$,onSlideMove:c?void 0:V,onSlideEnd:c?void 0:U,onHomeKeyDown:()=>!c&&F(n,0,{commit:!0}),onEndKeyDown:()=>!c&&F(i,b.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:E})=>{if(!c){const x=be.includes(P.key)||P.shiftKey&&we.includes(P.key)?10:1,w=v.current,S=b[w],N=a*x*E;F(S+N,w,{commit:!0})}}})})})})});Se.displayName=K;var[Ce,Ne]=Pe(K,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Ct=l.forwardRef((e,o)=>{const{min:r,max:n,dir:i,inverted:a,onSlideStart:s,onSlideMove:c,onSlideEnd:u,onStepKeyDown:d,...p}=e,[m,h]=l.useState(null),g=I(o,b=>h(b)),C=l.useRef(),y=Qe(i),v=y==="ltr",_=v&&!a||!v&&a;function D(b){const R=C.current||m.getBoundingClientRect(),A=[0,R.width],V=Q(A,_?[r,n]:[n,r]);return C.current=R,V(b-R.left)}return t(Ce,{scope:e.__scopeSlider,startEdge:_?"left":"right",endEdge:_?"right":"left",direction:_?1:-1,size:"width",children:t(_e,{dir:y,"data-orientation":"horizontal",...p,ref:g,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const R=D(b.clientX);s==null||s(R)},onSlideMove:b=>{const R=D(b.clientX);c==null||c(R)},onSlideEnd:()=>{C.current=void 0,u==null||u()},onStepKeyDown:b=>{const A=ye[_?"from-left":"from-right"].includes(b.key);d==null||d({event:b,direction:A?-1:1})}})})}),Nt=l.forwardRef((e,o)=>{const{min:r,max:n,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:c,onStepKeyDown:u,...d}=e,p=l.useRef(null),m=I(o,p),h=l.useRef(),g=!i;function C(y){const v=h.current||p.current.getBoundingClientRect(),_=[0,v.height],b=Q(_,g?[n,r]:[r,n]);return h.current=v,b(y-v.top)}return t(Ce,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:t(_e,{"data-orientation":"vertical",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:y=>{const v=C(y.clientY);a==null||a(v)},onSlideMove:y=>{const v=C(y.clientY);s==null||s(v)},onSlideEnd:()=>{h.current=void 0,c==null||c()},onStepKeyDown:y=>{const _=ye[g?"from-bottom":"from-top"].includes(y.key);u==null||u({event:y,direction:_?-1:1})}})})}),_e=l.forwardRef((e,o)=>{const{__scopeSlider:r,onSlideStart:n,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:u,...d}=e,p=W(K,r);return t(B.span,{...d,ref:o,onKeyDown:k(e.onKeyDown,m=>{m.key==="Home"?(s(m),m.preventDefault()):m.key==="End"?(c(m),m.preventDefault()):be.concat(we).includes(m.key)&&(u(m),m.preventDefault())}),onPointerDown:k(e.onPointerDown,m=>{const h=m.target;h.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(h)?h.focus():n(m)}),onPointerMove:k(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:k(e.onPointerUp,m=>{const h=m.target;h.hasPointerCapture(m.pointerId)&&(h.releasePointerCapture(m.pointerId),a(m))})})}),Re="SliderTrack",ke=l.forwardRef((e,o)=>{const{__scopeSlider:r,...n}=e,i=W(Re,r);return t(B.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...n,ref:o})});ke.displayName=Re;var q="SliderRange",Ae=l.forwardRef((e,o)=>{const{__scopeSlider:r,...n}=e,i=W(q,r),a=Ne(q,r),s=l.useRef(null),c=I(o,s),u=i.values.length,d=i.values.map(h=>De(h,i.min,i.max)),p=u>1?Math.min(...d):0,m=100-Math.max(...d);return t(B.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...n,ref:c,style:{...e.style,[a.startEdge]:p+"%",[a.endEdge]:m+"%"}})});Ae.displayName=q;var J="SliderThumb",Ee=l.forwardRef((e,o)=>{const r=yt(e.__scopeSlider),[n,i]=l.useState(null),a=I(o,c=>i(c)),s=l.useMemo(()=>n?r().findIndex(c=>c.ref.current===n):-1,[r,n]);return t(_t,{...e,ref:a,index:s})}),_t=l.forwardRef((e,o)=>{const{__scopeSlider:r,index:n,name:i,...a}=e,s=W(J,r),c=Ne(J,r),[u,d]=l.useState(null),p=I(o,D=>d(D)),m=u?!!u.closest("form"):!0,h=et(u),g=s.values[n],C=g===void 0?0:De(g,s.min,s.max),y=At(n,s.values.length),v=h==null?void 0:h[c.size],_=v?Dt(v,C,c.direction):0;return l.useEffect(()=>{if(u)return s.thumbs.add(u),()=>{s.thumbs.delete(u)}},[u,s.thumbs]),f("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${C}% + ${_}px)`},children:[t(X.ItemSlot,{scope:e.__scopeSlider,children:t(B.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":s.min,"aria-valuenow":g,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...a,ref:p,style:g===void 0?{display:"none"}:e.style,onFocus:k(e.onFocus,()=>{s.valueIndexToChangeRef.current=n})})}),m&&t(Rt,{name:i??(s.name?s.name+(s.values.length>1?"[]":""):void 0),value:g},n)]})});Ee.displayName=J;var Rt=e=>{const{value:o,...r}=e,n=l.useRef(null),i=tt(o);return l.useEffect(()=>{const a=n.current,s=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(s,"value").set;if(i!==o&&u){const d=new Event("input",{bubbles:!0});u.call(a,o),a.dispatchEvent(d)}},[i,o]),t("input",{style:{display:"none"},...r,ref:n,defaultValue:o})};function kt(e=[],o,r){const n=[...e];return n[r]=o,n.sort((i,a)=>i-a)}function De(e,o,r){const a=100/(r-o)*(e-o);return xe(a,[0,100])}function At(e,o){return o>2?`Value ${e+1} of ${o}`:o===2?["Minimum","Maximum"][e]:void 0}function Et(e,o){if(e.length===1)return 0;const r=e.map(i=>Math.abs(i-o)),n=Math.min(...r);return r.indexOf(n)}function Dt(e,o,r){const n=e/2,a=Q([0,50],[0,n]);return(n-a(o)*r)*r}function Mt(e){return e.slice(0,-1).map((o,r)=>e[r+1]-o)}function Ot(e,o){if(o>0){const r=Mt(e);return Math.min(...r)>=o}return!0}function Q(e,o){return r=>{if(e[0]===e[1]||o[0]===o[1])return o[0];const n=(o[1]-o[0])/(e[1]-e[0]);return o[0]+n*(r-e[0])}}function Tt(e){return(String(e).split(".")[1]||"").length}function Ft(e,o){const r=Math.pow(10,o);return Math.round(e*r)/r}var It=Se,Vt=ke,zt=Ae,ae=Ee,ee="Popover",[Me,Mo]=me(ee,[he]),G=he(),[Lt,T]=Me(ee),Oe=e=>{const{__scopePopover:o,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:s=!1}=e,c=G(o),u=l.useRef(null),[d,p]=l.useState(!1),[m=!1,h]=pe({prop:n,defaultProp:i,onChange:a});return t(ut,{...c,children:t(Lt,{scope:o,contentId:qe(),triggerRef:u,open:m,onOpenChange:h,onOpenToggle:l.useCallback(()=>h(g=>!g),[h]),hasCustomAnchor:d,onCustomAnchorAdd:l.useCallback(()=>p(!0),[]),onCustomAnchorRemove:l.useCallback(()=>p(!1),[]),modal:s,children:r})})};Oe.displayName=ee;var Te="PopoverAnchor",Bt=l.forwardRef((e,o)=>{const{__scopePopover:r,...n}=e,i=T(Te,r),a=G(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:c}=i;return l.useEffect(()=>(s(),()=>c()),[s,c]),t(ge,{...a,...n,ref:o})});Bt.displayName=Te;var Fe="PopoverTrigger",Ie=l.forwardRef((e,o)=>{const{__scopePopover:r,...n}=e,i=T(Fe,r),a=G(r),s=I(o,i.triggerRef),c=t(B.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":$e(i.open),...n,ref:s,onClick:k(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:t(ge,{asChild:!0,...a,children:c})});Ie.displayName=Fe;var te="PopoverPortal",[Kt,$t]=Me(te,{forceMount:void 0}),Ve=e=>{const{__scopePopover:o,forceMount:r,children:n,container:i}=e,a=T(te,o);return t(Kt,{scope:o,forceMount:r,children:t(fe,{present:r||a.open,children:t(ct,{asChild:!0,container:i,children:n})})})};Ve.displayName=te;var L="PopoverContent",ze=l.forwardRef((e,o)=>{const r=$t(L,e.__scopePopover),{forceMount:n=r.forceMount,...i}=e,a=T(L,e.__scopePopover);return t(fe,{present:n||a.open,children:a.modal?t(Ht,{...i,ref:o}):t(jt,{...i,ref:o})})});ze.displayName=L;var Ht=l.forwardRef((e,o)=>{const r=T(L,e.__scopePopover),n=l.useRef(null),i=I(o,n),a=l.useRef(!1);return l.useEffect(()=>{const s=n.current;if(s)return mt(s)},[]),t(nt,{as:Je,allowPinchZoom:!0,children:t(Le,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:k(e.onCloseAutoFocus,s=>{var c;s.preventDefault(),a.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:k(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:k(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),jt=l.forwardRef((e,o)=>{const r=T(L,e.__scopePopover),n=l.useRef(!1),i=l.useRef(!1);return t(Le,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,c;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(n.current||(c=r.triggerRef.current)==null||c.focus(),a.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:a=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=a.target;((d=r.triggerRef.current)==null?void 0:d.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),Le=l.forwardRef((e,o)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,...m}=e,h=T(L,r),g=G(r);return at(),t(it,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:a,children:t(st,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:t(lt,{"data-state":$e(h.open),role:"dialog",id:h.contentId,...g,...m,ref:o,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Be="PopoverClose",Gt=l.forwardRef((e,o)=>{const{__scopePopover:r,...n}=e,i=T(Be,r);return t(B.button,{type:"button",...n,ref:o,onClick:k(e.onClick,()=>i.onOpenChange(!1))})});Gt.displayName=Be;var Ut="PopoverArrow",Ke=l.forwardRef((e,o)=>{const{__scopePopover:r,...n}=e,i=G(r);return t(dt,{...i,...n,ref:o})});Ke.displayName=Ut;function $e(e){return e?"open":"closed"}var ie=Oe,se=Ie,ce=Ve,le=ze,de=Ke;function Oo({auth:e,business:o,max_price:r,min_price:n,categories:i,voucher_types:a,gift_card:s,show_header:c}){const u=O().props.lang,d=O().props.locale,p=o.customization,m=Math.floor(n),h=Math.ceil(r),[g,C]=l.useState([]),[y,v]=l.useState(),[_,D]=l.useState(!1),[b,R]=l.useState(!1),A={price_range:[m,h],categories:i.map(x=>x.id)},[$,V]=l.useState(A);window.WebFont.load({google:{families:[p.title_font,p.text_font]}});const[U,F]=l.useState();l.useEffect(()=>{window.setTimeout(function(){"parentIFrame"in window&&window.parentIFrame.getPageInfo(function(x){F(window.parentIFrame)})},500)},[]);function P(x){g.length>0&&(v(g.filter(w=>w.id===x)[0]),D(!0))}function E(x,w){C(g.map(S=>{if(S.id===x){const N=new URL(S.url);N.searchParams.set("room",w.toString()),N.searchParams.set("lang",d),S.url=N.toString()}return S}))}function M(){V(A),z(A)}l.useEffect(()=>{z()},[]);const z=x=>{R(!0);const w=x??$;He.get(route("api.vouchers",o.slug),{params:w}).then(S=>{C(S.data.data.map(function(N){return N.url+="?lang="+d,N})),v(S.data.data[0])}).catch(function(S){console.log(S.toJSON())}).finally(()=>R(!1))};return f(Ge,{user:e.user,children:[t(je,{title:`${o.name} - ${u["Gift vouchers"]}`}),c&&f(H,{children:[t(xt,{business:o,customization:p}),t("div",{className:"fixed left-0 right-0 top-0 z-10 h-20 bg-white md:h-32",style:{backgroundColor:p.background_color}})]}),t("div",{className:"min-h-screen bg-gray-100 pb-8",style:{backgroundColor:p.background_color,fontFamily:p.text_font},children:f("main",{className:"container mx-auto max-w-7xl px-4 py-10",children:[f(ht,{defaultValue:"vouchers",children:[t("div",{className:"text-center",children:f(gt,{className:"mb-12 bg-transparent",children:[t(re,{value:"vouchers",className:"rounded-none border-b-2 border-white bg-transparent px-5 py-3 font-bold uppercase shadow-none data-[state=active]:border-black data-[state=active]:bg-transparent data-[state=active]:shadow-none md:px-10 md:py-4 md:text-lg",children:u["Gift vouchers"]}),o.can_have_card&&s&&t(re,{value:"card",className:"rounded-none border-b-2 border-white bg-transparent px-5 py-3 font-bold uppercase shadow-none data-[state=active]:border-black data-[state=active]:bg-transparent data-[state=active]:shadow-none md:px-10 md:py-4 md:text-lg",children:u["Gift card"]})]})}),f(ne,{value:"vouchers",children:[t(Yt,{params:$,setParams:V,fetchData:z,customization:p,categories:i,minPrice:m,maxPrice:h}),b?f("div",{className:"my-40 space-y-4 text-center",children:[t(wt,{className:"mx-auto h-8 w-8 animate-spin text-gray-600"}),t("div",{className:"text-xs font-bold uppercase text-gray-600",children:u.Loading})]}):t(H,{children:g.length>0?f(H,{children:[p.group_vouchers_by_category&&t(H,{children:a.map(x=>t("div",{children:g.filter(w=>w.voucher_type_id===x.id).length>0&&t("div",{children:f("div",{className:"mb-12",children:[a.length>1&&t("h2",{className:"mb-4 text-lg font-semibold uppercase",children:o.customization["voucher_type_"+x.id+"_custom_name"]!=null?o.customization["voucher_type_"+x.id+"_custom_name"][d]:x.name[d]}),t("div",{className:Y(`grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3 xl:gap-8 ${a.length>1&&"md:px-2"} ${[1,2].includes(g.length)&&a.length===1&&"flex flex-wrap justify-center"}`),children:g.filter(w=>w.voucher_type_id===x.id).map(w=>t(ue,{applyFix:[1,2].includes(g.length)&&a.length===1,voucher:w,business:o,show_header:c,parentW:U,handleRoomSelect:E,handleShowVoucherDetailsModal:P},w.id))})]},x.id+"_int")},x.id)},x.id))}),!p.group_vouchers_by_category&&t(H,{children:t("div",{className:Y(`grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3 xl:gap-8 ${[1,2].includes(g.length)&&a.length===1&&"flex flex-wrap justify-center"}`),children:g.map(x=>t(ue,{voucher:x,business:o,show_header:c,parentW:U,handleRoomSelect:E,handleShowVoucherDetailsModal:P},x.id))})})]}):f("div",{className:"my-40 space-y-4 text-center",children:[t(bt,{className:"mx-auto h-8 w-8 text-gray-600"}),t("div",{className:"text-xs font-bold uppercase text-gray-600",children:u["No se han encontrado bonos con estos parámetros."]}),t(Z,{customization:p,type:"button",onClick:()=>M(),children:u["Reset filters"]})]})})]}),o.can_have_card&&s&&t(ne,{value:"card",children:t(Wt,{business:o,gift_card:s})})]}),t(vt,{business:o})]})})]})}function Wt({business:e,gift_card:o}){const r=O().props.lang,n=O().props.locale,i=e.customization,[a,s]=l.useState(o.options[0].price),c=route("gift-card",e.slug)+`?amount=${a}`,u=o.allow_custom_amount&&a>=o.minimum_amount||o.options.map(d=>d.price).includes(a);return f("div",{className:"bg-white p-10 py-16 shadow",children:[t("h2",{className:"mb-8 text-center text-lg font-bold uppercase md:mb-16 md:text-2xl",style:{color:i.title_color,fontFamily:i.title_font},children:r["Choose a gift card"]}),f("div",{className:"mb-10 gap-10 md:flex",children:[f("div",{className:" max-md:mb-10 md:px-10 lg:flex-shrink-0",children:[t("div",{className:"relative mb-2 aspect-video w-96 max-w-full overflow-hidden rounded-xl bg-cover bg-center shadow max-md:mx-auto",style:{backgroundImage:`url(${o.image_url})`},children:f("div",{className:"absolute inset-0 bg-black/25 p-8",children:[t("i",{className:"font-serif text-2xl font-semibold text-white drop-shadow-md",children:e.name}),t("p",{className:"text-sm font-bold uppercase text-white drop-shadow-md",children:r["Gift card"]}),t("p",{className:"absolute bottom-6 right-6 text-3xl font-bold uppercase text-white drop-shadow-md",children:j(a)})]})}),o.expires&&t("i",{className:"text-xs text-gray-500",children:`${r["Valid for"]} ${o.expiration_in_months} ${r["months from the purchase date"]}.`})]}),f("div",{className:"flex-grow space-y-4",children:[t("p",{style:{color:i.text_color,fontFamily:i.text_font},children:r["Gift a card! The beneficiary will be the one who chooses how to spend it best!"]}),o.description&&o.description[n]&&o.description[n].length>0&&t("p",{children:o.description[n]}),t("div",{className:"flex flex-wrap gap-4",children:o.options.map((d,p)=>t("div",{className:`flex h-20 w-20 cursor-pointer flex-wrap items-center justify-center border-2 p-4 text-center transition-transform will-change-transform md:h-28 md:w-28 ${d.price===a&&"scale-105 border-4"}`,style:{borderColor:i.accent_color},onClick:()=>s(d.price),children:f("div",{children:[t("p",{className:"font-bold md:text-2xl",children:j(d.price)}),d.description&&d.description[n]&&d.description[n].length>0&&t("p",{children:d.description[n]})]})},p))}),o.allow_custom_amount&&f("div",{className:"flex items-center gap-8",children:[f("div",{children:[t("b",{children:r.Amount}),t("br",{}),f("span",{className:"text-xs",children:["(",r["starting from"]," ",j(o.minimum_amount),")"]})]}),t(ft,{id:"custom_amount",type:"number",name:"custom_amount",value:a,className:"w-16 rounded-none border-0 border-b border-black border-opacity-100 shadow-none",onChange:d=>s(+d.target.value)})]})]})]}),t("div",{className:"text-right",children:t("a",{target:"_blank",href:c,className:`${!u&&"pointer-events-none opacity-30"}`,children:t(Z,{customization:i,children:r.Purchase})})})]})}function Yt({params:e,setParams:o,categories:r,customization:n,minPrice:i,maxPrice:a,fetchData:s}){const c=O().props.lang,u=O().props.locale;function d(p){let m=[...e.categories];p.target.checked?m=[...e.categories,+p.target.value]:m.splice(e.categories.indexOf(+p.target.value),1),o({...e,categories:m})}return f("div",{className:"mb-10 flex flex-wrap items-center gap-4 md:justify-end",children:[r.length>1&&t("div",{children:f(ie,{children:[f(se,{className:"inline-flex items-center gap-2 border-2 border-black bg-white px-3 py-1 text-sm uppercase tracking-widest text-black transition duration-150 ease-in-out hover:opacity-90 focus:opacity-90 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 md:px-8 md:py-2 md:text-base",children:[t("div",{children:t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-6 w-6",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 11-3 0m3 0a1.5 1.5 0 10-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-9.75 0h9.75"})})}),t("span",{children:c.Categories})]}),t(ce,{children:f(le,{className:"z-10 max-w-full border-2 border-gray-200 bg-white p-4 shadow lg:p-8",children:[t("p",{className:"mb-4 font-bold",children:c["Select one or more voucher types"]}),r.map(p=>f("label",{className:"my-2 flex items-center pl-4",children:[t(ot,{name:"remember",value:p.id,checked:e.categories.includes(p.id),onChange:m=>d(m),color:n.accent_color}),t("span",{className:"ml-2",children:p.name[u]})]},p.id)),t("div",{className:"text-right",children:t("button",{className:"p-3 text-sm underline hover:no-underline",type:"button",onClick:()=>s(),children:c["Apply filters"]})}),t(de,{className:"fill-white shadow"})]})})]})}),t("div",{children:f(ie,{children:[f(se,{className:"inline-flex items-center gap-2 border-2 border-black bg-white px-3 py-1 text-sm uppercase tracking-widest text-black transition duration-150 ease-in-out hover:opacity-90 focus:opacity-90 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 md:px-8 md:py-2 md:text-base",children:[t("div",{children:t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-6 w-6",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 7.756a4.5 4.5 0 100 8.488M7.5 10.5h5.25m-5.25 3h5.25M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),t("span",{children:c.Price})]}),t(ce,{children:f(le,{className:"z-10 mr-4 max-w-full border-2 border-gray-200 bg-white p-4 shadow lg:p-8",children:[t("p",{className:"mb-4 font-bold",children:c["How much do you want to pay?"]}),t("div",{className:"mb-4 w-60",children:f(It,{className:"relative flex h-4 w-full items-center",step:1,minStepsBetweenThumbs:5,min:i,max:a,value:[e.price_range[0],e.price_range[1]],onValueChange:p=>o({...e,price_range:p}),children:[t(Vt,{className:"relative h-1 grow bg-gray-200",children:t(zt,{className:"absolute h-full bg-gray-500",style:{backgroundColor:n.accent_color}})}),t(ae,{className:"relative block h-4 w-4 cursor-pointer rounded-full bg-gray-900 hover:bg-gray-700",children:t("div",{className:"absolute left-1/2 top-5 -translate-x-1/2 text-xs font-bold text-gray-500",children:j(e.price_range[0])})}),t(ae,{className:"relative block h-4 w-4 cursor-pointer rounded-full bg-gray-900 hover:bg-gray-700",children:t("div",{className:"absolute left-1/2 top-5 -translate-x-1/2 text-xs font-bold text-gray-500",children:j(e.price_range[1])})})]})}),t("div",{className:"text-right",children:t("button",{className:"p-3 text-sm underline hover:no-underline",type:"button",onClick:()=>s(),children:c["Apply filters"]})}),t(de,{className:"fill-white shadow"})]})})]})})]})}const ue=({voucher:e,business:o,handleRoomSelect:r,handleShowVoucherDetailsModal:n,show_header:i,parentW:a,applyFix:s})=>{const c=O().props.lang,u=O().props.locale;return f("div",{className:Y(`grid grid-cols-1 bg-white shadow-xl ${s&&"max-w-md"}`),style:{gridTemplateRows:"auto 1fr"},children:[t("div",{children:t(Ue,{modules:[We,Xe],spaceBetween:2,slidesPerView:1,navigation:!0,pagination:{clickable:!0},style:{"--swiper-pagination-color":"#fff","--swiper-navigation-color":"#fff","--swiper-navigation-size":"2rem"},children:e.images.map((d,p)=>t(Ye,{children:t("img",{loading:"lazy",src:d,alt:`Voucher image #${p}`,className:"block aspect-[4/3] h-full w-full object-cover"})},d))})}),f("div",{className:"flex h-full flex-col justify-between p-4 md:p-8",children:[f("div",{className:"",children:[t("h2",{className:"mb-2 font-bold uppercase text-gray-900 md:text-xl",style:{color:o.customization.title_color,fontFamily:o.customization.title_font},children:t("a",{href:e.url,target:"_blank",children:e.name[u]})}),t("div",{className:"mb-4 line-clamp-4 text-sm md:text-base",style:{color:o.customization.text_color},children:t("a",{href:e.url,target:"_blank",children:e.description[u]})})]}),f("div",{children:[t(rt,{business:o,voucher:e,handleRoomSelect:r}),f("div",{className:"mt-4 flex items-center justify-between gap-4",children:[t("a",{href:`
            ${route("voucher_details",{business:o.slug,voucher:e.id})}${i===!1?"?view=iframe":""}`,onClick:()=>{a&&a.scrollToOffset(0,-150)},children:t(pt,{customization:o.customization,style:{color:o.customization.text_color},onClick:()=>n(e.id),children:c.Details})}),t("a",{href:e.url,target:"_blank",children:t(Z,{customization:o.customization,type:"button",children:c.Purchase})})]})]})]})]})};export{Oo as default};
