PageSourceSearch

https://www.discovercrete.com/_nuxt/discounts.a032b175.js

js discovercrete.com collected 2026-10-02 13:38:01 UTC 14,879 bytes, 34 lines download raw bytes

1import{_ as se}from"./CouponCreated.f4d28c71.js";import{_ as ie}from"./BackLink.cd5d8eaa.js";import{_ as ne}from"./nuxt-link.1ac5d3a4.js";import{_ as ae}from"./nuxt-img.b8820f2e.js";import{_ as re}from"./DynamicCheckbox.8d13736d.js";import{_ as le}from"./Checkbox.93a26901.js";import{_ as ce}from"./client-only.18c4ea92.js";import{u as de,s as ue,a as pe,b as xe,h as me,f as F,c as fe,g as V,j as k,n as _e,k as T}from"./entry.c9f0dfe4.js";import{u as he}from"./useSiteId.48e6c61a.js";import{u as ge}from"./useCreateRelativeUrl.7ad03dfd.js";import{a as P,ac as q,J as u,S as s,R as r,u as t,F as l,G as A,N as _,K as e,W as n,aa as E,L as be,a0 as ve,O as ye,P as y}from"./swiper-vue.b7606e03.js";import{u as we,A as Ce}from"./InstantSearch.1561c754.js";import{_ as ke}from"./discounts-pin.64c152cb.js";import{S as Pe,U as Se,h as D,G as $e,r as Te,_ as J}from"./XMarkIcon.28f6b907.js";import{a as G}from"./ExperimentalDynamicWidgets.3af9a0cd.js";import{a as Ae,b as Ee}from"./SearchBox.vue.015d7234.js";import{A as je}from"./Configure.6b3c18fa.js";import"./BaseIcon.6067482c.js";import"./entry.07438c3c.js";import"./vue.f36acd1f.aac6b694.js";import"./MenuSelect.vue.d6515e91.js";import"./panel.ab259ffa.js";const Re={class:"pb-10 xl:pb-16 bg-color10 relative"},Oe={class:"mb-10 xl:mb-16 pt-7 xl:pt-14 discover-container-paddings"},Ue={class:"discover-container"},Ie={class:"discover-container flex items-end justify-between gap-6 border-b border-color1"},Ne={class:"pb-6 text-36-24 font-extrabold"},Le={class:"flex items-end gap-x-10"},Me={class:"text-16-14-md"},ze=e("img",{class:"w-8 md:w-12",src:ke,alt:"discover crete"},null,-1),Be={class:"discover-container"},Fe={class:"py-4 xl:pt-8 xl:pb-6 border-b border-color1"},Ve={class:"flex flex-col gap-y-4 xl:w-1/2"},qe={class:"text-27-20-md font-ropa font-bold italic"},De={class:"discover-container-paddings md:hidden"},Ge={class:"discover-container grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-x-4 gap-y-11"},Je={class:"col-span-full md:hidden flex items-center justify-center"},We={class:"text-16-14-md"},He={class:"mb-20 discover-container-paddings"},Ke={class:"mt-10 discover-container"},Qe={class:"flex justify-end items-center gap-x-3 md:gap-x-5"},Ye=["href","onClick"],Xe=["href","onClick"],Ze=e("img",{class:"w-[18px]",src:J,alt:"filters"},null,-1),et={class:"text-[13px] font-bold"},tt={class:"pb-[60px] xl:pb-[70px] w-full bg-color10"},ot={class:"discover-container-paddings"},st={class:"discover-container"},it={class:"w-full grid grid-cols-[repeat(auto-fill,_305px)] justify-center gap-x-5 gap-y-5"},nt={class:"px-7 py-6 min-h-[277px] flex flex-col justify-between"},at={class:"mb-3"},rt={key:0,class:"mb-2 text-14-12-md"},lt={class:"font-bold text-30-25-md"},ct={class:"mt-1 font-bold italic text-18-16"},dt={class:"text-26-21-md"},ut=["innerHTML"],pt={key:0,class:"mt-2 text-14-12-md"},xt={class:"w-full h-[277px] relative"},mt=["onClick"],ft={class:"whitespace-nowrap"},_t={class:"whitespace-nowrap"},ht={class:"whitespace-nowrap"},gt={class:"mt-36 w-full flex justify-center discover-container"},bt=e("div",{class:"fixed inset-0 bg-black bg-opacity-25"},null,-1),vt={class:"fixed inset-0 z-40 flex"},yt={class:"py-1 px-4 flex items-center justify-between shadow-[0px_3px_6px_#00000029]"},wt=["href","onClick"],Ct=["href","onClick"],kt={class:"flex items-center justify-center gap-x-2"},Pt=e("img",{class:"w-[18px]",src:J,alt:"filters"},null,-1),St={class:"text-[13px] font-bold"},$t=e("span",{class:"sr-only"},"Close menu",-1),Tt={class:"pb-12 overflow-y-auto flex-grow"},At={class:"font-medium"},to={__name:"discounts",async setup(Et){let p,S;const $=de(),{isLoggedIn:j,currentUser:x}=ue(pe()),{locale:N,t:h}=xe(),{siteId:L}=he(),m=fe(),{showNotification:M}=me();ge();const R=P(!1),c=P(!1);[p,S]=q(()=>V("/api",{baseURL:m.public.CRAFT_BASE_URL,headers:{Authorization:m.public.GQL_TOKEN},method:"post",body:JSON.stringify({query:`
2        query discounts {
3          entries(section: "discounts", siteId: ${L.value}) {
4            id
5            ... on discounts_default_Entry {
6              id
7              title
8              couponTitle
9              couponDescription
10              couponDiscountText
11              couponValidUntilText
12              couponThumbnail {
13                id
14                url
15                focalPoint
16              }
17              couponRelatedEntry {
18                id 
19                url
20              }
21            }
22          }
23        }
24      `}),transform:o=>o.data.entries},"$uB4z6lteX2")),p=await p,S();const{data:z,indexError:jt}=([p,S]=q(()=>V("/api",{baseURL:m.public.CRAFT_BASE_URL,headers:{Authorization:m.public.GQL_TOKEN},method:"post",body:JSON.stringify({query:`
25        query discountsIndex {
26          entry(section: "discountsIndex", siteId: ${L.value}) {
27            id
28            title
29            ... on discountsIndex_discountsIndex_Entry {
30              discountsIndexText
31            }
32          }
33        }
34      `}),transform:o=>o.data.entry},"$g7Af2ZHIW5")),p=await p,S(),p),W=P(m.public.ALGOLIA_ENV+"_discount_"+N.value),H=we(),K=P(24),Q={"ais-Pagination":"self-center xl:self-end w-fit","ais-Pagination-list":"!px-4 !py-1.5 flex items-center bg-color1 rounded-3xl","ais-Pagination-link":"!px-2.5 xl:!px-3 !py-0.5 !border-none 
34!border-0 text-[16px] md:!text-[19px] !text-white hover:!bg-[transparent] hover:!text-color10","ais-Pagination-item--page":"py-0.5 px-0 rounded-md","ais-Pagination-item--selected":"bg-white !text-color1","ais-Pagination-item--firstPage":"xl:p-1 text-white rounded-md","ais-Pagination-item--lastPage":"xl:p-1 text-white rounded-md","ais-Pagination-item--previousPage":"xl:p-1 text-white rounded-md","ais-Pagination-item--nextPage":"xl:p-1 text-white rounded-md"},w=P(!1),B=["name:asc"],Y={router:{read(){return F().query},write(o){this.createURL(o)!==this.createURL(this.read())&&(k().currentRoute.value.name!="discounts___el"&&k().currentRoute.value.name!="discounts___en"||k().push({query:o}))},createURL(o){return k().resolve({query:o}).href},onUpdate(o){typeof window>"u"||(this._removeAfterEach=k().afterEach(()=>{o(this.read())}),this._onPopState=()=>{o(this.read())},window.addEventListener("popstate",this._onPopState))},dispose(){typeof window>"u"||(this._onPopState&&window.removeEventListener("popstate",this._onPopState),this._removeAfterEach&&this._removeAfterEach())}}},X=F().query;function Z(){window.scrollTo({top:0,behavior:"smooth"})}async function ee(o){c.value=!0;const a=await $fetch(m.public.CRAFT_BASE_URL+"/actions/discount-coupons/coupon/create",{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({userId:x.value.id,userEmail:x.value.email,couponId:o})});a.data.newcouponId?R.value=!0:a.data.error?M(h(a.data.errorMessage),"","error"):M(h("general-error-message"),"","error"),c.value=!1}async function te(){await _e($({path:"/login",query:{redirectTo:"/discounts"}}))}async function oe(){c.value=!0;let o="subscribe";x.value.isPremiumMember&&(o="manageSubscription");const a=await $fetch(m.public.CRAFT_BASE_URL+"/actions/discount-coupons/subscription/subscription-redirect",{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({username:x.value.email,type:o,locale:N.value})});c.value=!1,Object.entries(a.cookies).forEach(([g,b],f)=>{switch(f){case 0:const O=T(g,{domain:"discovercrete.com"});O.value=b.value;break;case 1:const U=T(g,{domain:"discovercrete.com"});U.value=b.value;break;case 2:const C=T(g,{domain:"discovercrete.com"});C.value=b.value;break;case 3:const I=T(g,{domain:"discovercrete.com"});I.value=b.value;break}}),a.success&&(window.location.href=a.redirectUrl)}return(o,a)=>{const g=se,b=ie,f=ne,O=ae,U=re,C=le,I=ce;return l(),u("div",Re,[s(t(Ce),{"index-name":t(W),"search-client":t(H),routing:Y,"initial-ui-state":t(X)},{default:r(()=>[s(t(je),{distinct:!0,hitsPerPage:t(K)},null,8,["hitsPerPage"]),t(R)?(l(),A(g,{key:0,onCloseModal:a[0]||(a[0]=d=>R.value=!1)})):_("",!0),e("div",Oe,[e("div",Ue,[s(b,{classes:"mb-5"})]),e("div",Ie,[e("h1",Ne,n(t(z).title),1),e("div",Le,[t(x).isPremiumMember?(l(),A(f,{key:0,class:"max-md:hidden mb-4 px-5 md:px-10 py-3 md:py-3 flex items-center justify-center gap-x-2 md:gap-x-5 lg:gap-x-8 rounded-[43px] border border-color1 bg-color1 text-white xl:hover:text-color1 xl:hover:bg-white transition-colors duration-300 group cursor-pointer",to:t($)("/account/coupons")},{default:r(()=>[e("span",Me,n(o.$t("VIEW YOUR COUPONS")),1)]),_:1},8,["to"])):_("",!0),ze])]),e("div",Be,[e("div",Fe,[e("div",Ve,[e("p",qe,n(t(z).discountsIndexText),1)])])])]),e("div",De,[e("div",Ge,[e("div",Je,[s(f,{class:"px-5 md:px-10 py-3 md:py-3 flex items-center justify-center gap-x-2 md:gap-x-5 lg:gap-x-8 rounded-[43px] border border-color1 bg-color1 text-white xl:hover:text-color1 xl:hover:bg-white transition-colors duration-300 group cursor-pointer",to:t($)("/account/coupons")},{default:r(()=>[e("span",We,n(o.$t("VIEW YOUR COUPONS")),1)]),_:1},8,["to"])])])]),e("div",He,[e("div",Ke,[e("div",Qe,[s(t(G),null,{default:r(({canRefine:d,refine:v,createURL:i})=>[d?(l(),u("a",{key:0,href:i(),onClick:E(v,["prevent"]),class:"flex justify-center items-center text-[14px] text-color1 xl:hover:text-white transition-colors duration-300"},n(o.$t("Clear")),9,Ye)):(l(),u("a",{key:1,href:i(),onClick:E(v,["prevent"]),class:"flex justify-center items-center text-[14px] text-color1 opacity-60 pointer-events-none"},n(o.$t("Clear")),9,Xe))]),_:1}),e("button",{type:"button",class:"py-2 px-5 flex items-center justify-center gap-x-2 border border-color1 rounded-[10px]",onClick:a[1]||(a[1]=d=>w.value=!0)},[Ze,e("span",et,n(o.$t("Filters")),1)])])])]),e("div",tt,[e("div",ot,[e("div",st,[s(t(Ae),null,{default:r(({items:d,sendEvent:v})=>[e("div",it,[(l(!0),u(be,null,ve(d,i=>(l(),u("div",{class:"col-span-1 rounded-[10px] text-white relative overflow-hidden",style:ye("background-color:"+i.categoryColor+";"),key:i.objectID},[s(f,{to:t($)("/"+i.uri),class:"group h-full grid grid-cols-1 grid-rows-[1fr_277px]"},{default:r(()=>[e("div",nt,[e("div",at,[i.categoryName?(l(),u("p",rt,"["+n(i.categoryName)+"]",1)):_("",!0),e("p",lt,n(i.couponTitle),
341),e("p",ct,n(i.couponDescription),1)]),e("div",null,[e("div",dt,[e("div",{innerHTML:i.couponDiscountText},null,8,ut)]),i.couponValidUntilText?(l(),u("div",pt,[e("p",null,n(o.$t("Valid until"))+" "+n(i.couponValidUntilText),1)])):_("",!0)])]),e("div",xt,[s(O,{loading:"lazy",format:"webp",sizes:"400px",quality:"75",class:"w-full h-full object-cover object-center group-hover:opacity-80 transition-opacity duration-300",src:i.thumbnail.length?i.thumbnail:"https://discovercreteweb.s3.eu-west-1.amazonaws.com/static/website/placeholders/853x342.png",alt:i.title},null,8,["src","alt"])])]),_:2},1032,["to"]),t(j)&&t(x).isPremiumMember?(l(),u("button",{key:0,class:y(["bottom-10 left-1/2 -translate-x-1/2 absolute z-50 flex items-end",{"pointer-events-none":t(c)}]),onClick:Rt=>ee(i.objectID)},[e("div",{class:y(["text-[14px] mx-auto px-7 h-[52px] max-w-full border-2 border-color1 bg-white text-color1 rounded-[35px] shadow-[0px_3px_6px_#00000029] cursor-pointer hover:bg-color1 hover:text-white transition-colors duration-300 flex items-center justify-center",{"!bg-color41 !border-color42 !text-color42":t(c)}])},[e("p",ft,n(o.$t("CREATE COUPON")),1)],2)],10,mt)):_("",!0),t(j)&&!t(x).isPremiumMember?(l(),A(f,{key:1,class:y(["bottom-10 left-1/2 -translate-x-1/2 absolute z-50 flex items-end",{"pointer-events-none":t(c)}]),onClick:oe},{default:r(()=>[e("div",{class:y(["text-[14px] mx-auto px-7 h-[52px] max-w-full border-2 border-color1 bg-white text-color1 rounded-[35px] shadow-[0px_3px_6px_#00000029] cursor-pointer hover:bg-color1 hover:text-white transition-colors duration-300 flex items-center justify-center",{"!bg-color41 !border-color42 !text-color42":t(c)}])},[e("p",_t,n(o.$t("CREATE COUPON")),1)],2)]),_:1},8,["class"])):_("",!0),t(j)?_("",!0):(l(),A(f,{key:2,class:y(["bottom-10 left-1/2 -translate-x-1/2 absolute z-50 flex items-end",{"pointer-events-none":t(c)}]),onClick:te},{default:r(()=>[e("div",{class:y(["text-[14px] mx-auto px-7 h-[52px] max-w-full border-2 border-color1 bg-white text-color1 rounded-[35px] shadow-[0px_3px_6px_#00000029] cursor-pointer hover:bg-color1 hover:text-white transition-colors duration-300 flex items-center justify-center",{"!bg-color41 !border-color42 !text-color42":t(c)}])},[e("p",ht,n(o.$t("CREATE COUPON")),1)],2)]),_:1},8,["class"]))],4))),128))])]),_:1})])]),e("div",gt,[s(t(Ee),{padding:2,"class-names":Q,onPageChange:Z})]),s(I,null,{default:r(()=>[s(t(Pe),{as:"template",unmount:!1,show:t(w)},{default:r(()=>[s(t(Se),{as:"div",class:"relative z-[99]",unmount:!1,onClose:a[4]||(a[4]=d=>w.value=!1)},{default:r(()=>[s(t(D),{as:"template",unmount:!1,enter:"transition-opacity ease-linear duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"transition-opacity ease-linear duration-300","leave-from":"opacity-100","leave-to":"opacity-0"},{default:r(()=>[bt]),_:1}),s(t(D),{as:"template",unmount:!1,enter:"transition ease-in-out duration-300 transform","enter-from":"translate-x-full","enter-to":"translate-x-0",leave:"transition ease-in-out duration-300 transform","leave-from":"translate-x-0","leave-to":"translate-x-full"},{default:r(()=>[e("div",vt,[s(t($e),{class:"relative ml-auto flex h-full w-full max-w-xs flex-col bg-white shadow-xl"},{default:r(()=>[e("div",yt,[e("div",null,[s(t(G),null,{default:r(({canRefine:d,refine:v,createURL:i})=>[d?(l(),u("a",{key:0,href:i(),onClick:E(v,["prevent"]),class:"flex justify-center items-center text-[14px] text-color1 xl:hover:text-white transition-colors duration-300"},n(o.$t("Clear")),9,wt)):(l(),u("a",{key:1,href:i(),onClick:E(v,["prevent"]),class:"flex justify-center items-center text-[14px] text-color1 opacity-60 pointer-events-none"},n(o.$t("Clear")),9,Ct))]),_:1})]),e("div",kt,[Pt,e("span",St,n(o.$t("Filters")),1)]),e("button",{type:"button",class:"-ml-2 flex h-10 w-10 items-center justify-center rounded-md bg-white p-2 text-gray-400",onClick:a[2]||(a[2]=d=>w.value=!1)},[$t,s(t(Te),{class:"h-6 w-6","aria-hidden":"true"})])]),e("div",Tt,[s(U,{algoliaAttribute:"locations",algoliaSorting:[],heading:t(h)("Regions"),isMobile:!0},null,8,["heading"]),s(C,{algoliaAttribute:"municipalities",algoliaSorting:B,heading:t(h)("Municipalities"),isMobile:!0,isOpen:!1},null,8,["heading"]),s(C,{algoliaAttribute:"mainCategories",algoliaSorting:B,heading:t(h)("Categories"),isMobile:!0},null,8,["heading"]),s(C,{algoliaAttribute:"subCategories",algoliaSorting:[],heading:t(h)("Subcategories"),isMobile:!0},null,8,["heading"])]),e("button",{type:"button",class:"py-3.5 px-4 bg-color1 text-white",onClick:a[3]||(a[3]=d=>w.value=!1)},[e("span",At,n(o.$t("View results")),1)])]),_:1})])]),_:1})]),_:1})]),_:1},8,["show"])]),_:1})])]),_:1}
34,8,["index-name","search-client","initial-ui-state"])])}}};export{to as default};

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.