"use strict";(self.webpackChunkNexoPOS_4x=self.webpackChunkNexoPOS_4x||[]).push([[3670],{3670:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var r=s(2242),n=s(6650);const i={name:"ns-pos-delivery-button",methods:{__:s(7389).__,openPendingOrdersPopup:function(){new r.G({primarySelector:"#pos-app",popupClass:"shadow-lg bg-white w-3/5 md:w-2/3 lg:w-2/5 xl:w-2/4"}).open(n.default)}}};const c=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("button",{staticClass:"flex-shrink-0 h-12 flex items-center shadow rounded px-2 py-1 text-sm",on:{click:function(t){return e.openPendingOrdersPopup()}}},[s("i",{staticClass:"mr-1 text-xl las la-truck"}),e._v(" "),s("span",[e._v(e._s(e.__("Order Type")))])])}),[],!1,null,null,null).exports},6650:(e,t,s)=>{s.r(t),s.d(t,{default:()=>o});var r=s(7757),n=s.n(r),i=s(6386);function c(e,t,s,r,n,i,c){try{var l=e[i](c),o=l.value}catch(e){return void s(e)}l.done?t(o):Promise.resolve(o).then(r,n)}const l={data:function(){return{types:[],typeSubscription:null}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.resolveIfQueued(!1)})),this.typeSubscription=POS.types.subscribe((function(t){e.types=t,1===Object.values(e.types).length&&e.select(Object.keys(e.types)[0])}))},destroyed:function(){this.typeSubscription.unsubscribe()},methods:{__:s(7389).__,resolveIfQueued:i.Z,select:function(e){var t,s=this;return(t=n().mark((function t(){var r;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Object.values(s.types).forEach((function(e){return e.selected=!1})),s.types[e].selected=!0,r=s.types[e],t.prev=3,t.next=6,POS.triggerOrderTypeSelection(r);case 6:t.sent,POS.types.next(s.types),s.resolveIfQueued(r),t.next=13;break;case 11:t.prev=11,t.t0=t.catch(3);case 13:case"end":return t.stop()}}),t,null,[[3,11]])})),function(){var e=this,s=arguments;return new Promise((function(r,n){var i=t.apply(e,s);function l(e){c(i,r,n,l,o,"next",e)}function o(e){c(i,r,n,l,o,"throw",e)}l(void 0)}))})()}}};const o=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-full w-4/5-screen md:w-2/5-screen lg:w-2/5-screen xl:w-2/6-screen bg-surface-tertiary shadow-lg"},[s("div",{staticClass:"h-16 flex justify-center items-center",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold text-primary"},[e._v(e._s(e.__("Define The Order Type")))])]),e._v(" "),0===Object.values(e.types).length?s("div",{staticClass:"grid grid-flow-row grid-cols-1 grid-rows-1"},[s("div",{staticClass:"h-full w-full flex items-center justify-center flex-col"},[s("i",{staticClass:"las la-frown text-7xl text-error-primary"}),e._v(" "),s("div",{staticClass:"p-4 md:w-2/3"},[s("p",{staticClass:"text-center text-secondary"},[e._v(e._s(e.__("No payment type has been selected on the settings. Please check your POS features and choose the supported order type")))]),e._v(" "),s("div",{staticClass:"flex justify-center py-1"},[s("ns-link",{attrs:{target:"_blank",type:"info",href:"https://my.nexopos.com/en/documentation/components/order-types"}},[e._v(e._s(e.__("Read More")))])],1)])])]):e._e(),e._v(" "),Object.values(e.types).length>0?s("div",{staticClass:"grid grid-flow-row grid-cols-2 grid-rows-2"},e._l(e.types,(function(t){return s("div",{key:t.identifier,staticClass:"hover:bg-info-primary h-56 flex items-center justify-center flex-col cursor-pointer border border-surface-secondary",class:t.selected?"bg-info-primary":"",on:{click:function(s){return e.select(t.identifier)}}},[s("img",{staticClass:"w-32 h-32",attrs:{src:t.icon,alt:""}}),e._v(" "),s("h4",{staticClass:"font-semibold text-xl my-2 text-primary"},[e._v(e._s(t.label))])])})),0):e._e()])}),[],!1,null,null,null).exports}}]);