PageSourceSearch

https://grillwood.pro/static/resources/SabyGetMenu/Widgets/Buttons…?x_module=e835269983ed9c7ba744f238a819cb6d

js grillwood.pro collected 2026-10-02 02:08:44 UTC 9,086 bytes, 1 lines download raw bytes

1define("SabyGetMenu/Widgets/Buttons",["require","exports","react/jsx-runtime","react","Frame-DataEnv/dataLoader","SabyGetConstructor/Helpers","SabyGetMenu/Helpers","SabyGetMenu/constants","SabyGetShop/constants","SabyGetCore/constants","SabyGetCore/constants","Controls-DataEnv/context","UI/Async","I18n/i18n","UI/Adaptive","SabyGetConstructor/WidgetConfigConnect","WNCSabyGet/basketUtils","Browser/Transport","Router/router","css!SabyGetMenu/Widgets/Buttons/styles"],(function(e,t,n,o,i,s,a,l,r,u,d,c,g,y,b,S,p,m,v){"use strict";function B(e){const{orderItems:t,identifier:i,className:s,buttonStyleSettings:a,clickable:l}=e,r=(0,o.useMemo)((()=>(0,g.lazy)((()=>(0,g.importer)("SabyGetPurchases/waiter:Button")))),[]),u=t&&t.getMetaData(),d=!(!t||!t.getCount()),c=u&&u.waiter;return(0,n.jsx)(r,{buttonStyleSettings:a,captionPosition:null==a?void 0:a.captionPosition,caption:null==a?void 0:a.caption,waiterData:c,identifier:i,className:s,clickable:l,readOnly:!1,viewMode:c&&d?"info":"primary",backgroundMode:"transparent"})}function h(e){const{record:t,netSiteId:i,regionId:s,netPointId:a,branchId:l,orderSource:r,className:u,buttonClassName:d,isPhone:c,isDesignMode:y,buttonStyleSettings:b,clickable:S}=e,p=(0,o.useMemo)((()=>(0,g.lazy)((()=>(0,g.importer)("SabyGetShop/Controls/OrderButton")))),[]),m=(0,o.useMemo)((()=>({booking:{visibleField:"BookingButtonEnabled",...c?{title:void 0,icon:"icon-Calendar"}:{}}})),[c]);return(0,n.jsx)(p,{buttonStyleSettings:b,caption:null==b?void 0:b.caption,icon:null==b?void 0:b.icon,record:t,netSiteId:i,regionId:s,netPointId:a,branchId:l,orderSource:r,className:u,buttonClassName:d,widgetsConfig:m,isDesignMode:y,clickable:S,showChat:!1,mobileView:c,orderButtonVisible:!1,deliveryButtonVisible:!1,appointmentButtonVisible:!1,roomsButtonVisible:!1,simpleView:!0})}function f(e){const{record:t,orderData:i,identifier:s,orderSource:a,onBasketFilledChanged:l,clickable:u,className:d,buttonClassName:c,buttonStyleSettings:y,timestamp:b,waiterButtonVisible:S,onPanelOpenStateChanged:p}=e,m=(0,o.useMemo)((()=>(0,g.lazy)((()=>(0,g.importer)("SabyGetShop/tableOrders:Button")))),[]);return(0,n.jsx)(m,{buttonStyleSettings:y,captionPosition:null==y?void 0:y.captionPosition,icon:null==y?void 0:y.icon,orderData:i,identifier:s,orderSource:a,timestamp:b,re
1cord:t,className:d,buttonClassName:c,waiterButtonVisible:S,onBasketFilledChanged:l,onPanelOpenStateChanged:p,clickable:u,readOnly:!1,mode:"menu",priceType:r.CatalogPriceType.menu,waiterButtonBackgroundMode:"transparent",openPanelImmediately:!0})}function k(e){var t;const{record:i,pointId:s,isPhone:a,showEmptyCaption:r,clickable:u,...d}=e,b=(0,o.useMemo)((()=>(0,g.lazy)((()=>(0,g.importer)("WNCSabyGet/Buttons/Double")))),[]),S=null===(t=(0,c.useSlice)(l.PRELOADING_DATA.DELIVERY_MAP))||void 0===t?void 0:t.state;return(0,n.jsx)(b,{...d,forceEnableOrder:!u,deliveryCfg:S,shopRecord:i,mobileView:a,readOnly:!1,fontColorStyle:"default",iconStyle:"default",useControlFontSize:!1,basketPopupOffset:P,pointId:s,showBasketAuthDialog:!0,showEmptyCaption:r,useOrderEnabled:!0,currency:y.controller.currentLocaleConfig.money.symbol,currencyStyle:"default"})}function M(e){const{slice:t,record:o}=(0,s.useShopRecord)(),{isShop:a,isDesign:l}=e,r=(0,i.useDataMode)(),u=l||"demo"===r;if(!(a||u||o&&(null==o?void 0:o.get("@Заведение"))))return null;else return(0,n.jsx)(I,{...e,isDesign:u,shopRecord:t,shopRecordInst:o})}function I(e){var t,i,y,S;const{className:M,sticky:I=!0,clickable:C=!0,isShop:P,shopRecord:w,shopRecordInst:N,chatButtonStyleSettings:D,doubleButtonStyleSettings:T,bookingButtonStyleSettings:O,orderButtonStyleSettings:E,waiterButtonStyleSettings:G,isDesign:_}=e,{data:x}=(null===(t=(0,c.useSlice)(l.NET_INFO_SLICE))||void 0===t?void 0:t.state)||{},j=(0,v.useRouter)().maskResolver.calculateUrlParams("chain=:chain"),R=!!(null==j?void 0:j.chain),W=null==x?void 0:x.get("IsNet"),A=!!m.URL.getQueryParam("isSnapshot"),F=null==x?void 0:x.get("BranchData"),L=W?null==x?void 0:x.get("SiteId"):null,V=W?null===(i=null==x?void 0:x.get("LocalityData"))||void 0===i?void 0:i.get("Id"):null,H=W?null===(y=null==x?void 0:x.get("LocalityData"))||void 0===y?void 0:y.get("Parent"):null,z=W&&x.get("DifferentPrices")?null==F?void 0:F.get("ТочкаПродаж"):null,U=W&&R?null==F?void 0:F.get("Идентификатор"):null,Y=(0,c.useSlice)("orderData"),q=(null==Y?void 0:Y.state)||{},{availableServices:Q,identifier:J,orderTimestamp:K,items:X,siteType:Z}=q,$=Z===d.MenuPageType.menu,ee=Z===d.MenuPageType.franchise_delivery,te=Z===d.MenuPageType.delivery||ee,ne=Z===d.MenuPageType.sabyservice,oe=(0,b.useAdaptiveMode)(),ie=oe.device.isPhone(),se=oe.device.isTablet(),ae=(0,a.getShopType)({initialShopType:null==N?void 0:N.get("ShopType"),shopTypeFlags:null==N?void 0:N.get("ТипЗаведения"),widgetFlags:null==N?void 0:N.get("Флаги"),siteType:Z,isDesign:_}),le=null===(S=(0,c.useSlice)(l.SETTINGS_SLICE))||void 0===S?void 0:S.state,re=!(null==le?void 0:le.get("OrderFromCatalog")),[ue,de]=(0,o.useState)(null),ce=u.OrderSource[Z],ge=(0,o.useCallback)((e=>{if(q){const t={...q};t.basketState.isBasketFilled=e,null==Y||Y.setState(t)}}),[q,Y]),ye=(0,s.useWaiterButtonVisible)(!!_),be=(0,o.useMemo)((()=>{const e=(0,s.getOrderSettings)(Q).isTableOrderMode&&!!(null==w?void 0:w.get("IsRestaurant")),t=!P&&ye&&(_||se),n=!P&&$&&(_||e&&(se||ie)),o=P||(te||ne)&&(_||function(e,t){if(t===d.SHOP_TYPE.RESTAURANT)return e.get("DeliveryButtonEnabled");if(t===d.SHOP_TYPE.SHOP)return e.get("OrderButtonEnabled");if(t===d.SHOP_TYPE.SALON)return e.get("AppointmentButtonEnabled");else return!1}(w,ae)),i=P||_||(null==w?void 0:w.get("ЕстьЧат")),a=!P&&te&&!ee&&(_||(null==w?void 0:w.get("BookingButtonEnabled")));return{chat:i,order:n,basket:o,waiter:t,waiterInOrder:ye,booking:a}}),[Q,te,ee,ne,w,ae,se,P,re,_]),Se=(0,o.useMemo)((()=>{const e=A?r.CatalogPriceType.menu:r.CatalogPriceType[Z],t=U||(null==N?void 0:N.get("Идентификатор")),n=(null==N?void 0:N.get("AdditionalSalePoint"))?null==N?void 0:N.get("ТочкаПродаж"):void 0,o=(0,p.getBasketHistoryId)({priceListType:e,shopType:ae,uuid:t,salePoint:n});return{priceListType:e,shopType:ae,uuid:t,historyId:o,basketWidgetOptions:{pointId:n,regionId:V,parentRegionId:H,netPointId:z,netSiteId:L}}}),[Z,N,ae,U,z,L,V,A]),[pe,me]=(0,o.useState)((()=>{var e;return!!(null===(e=(0,p.getBasketStoreState)(Se.basketHistoryId))||void 0===e?void 0:e.isBasketFilled)})),ve=(0,o.useMemo)((()=>be.basket&&(0,n.jsx)(k,{className:"controls-margin_left-m",buttonClassName:"double-button-style-settings",onBasketFilledChanged:e=>{me(e)},...Se,...T,isPhone:ie,record:N,isMenu:$,netPointId:z,pointId:z,isDelivery:te,branchId:U,noBasketButton:re,showEmptyCaption:!ne||re,orderSource:ce,clickable:C})),[be.basket,ie,te,ne,Se,C,N,re,ce,$,T]),Be=(0,o.useMemo)((()=>be.waiter&&(0,n.jsx)(B,{className:"controls-margin_left-m waiter-button-style-settings",buttonStyleSettings:G,identifier:J,orderItems:X,clickable:C})),[be.waiter,J,X,G,C]),he=(0,o.useMemo)((()=>!(pe&&ie)&&be.booking&&(0,n.jsx)(h,{buttonClassName:"booking-button-style-settings",buttonStyleSettings:O,isPhone:ie,record:N,netSiteId:L,regionId:V,netPointId:z,branchId:U,orderSource:ce,isDesignMode:_,clickable:C})),[be.booking,pe,ie,_,N,ce,O,C]),fe=(0,o.useMemo)((()=>{const e=(0,g.lazy)((()=>(0,g.importer)("SabyGetCore/chatButton:ChatButton")));return!(pe&&ie)&&be.chat&&(0,n.jsx)(e,{className:"controls-margin_left-m chat-button-style-settings",iconSize:"empty",buttonStyleSettings:D,record:N,isPhone:ie,clickable:C})}),[be.chat,pe,N,ie,D,C]),ke=(0,o.useMemo)((()=>be.order&&(0,n.jsx)(f,{className:"controls-margin_left-m",buttonClassName:"order-button-style-settings",buttonStyleSettings:E,orderData:q,orderSource:ce,record:N,timestamp:K,waiterButtonVisible:be.waiterInOrder,identifier:J,clickable:C,onBasketFilledChanged:ge,onPanelOpenStateChanged:de})),[be.order,be.waiterInOrder,q,ce,N,K,J,E,C]),Me=(0,o.useMemo)((()=>(0,n.jsx)("div",{className:"sg-DMenuButtons__container tw-flex tw-w-full tw-justify-end",children:(0,n.jsxs)("div",{className:"sg-DMenuButtons__buttons tw-flex",children:[Be,ve,he,fe,ke]})})),[Be,ve,fe,ke,he]),Ie=(0,o.useMemo)((()=>{const e=["sg-DMenuButtons",I&&!_?"tw-sticky":"","tw-flex","tw-flex-shrink-0","tw-justify-end",P?"controls-padding-m":"controls-padding_top-s controls-padding_bottom-s",M];if("boolean"==typeof ue)e.push("sg-DMenuButtons__fade-"+(ue?"off":"on"));return e.join(" ")}),[I,ue,C,M,P,_]);if(!(Be||ve||fe||ke||he))return null;else return(0,n.jsx)("div",{className:Ie,children:Me})}var C;
1Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Booking=0]="Booking",e[e.Delivery=1]="Delivery",e[e.Menu=2]="Menu"}(C||(C={}));const P={vertical:12};B.displayName="SabyGetMenu/Widgets/Buttons.WaiterButton",h.displayName="SabyGetMenu/Widgets/Buttons.BookingButton",f.displayName="SabyGetMenu/Widgets/Buttons.OrderButton",k.displayName="SabyGetMenu/Widgets/Buttons.BasketButton",M.displayName="SabyGetMenu/Widgets/Buttons",I.displayName="SabyGetMenu/Widgets/Buttons.MenuButtons",t.default=(0,S.default)(M,"menuButtons")}));

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.