@restaround/react 1.0.48 → 1.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ import * as productModels from "src/models/product";
2
+ interface Props {
3
+ product: productModels.Product;
4
+ currency: string;
5
+ language: string;
6
+ onClick?: () => void;
7
+ }
8
+ declare const ProductsGridItem: ({ product, currency, language, onClick }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default ProductsGridItem;
@@ -0,0 +1 @@
1
+ export { default } from "./ProductsGridItem";
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{isEmpty as r,trackEvent as i,priceFormatter as n,classNames as o}from"@sorocraft/js-utils";import{createContext as l,useContext as d,useState as c,useRef as s,useEffect as u,useMemo as m,memo as _,useCallback as h}from"react";import{Row as g,classNames as p,IconLink as v,Tooltip as f,SVGIcon as y,Flex as b,Column as C,Carousel as P,CarouselItem as I,Chip as A,UIElementType as w,Text as N,IconButton as O,Modal as k,Button as S,Drawer as L,Description as D,Container as T,Card as z,DropDown as R,DropDownMenuItem as j,Loading as x,BarChart as E}from"@sorocraft/ui";import{Phone as Q,Whatsapp as W,Instagram as H,Telegram as q,Tiktok as B,Facebook as M,Wifi as Y,MarkerPin as F,Plus as G,Minus as $,Close as U}from"@sorocraft/ui/icons";function V(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(a[r[i]]=e[r[i]])}return a}function K(e,t,a,r){return new(a||(a=Promise))((function(i,n){function o(e){try{d(r.next(e))}catch(e){n(e)}}function l(e){try{d(r.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(o,l)}d((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var Z="PublicMenu-module_container__QLN6U",X="PublicMenu-module_categories__Iy6NC",J="PublicMenu-module_footer__6G3DQ";const ee="https://images.restaround.co",te=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ee}/${e}`:"",ae=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ee}/${e}`:"https://images.restaround.co/no-photo-128.webp",re=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ee}/${e}`:"https://images.restaround.co/restaround-doodle.webp",ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ne=(e,t,a)=>ie.charAt(e>>2)+ie.charAt((3&e)<<4|t>>4)+ie.charAt((15&t)<<2|a>>6)+ie.charAt(63&a),oe="restaround.co",le=[oe,"restaround.az","restaround.ee","restaround.nl"],de=l({}),ce=({children:t,value:a})=>{const i=r(a)?{}:a;return i.currency||i.currency,i.language||i.language,e(de.Provider,{value:r(a)?{}:a,children:t})},se=()=>d(de),ue="digital_menu",me=`${ue}_category_select`,_e=`${ue}_category_scroll`,he=`${ue}_product_details`,ge=`${ue}_product_add_cart`,pe=[me,_e,he,ge],ve=(e,t)=>{var a,r;return(null===(r=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===r?void 0:r.call(a,(e=>e.language===t)))||{}};var fe="Header-module_container__tenlF",ye="Header-module_cover__BAWZK",be="Header-module_content__Gx4Al",Ce="Header-module_logo__4MTCm",Pe="Header-module_info__IchYA",Ie="Header-module_name__30wyw",Ae="Header-module_address__WOxXc",we="Header-module_addressText__lUszI",Ne="Header-module_social__AoP0z",Oe="Header-module_links__EeQxg",ke="Header-module_wifiPassword__VWBTa",Se="Header-module_wifiPasswordIcon__Ukn3D";const Le=t=>{const a=V(t,["priority","blurDataURL","quality","placeholder","fetchPriority"]),{imageTag:r}=se()||{};if(r){return e(r,Object.assign({},t,{quality:t.quality||100,placeholder:"blur",blurDataURL:(i=235,n=59,o=90,`data:image/gif;base64,R0lGODlhAQABAPAA${ne(0,i,n)+ne(o,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`)}))}var i,n,o;return e("img",Object.assign({},a))};var De={container:"Languages-module_container__nJeK1",currentLanguage:"Languages-module_currentLanguage__EFw6Q",options:"Languages-module_options__6jLRm",option:"Languages-module_option__QkVQd",isOpen:"Languages-module_isOpen__eUGbg",flexWide:"Languages-module_flexWide__zQ9jN",slidein:"Languages-module_slidein__C4UHU",fadeInOut:"Languages-module_fadeInOut__U-vhH",heightAnimation:"Languages-module_heightAnimation__gIQkF",fadein:"Languages-module_fadein__vPmsX",floatAnimation:"Languages-module_floatAnimation__L-kPH",bottomSheet:"Languages-module_bottomSheet__-t-q8",slideRightToLeft:"Languages-module_slideRightToLeft__y0l-f"};const Te=()=>{var a;const{language:r,languages:i,onLanguageSelect:n}=se(),[o,l]=c(!1),d=(null==i?void 0:i.length)>1,s=(null===(a=null==i?void 0:i.filter)||void 0===a?void 0:a.call(i,(({code:e})=>e!==r)))||[],u=e=>`https://images.restaround.co/languages/${e}.svg`;return d?e("div",{className:De.container,onClick:()=>l(!o),children:t(g,{alignItems:"center",gap:0,children:[e(g,{alignItems:"center",className:p(De,{options:!0,isOpen:o}),children:s.map((({code:t})=>e("img",{src:u(t),className:De.option,onClick:()=>(e=>{n&&n(e)})(t),alt:t},t)))}),e("img",{src:u(r),alt:r||"",className:De.currentLanguage})]})}):null},ze=({branch:a,coverImage:i,logoImage:n,name:o,instagram:l,facebook:d,whatsapp:c,telegram:s,tiktok:u})=>{const{address:m,latitude:_,longitude:h,phone:p,wifiPassword:P}=a||{},I=r(a),A=`https://www.google.com/maps/place/${_},${h}`;return t("div",{className:fe,children:[e(Le,{src:i,alt:o,className:ye,width:1024,height:400,priority:!0,sizes:"100vw",fetchPriority:"high",loading:"eager"}),e("div",{className:be,children:e(I?()=>t(C,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e(Le,{src:n,alt:o,className:Ce,width:96,height:96}),e("div",{className:Pe,children:e("h1",{className:Ie,children:o})})]}):()=>t(b,{direction:"row",gap:1,alignItems:"center",children:[e(b.Item,{children:e(Le,{src:n,alt:o,className:Ce,width:96,height:96})}),e(b.Item,{shrink:!0,children:e("div",{className:Pe,children:t(C,{gap:.25,children:[e("h1",{className:Ie,children:o}),e("a",{className:Ae,href:A,target:"_blank",rel:"noopener noreferrer",children:t(g,{alignItems:"center",gap:.5,children:[e(y,{icon:F,theme:"dark"}),e("span",{className:we,children:m})]})})]})})})]}),{})}),e(Te,{}),!I&&e("div",{className:Ne,children:e("div",{className:Oe,children:e(g,{gap:2,alignItems:"center",children:t(g,{alignItems:"center",justifyContent:"center",gap:.5,children:[!!p&&e(v,{icon:Q,href:`tel:+${p}`,size:"sm",shape:"circle",theme:"light"}),!!c&&e(v,{icon:W,href:`https://wa.me/${c}`,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!l&&e(v,{icon:H,href:l,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!s&&e(v,{icon:q,href:s,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!u&&e(v,{icon:B,href:u,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!d&&e(v,{icon:M,href:d,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!P&&e(f,{hint:P,children:e("div",{className:ke,children:e(y,{icon:Y,size:"sm",className:Se})})})]})})})})]})},Re=({categoryProductMap:t=[],language:a,selectedCategoryId:r,onSelectCategory:n})=>{const o=s({}),l=s(null);return u((()=>{r&&(()=>{var e;const t=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e[r];if(!t||!l.current)return;const a=l.current.clientWidth,i=t.offsetLeft-a/2+t.offsetWidth/2;l.current.scrollTo({left:i,behavior:"smooth"})})()}),[r]),e("div",{className:X,children:e(P,{gap:1,onGetRef:e=>{(null==e?void 0:e.current)&&(l.current=e.current)},children:(t||[]).map((({id:t,translations:l})=>{const{name:d}=l.find((e=>e.language===a))||{};return e(I,{children:e(A,{onClick:()=>((e,t)=>{e!==r&&(i(me,{name:t}),n(e))})(t,d),type:w.BORDERED_PRIMARY,active:t===r,children:e("div",{ref:e=>o.current[t]=e,children:d})})},t)}))})})};var je="Products-module_container__bF2LF",xe="Products-module_products__AoDrY",Ee="Products-module_category__Sp7dE",Qe="Products-module_list__LH4v5";const We=(e,t)=>{var a,r;return(null===(r=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===r?void 0:r.call(a,(e=>e.language===t)))||{}},He=(e,t,a=0)=>e*t*(1+a/100),qe=(e,t,a,r=1)=>{const{price:i,vat:o}=e||{},l=He(i,r,o);return{totalPrice:l,formattedTotalPrice:n(l,t,a)}},Be=l({cart:{},isCartOpen:!1,addProduct:()=>{},updateProduct:()=>{},setIsCartOpen:()=>{}}),Me=({children:t})=>{const[a,i]=c({}),[n,o]=c(!1),l=(e,t,a)=>{if(r(e)||t<0)return;const{id:n,price:o,vat:l=0}=e;i((e=>{const r=e[n],i=a?((null==r?void 0:r.quantity)||0)+t:t;if(i<=0){const t=e,a=n;t[a];return V(t,["symbol"==typeof a?a:a+""])}return Object.assign(Object.assign({},e),{[n]:{productId:n,price:o,quantity:i,vat:l}})}))},d=(e,t=1)=>l(e,t,!0),s=(e,t=1)=>l(e,t,!1),u=m((()=>({cart:a,isCartOpen:n,addProduct:d,updateProduct:s,setIsCartOpen:o})),[a,n]);return e(Be.Provider,{value:u,children:t})},Ye=()=>d(Be);var Fe={container:"ProductsListItem-module_container__i9tFs",isClickable:"ProductsListItem-module_isClickable__iHHdI",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",price:"ProductsListItem-module_price__V1GRM",image:"ProductsListItem-module_image__h6Wbi",addToCart:"ProductsListItem-module_addToCart__WXrQZ",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV",bottomSheet:"ProductsListItem-module_bottomSheet__-YAdd",slideRightToLeft:"ProductsListItem-module_slideRightToLeft__oXk26"};const Ge=({product:a,currency:r,language:n,onClick:l})=>{const{addProduct:d}=Ye(),{image160:c,volume:s}=a||{},{name:u,description:_}=m((()=>We(a,n)),[a,n]),{formattedTotalPrice:h}=m((()=>qe(a,r,n)),[a,r,n]);return t("div",{className:o(Fe,{container:!0,isClickable:!!l}),onClick:l,children:[t(g,{justifyContent:"space-between",gap:0,children:[e("div",{className:Fe.data,children:t(C,{gap:.25,children:[e("h3",{className:Fe.name,children:u}),e("p",{className:Fe.description,children:_}),t(g,{className:Fe.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:h}),!!s&&e(N,{color:"muted",children:s})]})]})}),c&&e(Le,{src:te(c),alt:u||"menu",className:Fe.image,loading:"lazy",width:160,height:90})]}),e("div",{className:Fe.addToCart,children:e(O,{onClick:e=>{e.preventDefault(),e.stopPropagation(),d(a),i(ge,{name:u,quantity:1})},icon:G,type:w.DEFAULT})})]})};var $e={container:"ProductDetails-module_container__oa07j",content:"ProductDetails-module_content__Db3NC",image:"ProductDetails-module_image__BlMfl",details:"ProductDetails-module_details__zfnlt",name:"ProductDetails-module_name__ganLM",price:"ProductDetails-module_price__W34k9",volume:"ProductDetails-module_volume__RWG5s",description:"ProductDetails-module_description__HBufi",close:"ProductDetails-module_close__4cHZ3",addAction:"ProductDetails-module_addAction__o4T5R",actionTitle:"ProductDetails-module_actionTitle__NIJGW",flexWide:"ProductDetails-module_flexWide__w06FX",slidein:"ProductDetails-module_slidein__N8f4g",fadeInOut:"ProductDetails-module_fadeInOut__hYRtK",heightAnimation:"ProductDetails-module_heightAnimation__hLQyz",fadein:"ProductDetails-module_fadein__QN4mI",floatAnimation:"ProductDetails-module_floatAnimation__dTQbc",bottomSheet:"ProductDetails-module_bottomSheet__HO2S-",slideRightToLeft:"ProductDetails-module_slideRightToLeft__hbtJg"};const Ue={en:{viewOrder:"View order",removeFromOrder:"Remove from order",updateOrder:"Update order",addToOrder:"Add to order"},az:{viewOrder:"Şifarişi göstər",removeFromOrder:"Sifarişdən sil",updateOrder:"Sifarişi yenilə",addToOrder:"Sifarişə əlavə et","Your order":"Sifarişiniz",Subtotal:"Ümumi","Empty order":"Boş sifariş","You don't have any items in your order":"Sifarişinizdə heç bir məhsul yoxdur","Add items":"Məhsul əlavə et",Events:"Hərəkətlər","Scrolled to Category":"Kateqoriyaya sürüşdürdü","Category Selected":"Kateqoriya seçildi","Product Details":"Məhsul detalına baxıldı","Product Added to Cart":"Səbətə əlavə edildi"},tr:{viewOrder:"Siparişi Görüntüle",removeFromOrder:"Siparişten Kaldır",updateOrder:"Siparişi Güncelle",addToOrder:"Siparişe Ekle","Your order":"Siparişiniz","Empty order":"Boş sipariş","You don't have any items in your order":"Siparişinizde hiç bir ürün yok","Add items":"Ürün ekle",Subtotal:"Toplam",Events:"Olaylar"},nl:{viewOrder:"Bestelling bekijken",removeFromOrder:"Uit bestelling verwijderen",updateOrder:"Bestelling bijwerken",addToOrder:"Aan bestelling toevoegen","Your order":"Uw bestelling","Empty order":"Lege bestelling","You don't have any items in your order":"U heeft geen items in uw bestelling","Add items":"Items toevoegen",Subtotal:"Totaal",Events:"Gebeurtenissen"},et:{viewOrder:"Vaata tellimust",removeFromOrder:"Eemalda tellimusest",updateOrder:"Uuenda tellimust",addToOrder:"Lisa tellimusele","Your order":"Teie tellimus","Empty order":"Tühi tellimus","You don't have any items in your order":"Teie tellimuses pole ühtegi eset","Add items":"Lisa esemeid",Subtotal:"Kokku",Events:"Sündmused"},pl:{viewOrder:"Zobacz zamówienie",removeFromOrder:"Usuń z zamówienia",updateOrder:"Zaktualizuj zamówienie",addToOrder:"Dodaj do zamówienia","Your order":"Twoje zamówienie","Empty order":"Puste zamówienie","You don't have any items in your order":"Nie masz żadnych pozycji w zamówieniu","Add items":"Dodaj przedmioty",Subtotal:"Suma",Events:"Wydarzenia"},ru:{viewOrder:"Посмотреть заказ",removeFromOrder:"Удалить из заказа",updateOrder:"Обновить заказ",addToOrder:"Добавить в заказ","Your order":"Ваш заказ","Empty order":"Пустой заказ","You don't have any items in your order":"В вашем заказе нет товаров","Add items":"Добавить товары",Subtotal:"Итого",Events:"События"}},Ve=e=>{const{language:t}=se(),a=e||t;return{t:e=>{var t;return(null===(t=Ue[a])||void 0===t?void 0:t[e])||e}}},Ke=()=>{const{cart:e}=Ye();return Object.values(e||{}).reduce(((e,t)=>e+t.quantity),0)};var Ze={container:"Quantity-module_container__01ySb",quantityAction:"Quantity-module_quantityAction__wRV2F",quantityValue:"Quantity-module_quantityValue__BBpyw",isDisabled:"Quantity-module_isDisabled__crQCf",sm:"Quantity-module_sm__0Hgp2",md:"Quantity-module_md__hu7a8",lg:"Quantity-module_lg__GA4jn",flexWide:"Quantity-module_flexWide__R95Jw",slidein:"Quantity-module_slidein__5yeWf",fadeInOut:"Quantity-module_fadeInOut__cllco",heightAnimation:"Quantity-module_heightAnimation__dhOgA",fadein:"Quantity-module_fadein__Cof2o",floatAnimation:"Quantity-module_floatAnimation__DSqQr",bottomSheet:"Quantity-module_bottomSheet__5-5iY",slideRightToLeft:"Quantity-module_slideRightToLeft__cjDHk"};const Xe=({isDecreaseDisabled:a=!1,quantity:r=1,size:i="md",onIncrease:n,onDecrease:l})=>t(g,{className:o(Ze,{container:!0},[Ze[i]]),justifyContent:"space-between",gap:0,children:[e("div",{className:o(Ze,{quantityAction:!0,isDisabled:a}),onClick:l,children:e(y,{icon:$})}),e("div",{className:Ze.quantityValue,children:r}),e("div",{className:Ze.quantityAction,onClick:n,children:e(y,{icon:G})})]}),Je=({product:a,onClose:o})=>{const{language:l,currency:d}=se(),{addProduct:_,updateProduct:h}=Ye(),[p,v]=c(1),[f,y]=c(!1),b=s(),{t:P}=Ve(),I=(e=>{var t;const{cart:a}=Ye();return r(a)||!e?0:(null===(t=a[e])||void 0===t?void 0:t.quantity)||0})(null==a?void 0:a.id),{name:A,description:w}=m((()=>We(a,l)),[a,l]),{totalPrice:N,formattedTotalPrice:L}=m((()=>qe(a,d,l)),[a,d,l]),D=m((()=>p*N),[p,N]),T=m((()=>n(D,d,l)),[D,d,l]),z=f?0===p:1===p,R=m((()=>P(f?0===p?"removeFromOrder":"updateOrder":"addToOrder")),[f,p]);u((()=>{v(I>0?I:1),y(I>0)}),[I,a]);const j=e=>{-1===e&&z||v((t=>Math.max(0,t+e)))};if(r(a))return null;const{image1024:x,volume:E}=a;return e("div",{className:$e.container,onClick:e=>{var t,a;(null===(a=null===(t=null==b?void 0:b.current)||void 0===t?void 0:t.contains)||void 0===a?void 0:a.call(t,null==e?void 0:e.target))||o&&o()},children:e(k,{onClose:o,ref:b,noBodyPadding:!0,size:"small",content:t("div",{className:$e.content,children:[t(C,{gap:0,children:[x&&e(Le,{src:te(x),width:1024,height:400,alt:A||"product",className:$e.image}),t(C,{className:$e.details,gap:1,children:[e("h2",{className:$e.name,children:A}),t(g,{justifyContent:"space-between",children:[e("div",{className:$e.price,children:L}),e("div",{className:$e.volume,children:E})]}),e("div",{className:$e.description,children:w})]})]}),e("div",{className:$e.close,children:e(O,{onClick:o,icon:U})})]}),footer:t(g,{className:$e.addToCart,gap:.5,children:[e(Xe,{isDecreaseDisabled:z,onDecrease:()=>j(-1),onIncrease:()=>j(1),quantity:p}),e(S,{className:$e.addAction,label:t(g,{fullWidth:!0,justifyContent:"space-between",children:[e("span",{className:$e.actionTitle,children:R}),e("span",{children:T})]}),onClick:()=>{f?h(a,p):(_(a,p),i(ge,{name:A,quantity:p})),o&&o()},size:"xl",fullWidth:!0})]})})})};var et="Cart-module_container__3KQtx",tt="Cart-module_content__rkiZa",at={container:"CartStepper-module_container__4CF1L",count:"CartStepper-module_count__E-RBg",actionText:"CartStepper-module_actionText__-rVKA",totalPrice:"CartStepper-module_totalPrice__QboRN",isClickable:"CartStepper-module_isClickable__mDptU",flexWide:"CartStepper-module_flexWide__eXxCr",slidein:"CartStepper-module_slidein__d5JQ-",fadeInOut:"CartStepper-module_fadeInOut__pS8nn",heightAnimation:"CartStepper-module_heightAnimation__7-e5Z",fadein:"CartStepper-module_fadein__-Ba0-",floatAnimation:"CartStepper-module_floatAnimation__rq6zX",bottomSheet:"CartStepper-module_bottomSheet__1wHHD",slideRightToLeft:"CartStepper-module_slideRightToLeft__0KLAo"};const rt=({actionText:a,onClick:r})=>{const i=Ke(),{formattedTotalPrice:l}=(()=>{const{cart:e}=Ye(),{currency:t,language:a}=se(),r=Object.values(e||{}).reduce(((e,{price:t,quantity:a,vat:r})=>e+He(t,a,r)),0);return{totalPrice:r,formattedTotalPrice:n(r,t,a)}})();return t(b,{className:o(at,{container:!0,isClickable:!!r}),justifyContent:"space-between",alignItems:"center",onClick:r,children:[e(b.Item,{flex:1,children:t(g,{alignItems:"center",children:[e("div",{className:at.count,children:i}),e("div",{className:at.actionText,children:a})]})}),e(b.Item,{className:at.totalPrice,flex:1,children:l})]})},it=()=>{const{setIsCartOpen:t}=Ye(),{t:a}=Ve();return Ke()<=0?null:e("div",{className:et,children:e("div",{className:tt,children:e(rt,{onClick:()=>t(!0),actionText:a("viewOrder")})})})};var nt={container:"CartDrawer-module_container__zvapw",content:"CartDrawer-module_content__ELSiG",flexWide:"CartDrawer-module_flexWide__ySgY-",slidein:"CartDrawer-module_slidein__XC9AW",fadeInOut:"CartDrawer-module_fadeInOut__w9h6X",heightAnimation:"CartDrawer-module_heightAnimation__tBgkj",fadein:"CartDrawer-module_fadein__QNPoQ",floatAnimation:"CartDrawer-module_floatAnimation__nZWoY",bottomSheet:"CartDrawer-module_bottomSheet__m0wy7",slideRightToLeft:"CartDrawer-module_slideRightToLeft__gpixh"},ot="CartItem-module_container__At7lj",lt="CartItem-module_image__D-zzG",dt="CartItem-module_data__Lo3Fb",ct="CartItem-module_name__EksZu",st="CartItem-module_price__yJxl6";const ut=e=>{var t;const{products:a}=se();return(null===(t=null==a?void 0:a.find)||void 0===t?void 0:t.call(a,(({id:t})=>t===e)))||{}},mt=({productId:t,min:a=1,size:r="md"})=>{const i=(e=>{const{cart:t}=Ye(),a=t[e];return(null==a?void 0:a.quantity)||1})(t),n=ut(t),{updateProduct:o}=Ye();return e(Xe,{isDecreaseDisabled:i===a,onDecrease:()=>o(n,i-1),onIncrease:()=>o(n,i+1),quantity:i,size:r})},_t=({item:a})=>{const{productId:r,quantity:i}=a||{},n=ut(r),{language:o,currency:l}=se(),{image160:d}=n,{name:c}=m((()=>We(n,o)),[n,o]),{formattedTotalPrice:s}=m((()=>qe(n,l,o,i)),[n,l,o,i]);return t(g,{className:ot,gap:1,alignItems:"center",children:[d&&e(Le,{src:te(d),alt:c||"menu",className:lt,loading:"lazy",width:80,height:45}),t("div",{className:dt,children:[e("div",{className:ct,children:c}),e("div",{className:st,children:s})]}),e(mt,{productId:r,size:"sm",min:0})]})},ht=()=>{const{isCartOpen:a,cart:i,setIsCartOpen:n}=Ye(),o=s(),{t:l}=Ve(),d=r(i),c=()=>n(!1);return a?e("div",{className:nt.container,onClick:e=>{var t,a;(null===(a=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.contains)||void 0===a?void 0:a.call(t,null==e?void 0:e.target))||c()},children:e(L,{ref:o,onClose:c,isOpen:a,title:l("Your order"),content:e("div",{className:nt.content,children:d?e((()=>t(C,{className:nt.noItems,fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",gap:0,children:[e(N,{variant:"h2",children:l("Empty order")}),e(D,{text:l("You don't have any items in your order")})]})),{}):e("div",{className:nt.items,children:Object.keys(i||{}).map((t=>e(_t,{item:i[t]},t)))})}),footer:d?e(S,{label:l("Add items"),onClick:c,type:w.PRIMARY,size:"xl",fullWidth:!0}):e(rt,{actionText:l("Subtotal")})})}):null},gt=_((({categoryProductMap:a=[],currency:r,language:n,productBlocksRef:o,containerRef:l,onCategoryInView:d})=>{const[s,m]=c(null);return u((()=>{const e=new IntersectionObserver((e=>{var t;const a=((null===(t=null==l?void 0:l.current)||void 0===t?void 0:t.clientHeight)||1e3)/2;let r=null,i=1/0;e.forEach((e=>{if(e.isIntersecting){const t=e.boundingClientRect,n=t.top+t.height/2,o=Math.abs(n-a);o<i&&(i=o,r=e.target.getAttribute("data-category-id"))}})),r&&d(Number(r))}),{threshold:.5});return Object.entries(o.current||{}).forEach((([t,a])=>{a&&(a.setAttribute("data-category-id",t),e.observe(a))})),()=>{e.disconnect()}}),[o,l]),e(Me,{children:t("div",{className:je,children:[e(C,{children:(a||[]).map((a=>{const{name:l}=ve(a,n),{id:d,products:c}=a;return t("div",{className:xe,ref:e=>o.current[d]=e,"data-category-id":d,children:[e("h2",{className:Ee,children:l}),e("div",{className:Qe,children:e(C,{gap:0,children:(c||[]).map((t=>e(Ge,{product:t,currency:r,language:n,onClick:()=>(e=>{const{name:t}=We(e,n);i(he,{name:t}),m(e)})(t)},t.id)))})})]},d)}))}),e(Je,{product:s,onClose:()=>m(null)}),e(it,{}),e(ht,{})]})})}),((e,t)=>e.categoryProductMap===t.categoryProductMap&&e.currency===t.currency&&e.language===t.language));var pt="Branches-module_branches__sOuoV",vt="Branches-module_list__vYoT2",ft="Branches-module_name__K0Z-4";const yt=({branches:t=[],rootPath:a="",onBranchSelect:r})=>{const i=({children:t,id:i})=>r?e("div",{onClick:()=>r(i),children:t}):e("a",{href:`${a}/${i}`,children:t});return e("div",{className:pt,children:e(T,{className:vt,children:t.map((({id:t,name:a})=>e(i,{id:t,children:e(z,{noBottomMargin:!0,children:e(b,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e("h2",{className:ft,children:a})})})},t)))})})},bt=({data:n})=>{var o;const{name:l,coverImage:d,logoImage:u,branches:m=[],branchId:_,language:h,categories:g,products:p,currency:v,instagram:f,facebook:y,whatsapp:b,telegram:C,tiktok:P,rootPath:I,hostname:A,onBranchSelect:w}=n||{},N=m.length<=1,O=((e,t)=>{const a=t.reduce(((e,t)=>{const a=Number(t.categoryId);return e[a]||(e[a]=[]),e[a].push(t),e}),{});return e.map((e=>Object.assign(Object.assign({},e),{products:a[Number(e.id)]||[]}))).filter((e=>{var t;return(null===(t=null==e?void 0:e.products)||void 0===t?void 0:t.length)>0}))})(g,p),k=(()=>{var e;return N?(null===(e=null==m?void 0:m[0])||void 0===e?void 0:e.id)?m[0]:{}:m.find((e=>e.id===Number(_)))})(),S=N||!(null==k?void 0:k.name)?l:(null==k?void 0:k.name)||"",[L,D]=c(null===(o=null==g?void 0:g[0])||void 0===o?void 0:o.id),T=s({}),z=s(null),R=s(!0),{url:j,domain:x}=((e,t)=>{const a=le.includes(e)?e:oe;return{url:`https://${a}/${t||"en"}`,domain:a}})(A,h);return t("div",{className:Z,ref:z,children:[e(ze,{branch:k,name:S,coverImage:re(d),logoImage:ae(u),instagram:f,facebook:y,whatsapp:b,telegram:C,tiktok:P}),N||_?t(a,{children:[e(Re,{categoryProductMap:O,language:h,selectedCategoryId:L,onSelectCategory:e=>K(void 0,void 0,void 0,(function*(){R.current=!1,D(e),(e=>{var t;const a=null===(t=null==T?void 0:T.current)||void 0===t?void 0:t[e];a&&(setTimeout((()=>{a.scrollIntoView({behavior:"smooth",block:"start"})}),100),setTimeout((()=>{R.current=!0}),1e3))})(e)}))}),e(gt,{currency:v,language:h,productBlocksRef:T,containerRef:z,categoryProductMap:O,onCategoryInView:e=>{if(!(null==R?void 0:R.current))return;const t=((e,t,a)=>{var i;const n=null===(i=null==t?void 0:t.find)||void 0===i?void 0:i.call(t,(({id:t})=>t===e));if(r(n))return"";const{name:o}=ve(n,a);return o})(e,g,h);i(_e,{name:t}),D(e)}})]}):e(yt,{branches:m,onBranchSelect:w,rootPath:I}),!!A&&e("a",{rel:"noopener",target:"_blank",href:j,className:J,children:x})]})},Ct=({data:t})=>e(ce,{value:t,children:e(bt,{data:t})});var Pt={};const It=({currentGoal:t,language:a,setGoal:r})=>{const{t:i}=Ve(a),n=s({}),o=e=>{switch(e){case _e:return i("Scrolled to Category");case me:return i("Category Selected");case he:return i("Product Details");case ge:return i("Product Added to Cart");default:return""}},l=h((e=>{var t,a;r(e),null===(a=null===(t=null==n?void 0:n.current)||void 0===t?void 0:t.close)||void 0===a||a.call(t)}),[r]);return e(R,{action:o(t),actionSize:"large",type:w.BORDERED_PRIMARY,closeRef:n,menu:e("div",{className:Pt.toolbarMenu,children:pe.map((t=>e(j,{onClick:()=>l(t),children:o(t)},t)))})})},At=({data:t,isLoading:a=!1,loadingImage:r,language:i,goal:n,setGoal:o})=>{const{t:l}=Ve(i);return e(z,{title:l("Events"),toolbar:e(It,{language:i,currentGoal:n,setGoal:o}),children:a?e(x,{image:r}):e(E,{data:t})})};export{At as Events,Ct as PublicMenu};
1
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{isEmpty as r,trackEvent as i,priceFormatter as n,classNames as o}from"@sorocraft/js-utils";import{createContext as l,useContext as d,useState as c,useRef as s,useEffect as u,useMemo as m,memo as _,useCallback as h}from"react";import{Row as g,classNames as p,IconLink as v,Tooltip as f,SVGIcon as y,Flex as b,Column as I,Carousel as P,CarouselItem as C,Chip as A,UIElementType as N,Text as w,IconButton as O,Modal as k,Button as L,Drawer as S,Description as D,Container as T,Card as z,DropDown as R,DropDownMenuItem as G,Loading as x,BarChart as j}from"@sorocraft/ui";import{Phone as W,Whatsapp as E,Instagram as H,Telegram as Q,Tiktok as B,Facebook as q,Wifi as Y,MarkerPin as F,Plus as M,Minus as U,Close as $,List as V,Grid as Z}from"@sorocraft/ui/icons";function K(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(a[r[i]]=e[r[i]])}return a}function X(e,t,a,r){return new(a||(a=Promise))((function(i,n){function o(e){try{d(r.next(e))}catch(e){n(e)}}function l(e){try{d(r.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(o,l)}d((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var J="PublicMenu-module_container__QLN6U",ee="PublicMenu-module_categories__Iy6NC",te="PublicMenu-module_footer__6G3DQ";const ae="https://images.restaround.co",re=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ae}/${e}`:"",ie=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ae}/${e}`:"https://images.restaround.co/no-photo-128.webp",ne=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ae}/${e}`:"https://images.restaround.co/restaround-doodle.webp",oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",le=(e,t,a)=>oe.charAt(e>>2)+oe.charAt((3&e)<<4|t>>4)+oe.charAt((15&t)<<2|a>>6)+oe.charAt(63&a),de="restaround.co",ce=[de,"restaround.az","restaround.ee","restaround.nl"],se=l({}),ue=({children:t,value:a})=>{const i=r(a)?{}:a;return i.currency||i.currency,i.language||i.language,e(se.Provider,{value:r(a)?{}:a,children:t})},me=()=>d(se),_e="digital_menu",he=`${_e}_category_select`,ge=`${_e}_category_scroll`,pe=`${_e}_product_details`,ve=`${_e}_product_add_cart`,fe=[he,ge,pe,ve],ye=(e,t)=>{var a,r;return(null===(r=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===r?void 0:r.call(a,(e=>e.language===t)))||{}};var be="Header-module_container__tenlF",Ie="Header-module_cover__BAWZK",Pe="Header-module_content__Gx4Al",Ce="Header-module_logo__4MTCm",Ae="Header-module_info__IchYA",Ne="Header-module_name__30wyw",we="Header-module_address__WOxXc",Oe="Header-module_addressText__lUszI",ke="Header-module_social__AoP0z",Le="Header-module_links__EeQxg",Se="Header-module_wifiPassword__VWBTa",De="Header-module_wifiPasswordIcon__Ukn3D";const Te=t=>{const a=K(t,["priority","blurDataURL","quality","placeholder","fetchPriority"]),{imageTag:r}=me()||{};if(r){return e(r,Object.assign({},t,{quality:t.quality||100,placeholder:"blur",blurDataURL:(i=235,n=59,o=90,`data:image/gif;base64,R0lGODlhAQABAPAA${le(0,i,n)+le(o,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`)}))}var i,n,o;return e("img",Object.assign({},a))};var ze={container:"Languages-module_container__nJeK1",currentLanguage:"Languages-module_currentLanguage__EFw6Q",options:"Languages-module_options__6jLRm",option:"Languages-module_option__QkVQd",isOpen:"Languages-module_isOpen__eUGbg",flexWide:"Languages-module_flexWide__zQ9jN",slidein:"Languages-module_slidein__C4UHU",fadeInOut:"Languages-module_fadeInOut__U-vhH",heightAnimation:"Languages-module_heightAnimation__gIQkF",fadein:"Languages-module_fadein__vPmsX",floatAnimation:"Languages-module_floatAnimation__L-kPH",bottomSheet:"Languages-module_bottomSheet__-t-q8",slideRightToLeft:"Languages-module_slideRightToLeft__y0l-f"};const Re=()=>{var a;const{language:r,languages:i,onLanguageSelect:n}=me(),[o,l]=c(!1),d=(null==i?void 0:i.length)>1,s=(null===(a=null==i?void 0:i.filter)||void 0===a?void 0:a.call(i,(({code:e})=>e!==r)))||[],u=e=>`https://images.restaround.co/languages/${e}.svg`;return d?e("div",{className:ze.container,onClick:()=>l(!o),children:t(g,{alignItems:"center",gap:0,children:[e(g,{alignItems:"center",className:p(ze,{options:!0,isOpen:o}),children:s.map((({code:t})=>e("img",{src:u(t),className:ze.option,onClick:()=>(e=>{n&&n(e)})(t),alt:t},t)))}),e("img",{src:u(r),alt:r||"",className:ze.currentLanguage})]})}):null},Ge=({branch:a,coverImage:i,logoImage:n,name:o,instagram:l,facebook:d,whatsapp:c,telegram:s,tiktok:u})=>{const{address:m,latitude:_,longitude:h,phone:p,wifiPassword:P}=a||{},C=r(a),A=`https://www.google.com/maps/place/${_},${h}`;return t("div",{className:be,children:[e(Te,{src:i,alt:o,className:Ie,width:1024,height:400,priority:!0,sizes:"100vw",fetchPriority:"high",loading:"eager"}),e("div",{className:Pe,children:e(C?()=>t(I,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e(Te,{src:n,alt:o,className:Ce,width:96,height:96}),e("div",{className:Ae,children:e("h1",{className:Ne,children:o})})]}):()=>t(b,{direction:"row",gap:1,alignItems:"center",children:[e(b.Item,{children:e(Te,{src:n,alt:o,className:Ce,width:96,height:96})}),e(b.Item,{shrink:!0,children:e("div",{className:Ae,children:t(I,{gap:.25,children:[e("h1",{className:Ne,children:o}),e("a",{className:we,href:A,target:"_blank",rel:"noopener noreferrer",children:t(g,{alignItems:"center",gap:.5,children:[e(y,{icon:F,theme:"dark"}),e("span",{className:Oe,children:m})]})})]})})})]}),{})}),e(Re,{}),!C&&e("div",{className:ke,children:e("div",{className:Le,children:e(g,{gap:2,alignItems:"center",children:t(g,{alignItems:"center",justifyContent:"center",gap:.5,children:[!!p&&e(v,{icon:W,href:`tel:+${p}`,size:"sm",shape:"circle",theme:"light"}),!!c&&e(v,{icon:E,href:`https://wa.me/${c}`,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!l&&e(v,{icon:H,href:l,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!s&&e(v,{icon:Q,href:s,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!u&&e(v,{icon:B,href:u,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!d&&e(v,{icon:q,href:d,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!P&&e(f,{hint:P,children:e("div",{className:Se,children:e(y,{icon:Y,size:"sm",className:De})})})]})})})})]})},xe=({categoryProductMap:t=[],language:a,selectedCategoryId:r,onSelectCategory:n})=>{const o=s({}),l=s(null);return u((()=>{r&&(()=>{var e;const t=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e[r];if(!t||!l.current)return;const a=l.current.clientWidth,i=t.offsetLeft-a/2+t.offsetWidth/2;l.current.scrollTo({left:i,behavior:"smooth"})})()}),[r]),e("div",{className:ee,children:e(P,{gap:1,onGetRef:e=>{(null==e?void 0:e.current)&&(l.current=e.current)},children:(t||[]).map((({id:t,translations:l})=>{const{name:d}=l.find((e=>e.language===a))||{};return e(C,{children:e(A,{onClick:()=>((e,t)=>{e!==r&&(i(he,{name:t}),n(e))})(t,d),type:N.BORDERED_PRIMARY,active:t===r,children:e("div",{ref:e=>o.current[t]=e,children:d})})},t)}))})})};var je="Products-module_container__bF2LF",We="Products-module_view__l857X",Ee="Products-module_products__AoDrY",He="Products-module_category__Sp7dE",Qe="Products-module_list__LH4v5";const Be=(e,t)=>{var a,r;return(null===(r=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===r?void 0:r.call(a,(e=>e.language===t)))||{}},qe=(e,t,a=0)=>e*t*(1+a/100),Ye=(e,t,a,r=1)=>{const{price:i,vat:o}=e||{},l=qe(i,r,o);return{totalPrice:l,formattedTotalPrice:n(l,t,a)}};var Fe;!function(e){e.LIST="list",e.GRID="grid"}(Fe||(Fe={}));const Me=l({cart:{},isCartOpen:!1,addProduct:()=>{},updateProduct:()=>{},setIsCartOpen:()=>{}}),Ue=({children:t})=>{const[a,i]=c({}),[n,o]=c(!1),l=(e,t,a)=>{if(r(e)||t<0)return;const{id:n,price:o,vat:l=0}=e;i((e=>{const r=e[n],i=a?((null==r?void 0:r.quantity)||0)+t:t;if(i<=0){const t=e,a=n;t[a];return K(t,["symbol"==typeof a?a:a+""])}return Object.assign(Object.assign({},e),{[n]:{productId:n,price:o,quantity:i,vat:l}})}))},d=(e,t=1)=>l(e,t,!0),s=(e,t=1)=>l(e,t,!1),u=m((()=>({cart:a,isCartOpen:n,addProduct:d,updateProduct:s,setIsCartOpen:o})),[a,n]);return e(Me.Provider,{value:u,children:t})},$e=()=>d(Me);var Ve={container:"ProductsListItem-module_container__i9tFs",isClickable:"ProductsListItem-module_isClickable__iHHdI",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",price:"ProductsListItem-module_price__V1GRM",image:"ProductsListItem-module_image__h6Wbi",addToCart:"ProductsListItem-module_addToCart__WXrQZ",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV",bottomSheet:"ProductsListItem-module_bottomSheet__-YAdd",slideRightToLeft:"ProductsListItem-module_slideRightToLeft__oXk26"};const Ze=({product:a,currency:r,language:n,onClick:l})=>{const{addProduct:d}=$e(),{image160:c,volume:s}=a||{},{name:u,description:_}=m((()=>Be(a,n)),[a,n]),{formattedTotalPrice:h}=m((()=>Ye(a,r,n)),[a,r,n]);return t("div",{className:o(Ve,{container:!0,isClickable:!!l}),onClick:l,children:[t(g,{justifyContent:"space-between",gap:0,children:[e("div",{className:Ve.data,children:t(I,{gap:.25,children:[e("h3",{className:Ve.name,children:u}),e("p",{className:Ve.description,children:_}),t(g,{className:Ve.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:h}),!!s&&e(w,{color:"muted",children:s})]})]})}),c&&e(Te,{src:re(c),alt:u||"menu",className:Ve.image,loading:"lazy",width:160,height:90})]}),e("div",{className:Ve.addToCart,children:e(O,{onClick:e=>{e.preventDefault(),e.stopPropagation(),d(a),i(ve,{name:u,quantity:1})},icon:M,type:N.DEFAULT})})]})};var Ke={container:"ProductsGridItem-module_container__DU5KG",content:"ProductsGridItem-module_content__FXs0Y",isClickable:"ProductsGridItem-module_isClickable__8zhwt",info:"ProductsGridItem-module_info__HkBG-",data:"ProductsGridItem-module_data__Z-N1X",name:"ProductsGridItem-module_name__ZrIx3",description:"ProductsGridItem-module_description__-FQPA",price:"ProductsGridItem-module_price__BFu2H",imageContainer:"ProductsGridItem-module_imageContainer__eHS4Z",image:"ProductsGridItem-module_image__alZWL",addToCart:"ProductsGridItem-module_addToCart__gYVrI",noImage:"ProductsGridItem-module_noImage__78UHW",volume:"ProductsGridItem-module_volume__oxEAr",flexWide:"ProductsGridItem-module_flexWide__qcB5X",slidein:"ProductsGridItem-module_slidein__oKaVb",fadeInOut:"ProductsGridItem-module_fadeInOut__d2zot",heightAnimation:"ProductsGridItem-module_heightAnimation__zgbh9",fadein:"ProductsGridItem-module_fadein__Z067K",floatAnimation:"ProductsGridItem-module_floatAnimation__GXjP-",bottomSheet:"ProductsGridItem-module_bottomSheet__-zrFD",slideRightToLeft:"ProductsGridItem-module_slideRightToLeft__R7hv5"};const Xe=({product:a,currency:r,language:n,onClick:l})=>{const{addProduct:d}=$e(),{volume:c,image580:s,image160:u,image1024:_}=a||{},h=s||_||u,{name:p,description:v}=m((()=>Be(a,n)),[a,n]),{formattedTotalPrice:f}=m((()=>Ye(a,r,n)),[a,r,n]);return e("div",{className:Ke.container,children:t("div",{className:o(Ke,{content:!0,isClickable:!!l,noImage:!h}),onClick:l,children:[h&&e("div",{className:Ke.imageContainer,children:e(Te,{src:re(h),alt:p||"menu",className:Ke.image,loading:"lazy",width:580,height:326})}),e("div",{className:Ke.info,children:e("div",{className:Ke.data,children:t(I,{gap:.25,children:[e("h3",{className:Ke.name,children:p}),e("p",{className:Ke.description,children:v}),t(g,{className:Ke.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:f}),!!c&&e(w,{color:"white",className:Ke.volume,children:c})]})]})})}),e("div",{className:Ke.addToCart,children:e(O,{onClick:e=>{e.preventDefault(),e.stopPropagation(),d(a),i(ve,{name:p,quantity:1})},icon:M,type:N.DEFAULT})})]})})};var Je={container:"ProductDetails-module_container__oa07j",content:"ProductDetails-module_content__Db3NC",image:"ProductDetails-module_image__BlMfl",details:"ProductDetails-module_details__zfnlt",name:"ProductDetails-module_name__ganLM",price:"ProductDetails-module_price__W34k9",volume:"ProductDetails-module_volume__RWG5s",description:"ProductDetails-module_description__HBufi",close:"ProductDetails-module_close__4cHZ3",addAction:"ProductDetails-module_addAction__o4T5R",actionTitle:"ProductDetails-module_actionTitle__NIJGW",flexWide:"ProductDetails-module_flexWide__w06FX",slidein:"ProductDetails-module_slidein__N8f4g",fadeInOut:"ProductDetails-module_fadeInOut__hYRtK",heightAnimation:"ProductDetails-module_heightAnimation__hLQyz",fadein:"ProductDetails-module_fadein__QN4mI",floatAnimation:"ProductDetails-module_floatAnimation__dTQbc",bottomSheet:"ProductDetails-module_bottomSheet__HO2S-",slideRightToLeft:"ProductDetails-module_slideRightToLeft__hbtJg"};const et={en:{viewOrder:"View order",removeFromOrder:"Remove from order",updateOrder:"Update order",addToOrder:"Add to order"},az:{viewOrder:"Şifarişi göstər",removeFromOrder:"Sifarişdən sil",updateOrder:"Sifarişi yenilə",addToOrder:"Sifarişə əlavə et","Your order":"Sifarişiniz",Subtotal:"Ümumi","Empty order":"Boş sifariş","You don't have any items in your order":"Sifarişinizdə heç bir məhsul yoxdur","Add items":"Məhsul əlavə et",Events:"Hərəkətlər","Scrolled to Category":"Kateqoriyaya sürüşdürdü","Category Selected":"Kateqoriya seçildi","Product Details":"Məhsul detalına baxıldı","Product Added to Cart":"Səbətə əlavə edildi"},tr:{viewOrder:"Siparişi Görüntüle",removeFromOrder:"Siparişten Kaldır",updateOrder:"Siparişi Güncelle",addToOrder:"Siparişe Ekle","Your order":"Siparişiniz","Empty order":"Boş sipariş","You don't have any items in your order":"Siparişinizde hiç bir ürün yok","Add items":"Ürün ekle",Subtotal:"Toplam",Events:"Olaylar"},nl:{viewOrder:"Bestelling bekijken",removeFromOrder:"Uit bestelling verwijderen",updateOrder:"Bestelling bijwerken",addToOrder:"Aan bestelling toevoegen","Your order":"Uw bestelling","Empty order":"Lege bestelling","You don't have any items in your order":"U heeft geen items in uw bestelling","Add items":"Items toevoegen",Subtotal:"Totaal",Events:"Gebeurtenissen"},et:{viewOrder:"Vaata tellimust",removeFromOrder:"Eemalda tellimusest",updateOrder:"Uuenda tellimust",addToOrder:"Lisa tellimusele","Your order":"Teie tellimus","Empty order":"Tühi tellimus","You don't have any items in your order":"Teie tellimuses pole ühtegi eset","Add items":"Lisa esemeid",Subtotal:"Kokku",Events:"Sündmused"},pl:{viewOrder:"Zobacz zamówienie",removeFromOrder:"Usuń z zamówienia",updateOrder:"Zaktualizuj zamówienie",addToOrder:"Dodaj do zamówienia","Your order":"Twoje zamówienie","Empty order":"Puste zamówienie","You don't have any items in your order":"Nie masz żadnych pozycji w zamówieniu","Add items":"Dodaj przedmioty",Subtotal:"Suma",Events:"Wydarzenia"},ru:{viewOrder:"Посмотреть заказ",removeFromOrder:"Удалить из заказа",updateOrder:"Обновить заказ",addToOrder:"Добавить в заказ","Your order":"Ваш заказ","Empty order":"Пустой заказ","You don't have any items in your order":"В вашем заказе нет товаров","Add items":"Добавить товары",Subtotal:"Итого",Events:"События"}},tt=e=>{const{language:t}=me(),a=e||t;return{t:e=>{var t;return(null===(t=et[a])||void 0===t?void 0:t[e])||e}}},at=()=>{const{cart:e}=$e();return Object.values(e||{}).reduce(((e,t)=>e+t.quantity),0)};var rt={container:"Quantity-module_container__01ySb",quantityAction:"Quantity-module_quantityAction__wRV2F",quantityValue:"Quantity-module_quantityValue__BBpyw",isDisabled:"Quantity-module_isDisabled__crQCf",sm:"Quantity-module_sm__0Hgp2",md:"Quantity-module_md__hu7a8",lg:"Quantity-module_lg__GA4jn",flexWide:"Quantity-module_flexWide__R95Jw",slidein:"Quantity-module_slidein__5yeWf",fadeInOut:"Quantity-module_fadeInOut__cllco",heightAnimation:"Quantity-module_heightAnimation__dhOgA",fadein:"Quantity-module_fadein__Cof2o",floatAnimation:"Quantity-module_floatAnimation__DSqQr",bottomSheet:"Quantity-module_bottomSheet__5-5iY",slideRightToLeft:"Quantity-module_slideRightToLeft__cjDHk"};const it=({isDecreaseDisabled:a=!1,quantity:r=1,size:i="md",onIncrease:n,onDecrease:l})=>t(g,{className:o(rt,{container:!0},[rt[i]]),justifyContent:"space-between",gap:0,children:[e("div",{className:o(rt,{quantityAction:!0,isDisabled:a}),onClick:l,children:e(y,{icon:U})}),e("div",{className:rt.quantityValue,children:r}),e("div",{className:rt.quantityAction,onClick:n,children:e(y,{icon:M})})]}),nt=({product:a,onClose:o})=>{const{language:l,currency:d}=me(),{addProduct:_,updateProduct:h}=$e(),[p,v]=c(1),[f,y]=c(!1),b=s(),{t:P}=tt(),C=(e=>{var t;const{cart:a}=$e();return r(a)||!e?0:(null===(t=a[e])||void 0===t?void 0:t.quantity)||0})(null==a?void 0:a.id),{name:A,description:N}=m((()=>Be(a,l)),[a,l]),{totalPrice:w,formattedTotalPrice:S}=m((()=>Ye(a,d,l)),[a,d,l]),D=m((()=>p*w),[p,w]),T=m((()=>n(D,d,l)),[D,d,l]),z=f?0===p:1===p,R=m((()=>P(f?0===p?"removeFromOrder":"updateOrder":"addToOrder")),[f,p]);u((()=>{v(C>0?C:1),y(C>0)}),[C,a]);const G=e=>{-1===e&&z||v((t=>Math.max(0,t+e)))};if(r(a))return null;const{image1024:x,volume:j}=a;return e("div",{className:Je.container,onClick:e=>{var t,a;(null===(a=null===(t=null==b?void 0:b.current)||void 0===t?void 0:t.contains)||void 0===a?void 0:a.call(t,null==e?void 0:e.target))||o&&o()},children:e(k,{onClose:o,ref:b,noBodyPadding:!0,size:"small",content:t("div",{className:Je.content,children:[t(I,{gap:0,children:[x&&e(Te,{src:re(x),width:1024,height:400,alt:A||"product",className:Je.image}),t(I,{className:Je.details,gap:1,children:[e("h2",{className:Je.name,children:A}),t(g,{justifyContent:"space-between",children:[e("div",{className:Je.price,children:S}),e("div",{className:Je.volume,children:j})]}),e("div",{className:Je.description,children:N})]})]}),e("div",{className:Je.close,children:e(O,{onClick:o,icon:$})})]}),footer:t(g,{className:Je.addToCart,gap:.5,children:[e(it,{isDecreaseDisabled:z,onDecrease:()=>G(-1),onIncrease:()=>G(1),quantity:p}),e(L,{className:Je.addAction,label:t(g,{fullWidth:!0,justifyContent:"space-between",children:[e("span",{className:Je.actionTitle,children:R}),e("span",{children:T})]}),onClick:()=>{f?h(a,p):(_(a,p),i(ve,{name:A,quantity:p})),o&&o()},size:"xl",fullWidth:!0})]})})})};var ot="Cart-module_container__3KQtx",lt="Cart-module_content__rkiZa",dt={container:"CartStepper-module_container__4CF1L",count:"CartStepper-module_count__E-RBg",actionText:"CartStepper-module_actionText__-rVKA",totalPrice:"CartStepper-module_totalPrice__QboRN",isClickable:"CartStepper-module_isClickable__mDptU",flexWide:"CartStepper-module_flexWide__eXxCr",slidein:"CartStepper-module_slidein__d5JQ-",fadeInOut:"CartStepper-module_fadeInOut__pS8nn",heightAnimation:"CartStepper-module_heightAnimation__7-e5Z",fadein:"CartStepper-module_fadein__-Ba0-",floatAnimation:"CartStepper-module_floatAnimation__rq6zX",bottomSheet:"CartStepper-module_bottomSheet__1wHHD",slideRightToLeft:"CartStepper-module_slideRightToLeft__0KLAo"};const ct=({actionText:a,onClick:r})=>{const i=at(),{formattedTotalPrice:l}=(()=>{const{cart:e}=$e(),{currency:t,language:a}=me(),r=Object.values(e||{}).reduce(((e,{price:t,quantity:a,vat:r})=>e+qe(t,a,r)),0);return{totalPrice:r,formattedTotalPrice:n(r,t,a)}})();return t(b,{className:o(dt,{container:!0,isClickable:!!r}),justifyContent:"space-between",alignItems:"center",onClick:r,children:[e(b.Item,{flex:1,children:t(g,{alignItems:"center",children:[e("div",{className:dt.count,children:i}),e("div",{className:dt.actionText,children:a})]})}),e(b.Item,{className:dt.totalPrice,flex:1,children:l})]})},st=()=>{const{setIsCartOpen:t}=$e(),{t:a}=tt();return at()<=0?null:e("div",{className:ot,children:e("div",{className:lt,children:e(ct,{onClick:()=>t(!0),actionText:a("viewOrder")})})})};var ut={container:"CartDrawer-module_container__zvapw",content:"CartDrawer-module_content__ELSiG",flexWide:"CartDrawer-module_flexWide__ySgY-",slidein:"CartDrawer-module_slidein__XC9AW",fadeInOut:"CartDrawer-module_fadeInOut__w9h6X",heightAnimation:"CartDrawer-module_heightAnimation__tBgkj",fadein:"CartDrawer-module_fadein__QNPoQ",floatAnimation:"CartDrawer-module_floatAnimation__nZWoY",bottomSheet:"CartDrawer-module_bottomSheet__m0wy7",slideRightToLeft:"CartDrawer-module_slideRightToLeft__gpixh"},mt="CartItem-module_container__At7lj",_t="CartItem-module_image__D-zzG",ht="CartItem-module_data__Lo3Fb",gt="CartItem-module_name__EksZu",pt="CartItem-module_price__yJxl6";const vt=e=>{var t;const{products:a}=me();return(null===(t=null==a?void 0:a.find)||void 0===t?void 0:t.call(a,(({id:t})=>t===e)))||{}},ft=({productId:t,min:a=1,size:r="md"})=>{const i=(e=>{const{cart:t}=$e(),a=t[e];return(null==a?void 0:a.quantity)||1})(t),n=vt(t),{updateProduct:o}=$e();return e(it,{isDecreaseDisabled:i===a,onDecrease:()=>o(n,i-1),onIncrease:()=>o(n,i+1),quantity:i,size:r})},yt=({item:a})=>{const{productId:r,quantity:i}=a||{},n=vt(r),{language:o,currency:l}=me(),{image160:d}=n,{name:c}=m((()=>Be(n,o)),[n,o]),{formattedTotalPrice:s}=m((()=>Ye(n,l,o,i)),[n,l,o,i]);return t(g,{className:mt,gap:1,alignItems:"center",children:[d&&e(Te,{src:re(d),alt:c||"menu",className:_t,loading:"lazy",width:80,height:45}),t("div",{className:ht,children:[e("div",{className:gt,children:c}),e("div",{className:pt,children:s})]}),e(ft,{productId:r,size:"sm",min:0})]})},bt=()=>{const{isCartOpen:a,cart:i,setIsCartOpen:n}=$e(),o=s(),{t:l}=tt(),d=r(i),c=()=>n(!1);return a?e("div",{className:ut.container,onClick:e=>{var t,a;(null===(a=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.contains)||void 0===a?void 0:a.call(t,null==e?void 0:e.target))||c()},children:e(S,{ref:o,onClose:c,isOpen:a,title:l("Your order"),content:e("div",{className:ut.content,children:d?e((()=>t(I,{className:ut.noItems,fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",gap:0,children:[e(w,{variant:"h2",children:l("Empty order")}),e(D,{text:l("You don't have any items in your order")})]})),{}):e("div",{className:ut.items,children:Object.keys(i||{}).map((t=>e(yt,{item:i[t]},t)))})}),footer:d?e(L,{label:l("Add items"),onClick:c,type:N.PRIMARY,size:"xl",fullWidth:!0}):e(ct,{actionText:l("Subtotal")})})}):null},It=_((({categoryProductMap:a=[],currency:r,language:n,productBlocksRef:o,containerRef:l,onCategoryInView:d})=>{const[s,m]=c(null),[_,h]=c(Fe.LIST),p=[{icon:V,type:Fe.LIST},{icon:Z,type:Fe.GRID}],v=e=>{const{name:t}=Be(e,n);i(pe,{name:t}),m(e)};return u((()=>{const e=new IntersectionObserver((e=>{var t;const a=((null===(t=null==l?void 0:l.current)||void 0===t?void 0:t.clientHeight)||1e3)/2;let r=null,i=1/0;e.forEach((e=>{if(e.isIntersecting){const t=e.boundingClientRect,n=t.top+t.height/2,o=Math.abs(n-a);o<i&&(i=o,r=e.target.getAttribute("data-category-id"))}})),r&&d(Number(r))}),{threshold:.1});return Object.entries(o.current||{}).forEach((([t,a])=>{a&&(a.setAttribute("data-category-id",t),e.observe(a))})),()=>{e.disconnect()}}),[o,l]),e(Ue,{children:t("div",{className:je,children:[e(g,{className:We,alignItems:"center",children:p.map((({icon:t,type:a})=>e(O,{icon:t,onClick:()=>h(a),type:a===_?N.PRIMARY:N.DEFAULT},a)))}),e(I,{children:(a||[]).map((a=>{const{name:i}=ye(a,n),{id:l,products:d}=a;return t("div",{className:Ee,ref:e=>o.current[l]=e,"data-category-id":l,children:[e("h2",{className:He,children:i}),e("div",{className:Qe,children:e(I,{gap:0,children:(d||[]).map((t=>_===Fe.GRID?e(Xe,{product:t,currency:r,language:n,onClick:()=>v(t)},t.id):e(Ze,{product:t,currency:r,language:n,onClick:()=>v(t)},t.id)))})})]},l)}))}),e(nt,{product:s,onClose:()=>m(null)}),e(st,{}),e(bt,{})]})})}),((e,t)=>e.categoryProductMap===t.categoryProductMap&&e.currency===t.currency&&e.language===t.language));var Pt="Branches-module_branches__sOuoV",Ct="Branches-module_list__vYoT2",At="Branches-module_name__K0Z-4";const Nt=({branches:t=[],rootPath:a="",onBranchSelect:r})=>{const i=({children:t,id:i})=>r?e("div",{onClick:()=>r(i),children:t}):e("a",{href:`${a}/${i}`,children:t});return e("div",{className:Pt,children:e(T,{className:Ct,children:t.map((({id:t,name:a})=>e(i,{id:t,children:e(z,{noBottomMargin:!0,children:e(b,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e("h2",{className:At,children:a})})})},t)))})})},wt=({data:n})=>{var o;const{name:l,coverImage:d,logoImage:u,branches:m=[],branchId:_,language:h,categories:g,products:p,currency:v,instagram:f,facebook:y,whatsapp:b,telegram:I,tiktok:P,rootPath:C,hostname:A,onBranchSelect:N}=n||{},w=m.length<=1,O=((e,t)=>{const a=t.reduce(((e,t)=>{const a=Number(t.categoryId);return e[a]||(e[a]=[]),e[a].push(t),e}),{});return e.map((e=>Object.assign(Object.assign({},e),{products:a[Number(e.id)]||[]}))).filter((e=>{var t;return(null===(t=null==e?void 0:e.products)||void 0===t?void 0:t.length)>0}))})(g,p),k=(()=>{var e;return w?(null===(e=null==m?void 0:m[0])||void 0===e?void 0:e.id)?m[0]:{}:m.find((e=>e.id===Number(_)))})(),L=w||!(null==k?void 0:k.name)?l:(null==k?void 0:k.name)||"",[S,D]=c(null===(o=null==g?void 0:g[0])||void 0===o?void 0:o.id),T=s({}),z=s(null),R=s(!0),{url:G,domain:x}=((e,t)=>{const a=ce.includes(e)?e:de;return{url:`https://${a}/${t||"en"}`,domain:a}})(A,h);return t("div",{className:J,ref:z,children:[e(Ge,{branch:k,name:L,coverImage:ne(d),logoImage:ie(u),instagram:f,facebook:y,whatsapp:b,telegram:I,tiktok:P}),w||_?t(a,{children:[e(xe,{categoryProductMap:O,language:h,selectedCategoryId:S,onSelectCategory:e=>X(void 0,void 0,void 0,(function*(){R.current=!1,D(e),(e=>{var t;const a=null===(t=null==T?void 0:T.current)||void 0===t?void 0:t[e];a&&(setTimeout((()=>{a.scrollIntoView({behavior:"smooth",block:"start"})}),100),setTimeout((()=>{R.current=!0}),1e3))})(e)}))}),e(It,{currency:v,language:h,productBlocksRef:T,containerRef:z,categoryProductMap:O,onCategoryInView:e=>{if(!(null==R?void 0:R.current))return;const t=((e,t,a)=>{var i;const n=null===(i=null==t?void 0:t.find)||void 0===i?void 0:i.call(t,(({id:t})=>t===e));if(r(n))return"";const{name:o}=ye(n,a);return o})(e,g,h);i(ge,{name:t}),D(e)}})]}):e(Nt,{branches:m,onBranchSelect:N,rootPath:C}),!!A&&e("a",{rel:"noopener",target:"_blank",href:G,className:te,children:x})]})},Ot=({data:t})=>e(ue,{value:t,children:e(wt,{data:t})});var kt={};const Lt=({currentGoal:t,language:a,setGoal:r})=>{const{t:i}=tt(a),n=s({}),o=e=>{switch(e){case ge:return i("Scrolled to Category");case he:return i("Category Selected");case pe:return i("Product Details");case ve:return i("Product Added to Cart");default:return""}},l=h((e=>{var t,a;r(e),null===(a=null===(t=null==n?void 0:n.current)||void 0===t?void 0:t.close)||void 0===a||a.call(t)}),[r]);return e(R,{action:o(t),actionSize:"large",type:N.BORDERED_PRIMARY,closeRef:n,menu:e("div",{className:kt.toolbarMenu,children:fe.map((t=>e(G,{onClick:()=>l(t),children:o(t)},t)))})})},St=({data:t,isLoading:a=!1,loadingImage:r,language:i,goal:n,setGoal:o})=>{const{t:l}=tt(i);return e(z,{title:l("Events"),toolbar:e(Lt,{language:i,currentGoal:n,setGoal:o}),children:a?e(x,{image:r}):e(j,{data:t})})};export{St as Events,Ot as PublicMenu};
2
2
  //# sourceMappingURL=index.esm.js.map