1import{_ as G}from"./CQWQMBLG.js";import{_ as T,a as C}from"./B5DBjuzc.js";import{u as L,_ as R}from"./Bv6ASoGA.js";import{_ as K}from"./DsfVUyPA.js";import{b as M}from"./-X32CfQZ.js";import{r as Q}from"./A8KAlvIv.js";import{aK as k,b2 as z,bd as H,aZ as U,aM as Z,b5 as j,ba as q}from"./CaEOT4Op.js";import{c as J}from"./DgtuXg6v.js";import{u as W}from"./CXhqVJIR.js";import{u as X}from"./C1aEJLpO.js";import{k as Y,b as ee,c as te,l as P,P as a,Q as _,O as w,ad as oe,R as re,u as e,a5 as p,N as se,aa as ae,S}from"./Bb4g8rqR.js";import"./9c8h-vUc.js";import"./BM3ZbVEx.js";import"./B-4hylaO.js";import"./DOr_DpHp.js";import"./BuSq-5kJ.js";import"./BdRBACd6.js";import"./Cw8aveDk.js";import"./BSfmkgY4.js";import"./n0jR5VhA.js";import"./BRUvSYQS.js";import"./bFTntSGj.js";import"./BFlkjZWd.js";import"./CA0ElPgn.js";import"./BMn3bR9l.js";import"./BuO1Tump.js";import"./CIyu6kS5.js";import"./CrJ250Vy.js";import"./DaUHehmy.js";import"./BdVtfmIi.js";import"./DE6K5qvG.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new l.Error().stack;
1n&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[n]="5b822099-629e-4185-b951-7eceb60aadc4",l._sentryDebugIdIdentifier="sentry-dbid-5b822099-629e-4185-b951-7eceb60aadc4")}catch{}})();const ne={key:3,class:"flex flex-col gap-8 lg:gap-12"},Ce=Y({__name:"index",setup(l){const{t:n}=k(),m=W(),i=ee([]),{$posthog:u}=z(),{locale:x}=k();let y=!1;const b=()=>{var t,s;y||(y=!0,(s=u==null?void 0:(t=u()).capture)==null||s.call(t,j.offersPageViewed,{entry_point:J(),campaign_id:null,section_count:i.value.length,is_rtl:x.value==="ar"}))},{onResult:D,loading:g,error:f,refetch:I}=H(M,null,{errorPolicy:"all"});D(({data:t})=>{t!=null&&t.offersScreenGet&&(i.value=[...t.offersScreenGet.nodes??[]].sort((s,c)=>s.order-c.order),b())}),te(f,t=>{t&&b()});const E=U(),N=P(()=>Q(f.value)),v=L(),h=()=>q(E("/")),V=P(()=>[{label:n("common.home"),to:"/"},{label:n("offers.page.title")}]),A=({state:t,productId:s})=>{const c=r=>r.map(o=>o.productId===s?{...o,isFavorite:t}:o);i.value=i.value.map(r=>({...r,products:r.products?{...r.products,nodes:c(r.products.nodes)}:null,stores:r.stores?{...r.stores,nodes:r.stores.nodes.map(o=>({...o,products:o.products?{...o.products,nodes:c(o.products.nodes)}:null}))}:null}))},{seo:B}=X({title:n("offers.page.title"),description:n("offers.page.metaDescription")});return Z(B),(t,s)=>{const c=G,r=T,o=R,O=K,$=C;return a(),_("div",null,[w(r,null,{default:oe(()=>[w(c,{items:e(V),class:S({"hidden lg:block":e(m)})},null,8,["items","class"])]),_:1}),re("div",{class:S(e(m)?"pt-2 pb-8 lg:py-8":"py-8")},[e(v)?(a(),p(o,{key:0,variant:e(v),onAction:h},null,8,["variant"])):e(g)&&!e(i).length?(a(),p(O,{key:1})):e(f)?(a(),p(o,{key:2,variant:e(N),"is-retrying":e(g),onAction:s[0]||(s[0]=d=>e(I)())},null,8,["variant","is-retrying"])):e(i).length?(a(),_("div",ne,[(a(!0),_(se,null,ae(e(i),(d,F)=>(a(),p($,{key:d.sectionKey,section:d,position:F,onFavoriteStateUpdate:A},null,8,["section","position"]))),128))])):(a(),p(o,{key:4,variant:"emptyOffers",onAction:h}))],2)])}}});export{Ce 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.