1import{b as as,r as h,j as s,e as cs}from"./react-CReYJ9E5.js";import{r as ls,A as ee,e as ds,f as us,T as L,B as V,g as yt,h as hs,i as fs,j as Me,k as gs,b as T,F as Re,t as ms,a as _e,S as ge,l as ve,m as We,n as xs,o as Pe,p as ps,P as $s,q as ke,s as ze,v as Tt,w as Ss,x as Lt,M as vs,y as js,z as Xe,C as te,E as Rt,V as Dt,H as At,I as bs,J as Cs,K as Bt,N as Is,R as Os,U as me,W as Mt,X as ws,Y as Es,Z as ys,$ as Ts,a0 as Ls,a1 as Rs,Q as Ds,a2 as Ue,a3 as As,a4 as Bs,a5 as Ms,a6 as _s,a7 as Ps,a8 as Ve,a9 as ks}from"./index-Ckck2ys9.js";import{k as zs,u as B,$ as z,a3 as Qe,x as Z,ab as Fs,e as Gs}from"./i18n-CZzEtILY.js";import{a9 as Ns,L as m,a8 as De,X as w,Z as je,$ as W,Y as O,l as be,j as re,p as Ye,V as Hs,ag as Ws,w as Xs,n as Us}from"./ui-kit-mQfLyY6y.js";import{O as Ae,b as Vs,u as Qs,Q as Ys,c as qs,A as Ks,d as Zs}from"./index-B5qJEAbz.js";import{a as E,u as Js,e as en,f as tn}from"./mobx-CvbbKE_c.js";import{P as se,S as sn,a as nn,b as rn,c as on,L as qe,M as an}from"./map-selector-modal-BkuuEZ4o.js";import{C as cn,D as _t,B as xe,S as Pt,O as ln,u as dn,L as un,E as hn,a as fn,T as gn,P as mn,M as xn,b as Ke,c as pn,d as $n,e as Sn,m as vn}from"./index-B9E-z3Ho.js";import{A as kt,U as jn}from"./index-DW-Yrc4s.js";import{C as ie,B as bn,m as Cn}from"./index-BlUlJ71-.js";import{S as zt,L as Ze}from"./chevron-CrVgvHdu.js";import"./social-yandex-D-CaYQCH.js";import"./use-dynamic-import-BAOEpYuN.js";import"./index-DzndkCRC.js";import"./index-DUfqjWGt.js";const In=(n,e)=>{switch(n.type){case"fixed-time":return e("schedule-badge.fixed-time",{ns:"offer",start:n.start,end:n.end});case"active-until":return e("schedule-badge.active-until",{ns:"offer",end:n.end});case"today-from":return e("schedule-badge.today-from",{ns:"offer",start:n.start});case"tomorrow-from":return e("schedule-badge.tomorrow-from",{ns:"offer",start:n.start});case"weekday-from":return e("schedule-badge.weekday-from",{ns:"offer",weekday:e(n.weekday,{ns:"textDictionary",context:"from"})})}},Je=3600,et=60;class On{constructor(e,t,r){this.offer=e,this.now=t,this.context=r}offer;now;context;execute(){const e=ls(this.offer,this.now,this.context);if(!e)return null;const t=zs(e.end).diff(this.now,"second");if(t<=0)return null;const r=Math.floor(t/Je),o=Math.floor(t%Je/et),i=t%et;return{expiresAt:e.end,totalSeconds:t,hours:String(r).padStart(2,"0"),minutes:String(o).padStart(2,"0"),seconds:String(i).padStart(2,"0")}}}function wn(n){return{getItem:(...e)=>ee.getItem(n,...e),setItem:(...e)=>ee.setItem(n,...e),mergeItem:(...e)=>ee.mergeItem(n,...e),removeItem:(...e)=>ee.removeItem(n,...e)}}const En=Object.freeze(Object.defineProperty({__proto__:null,default:ee,useAsyncStorage:wn},Symbol.toStringTag,{value:"Module"})),yn=as(En);let H=null;const Tn=()=>{try{const n=ds;let e=null;if(typeof n?.createMMKV=="function"?e=n.createMMKV({id:"react-native-tour-guide"}):typeof n?.MMKV=="function"&&(e=new n.MMKV({id:"react-native-tour-guide"})),e&&typeof e.getString=="function"&&typeof e.set=="function"&&(typeof e.remove=="function"||typeof e.delete=="function")){const t=(e.remove??e.delete).bind(e);return{getItem:r=>e.getString(r)??null,setItem:(r,o)=>{e.set(r,o)},removeItem:r=>{t(r)}}}return null}catch{return null}},Ln=()=>{try{const n=yn,e=n?.default??n;return e&&typeof e.getItem=="function"&&typeof e.setItem=="function"&&typeof e.removeItem=="function"?{getItem:t=>e.getItem(t),setItem:(t,r)=>e.setItem(t,r),removeItem:t=>e.removeItem(t)}:null}catch{return null}},Rn=()=>{const n=new Map;return{getItem:e=>n.get(e)??null,setItem:(e,t)=>{n.set(e,t)},removeItem:e=>{n.delete(e)}}},Dn=()=>{if(H)return H;const n=Tn();if(n)return H={type:"mmkv",adapter:n},H;const e=Ln();return e?(H={type:"async-storage",adapter:e},H):(H={type:"memory",adapter:Rn()},H)},Ie="@tour_guide:",An=n=>{const e=us(),t=n??Dn().adapter,r=h.useRef(t);r.current=t;const o=h.useRef(e.startTour);o.current=e.startTour;const i=h.useCallback(async f=>{try{return await r.current.getItem(`${Ie}${f}`)==="completed"}catch{return!1}},[]),l=h.useCallback(async f=>{try{await r.current.setItem(`${Ie}${f}`,"completed")}catch{}},[]),a=h.useCallback(async f=>{try{await r.current.removeItem(`${Ie}${f}`)}catch{}},[]),c=h.useCallback(async(f,g,p=!1)=>{const $=g?.tourId;if(!$)return o.current(f,g),!0;if(!p&&await i($))return!1;const S=g?.onTourEnd,j={...g,onTourEnd:x=>{x&&l($),S?.(x)}};return o.current(f,j),!0},[i,l]);return{...e,startTour:c,isTourCompleted:i,resetTour:a,markCompleted:l}},ae=300,Bn=32,tt=16,st=24,Mn=-8,nt=8,_n=-16,rt=54,ot=12,Oe=14,Pn=["quick",{type:"spring",damping:24,mass:1,stiffness:180}],kn=function({isLastStep:e,onNext:t,currentStep:r,totalSteps:o,title:i,description:l,position:a,targetHeight:c=0,targetWidth:f=0,screenWidth:g,insets:p,isOnlyOneStep:$}){const{t:S}=B("profile"),j=r+1,{width:x}=Ns(),d=g??x,u=a?.x??0,v=a?.y??0,b=u+f/2,C=u+f,I=b>=d/2,y=I?ae-rt:rt,R=p?.left??0,P=p?.right??0,F=R+tt,Q=d-P-ae-tt,G=I?C-ae:u,X=Math.max(F,Math.min(G,Math.max(F,Q))),q=v+c+Bn,Y=I,N=Y?ot:-ot,U=Y?Oe:-Oe;return s.jsxs(m,{testID:"__booster__onboarding-tooltip",animation:Pn,enterStyle:{opacity:0,scale:.85,x:U,y:-Oe},position:"absolute",top:q,left:X,width:ae,backgroundColor:"$white",borderRadius:"$10",padding:"$4",paddingTop:"$6",paddingLeft:$?"$4":"$6",paddingRight:"$4",paddingBottom:"$4",children:[s.jsx(De,{position:"absolute",top:Mn,left:y-st/2,size:st,backgroundColor:"$white"}
1),s.jsx(De,{position:"absolute",top:_n,left:y+N-nt/2,size:nt,backgroundColor:"$white"}),s.jsx(L,{testID:"__booster__onboarding-tooltip-title",size:"$display-s",bold:!0,marginBottom:"$1",...$&&{marginLeft:"$2"},children:S(i)}),s.jsx(L,{testID:"__booster__onboarding-tooltip-description",size:"$title-m",color:"$textGray",marginBottom:"$6",...$&&{marginLeft:"$2"},children:S(l)}),s.jsxs(w,{alignItems:"center",justifyContent:"space-between",children:[!$&&s.jsx(L,{testID:"__booster__onboarding-tooltip-steps",size:"$title-m",color:"$textGray",children:S("onboarding.steps",{stepOrder:j,totalSteps:o})}),s.jsx(je,{name:"brand",children:s.jsx(V,{testID:"__booster__onboarding-tooltip-next-button",backgroundColor:"$background",onPress:t,height:"$md",paddingHorizontal:"$8",flexGrow:$?1:0,children:s.jsx(V.Text,{size:"$title-m",semibold:!0,children:S(e?"onboarding.end-button":"onboarding.step-button")})})})]})]},`tooltip-${r}`)},zn=12,ce=4,it=(n=zn)=>({bounds:e})=>yt(e.x-ce,e.y-ce,e.width+ce*2,e.height+ce*2,n+2),Fn=({bounds:n})=>{const{x:e,y:t,width:r,height:o}=n,i=30,l=10,a=6;return yt(e-i,t-a,r+i+l,o+a+22,16)},Gn=(n,e,t)=>[{id:"qr-step",targetId:Ae.QR_CODE,title:"onboarding.step-one-title",description:"onboarding.step-one-description",spotlightStyles:{overlayOpacity:.5,maskPath:it()},backdropBehavior:"next",active:e,delayBefore:300},{id:"profile-step",targetId:Ae.PROFILE_BUTTON,title:"onboarding.step-two-title",description:"onboarding.step-two-description",spotlightStyles:{overlayOpacity:.5,maskPath:n&&t?Fn:it(16)},backdropBehavior:"next"}],Nn=({isAuthenticated:n,enabled:e=!0})=>{const t=hs(),{startTour:r,isActive:o}=An(t),{wlcrm:i}=fs(),{data:l}=Me({apiHttpClient:i}),{logger:a}=gs(),c=!!l?.areQRAndBarCodesAvailable,[f,g]=h.useState(!0),p=h.useRef(!1),$=W(),S=!!$.sm&&c,j=!!$.sm;return h.useEffect(()=>{if(!e||p.current)return;p.current=!0;const x=Gn(n,S,j),d=Vs.MAIN_SCREEN;r(x,{tourId:d,waitForInteractions:!0,renderTooltip:u=>s.jsx(kn,{...u,isOnlyOneStep:!S}),onTourStart:()=>{a.event({event:"onboarding:started",tourId:d})},onTourEnd:()=>{a.event({event:"onboarding:completed",tourId:d})}}).then(u=>{u||a.event({event:"onboarding:skipped-already-completed",tourId:d})}).catch(u=>{a.error({error:u,event:"onboarding:failed",tourId:d})}).finally(()=>{g(!1)})},[e]),{isActive:o,isPending:f}},at=E(function(e){const{menuStore:t}=T(),r=t.collectionsPolicy.getCollectionEmojiByTagTitle(e.item.title),o=()=>{t.collectionsPolicy.setSelectedCollection(e.item),t.setMenuType("collection")};return s.jsxs(V,{onPress:o,gap:"$2",paddingHorizontal:"$3",backgroundColor:"$white",borderRadius:"$7",...e.variant==="vertical"?{height:108,minWidth:96,maxWidth:160,flexDirection:"column"}:{height:80,flexDirection:"row",paddingHorizontal:"$5"},...e.stretchable&&{width:"100%",maxWidth:"100%",flex:1},children:[s.jsx(cn,{tag:e.item,emojiSrc:r,size:"$3"}),s.jsx(Re,{title:ms(e.item.title),numberOfLines:e.variant==="vertical"?2:1,semibold:!0,textAlign:"center",verticalAlign:"center",wrapperProps:{flex:0}})]})}),Hn="_slider_1uc3i_1",Wn="_sliderItem_1uc3i_7",le={slider:Hn,sliderItem:Wn},ct=n=>s.jsx(w,{gap:"$3",children:n.children}),Xn=E(function(){const{menuStore:e}=T(),{apiHttpClient:t}=_e(),r=W(),{data:o}=Me({apiHttpClient:t}),i=e.collectionsByLocation,l=i.length===0||!o?.areCollectionsAvailable,a=h.useCallback(c=>s.jsx(at,{item:c,variant:"vertical"}),[]);return l?null:r.sm?s.jsx(ct,{children:s.jsx(ge,{data:i,renderItem:a,slideClassName:le.sliderItem,containerClassName:le.slider})}):s.jsx(ct,{children:i.length>7?s.jsx(ge,{data:i,renderItem:a,slideClassName:le.sliderItem,containerClassName:le.slider}):i.map(c=>s.jsx(at,{item:c,stretchable:!0,variant:i.length>3?"vertical":"horizontal"},c.id))})}),Un=(n,e)=>{const t={},r=e.filter(i=>!i.isCartOnly);for(const i of r)t[i.id]=i;const o=new Set;for(const i of n)for(const l of i.orderItemsList)o.add(l.storeItemId);return[...o].map(i=>t[i]).filter(i=>!!i)},Vn="_forYouDishContainer_q6de9_1",Qn={forYouDishContainer:Vn},Yn=E(function(){const{t:e}=B(),{repositoryCustomer:t,repositoryOrders:r,menuStore:o}=T(),{isAuthenticated:i}=ve(),l=Js((g,p)=>Un(g,p))(r.data,o.dishesByLocation),a=[...o.favoriteDishesByLocation].reverse();if(!i||!t.favoriteDishes.length&&!l?.length)return null;const c=()=>{o.setMenuType("favorite")},f=g=>s.jsx(_t,{dish:g,tagsHidden:!0},g.id);return s.jsx(O,{gap:"$5",children:l.length?s.jsxs(s.Fragment,{children:[s.jsx(L,{size:"$display-s",textAlign:"center",children:e("for-you.title",{ns:"menu"})}),s.jsx(ge,{data:l,renderItem:f,prepend:s.jsx(We,{variant:"vertical",onPress:c,dishes:a}),slideClassName:Qn.forYouDishContainer})]}):s.jsx(m,{$sm:{marginHorizontal:"$5"},children:s.jsx(We,{variant:"horizontal",onPress:c,dishes:a})})})});class qn{offer;offerMedia;offerDishesPolicy=new xs;scrollElementRef=null;dishesPosition=0;constructor(e){this.offer=e.offer,this.offerMedia=e.offerMedia,en(this)}get offerDateEnd(){return this.offer.dateEnd}get offerTitle(){return this.offer.title}get offerDescription(){return this.offer.description}get promoBannerButtonContent(){return this.offer.type===z.PROMO_BANNER?{buttonUrl:this.offer.bannerUrl,buttonTitle:this.offer.bannerButtonName}:{buttonUrl:null,buttonTitle:null}}setScrollElementRef(e){this.scrollElementRef=e}setDishesPosition(e){this.dishesPosition=e}getOfferDishes(e){let t=[];return this.offer.type===z.COMBO||this.offer.type===z.SPECIAL||this.offer.type===z.DISCOUNT_PROMO||this.offer.type===z.DISCOUNT_FIXED||this.offer.type===z.DISCOUNT_SCHEDULED||this.offer.type===z.BONUS_PROGRAM?t=this.offerDishesPolicy.getDishesByOfferConditions(e,this.offer):t=this.offerDishesPolicy.getOfferGiftDishes(e,this.offer.setDishIds,this.offer.setCategoryIds,this.offer.setTagIds,this.offer.family,this.offer.type),t}getOfferSpecialGiftDishes(e){return this.offerDishesPolicy.getOfferGiftDishes(e,this.offer.setDishIds,this.offer.setCategoryIds,this.offer.setTagIds,this.offer.family,this.offer.type)}}const Ft=h.createContext(null);function k(){const n=h.useContext(Ft);if(n===null)throw new Error("OfferDetailsStoreContext error during initialization store");return n}function Kn(n){return new qn(n)}const Zn="650px",Gt={offerDetailsModalHeightDesktop:Zn};class Jn{constructor(e,t,r,o){this.offer=e,this.store=t,this.repositoryCustomer=r,this.preorderStore=o}offer;store;repositoryCustomer;preorderStore;_getOrdinalSuffix(e){if(Qe.language.includes("ru"))return"-Ñ";if(Qe.language.includes("en")){const t=e%10,r=e%100;if(r>=11&&r<=13)return"th";switch(t){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}return""}_generateTitle(e,t){if(t)return Z("modal.special-progress.title-active",{ns:"offer"});const r=e+1,o=this._getOrdinalSuffix(r);return Z("modal.special-progress.title-unactive",{ns:"offer",count:r,suffix:o})}_generateDescription(e,t,r){return t?Z("modal.special-progress.description-active",{ns:"offer"}):e===r?Z("modal.special-progress.description-unactive",{ns:"offer"}):Z("modal.special-progress.description-order-more-times",{ns:"offer",count:e})}_generateOfferProgressesItem(e,t,r){const o=t>=e?0:e-t,i=t>=e&&this.store.isPreorderAvailable&&r>0;return{title:this._generateTitle(e,i),description:this._generateDescription(o,i,e),triggerThreshold:e,score:t,left:o,canActivate:i}}get offerSpecialProgressList(){const{triggerThreshold:e}=this.offer,t=this.repositoryCustomer.getOfferAccountByOfferId(this.offer.id)?.available||0,r=this.preorderStore.offerAvailabilityPolicy.offersAvailableQuantity(this.offer,t,this.preorderStore.preorder),o=[];let i=this.preorderStore.offerAvailabilityPolicy.leftOfferAccountAvailable(e,t,r);for(;i>=0&&!(i===0&&t>0);)o.push(this._generateOfferProgressesItem(e,i,r)),i=i-e;return o}}const er="_shake_1d3v7_24",tr={shake:er};function lt({dishImageUrlFull:n,canActivate:e}){return s.jsxs(m,{$sm:{width:"$7",height:"$7"},$gtSm:{width:136,height:136},children:[s.jsx(m,{flex:1,borderRadius:20,overflow:"hidden",children:s.jsx(ps,{url:n})}),!e&&s.jsx(xe,{borderRadius:"$3",height:"$2.25",width:"$2.25",right:"$-1",children:s.jsx(xe.Icon,{children:s.jsx(Pt,{})})})]})}function dt({title:n,description:e,canActivate:t}){return s.jsxs(O,{flexShrink:1,$sm:{marginTop:"$1",marginBottom:"$2"},$gtSm:{margin:"$3",marginRight:"$4"},children:[s.jsxs(m,{display:"flex",flexDirection:"row",gap:"$1",children:[s.jsx(L,{size:"$2.5",lineHeight:"$3",semibold:!0,letterSpacing:"$4",children:n}),t&&s.jsx(xe,{position:"static",borderRadius:"$3",height:"$2.25",width:"$2.25",className:tr.shake,children:s.jsx(xe.Icon,{children:s.jsx(Pt,{})})})]}),s.jsx(L,{size:"$title-s",secondary:!0,marginTop:"$0.5",children:e})]})}function ut({triggerThreshold:n,score:e,left:t}){const{background:r}=be({name:"brand"});return n==0||e==0?null:s.jsx($s,{height:"$1",$gtSm:{marginLeft:"$3",marginRight:"$2"},currentValue:e,maxValue:n,backgroundColor:t===1?ke(r?.val,.24):"$backgroundLight"})}function ht({canActivate:n,score:e,isLocationActive:t,onPress:r}){const{t:o}=B("offer");return!n&&e!==0?null:s.jsx(je,{name:"brand",children:s.jsx(V,{flexGrow:0,height:"$md",disabled:!t,onPress:r,marginTop:"auto",marginBottom:"$1",marginRight:"$1",marginLeft:"$2",$sm:{marginLeft:"$1"},children:s.jsx(V.Text,{size:"$title-m",fontWeight:"$sb",children:o(n?"modal.special-progress.button-gift":"modal.special-progress.button-order")})})})}const sr=E(function(e){const{receivingStore:t}=T(),{isAuthenticated:r}
1=ve(),{scrollElementRef:o,dishesPosition:i}=k(),{sm:l}=W(),a=h.useRef(null),c=t.selectedLocation,f=!!c&&Pe.isActiveNow(c.locationWorkShiftsGenerator.locationWorkShifts),g=()=>{r?e.canActivate?e.showOfferGiftModal():o?.current?.scroll({top:l?i:i-parseInt(Gt.offerDetailsModalHeightDesktop)/2,behavior:"smooth"}):a.current?.open()};return s.jsxs(m,{borderRadius:"$8",backgroundColor:"white",gap:"$1",width:"100%",testID:"__booster__offer-special-progress-item",children:[s.jsx(m,{flexDirection:"row",padding:"$1",gap:"$1",$sm:{flexDirection:"column",gap:"$2"},children:l?s.jsxs(s.Fragment,{children:[s.jsxs(w,{gap:"$3",paddingRight:"$4",children:[s.jsx(lt,{dishImageUrlFull:e.dishImageUrlFull,canActivate:e.canActivate}),s.jsxs(O,{flexShrink:1,width:"100%",children:[s.jsx(dt,{title:e.title,description:e.description,canActivate:e.canActivate}),s.jsx(ut,{triggerThreshold:e.triggerThreshold,score:e.score,left:e.left})]})]}),s.jsx(ht,{canActivate:e.canActivate,score:e.score,isLocationActive:f,onPress:g})]}):s.jsxs(s.Fragment,{children:[s.jsx(lt,{dishImageUrlFull:e.dishImageUrlFull,canActivate:e.canActivate}),s.jsxs(O,{flex:1,children:[s.jsx(dt,{title:e.title,description:e.description,canActivate:e.canActivate}),s.jsx(ut,{triggerThreshold:e.triggerThreshold,score:e.score,left:e.left}),s.jsx(ht,{canActivate:e.canActivate,score:e.score,isLocationActive:f,onPress:g})]})]})}),s.jsx(kt,{ref:a})]})}),nr=E(function(){const e=T(),t=k(),[r,o]=h.useState(!1);if(t.offer.type!==z.SPECIAL)return null;const l=new Jn(t.offer,e,e.repositoryCustomer,e.preorderStore).offerSpecialProgressList;if(!l.length)return null;const a=t.getOfferSpecialGiftDishes(e.menuStore.dishesByLocation);if(!a.length)return null;const c=a[0].imageUrlFull,f=async()=>{e.preorderStore.preorder===null&&e.preorderStore.createPreorderData(),await e.preorderStore.syncPreorder(),o(!0)};return s.jsxs(m,{testID:"offer-special-progress-list",marginTop:"$6",$sm:{width:"100dvw",marginLeft:"$-4",paddingHorizontal:"$5",scrollbarWidth:"none",flexDirection:"row",overflow:"scroll",gap:"$2"},$gtSm:{gap:"$6"},children:[l.map((g,p)=>s.jsx(m,{$sm:{width:l.length>1?"calc(100dvw - var(--t-space-5) - var(--t-space-2) - 32px)":"100%"},children:s.jsx(sr,{dishImageUrlFull:c,showOfferGiftModal:f,...g})},`${p}-${g.left}`)),s.jsx(ln,{isOpen:r,onOpenChange:o,preorderOfferId:t.offer.id})]})}),pe="$2.75",ft=function(){return s.jsxs(m,{width:"$1",height:pe,justifyContent:"center",alignItems:"center",gap:"$0.5",marginHorizontal:"$0.5",children:[s.jsx(m,{width:"$0.5",height:"$0.5",borderRadius:"$10",backgroundColor:"$gray4"}),s.jsx(m,{width:"$0.5",height:"$0.5",borderRadius:"$10",backgroundColor:"$gray4"})]})},we=function(e){return s.jsx(je,{name:"brand",children:s.jsxs(m,{height:pe,borderRadius:"$lib-2",paddingHorizontal:"$2",backgroundColor:"$background",alignItems:"center",justifyContent:"center",overflow:"hidden",children:[s.jsx(m,{position:"absolute",left:0,right:0,top:"50%",bottom:0,backgroundColor:ke("#000000",.08)}),s.jsx(L,{size:"$title-m",bold:!0,color:"$white",tabularNums:!0,children:e.value})]})})},rr=function(e){const{backgroundLight:t}=be();return t?.val?s.jsxs(m,{testID:"__booster__offer-countdown",position:"relative",backgroundColor:"$white",borderRadius:"$7",paddingHorizontal:"$4",paddingVertical:"$4",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"$2",overflow:"hidden",onPress:e.onPress,cursor:e.onPress?"pointer":void 0,children:[s.jsxs(w,{alignItems:"center",gap:"$2",flexShrink:0,height:pe,children:[e.iconLeft?s.jsx(m,{width:"$2.5",height:"$2.5",flexShrink:0,children:e.iconLeft}):null,s.jsx(L,{size:"$title-m",semibold:!0,flexShrink:1,whiteSpace:"nowrap",children:e.title})]}),s.jsxs(w,{alignItems:"center",height:pe,children:[s.jsx(we,{value:e.hours}),s.jsx(ft,{}),s.jsx(we,{value:e.minutes}),s.jsx(ft,{}),s.jsx(we,{value:e.seconds})]})]}):null};var fe={exports:{}},or=fe.exports,gt;function ir(){return gt||(gt=1,(function(n,e){(function(t,r){n.exports=r(cs())})(typeof self<"u"?self:or,(t=>(()=>{var r={155:x=>{x.exports=t}},o={};function i(x){var d=o[x];if(d!==void 0)return d.exports;var u=o[x]={exports:{}};return r[x](u,u.exports,i),u.exports}i.d=(x,d)=>{for(var u in d)i.o(d,u)&&!i.o(x,u)&&Object.defineProperty(x,u,{enumerable:!0,get:d[u]})},i.o=(x,d)=>Object.prototype.hasOwnProperty.call(x,d),i.r=x=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(x,"__esModule",{value:!0})};var l={};i.r(l),i.d(l,{useStopwatch:()=>S,useTime:()=>j,useTimer:()=>$});var a=i(155);class c{static getTimeFromMilliseconds(d,u=!0){const v=u?Math.ceil(d/1e3):Math.floor(d/1e3),b=Math.floor(v/86400),C=Math.floor(v%86400/3600),I=Math.floor(v%3600/60),y=Math.floor(v%60);return{totalMilliseconds:d,totalSeconds:v,milliseconds:Math.floor(d%1e3),seconds:y,minutes:I,hours:C,days:b}}static getMillisecondsFromExpiry(d){const u=new Date().getTime(),v=d?.getTime()-u;return v>0?v:0}static getMillisecondsFromPrevTime(d){const u=new Date().getTime()-d;return u>0?u:0}static getMillisecondsFromTimeNow(){const d=new Date;return d.getTime()-60*d.getTimezoneOffset()*1e3}static getFormattedTimeFromMilliseconds(d,u){const{milliseconds:v,seconds:b,minutes:C,hours:I}=c.getTimeFromMilliseconds(d);let y="",R=I;return u==="12-hour"&&(y=I>=12?"pm":"am",R=I%12),{milliseconds:v,seconds:b,minutes:C,hours:R,ampm:y}}}class f{static expiryTimestamp(d){const u=new Date(d).getTime()>0;return u||console.warn("react-timer-hook: { useTimer } Invalid expiryTimestamp settings",d),u}static onExpire(d){const u=d&&typeof d=="function";return d&&!u&&console.warn("react-timer-hook: { useTimer } Invalid onExpire settings function",d),u}}function g(x,d){const u=(0,a.useRef)(x);(0,a.useEffect)((()=>{u.current=x})),(0,a.useEffect)((()=>
1{if(!d)return()=>{};const v=setInterval((()=>{var b;(b=u?.current)===null||b===void 0||b.call(u)}),d);return()=>clearInterval(v)}),[d])}const p=1e3;function $({expiryTimestamp:x,onExpire:d=()=>{},autoStart:u=!0,interval:v=p}){const[b,C]=(0,a.useState)(x),[I,y]=(0,a.useState)(c.getMillisecondsFromExpiry(b)),[R,P]=(0,a.useState)(u),[F,Q]=(0,a.useState)(u),[G,X]=(0,a.useState)(v),q=(0,a.useCallback)((()=>{f.onExpire(d)&&d(),P(!1),X(null)}),[d]),Y=(0,a.useCallback)((()=>{P(!1)}),[]),N=(0,a.useCallback)(((D,K=!0)=>{X(v),Q(K),P(K),C(D),y(c.getMillisecondsFromExpiry(D))}),[v]),U=(0,a.useCallback)((()=>{const D=new Date;D.setMilliseconds(D.getMilliseconds()+I),N(D)}),[I,N]),Ce=(0,a.useCallback)((()=>{F?(y(c.getMillisecondsFromExpiry(b)),P(!0)):U()}),[b,F,U]);return g((()=>{const D=c.getMillisecondsFromExpiry(b);y(D),D<=0?q():G&&D<G&&X(D)}),R?G:null),(0,a.useEffect)((()=>{f.expiryTimestamp(b)}),[b]),Object.assign(Object.assign({},c.getTimeFromMilliseconds(I)),{start:Ce,pause:Y,resume:U,restart:N,isRunning:R})}function S({autoStart:x=!0,offsetTimestamp:d,interval:u=p}={}){const v=d?c.getMillisecondsFromExpiry(d):0,[b,C]=(0,a.useState)(new Date().getTime()-new Date(v).getTime()),[I,y]=(0,a.useState)(c.getMillisecondsFromPrevTime(b||0)),[R,P]=(0,a.useState)(x),F=p-I%p,[Q,G]=(0,a.useState)(u<F?u:F);g((()=>{Q!==u&&G(u),y(c.getMillisecondsFromPrevTime(b))}),R?Q:null);const X=(0,a.useCallback)((()=>{C(new Date().getTime()-new Date(I).getTime()),P(!0)}),[I]),q=(0,a.useCallback)((()=>{R&&(y(c.getMillisecondsFromPrevTime(b)),P(!1))}),[b,R]),Y=(0,a.useCallback)(((N,U=!0)=>{const Ce=N?c.getMillisecondsFromExpiry(N):0,D=new Date().getTime()-new Date(Ce).getTime(),K=c.getMillisecondsFromPrevTime(D),He=p-K%p;C(D),y(K),G(u<He?u:He),P(U)}),[u]);return Object.assign(Object.assign({},c.getTimeFromMilliseconds(I,!1)),{start:X,pause:q,reset:Y,isRunning:R})}function j({format:x,interval:d=p}={}){const[u,v]=(0,a.useState)(c.getMillisecondsFromTimeNow());return g((()=>{v(c.getMillisecondsFromTimeNow())}),d),Object.assign({},c.getFormattedTimeFromMilliseconds(u,x))}return l})()))})(fe)),fe.exports}var ar=ir();const cr=function(e){const{expiresAt:t,iconLeft:r,onExpire:o,onPress:i,title:l}=e,a=h.useRef(!1),{hours:c,minutes:f,seconds:g,totalSeconds:p,restart:$}=ar.useTimer({expiryTimestamp:t,autoStart:!0,interval:1e3,onExpire:()=>{a.current||(a.current=!0,o?.())}});return h.useEffect(()=>{a.current=!1,$(t)},[t,$]),h.useEffect(()=>{p>0||a.current||(a.current=!0,o?.())},[o,p]),p<=0?null:s.jsx(rr,{title:l,iconLeft:r,hours:String(c).padStart(2,"0"),minutes:String(f).padStart(2,"0"),seconds:String(g).padStart(2,"0"),onPress:i})},mt=E(function(e){const{receivingStore:t}=T(),{offer:r}=k(),{t:o}=B("offer"),{t:i}=B("textDictionary"),l=be({name:"brand"}),[a,c]=h.useState(null),[f,g]=h.useState(!1),[p,$]=h.useState(),S=h.useRef(null),j=t.selectedLocation?.timeOffset,x=j===void 0?null:new On(r,new Date,{timeOffset:j}).execute(),d=x?.expiresAt.getTime()??null,v=(("schedule"in r?r.schedule:[])??[]).map(C=>({dayKey:C.day,day:i(C.day),hoursLabel:ze.formatScheduleDayHours(C,o("countdown.inactive-label")),isActive:!!(C.active&&C.timeStart&&C.timeEnd)})),b=v.length>0;return h.useLayoutEffect(()=>{const C=S.current;if(!C)return;const I=()=>{const R=C.getBoundingClientRect().width;R>0&&$(R)};if(I(),typeof ResizeObserver>"u")return;const y=new ResizeObserver(I);return y.observe(C),()=>{y.disconnect()}},[d]),!x||d===a?null:s.jsx(Tt,{position:"absolute",bottom:"$0",left:"$0",right:"$0",paddingBottom:"$8",onLayout:e.onLayout,$sm:{paddingBottom:"$3",paddingHorizontal:"$5"},testID:"offer-countdown",children:s.jsxs(se,{open:f,onOpenChange:g,placement:"top",offset:{mainAxis:re("$2","space")},backdropOpacity:.1,backdropTestID:"offer-schedule-backdrop",children:[s.jsx(se.Anchor,{children:s.jsx(m,{ref:S,flex:1,children:s.jsx(cr,{title:o("countdown.title"),expiresAt:x.expiresAt,iconLeft:s.jsx(Ss,{color:l.background?.val}),onExpire:()=>{g(!1),c(d),e.onExpire?.()},onPress:b?()=>{g(!0)}:void 0})})}),b&&s.jsx(se.Content,{width:p,zIndex:"$bottom-sheet",testID:"offer-schedule-popover",children:s.jsx(Lt,{paddingHorizontal:"$0",width:"100%",testID:"offer-schedule-modal",children:s.jsx(sn,{schedule:v,testID:"offer-schedule-rows"})})})]})})}),lr=function(){const{offerDateEnd:e}=k(),{t}=B("date");return e?s.jsx(L,{secondary:!0,marginTop:"$2",$sm:{textAlign:"center"},testID:"offer-details-date-end",children:t("until-date",{date:Fs(e,"D MMMM YYYY")})}):null},dr=function(){const{offerDescription:e}=k();return e?s.jsx(Lt,{marginTop:"$6",testID:"offer-details-description",children:s.jsx(vs,{children:e})}):null},ur=E(function(){const{menuStore:e}=T(),t=k(),{t:r}=B("offer"),o=t.getOfferDishes(e.dishesByLocation);return o.length?s.jsxs(O,{gap:"$5",testID:"offer-details-dishes",onLayout:i=>t.setDishesPosition(i.nativeEvent.layout.y),children:[s.jsx(L,{size:"$display-s",bold:!0,$sm:{textAlign:"center"},testID:"offer-details-dishes-title",children:r("modal.dishes")}),s.jsx(w,{flexWrap:"wrap",gap:"$4",children:o.map(i=>s.jsx(m,{width:140,$sm:{width:"calc((100dvw - 20px * 2 - var(--t-space-4)) / 2)"},children:s.jsx(_t,{dish:i,withConfigurations:!0})},i.id))})]}):null}),hr=E(function(){const{t:e}=B(["offer","textDictionary"]),{offer:t}=k(),{receivingStore:r}=T(),{sm:o}=W(),[i,l]=h.useState(!1),a=r.selectedLocation?.timeOffset;if(t.type!==z.BONUS_PROGRAM||a===void 0||!("schedule"in t))return null;const c=new js(t,new Date,{timeOffset:a}).execute();if(!c)return null;const f=In(c,($,S)=>e($,S));if(!c.canOpenSchedule)return s.jsx(w,{marginTop:"$2",$sm:{justifyContent:"center"},children:s.jsx(Xe,{label:f,isActive:c.isActive,testID:"offer-schedule-badge"})});const g=ze.formatScheduleRows(t.schedule,$=>e($,{ns:"textDictionary"}),e("countdown.inactive-label",{ns:"offer"})),p=o?"top":"bottom-start";return s.jsx(w,{marginTop:"$2",$sm:{justifyContent:"center"},children:s.jsxs(se,{open:i,onOpenChange:l,placement:p,offset:re("$2","space"),stayInFrame:{padding:nn},backdropOpacity:.1,backdropTestID:"offer-schedule-backdrop",children:[s.jsx(se.Anchor,{children:s.jsx(Xe,{label:f,isActive:c.isActive,onPress:()=>{l(!0)},testID:"offer-schedule-badge"})}),s.jsx(rn,{schedule:g,testID:"offer-schedule-popover",rowsTestID:"offer-schedule-rows",zIndex:"$bottom-sheet"})]})})}),fr=function(){const{offerTitle:e}=k();return s.jsx(te.Title,{size:"$display-l",fontWeight:"$bd",$sm:{textAlign:"center"},testID:"offer-details-title",children:e})},xt=E(function(){const{promoBannerButtonContent:e}=k(),t=e.buttonTitle,r=e.buttonUrl;if(!t||!r)return null;const o=()=>{window.open(r,"_blank")};return s.jsx(Tt,{position:"absolute",bottom:"$0",left:"$0",right:"$0",paddingBottom:"$8",$
1sm:{paddingBottom:"$3",marginHorizontal:"$5"},testID:"offer-details-promo-banner-button",children:s.jsx(je,{name:"brand",children:s.jsx(V,{maxWidth:"100%",onPress:o,children:s.jsx(V.Text,{children:t})})})})}),gr="_blur_1p7qh_1",mr="_gradient_1p7qh_18",pt={blur:gr,gradient:mr},xr=E(function(){const e=k(),{sm:t}=W(),[r,o]=h.useState(0),i=h.useRef(null),l=Rt({rootRef:i}),a=e.promoBannerButtonContent.buttonTitle&&e.promoBannerButtonContent.buttonUrl;return h.useEffect(()=>{e.setScrollElementRef(i)},[e,i]),s.jsxs(m,{flex:1,testID:"offer-details",children:[s.jsxs(m,{scrollbarWidth:"none",flexDirection:"row",flex:1,ref:c=>{c&&t?i.current=c:t&&(i.current=null)},$gtSm:{gap:"$6"},$sm:{flexDirection:"column",overflow:"scroll"},children:[s.jsxs(m,{children:[s.jsx(m,{aspectRatio:3/4,position:"relative",overflow:"hidden",borderRadius:"$10",$gtSm:{width:452,marginVertical:"$6"},$sm:{borderBottomLeftRadius:"$0",borderBottomRightRadius:"$0"},testID:"offer-details-media-container",children:s.jsx(Dt,{url:e.offerMedia.url,children:s.jsx(At,{url:e.offerMedia.url})})}),s.jsx(m,{position:"absolute",className:pt.blur,$gtSm:{display:"none"}}),s.jsx(m,{position:"absolute",className:pt.gradient,$gtSm:{display:"none"}})]}),s.jsxs(m,{position:"relative",flex:1,$sm:{marginTop:"-2lh",paddingHorizontal:"$5"},testID:"offer-details-content",children:[s.jsxs(m,{scrollbarWidth:"none",paddingBottom:"$4",ref:c=>{t||(i.current=c)},$gtSm:{flex:1,overflow:"scroll",paddingVertical:"$10"},$sm:{paddingBottom:r+re("$4","space")},testID:"offer-details-scroll-content",children:[s.jsx(m,{ref:l,height:1,flexShrink:0}),s.jsx(m,{$gtSm:{marginRight:"$14"},$sm:{marginTop:"-2lh"},children:s.jsx(fr,{})}),s.jsx(lr,{}),s.jsx(hr,{}),s.jsx(nr,{}),s.jsx(dr,{}),s.jsx(Ye,{size:"$8"}),s.jsx(ur,{}),a&&s.jsx(Ye,{size:"$size.6"})]}),!t&&s.jsx(mt,{}),!t&&s.jsx(xt,{})]})]}),t&&s.jsx(mt,{onLayout:c=>{o(c.nativeEvent.layout.height)},onExpire:()=>{o(0)}}),t&&s.jsx(xt,{})]})}),pr=function(){const e=Cs();return s.jsx(te.Close,{children:s.jsx(Bt,{isShadow:e,position:"absolute",top:"$6",right:"$6",zIndex:"$1",$sm:{top:"$5",right:"$5"},children:s.jsx(Is,{})})})},$r=E(function(e){const{isOpen:t,onOpenChange:r,...o}=e,l=T().offersByLocations.find(c=>c.id===o.id);if(!l)return null;const a=Kn({offer:l,offerMedia:o});return s.jsx(Ft,{value:a,children:s.jsxs(te,{open:t,onOpenChange:r,children:[s.jsx(te.Overlay,{},"overlay"),s.jsx(te.Content,{$gtSm:{width:976,maxHeight:parseInt(Gt.offerDetailsModalHeightDesktop),paddingHorizontal:"$6"},$sm:{borderRadius:"$11",borderBottomLeftRadius:"$0",borderBottomRightRadius:"$0"},"data-testid":`offer-details-modal-content-${e.id}`,children:s.jsxs(bs,{children:[s.jsx(pr,{}),s.jsx(xr,{})]})},"content")]})})}),Sr="_offerItemContainer_17p8i_12",vr="_offerItemTitle_17p8i_24",jr="_offerItemTitle_overflow_17p8i_36",br="_textBackdrop_17p8i_40",de={offerItemContainer:Sr,offerItemTitle:vr,offerItemTitle_overflow:jr,textBackdrop:br},Cr=function(e){const{ref:t,isOverflow:r}=dn(),[o,i]=h.useState(!1),l=()=>{i(!0)};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{"data-testid":`offer-list-item-${e.id}`,className:me(de.offerItemContainer,e.containerClassName),onClick:l,children:[s.jsx(Dt,{url:e.url,children:s.jsx(At,{url:e.url})}),s.jsxs("div",{className:de.textBackdrop,children:[s.jsx(Os,{zIndex:0,borderBottomRightRadius:"$lib-6",borderBottomLeftRadius:"$lib-6"}),s.jsx("p",{ref:t,"data-testid":"offer-item-title",className:me(de.offerItemTitle,r&&de.offerItemTitle_overflow),children:e.text})]})]}),s.jsx($r,{isOpen:o,onOpenChange:i,...e})]})},Ir="_offerListContainer_4gfxt_12",Or="_offerItemContainer_4gfxt_25",wr="_offerItem_4gfxt_25",Ee={offerListContainer:Ir,offerItemContainer:Or,offerItem:wr},Er=E(function(){const{repositoryOffers:e}=T(),t=e.offersViewsForRender;if(t.length===0)return null;const r=o=>s.jsx(Cr,{...o,containerClassName:Ee.offerItem});return s.jsx(ge,{data:t,renderItem:r,containerClassName:Ee.offerListContainer,slideClassName:Ee.offerItemContainer})}),yr=E(n=>{const{preorderStore:e}=T(),t=e.preorder?.items.length===0;return s.jsxs(ie,{children:[s.jsx(ie.Header,{children:s.jsx(un,{onOpenMap:n.onOpenMap})}),t?s.jsx(m,{flex:1,paddingHorizontal:"$3",children:s.jsx(hn,{})}):s.jsx(ie.ScrolledContent,{maxHeight:"84%",children:s.jsx(O,{paddingVertical:"$4",children:s.jsx(fn,{isSidebar:!0})})}),!t&&s.jsx(ie.Footer,{children:s.jsx(gn,{})})]})}),Tr=function(){const{receivingStore:e,deliveryStore:t}=T(),r=Mt(),o=ws(e.receivingType,t.address,e.selectedLocation),i=()=>{r({to:"/map"})};return s.jsxs(O,{flex:1,justifyContent:"flex-start",alignItems:"center",marginHorizontal:"$7",marginTop:"$1",onPress:i,children:[o.title!==null&&s.jsxs(w,{justifyContent:"center",alignItems:"center",children:[s.jsx(Re,{numberOfLines:1,title:o.title,textAlign:"center",color:"$white",semibold:!0,fadeColor:"$backgroundDark",wrapperProps:{flex:1}}),s.jsx(Bt,{marginLeft:"$1",height:"$1.5",width:"$1.5",padding:2,backgroundColor:"$white",children:s.jsx(zt,{})})]}),o.subTitle&&s.jsx(Re,{numberOfLines:1,title:o.subTitle,disabled:!0,textAlign:"center",fadeColor:"$backgroundDark"})]})},Lr=E(function(){const{repositoryCustomer:e}
1=T(),t=e.data,r=t?.convertedTotalAvailableBonuses,{userEmoji:o}=e;return t&&t.bonusAccounts.length>0&&r!==void 0?s.jsx(w,{justifyContent:"center",alignItems:"center",pointerEvents:"none",height:"$xl",children:s.jsx(bn,{bonuses:r,padding:"$0.5",paddingRight:"$2",gap:"$1",borderRadius:"$5",alignItems:"center",children:s.jsx(jn,{emojiName:o??Es.alien,width:"$1.75",height:"$1.75",emojiWidth:re("$tiny","size"),$sm:{width:"$2.5",height:"$2.5"}})})}):null});let M=class{constructor(e,t){this.data=e,this.text=t.text||e,this.options=t}};class Rr extends M{constructor(e,t){e=e.toUpperCase(),t.mod43&&(e+=Br(Mr(e))),super(e,t)}encode(){var e=ye("*");for(let t=0;t<this.data.length;t++)e+=ye(this.data[t])+"0";return e+=ye("*"),{data:e,text:this.text}}valid(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}var Nt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],Dr=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function ye(n){return Ar(Ht(n))}function Ar(n){return Dr[n].toString(2)}function Br(n){return Nt[n]}function Ht(n){return Nt.indexOf(n)}function Mr(n){var e=0;for(let t=0;t<n.length;t++)e+=Ht(n[t]);return e=e%43,e}const ne=0,$e=1,Wt=2,_r=98,Pr=103,kr=104,zr=105,Fr=103,Gr=106,Nr=207,Hr={[Pr]:ne,[kr]:$e,[zr]:Wt},Wr={101:ne,100:$e,99:Wt},Xt="Ã",Ut="Ã",Vt="Ã",Fe="[\0-_Ã-Ã]",Ge="[ -�Ã-Ã]",Qt="(Ã*[0-9]{2}Ã*)",$t=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011];class A extends M{constructor(e,t){super(e.substring(1),t),this.bytes=e.split("").map(r=>r.charCodeAt(0))}valid(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}encode(){const e=this.bytes,t=e.shift()-105,r=Hr[t];if(r===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&e.unshift(Nr);const o=A.next(e,1,r);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:A.getBar(t)+o.result+A.getBar((o.checksum+t)%Fr)+A.getBar(Gr)}}shouldEncodeAsEan128(){let e=this.options.ean128||!1;return typeof e=="string"&&(e=e.toLowerCase()==="true"),e}static getBar(e){return $t[e]?$t[e].toString():""}static correctIndex(e,t){if(t===ne){const r=e.shift();return r<32?r+64:r-32}else return t===$e?e.shift()-32:(e.shift()-48)*10+e.shift()-48}static next(e,t,r){if(!e.length)return{result:"",checksum:0};let o,i;if(e[0]>=200){i=e.shift()-105;const c=Wr[i];c!==void 0?o=A.next(e,t+1,c):((r===ne||r===$e)&&i===_r&&(e[0]=r===ne?e[0]>95?e[0]-96:e[0]:e[0]<32?e[0]+96:e[0]),o=A.next(e,t+1,r))}else i=A.correctIndex(e,r),o=A.next(e,t+1,r);const l=A.getBar(i),a=i*t;return{result:l+o.result,checksum:a+o.checksum}}}const Yt=n=>n.match(new RegExp(`^${Fe}*`))[0].length,qt=n=>n.match(new RegExp(`^${Ge}*`))[0].length,Kt=n=>n.match(new RegExp(`^${Qt}*`))[0];function Ne(n,e){const t=e?Fe:Ge,r=n.match(new RegExp(`^(${t}+?)(([0-9]{2}){2,})([^0-9]|$)`));if(r)return r[1]+"Ã"+Zt(n.substring(r[1].length));const o=n.match(new RegExp(`^${t}+`))[0];return o.length===n.length?n:o+String.fromCharCode(e?205:206)+Ne(n.substring(o.length),!e)}function Zt(n){const e=Kt(n),t=e.length;if(t===n.length)return n;n=n.substring(t);const r=Yt(n)>=qt(n);return e+String.fromCharCode(r?206:205)+Ne(n,r)}const Xr=n=>{let e;if(Kt(n).length>=2)e=Vt+Zt(n);else{const r=Yt(n)>qt(n);e=(r?Xt:Ut)+Ne(n,r)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,(r,o)=>"Ã"+o)};class Ur extends A{constructor(e,t){/^[\x00-\x7F\xC8-\xD3]+$/.test(e)?super(Xr(e),t):super(e,t)}}class Vr extends A{constructor(e,t){super(Xt+e,t)}valid(){return new RegExp(`^${Fe}+$`).test(this.data)}}class Qr extends A{constructor(e,t){super(Ut+e,t)}valid(){return new RegExp(`^${Ge}+$`).test(this.data)}}class Yr extends A{constructor(e,t){super(Vt+e,t)}valid(){return new RegExp(`^${Qt}+$`).test(this.data)}}const ue="101",St="01010",qr={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},Kr=["LL","LG","GL","GG"],Zr=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","
1LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],Jr=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"],_=(n,e,t)=>{let r=n.split("").map((o,i)=>qr[e[i]]).map((o,i)=>o?o[n[i]]:"");if(t){const o=n.length-1;r=r.map((i,l)=>l<o?i+t:i)}return r.join("")};class Jt extends M{constructor(e,t){super(e,t),this.fontSize=!t.flat&&t.fontSize>t.width*10?t.width*10:t.fontSize,this.guardHeight=t.height+this.fontSize/2+t.textMargin}encode(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}leftText(e,t){return this.text.substr(e,t)}leftEncode(e,t){return _(e,t)}rightText(e,t){return this.text.substr(e,t)}rightEncode(e,t){return _(e,t)}encodeGuarded(){const e={fontSize:this.fontSize},t={height:this.guardHeight};return[{data:ue,options:t},{data:this.leftEncode(),text:this.leftText(),options:e},{data:St,options:t},{data:this.rightEncode(),text:this.rightText(),options:e},{data:ue,options:t}]}encodeFlat(){return{data:[ue,this.leftEncode(),St,this.rightEncode(),ue].join(""),text:this.text}}}const vt=n=>(10-n.substr(0,12).split("").map(t=>+t).reduce((t,r,o)=>o%2?t+r*3:t+r,0)%10)%10;class eo extends Jt{constructor(e,t){e.search(/^[0-9]{12}$/)!==-1&&(e+=vt(e)),super(e,t),this.lastChar=t.lastChar}valid(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===vt(this.data)}leftText(){return super.leftText(1,6)}leftEncode(){const e=this.data.substr(1,6),t=Jr[this.data[0]];return super.leftEncode(e,t)}rightText(){return super.rightText(7,6)}rightEncode(){const e=this.data.substr(7,6);return super.rightEncode(e,"RRRRRR")}encodeGuarded(){const e=super.encodeGuarded();return this.options.displayValue&&(e.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(e.push({data:"00"}),e.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),e}}const jt=n=>(10-n.substr(0,7).split("").map(t=>+t).reduce((t,r,o)=>o%2?t+r:t+r*3,0)%10)%10;class to extends Jt{constructor(e,t){e.search(/^[0-9]{7}$/)!==-1&&(e+=jt(e)),super(e,t)}valid(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===jt(this.data)}leftText(){return super.leftText(0,4)}leftEncode(){const e=this.data.substr(0,4);return super.leftEncode(e,"LLLL")}rightText(){return super.rightText(4,4)}rightEncode(){const e=this.data.substr(4,4);return super.rightEncode(e,"RRRR")}}const so=n=>n.split("").map(t=>+t).reduce((t,r,o)=>o%2?t+r*9:t+r*3,0)%10;class no extends M{constructor(e,t){super(e,t)}valid(){return this.data.search(/^[0-9]{5}$/)!==-1}encode(){const e=Zr[so(this.data)];return{data:"1011"+_(this.data,e,"01"),text:this.text}}}class ro extends M{constructor(e,t){super(e,t)}valid(){return this.data.search(/^[0-9]{2}$/)!==-1}encode(){const e=Kr[parseInt(this.data)%4];return{data:"1011"+_(this.data,e,"01"),text:this.text}}}class oo extends M{constructor(e,t){e.search(/^[0-9]{11}$/)!==-1&&(e+=Be(e)),super(e,t),this.displayValue=t.displayValue,t.fontSize>t.width*10?this.fontSize=t.width*10:this.fontSize=t.fontSize,this.guardHeight=t.height+this.fontSize/2+t.textMargin}valid(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==Be(this.data)}encode(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}flatEncoding(){var e="";return e+="101",e+=_(this.data.substr(0,6),"LLLLLL"),e+="01010",e+=_(this.data.substr(6,6),"RRRRRR"),e+="101",{data:e,text:this.text}}guardedEncoding(){var e=[];return this.displayValue&&e.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101"+_(this.data[0],"L"),options:{height:this.guardHeight}}),e.push({data:_(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:_(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),e.push({data:_(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&e.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),e}}function Be(n){var e=0,t;for(t=1;t<11;t+=2)e+=parseInt(n[t]);for(t=0;t<11;t+=2)e+=parseInt(n[t])*3;return(10-e%10)%10}const io=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],ao=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]];class co extends M{constructor(e,t){if(super(e,t),this.isValid=!1,e.search(/^[0-9]{6}
1$/)!==-1)this.middleDigits=e,this.upcA=bt(e,"0"),this.text=t.text||`${this.upcA[0]}${e}${this.upcA[this.upcA.length-1]}`,this.isValid=!0;else if(e.search(/^[01][0-9]{7}$/)!==-1)if(this.middleDigits=e.substring(1,e.length-1),this.upcA=bt(this.middleDigits,e[0]),this.upcA[this.upcA.length-1]===e[e.length-1])this.isValid=!0;else return;else return;this.displayValue=t.displayValue,t.fontSize>t.width*10?this.fontSize=t.width*10:this.fontSize=t.fontSize,this.guardHeight=t.height+this.fontSize/2+t.textMargin}valid(){return this.isValid}encode(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}flatEncoding(){var e="";return e+="101",e+=this.encodeMiddleDigits(),e+="010101",{data:e,text:this.text}}guardedEncoding(){var e=[];return this.displayValue&&e.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),e.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),e.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&e.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),e}encodeMiddleDigits(){const e=this.upcA[0],t=this.upcA[this.upcA.length-1],r=ao[parseInt(t)][parseInt(e)];return _(this.middleDigits,r)}}function bt(n,e){const t=parseInt(n[n.length-1]),r=io[t];let o="",i=0;for(let l=0;l<r.length;l++){let a=r[l];a==="X"?o+=n[i++]:o+=a}return o=`${e}${o}`,`${o}${Be(o)}`}const lo="1010",uo="11101",Ct=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"];class es extends M{valid(){return this.data.search(/^([0-9]{2})+$/)!==-1}encode(){const e=this.data.match(/.{2}/g).map(t=>this.encodePair(t)).join("");return{data:lo+e+uo,text:this.text}}encodePair(e){const t=Ct[e[1]];return Ct[e[0]].split("").map((r,o)=>(r==="1"?"111":"1")+(t[o]==="1"?"000":"0")).join("")}}const It=n=>{const e=n.substr(0,13).split("").map(t=>parseInt(t,10)).reduce((t,r,o)=>t+r*(3-o%2*2),0);return Math.ceil(e/10)*10-e};class ho extends es{constructor(e,t){e.search(/^[0-9]{13}$/)!==-1&&(e+=It(e)),super(e,t)}valid(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===It(this.data)}}class oe extends M{constructor(e,t){super(e,t)}encode(){for(var e="110",t=0;t<this.data.length;t++){var r=parseInt(this.data[t]),o=r.toString(2);o=fo(o,4-o.length);for(var i=0;i<o.length;i++)e+=o[i]=="0"?"100":"110"}return e+="1001",{data:e,text:this.text}}valid(){return this.data.search(/^[0-9]+$/)!==-1}}function fo(n,e){for(var t=0;t<e;t++)n="0"+n;return n}function Se(n){for(var e=0,t=0;t<n.length;t++){var r=parseInt(n[t]);(t+n.length)%2===0?e+=r:e+=r*2%10+Math.floor(r*2/10)}return(10-e%10)%10}function ts(n){for(var e=0,t=[2,3,4,5,6,7],r=0;r<n.length;r++){var o=parseInt(n[n.length-1-r]);e+=t[r%t.length]*o}return(11-e%11)%11}class go extends oe{constructor(e,t){super(e+Se(e),t)}}class mo extends oe{constructor(e,t){super(e+ts(e),t)}}class xo extends oe{constructor(e,t){e+=Se(e),e+=Se(e),super(e,t)}}class po extends oe{constructor(e,t){e+=ts(e),e+=Se(e),super(e,t)}}class $o extends M{constructor(e,t){super(e,t),this.number=parseInt(e,10)}encode(){for(var e=this.number,t="";!isNaN(e)&&e!=0;)e%2===0?(t="11100"+t,e=(e-2)/2):(t="100"+t,e=(e-1)/2);return t=t.slice(0,-2),{data:t,text:this.text}}valid(){return this.number>=3&&this.number<=131070}}class So extends M{constructor(e,t){e.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(e="A"+e+"A"),super(e.toUpperCase(),t),this.text=this.options.text||this.text.replace(/[A-D]/g,"")}valid(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}encode(){for(var e=[],t=this.getEncodings(),r=0;r<this.data.length;r++)e.push(t[this.data.charAt(r)]),r!==this.data.length-1&&e.push("0");return{text:this.text,data:e.join("")}}getEncodings(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}class vo extends M{constructor(e,t){super(e,t)}encode(){return{data:"10101010101010101010101010101010101010101",text:this.text}}valid(){return!0}}const jo={CODE39:Rr,CODE128:Ur,CODE128A:Vr,CODE128B:Qr,CODE128C:Yr,EAN13:eo,EAN8:to,EAN5:no,EAN2:ro,UPC:oo,UPCE:co,ITF14:ho,ITF:es,MSI:oe,MSI10:go,MSI11:mo,MSI1010:xo,MSI1110:po,pharmacode:$o,co
1dabar:So,GenericBarcode:vo},bo=(n,e,t)=>{if(typeof n!="string"||n.length===0)throw new Error("Barcode value must be a non-empty string");var r;try{r=new e(n,t)}catch{throw new Error("Invalid barcode format.")}if(!r.valid())throw new Error("Invalid barcode for selected format.");var o=r.encode();return o},Co=n=>{const e=[],t=n.data;let r=0,o=0,i=0;for(let l=0;l<t.length;l++)o=l,t[l]==="1"?r++:r>0&&(e[e.length]=Ot(o-r,i,r,100),r=0);return r>0&&(e[e.length]=Ot(o-r+1,i,r,100)),e},Ot=(n,e,t,r)=>`M${n},${e}h${t}v${r}h-${t}z`,Io=n=>{const{format:e="CODE128",lineColor:t="#000000",flat:r=!1,value:o,width:i,height:l,...a}=n,[c,f]=h.useState([]),[g,p]=h.useState(0);return h.useEffect(()=>{const $=jo[e],S=bo(o,$,{format:e,lineColor:t,flat:r,value:o,width:i,height:l});S&&(f(Co(S)),p(S.data.length))},[e,o,t,r,i,l]),s.jsx(Hs,{...a,children:s.jsx(ys,{height:"100%",width:"100%",viewBox:`0 0 ${g} 100`,preserveAspectRatio:"xMinYMin slice",fill:t,children:s.jsx(Ts,{d:c.join(" ")})})})},Oo=280,J=240,wo=40,wt=Oo-40,Eo=Io,yo=E(function(){const{repositoryCustomer:e}=T(),{brandConfig:t}
1=_e(),r=e.data,o=t.logoUrl,[i,l]=h.useState(0),[a,c]=h.useState(null),[f,g]=h.useState(J),p=h.useCallback(j=>{if(typeof HTMLElement<"u"&&j instanceof HTMLElement){c(j);return}c(j?.host??null)},[]),$=[...r?.qrCode?[{id:"qrCode",value:r.qrCode}]:[],...r?.barcode?[{id:"barCode",value:r.barcode}]:[]];h.useLayoutEffect(()=>{if(!a)return;const j=()=>g(a.clientWidth||J);if(j(),typeof ResizeObserver>"u")return;const x=new ResizeObserver(j);return x.observe(a),()=>x.disconnect()},[a]);const S=Math.max((f-J)/2,0);return s.jsxs(m,{ref:p,width:"100%",alignItems:"center",children:[s.jsx(Ls,{modules:[mn],pagination:{el:".swiper-pagination-container",bulletClass:"swiper-bullet",bulletActiveClass:"swiper-bullet-active"},slidesPerView:"auto",centeredSlides:!0,slidesOffsetBefore:S,slidesOffsetAfter:S,spaceBetween:wo,style:{width:"100%"},onSlideChange:j=>l(j.activeIndex),children:$.map((j,x)=>s.jsx(Rs,{style:{width:"auto"},children:s.jsx(m,{width:J,height:J,justifyContent:"center",alignItems:"center",opacity:i===x?1:.2,animation:"quick",children:j.id==="qrCode"?s.jsxs(s.Fragment,{children:[s.jsx(Ds,{value:j.value,frameSize:wt,dotColor:"#000",contentCells:7,content:s.jsx(m,{flex:1}),backgroundColor:"#FFFFFF00"}),o&&s.jsx(m,{justifyContent:"center",alignItems:"center",position:"absolute",width:"$6",height:"$6",borderRadius:"$5",backgroundColor:"$backgroundLight",children:s.jsx(Ws,{source:{uri:o},width:"$4",height:"$4",borderRadius:"$4"})})]}):s.jsx(Eo,{value:j.value,format:"CODE128",width:(wt-20)/120,lineColor:"#000",background:"#FFFFFF00"})})},j.id))}),s.jsx("div",{className:"swiper-pagination-container"})]})}),To=function(){const{t:e}=B();return s.jsxs(O,{children:[s.jsx(L,{size:"$display-l",marginHorizontal:"$4",textAlign:"center",marginBottom:"$2",marginTop:"$18",children:e("qr-code:modal.title")}),s.jsx(L,{marginHorizontal:"$8",textAlign:"center",marginBottom:"$10",children:e("qr-code:modal.description")}),s.jsx(m,{marginBottom:"$12",children:s.jsx(yo,{})})]})},Lo=function(e){return s.jsxs(Ue,{open:e.isOpen,onOpenChange:e.onOpenChange,children:[s.jsx(Ue.Header,{middle:s.jsx(Lr,{}),paddingHorizontal:"$4"}),s.jsx(To,{})]})},Ro=n=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",viewBox:"0 0 28 28",...n},h.createElement("path",{fill:"currentColor",d:"M1.998 17a1 1 0 0 1 1 1v.8c0 1.276 0 2.174.058 2.874.056.688.162 1.098.324 1.415a3.5 3.5 0 0 0 1.53 1.53c.316.16.726.267 1.414.323.7.058 1.598.058 2.874.058h.8a1 1 0 0 1 0 2h-.8c-1.243 0-2.236 0-3.037-.064-.812-.067-1.514-.207-2.16-.536a5.5 5.5 0 0 1-2.403-2.403c-.33-.646-.47-1.348-.536-2.16-.065-.8-.064-1.794-.064-3.037V18a1 1 0 0 1 1-1m24 0a1 1 0 0 1 1 1v.8c0 1.243.001 2.236-.064 3.037-.067.812-.207 1.514-.536 2.16a5.5 5.5 0 0 1-2.403 2.403c-.646.33-1.348.47-2.16.536-.8.065-1.794.064-3.037.064h-.8a1 1 0 0 1 0-2h.8c1.276 0 2.174 0 2.874-.058.688-.056 1.098-.162 1.415-.324a3.5 3.5 0 0 0 1.53-1.53c.16-.316.267-.726.323-1.414.058-.7.058-1.598.058-2.874V18a1 1 0 0 1 1-1m-10 3a1 1 0 1 1 0 2 1 1 0 0 1 0-2m5 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2m-11.1-4.875c.353 0 .67 0 .933.02.273.023.563.073.848.218.411.21.746.545.956.956.145.285.195.575.217.848.022.263.021.58.021.933v.8c0 .353.001.67-.02.933a2.2 2.2 0 0 1-.218.848c-.21.411-.545.746-.956.956a2.2 2.2 0 0 1-.848.218c-.262.02-.58.02-.933.02h-.8c-.353 0-.67 0-.933-.02a2.2 2.2 0 0 1-.848-.218 2.2 2.2 0 0 1-.956-.956 2.2 2.2 0 0 1-.217-.848c-.022-.263-.021-.58-.021-.933v-.8c0-.353 0-.67.02-.933.023-.273.073-.563.218-.848.21-.411.545-.746.956-.956.285-.145.575-.195.848-.217.263-.022.58-.021.933-.021zm-.8 1.75c-.382 0-.
1616 0-.79.015a1 1 0 0 0-.189.03l-.007.003a.44.44 0 0 0-.191.191l-.003.007-.008.027c-.007.03-.016.08-.022.162-.015.174-.015.408-.015.79v.8c0 .382 0 .616.015.79a1 1 0 0 0 .03.189l.003.007a.44.44 0 0 0 .198.194l.027.008c.03.007.08.016.162.022.174.015.408.015.79.015h.8c.382 0 .616 0 .79-.015a1 1 0 0 0 .189-.03l.007-.003a.44.44 0 0 0 .191-.191l.003-.007.008-.027c.007-.03.016-.08.022-.162.015-.174.015-.408.015-.79v-.8c0-.382 0-.616-.015-.79a1 1 0 0 0-.03-.189l-.003-.007a.44.44 0 0 0-.198-.194l-.027-.008a1 1 0 0 0-.162-.022 11 11 0 0 0-.79-.015zm9.402.625a1 1 0 1 1 0 2 1 1 0 0 1 0-2M15.998 15a1 1 0 1 1 0 2 1 1 0 0 1 0-2m5 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2m-11.1-8.875c.353 0 .67 0 .933.02.273.023.563.073.848.218.411.21.746.545.956.956.145.285.195.575.217.848.022.263.021.58.021.933v.8c0 .353.001.67-.02.933a2.2 2.2 0 0 1-.218.848c-.21.411-.545.746-.956.956a2.2 2.2 0 0 1-.848.217c-.262.022-.58.021-.933.021h-.8c-.353 0-.67 0-.933-.02a2.2 2.2 0 0 1-.848-.218 2.2 2.2 0 0 1-.956-.956 2.2 2.2 0 0 1-.217-.848c-.022-.263-.021-.58-.021-.933v-.8c0-.353 0-.67.02-.933.023-.273.073-.563.218-.848.21-.411.545-.746.956-.956.285-.145.575-.195.848-.217.263-.022.58-.021.933-.021zm9 0c.353 0 .67 0 .933.02.273.023.563.073.848.218.411.21.746.545.956.956.145.285.195.575.217.848.022.263.021.58.021.933v.8c0 .353.001.67-.02.933a2.2 2.2 0 0 1-.218.848c-.21.411-.545.746-.956.956a2.2 2.2 0 0 1-.848.217c-.262.022-.58.021-.933.021h-.8c-.353 0-.67 0-.933-.02a2.2 2.2 0 0 1-.848-.218 2.2 2.2 0 0 1-.956-.956 2.2 2.2 0 0 1-.217-.848c-.022-.263-.021-.58-.021-.933v-.8c0-.353 0-.67.02-.933.023-.273.073-.563.218-.848.21-.411.545-.746.956-.956.285-.145.575-.195.848-.217.263-.022.58-.021.933-.021zm-9.8 1.75c-.382 0-.
1616 0-.79.015a1 1 0 0 0-.189.03l-.007.003a.44.44 0 0 0-.191.191l-.003.007-.008.027a1 1 0 0 0-.022.162c-.015.174-.015.408-.015.79v.8c0 .382 0 .616.015.79a1 1 0 0 0 .03.189l.003.007a.44.44 0 0 0 .198.194l.027.008c.03.007.08.016.162.022.174.015.408.015.79.015h.8c.382 0 .616 0 .79-.015a1 1 0 0 0 .189-.03l.007-.003a.44.44 0 0 0 .191-.191l.003-.007.008-.027c.007-.03.016-.08.022-.162.015-.174.015-.408.015-.79v-.8c0-.382 0-.616-.015-.79a1 1 0 0 0-.03-.189l-.003-.007a.44.44 0 0 0-.191-.191l-.007-.003-.027-.008a1 1 0 0 0-.162-.022 11 11 0 0 0-.79-.015zm9 0c-.382 0-.615 0-.79.015a1 1 0 0 0-.189.03l-.007.003a.44.44 0 0 0-.191.191l-.003.007-.008.027c-.007.03-.016.08-.022.162-.015.174-.015.408-.015.79v.8c0 .382 0 .616.015.79a1 1 0 0 0 .03.189l.003.007a.44.44 0 0 0 .198.194l.027.008c.03.007.08.016.162.022.175.015.408.015.79.015h.8c.382 0 .616 0 .79-.015a1 1 0 0 0 .189-.03l.007-.003a.44.44 0 0 0 .191-.191l.003-.007.008-.027c.007-.03.016-.08.022-.162.015-.174.015-.408.015-.79v-.8c0-.382 0-.616-.015-.79a1 1 0 0 0-.03-.189l-.003-.007a.44.44 0 0 0-.191-.191l-.007-.003-.027-.008a1 1 0 0 0-.162-.022 11 11 0 0 0-.79-.015zM9.998 1a1 1 0 0 1 0 2h-.8c-1.276 0-2.174 0-2.874.058-.688.056-1.098.162-1.415.324a3.5 3.5 0 0 0-1.53 1.53c-.16.316-.267.726-.323 1.414-.058.7-.058 1.598-.058 2.874v.8a1 1 0 1 1-2 0v-.8c0-1.243 0-2.236.065-3.037.066-.812.206-1.514.535-2.16A5.5 5.5 0 0 1 4 1.6c.646-.33 1.348-.47 2.16-.536C6.961 1 7.955 1 9.198 1zm8.8 0c1.243 0 2.236 0 3.037.064.812.067 1.514.207 2.16.536a5.5 5.5 0 0 1 2.403 2.403c.33.646.47 1.348.536 2.16.065.8.064 1.794.064 3.037v.8a1 1 0 1 1-2 0v-.8c0-1.276 0-2.174-.058-2.874-.056-.688-.162-1.098-.324-1.415a3.5 3.5 0 0 0-1.53-1.53c-.316-.16-.726-.267-1.414-.323C20.972 3 20.074 3 18.798 3h-.8a1 1 0 0 1 0-2z"})),Do=E(function(){const{isAuthenticated:e}=ve(),t=Qs(Ae.QR_CODE),[r,o]=h.useState(!1),i=h.useRef(null),{apiHttpClient:l}=_e(),{data:a}=Me({apiHttpClient:l}),c=!a?.areQRAndBarCodesAvailable,f=()=>{e?o(!0):i.current?.open()};return c?s.jsx(m,{width:"$sm",height:"$sm","data-testid":"qr-button-stub"}):s.jsxs(s.Fragment,{children:[s.jsx(Ys,{children:s.jsxs(m,{width:"$sm",height:"$sm",onPress:f,justifyContent:"center",alignItems:"center","data-testid":"qr-button",children:[s.jsx(Ro,{color:"white"}),t&&s.jsx(qs,{borderRadius:"$4.5"})]})}),s.jsx(Lo,{isOpen:r,onOpenChange:o}),s.jsx(kt,{ref:i})]})}),Ao=function(){const[e,t]=h.useState(0),[r,o]=h.useState(0),i=Math.max(e,r),l=c=>{const f=Math.ceil(c.nativeEvent.layout.width);t(f)},a=c=>{const f=Math.ceil(c.nativeEvent.layout.width);o(f)};return s.jsxs(w,{width:"100%",backgroundColor:"$black",position:"fixed",top:"$0",zIndex:"$1",height:"$5",paddingTop:"$2",paddingHorizontal:"$4",alignItems:"center",children:[s.jsx(w,{width:i||void 0,justifyContent:"flex-start",flexShrink:0,children:s.jsx(w,{onLayout:l,children:s.jsx(Do,{})})}),s.jsx(w,{flex:1,minWidth:0,justifyContent:"center",alignItems:"center",children:s.jsx(Tr,{})}),s.jsx(w,{width:i||void 0,justifyContent:"flex-end",flexShrink:0,children:s.jsx(w,{onLayout:a,children:s.jsx(Ks,{})})})]})},Bo="_icon_1bbp6_1",Mo="_cancel_1bbp6_5",Te={icon:Bo,cancel:Mo},ss=n=>n.isSearching?s.jsx(Bs,{className:me(Te.icon,Te.cancel)}):s.jsx(As,{className:Te.icon});ss.displayName="WLSearchBarIcon";const _o="_search_2hy33_12",Po="_label_2hy33_23",Et={search:_o,label:Po},ko=E(function(e){const{menuStore:t}=T(),{t:r}=B();return h.useEffect(()=>{const o=tn(()=>t.isFilteredBySearch,()=>{Cn.animateScroll.scrollToTop(xn)});return()=>o()},[t.isFilteredBySearch]),s.jsxs("section",{className:me(Et.search,e.className),children:[s.jsx("label",{className:Et.label,htmlFor:"search",onClick:()=>{t.menuSearchPolicy.reset()},children:s.jsx(ss,{isSearching:t.menuSearchPolicy.anySearchQuery})}),s.jsx(Ms,{id:"search",width:"100%",padding:"$0",typography:"$title-l",fontWeight:"$md",placeholder:r("search.search",{ns:"menu"}),value:t.menuSearchPolicy.searchQuery,onChangeText:o=>{o===""&&t.menuSearchPolicy.reset(),t.menuSearchPolicy.setSearchQuery(o??"")}})]})}),zo=n=>s.jsx(L,{size:"$title-s",secondary:!0,...n}),Fo=n=>{const{t:e}=B();return s.jsxs(s.Fragment,{children:[n.children,s.jsx(L,{size:"$title-s",secondary:!0,...n,children:e("textDictionary:from")})]})},Go=n=>{const{t:e}=B(),{isAttention:t,time:r,attentionTextProps:o,textProps:i,...l}=n;if(!r)return null;const a=e("minutes",{count:r,ns:"textDictionary"});return s.jsxs(m,{flexDirection:"row",alignItems:"center",...l,children:[t&&s.jsx(on,{color:re("$attention","color")}),s.jsx(L,{size:"$title-s",secondary:!0,...i,...t&&o,children:a})]})},No=function(e){return s.jsx(m,{flexDirection:"row",gap:"$1",...e,children:e.children})},he=Xs(No,{Head:zo,Body:Fo,Tail:Go}),Ho=function({location:e}){const{t}=B(),r=e?Pe.getDateWhenOpen(e.locationWorkShiftsGenerator.locationWorkShifts):null,o=r&&e?ze.getOpeningDate(r,e.timeOffset):null,i=o?o.formattedTime:null,l=o?o.formattedDay:null,a=`${i??""}`+(l?` ${l}`:"");return s.jsxs(w,{alignItems:"center",children:[s.jsx(De,{size:3,backgroundColor:"$textGray",marginHorizontal:"$2"}),s.jsx(L,{size:"$title-s",secondary:!0,medium:!0,children:t("date:from-date",{date:a})})]})},Le="#707070",Wo=36,Xo=E(function(){const{receivingStore:e}=T(),t=Mt(),{t:r}=B(),{attention:o}=be(),i=e.selectedLocation;if(!i)return null;const l=e.receivingType===Gs.DELIVERY,a=e.receivingTime,c=e.isDefaultReceivingTimeExceeded,f=()=>{t({to:"/map"})},g=!Pe.isActiveNow(i.locationWorkShiftsGenerator.locationWorkShifts);return s.jsxs(w,{backgroundColor:"$gray7",justifyContent:"center",alignItems:"center",paddingRight:"$4",paddingLeft:"$5",borderTopLeftRadius:"$7",borderTopRightRadius:"$7",maxWidth:"80%",height:Wo,onPress:f,children:[l?s.jsx(_s,{onPrimaryColor:Le}):s.jsx(Ps,{onPrimaryColor:Le}),s.jsxs(he,{marginLeft:"$2",marginRight:"$1",...g&&{gap:"$0"},children:[s.jsx(he.Head,{color:"$white",fontWeight:"$md",children:r(l?"delivery":"pickup",{ns:"textDictionary"})}),g?s.jsx(Ho,{location:i}):s.jsxs(s.Fragment,{children:[a!==0&&a!==null&&s.jsx(he.Body,{color:"$white",fontWeight:"$md"}),s.jsx(he.Tail,{time:a,isAttention:c,...c&&{paddingHorizontal:"$1",gap:"$1",borderRadius:"$2",backgroundColor:ke(o?.val,.24)},textProps:{fontWeight:"$md",color:"$white"},attentionTextProps:{color:"$attention",fontWeight:"$bd",fontSize:"$1",lineHeight:"$1"}})]})]}),s.jsx(zt,{color:Le})]})}),ns=({children:n})=>s.jsx(m,{tag:"section","data-testid":"forYouSlot",$gtSm:{paddingHorizontal:"$10"},$gtMd:{paddingHorizontal:0},children:n});ns.displayName="WLForYouSlot";const rs=({children:n,isOnlyDishesMode:e})=>s.jsx(O,{tag:"section",flex:1,paddingHorizontal:"$5","data-testid":"menuSlot",backgroundColor:"$backgroundLight",$sm:{paddingTop:e?"$5":"$8"},paddingBottom:"$4",borderBottomLeftRadius:"$20",borderBottomRightRadius:"$20",$gtSm:{paddingHorizontal:"$10",paddingBottom:"$6"},$gtMd:{paddingHorizontal:0,paddingBottom:"$6"},children:n});rs.displayName="WLMenuSlot";const os=h.forwardRef((n,e)=>s.jsx(m,{ref:e,tag:"section","data-testid":"promoSlot",$gtSm:{paddingHorizontal:"$10"},$gtMd:{paddingHorizontal:0},children:s.jsx(m,{position:"relative",zIndex:0,children:n.children})}));os.displayName="WLPromo";const Uo=function(e){const{sm:t}=W();return t?s.jsx(O,{flex:1,width:"100%",paddingTop:"$size.5",children:e.children}):s.jsx(Us,{tag:"section",id:Sn,className:"hidden-scrollbar",padding:"$6",paddingBottom:"$0",children:e.children})},Vo=function(e){const{sm:t}=W();return t?s.jsx(h.Fragment,{children:e.children}):s.jsx(O,{$sm:{gap:"$8"},$gtSm:{gap:"$12"},$gtMd:{gap:"$10"},...vn,children:e.children})},is=E(()=>{const{menuStore:n,receivingStore:e,repositoryOffers:t}=T(),{isAuthenticated:r}
1=ve(),o=W(),i=Rt(),[l,a]=h.useState(!1);Nn({isAuthenticated:r});const c=!o.md&&n.dishGroups.length>0,f=!o.md,g=o.gtSm?s.jsx(ko,{}):null,p=n.isFilteredBySearch||n.menuType!=="main",$=t.offersViewsForRender.length>0,S=e.selectedLocation;return s.jsxs(s.Fragment,{children:[s.jsx(Zs,{position:"middle",children:g}),o.sm&&s.jsx(Ao,{}),s.jsxs(w,{flex:1,minHeight:0,overflow:"hidden",alignItems:"flex-start",width:"100%",position:"static",$sm:{alignItems:"stretch",borderTopLeftRadius:"$11",borderTopRightRadius:"$11",backgroundColor:"$black",overflow:"visible"},children:[c&&s.jsx(O,{tag:"aside","data-testid":"leftSidebarSlot",width:Ze.sidebarLeft,flexShrink:0,height:"100%",paddingVertical:"$6",children:s.jsx(O,{flex:1,flexGrow:0,borderRadius:"$8",backgroundColor:"$white",overflow:"hidden",position:"relative",children:s.jsx(Ke,{type:"sidebar"})})}),s.jsx(O,{flex:1,height:"100%",$sm:{height:"auto"},children:s.jsxs(Uo,{children:[s.jsx(m,{ref:i,style:{height:1,flexShrink:0}}),o.sm&&s.jsxs(O,{position:"sticky",alignItems:"center",paddingHorizontal:"$4",gap:"$7",width:"100%",top:"$size.5",children:[s.jsx(qe,{title:S?.disclaimerTitle,description:S?.disclaimerText,marginTop:"$6",width:"100%"}),s.jsx(Xo,{})]}),s.jsxs(O,{$sm:{backgroundColor:"$backgroundLight",borderRadius:"$11",flex:1},children:[s.jsxs(O,{$gtMd:{gap:p?"$0":"$10"},$gtSm:{gap:"$12"},$sm:{gap:p?"$5":"$8",flex:1},children:[!p&&s.jsxs(Vo,{children:[o.gtSm&&s.jsx(qe,{title:S?.disclaimerTitle,description:S?.disclaimerText}),$&&s.jsx(os,{children:s.jsx(Er,{})}),o.sm&&s.jsx(Ve,{}),s.jsx(Xn,{}),o.sm&&s.jsx(Ke,{type:"tabbar"}),s.jsx(ns,{children:s.jsx(Yn,{})})]}),s.jsx(rs,{isOnlyDishesMode:p,children:s.jsx(pn,{})})]}),s.jsx(O,{position:"sticky",bottom:"$0",zIndex:"$2",$gtSm:{alignItems:"flex-end",pointerEvents:"none"},children:s.jsx($n,{})})]})]})}),f&&s.jsx(O,{tag:"aside","data-testid":"rightSidebarSlot",width:Ze.sidebarRight,flexShrink:0,height:"100%",paddingVertical:"$6",children:s.jsxs(O,{height:"100%",borderRadius:"$8",backgroundColor:"transparent",overflow:"hidden",children:[!o.sm&&s.jsx(Ve,{}),s.jsx(yr,{onOpenMap:()=>a(!0)})]})})]}),s.jsx(an,{isOpen:l,onOpenChange:a}),s.jsx(ks,{})]})});is.displayName="WLMainPage";const di=is;export{di as component};
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.