From 99659077b06b3e4c6393c7264fa79349ba2017a8 Mon Sep 17 00:00:00 2001 From: blair2004 Date: Wed, 1 Mar 2023 11:47:00 +0100 Subject: [PATCH] Changelog: ======== - Fixed: wrong option name used for printing paid orders --- config/nexopos.php | 2 +- public/js/app.min.js | 2 +- public/js/auth.min.js | 2 +- public/js/bootstrap.min/117.js | 2 +- public/js/bootstrap.min/186.js | 1 + public/js/bootstrap.min/204.js | 2 +- public/js/bootstrap.min/298.js | 1 + public/js/bootstrap.min/399.js | 2 +- public/js/bootstrap.min/413.js | 1 + public/js/bootstrap.min/465.js | 1 + public/js/bootstrap.min/493.js | 1 + public/js/bootstrap.min/521.js | 2 +- public/js/bootstrap.min/537.js | 2 +- public/js/bootstrap.min/58.js | 1 + public/js/bootstrap.min/59.js | 2 +- public/js/bootstrap.min/694.js | 1 + public/js/bootstrap.min/701.js | 1 + public/js/bootstrap.min/730.js | 2 +- public/js/bootstrap.min/901.js | 1 + public/js/bootstrap.min/939.js | 2 +- public/js/bootstrap.min/945.js | 2 +- public/js/bootstrap.min/967.js | 2 +- public/js/manifest.js | 2 +- public/js/popups.min.js | 2 +- public/js/pos-init.min.js | 2 +- public/js/pos.min.js | 2 +- public/js/setup.min.js | 2 +- public/js/update.min.js | 2 +- public/js/vendor.js | 2 +- public/mix-manifest.json | 18 +++++++++--------- resources/ts/pos-init.ts | 2 +- 31 files changed, 39 insertions(+), 30 deletions(-) create mode 100644 public/js/bootstrap.min/186.js create mode 100644 public/js/bootstrap.min/298.js create mode 100644 public/js/bootstrap.min/413.js create mode 100644 public/js/bootstrap.min/465.js create mode 100644 public/js/bootstrap.min/493.js create mode 100644 public/js/bootstrap.min/58.js create mode 100644 public/js/bootstrap.min/694.js create mode 100644 public/js/bootstrap.min/701.js create mode 100644 public/js/bootstrap.min/901.js diff --git a/config/nexopos.php b/config/nexopos.php index 5d0a6c86d..cfaae284e 100644 --- a/config/nexopos.php +++ b/config/nexopos.php @@ -1,7 +1,7 @@ '4.8.14', + 'version' => '4.8.15', 'languages' => [ 'en' => 'English', 'de' => 'Deutsch', diff --git a/public/js/app.min.js b/public/js/app.min.js index acf9dbf36..c19351280 100644 --- a/public/js/app.min.js +++ b/public/js/app.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[219,198],{6178:(e,t,n)=>{"use strict";var s=n(538),i=n(8829),r=(n(131),n(7166)),a=n.n(r),o=n(5675),l=n(1625),c=window.nsState,d=window.nsScreen,u=window.ns.cssFiles,f=window.nsExtraComponents,p={name:"_blank",specs:["fullscreen=yes","titlebar=yes","scrollbars=yes"],styles:["/css/".concat(u["app.css"]),"/css/".concat(u["light.css"]),"/css/".concat(u["grid.css"]),"/css/".concat(u["typography.css"])]};window.nsHotPress=new l.e,s.default.use(o.Z,p);var h=s.default.component("vue-apex-charts",a()),m=Object.assign(Object.assign({nsModules:function(){return n.e(333).then(n.bind(n,2333))},nsRewardsSystem:function(){return n.e(533).then(n.bind(n,1533))},nsCreateCoupons:function(){return n.e(588).then(n.bind(n,7588))},nsManageProducts:function(){return n.e(155).then(n.bind(n,3840))},nsSettings:function(){return n.e(914).then(n.bind(n,7353))},nsReset:function(){return n.e(517).then(n.bind(n,5517))},nsPermissions:function(){return n.e(496).then(n.bind(n,2496))},nsProcurement:function(){return n.e(204).then(n.bind(n,3204))},nsProcurementInvoice:function(){return n.e(716).then(n.bind(n,7716))},nsMedia:function(){return Promise.resolve().then(n.bind(n,1274))},nsDashboardCards:function(){return n.e(270).then(n.bind(n,4270))},nsCashierDashboard:function(){return n.e(987).then(n.bind(n,7987))},nsBestCustomers:function(){return n.e(352).then(n.bind(n,5352))},nsBestCashiers:function(){return n.e(458).then(n.bind(n,8458))},nsOrdersSummary:function(){return n.e(509).then(n.bind(n,509))},nsOrdersChart:function(){return n.e(522).then(n.bind(n,5522))},nsNotifications:function(){return n.e(665).then(n.bind(n,1665))},nsSaleReport:function(){return n.e(939).then(n.bind(n,9939))},nsSoldStockReport:function(){return n.e(967).then(n.bind(n,1967))},nsProfitReport:function(){return n.e(730).then(n.bind(n,9730))},nsCashFlowReport:function(){return n.e(537).then(n.bind(n,7537))},nsYearlyReport:function(){return n.e(59).then(n.bind(n,5059))},nsPaymentTypesReport:function(){return n.e(945).then(n.bind(n,4948))},nsBestProductsReport:function(){return n.e(521).then(n.bind(n,5521))},nsLowStockReport:function(){return n.e(399).then(n.bind(n,399))},nsStockAdjustment:function(){return n.e(114).then(n.bind(n,2114))},nsPromptPopup:function(){return n.e(33).then(n.bind(n,3033))},nsAlertPopup:function(){return n.e(634).then(n.bind(n,7634))},nsConfirmPopup:function(){return Promise.resolve().then(n.bind(n,914))},nsPOSLoadingPopup:function(){return n.e(409).then(n.bind(n,409))},nsOrderInvoice:function(){return n.e(69).then(n.bind(n,2069))},VueApexCharts:h},i),f);for(var v in m)void 0!==m[v].name&&"VueComponent"!==m[v].name&&s.default.component(m[v].name,m[v]);var b=new s.default({el:"#dashboard-aside",data:{sidebar:"visible"},components:m,mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))}});window.nsDashboardAside=b,window.nsDashboardOverlay=new s.default({el:"#dashboard-overlay",data:{sidebar:null},components:m,mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))},methods:{closeMenu:function(){c.setState({sidebar:"hidden"===this.sidebar?"visible":"hidden"})}}}),window.nsDashboardHeader=new s.default({el:"#dashboard-header",data:{menuToggled:!1,sidebar:"visible"},components:m,methods:{toggleMenu:function(){this.menuToggled=!this.menuToggled},toggleSideMenu:function(){["lg","xl"].includes(d.breakpoint),c.setState({sidebar:"hidden"===this.sidebar?"visible":"hidden"})}},mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))}}),window.nsComponents=Object.assign(m,i),window.nsDashboardContent=new s.default({el:"#dashboard-content",components:m})},7700:(e,t,n)=>{"use strict";n.d(t,{l:()=>Y,kq:()=>Z,ih:()=>z,kX:()=>H});var s=n(6486),i=n(8945),r=n(6300),a=n(8345),o=n(9093),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=Z.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),S=n(9020),E=n(7794);function P(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),N=new b({sidebar:["xs","sm","md"].includes(I.breakpoint)?"hidden":"visible"});z.defineClient(i.Z),window.nsEvent=Y,window.nsHttpClient=z,window.nsSnackBar=H,window.nsCurrency=S.W,window.nsTruncate=E.b,window.nsRawCurrency=S.f,window.nsAbbreviate=$,window.nsState=N,window.nsUrl=L,window.nsScreen=I,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=R},8829:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(7700),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n
\n \n \n \n {{ label }}\n \n {{ notification }}\n \n \n
\n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
\n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(3632),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(6979),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(4679),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(4110),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(1274),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),S=n(1272),E=n.n(S),P=n(5234),D=n.n(P),O=s.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:E().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),M=n(3164),A=n(9765),q=n(7757),V=n.n(q),Y=n(914),z=n(665),H=n(2830);const L={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:z.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var R=n(1900);const Z=(0,R.Z)(L,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var I=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const N={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(Y.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return I(this,void 0,void 0,V().mark((function e(){var t,n=this;return V().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(Z),e.next=4,new Promise((function(e,t){h.G.show(Z,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,R.Z)(N,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full text-sm h-10 px-3 outline-none border ns-crud-button",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(7751),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,R.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=n(328),J=n(2404),ee=n(4915),te=n(3502);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,R.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},4110:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(328),r=n(9765),a=n(3164),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n '})},9020:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},7794:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},4679:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3632:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},1625:(e,t,n)=>{"use strict";function s(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);nc});var c=function(){function e(){var t=this;a(this,e),this.listeners=new Object,document.addEventListener("keydown",(function(e){return t.processEvent(e)}))}return l(e,[{key:"processEvent",value:function(e){var t=this;for(var n in this.listeners){var s=this.listeners[n].getConfig();if(s.hidden.length>0)if(s.hidden.filter((function(e){return e instanceof HTMLElement==!1&&null===document.querySelector(e)})).length!==s.hidden.length)continue;if(s.visible.length>0)if(!(s.visible.filter((function(e){return e instanceof HTMLElement==!0||null!==document.querySelector(e)})).length===s.visible.length))continue;s.callbacks.forEach((function(e){"string"==typeof e.action?t.processSingleAction({action:e.action.trim(),callback:e.callback}):"object"===r(e.action)&&null!==e.action&&e.action.length>0&&e.action.forEach((function(n){t.processSingleAction({action:n.toString().trim(),callback:e.callback})}))}))}}},{key:"processSingleAction",value:function(e){var t=e.action,n=e.callback,s=t.split("+"),i={ctrlKey:!1,altKey:!1,shiftKey:!1};s.forEach((function(e){switch(e){case"ctrl":i.ctrlKey=!0;break;case"alt":i.altKey=!0;break;case"shift":i.shiftKey=!0}}));var r=s.filter((function(e){return!["ctrl","alt","shift"].includes(e)}));this.executeCallback({event,combinableKeys:i,callback:n,key:r[0]})}},{key:"executeCallback",value:function(e){var t=e.event,n=e.callback,s=e.combinableKeys,i=e.key;if(void 0!==t.key&&t.key.toLowerCase()===i.toLowerCase()){var r=!0;for(var a in s)t[a]!==s[a]&&(r=!1);r&&n(t,i)}}},{key:"create",value:function(e){return this.listeners[e]=new d}},{key:"destroy",value:function(e){delete this.listeners[e]}}]),e}(),d=function(){function e(){a(this,e),this.visible=[],this.hidden=[],this.callbacks=[]}return l(e,[{key:"whenVisible",value:function(e){var t;"object"===r(e)?(t=this.visible).push.apply(t,s(e)):this.visible.push(e);return this}},{key:"clearVisible",value:function(){return this.visible=[],this}},{key:"whenNotVisible",value:function(e){var t;e.length>0?(t=this.hidden).push.apply(t,s(e)):this.hidden.push(e);return this}},{key:"clearHidden",value:function(){return this.hidden=[],this}},{key:"whenPressed",value:function(e,t){this.callbacks.push({action:e,callback:t})}},{key:"clearCallbacks",value:function(){return this.callbacks=[],this}},{key:"getConfig",value:function(){return{callbacks:this.callbacks,hidden:this.hidden,visible:this.visible}}}]),e}()},665:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},2830:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},6979:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9093:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},131:(e,t,n)=>{"use strict";var s=n(381),i=n.n(s);ns.date.moment=i()(ns.date.current),ns.date.interval=setInterval((function(){ns.date.moment.add(1,"seconds"),ns.date.current=i()(ns.date.current).add(1,"seconds").format("YYYY-MM-DD HH:mm:ss")}),1e3),ns.date.getNowString=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e).format("YYYY-MM-DD HH:mm:ss")},ns.date.getMoment=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e)}},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":1793,"./ru.js":1793,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},328:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(3632));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},9765:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(3632).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},4915:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(3632).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},2404:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},7751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(3632);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3502:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},3164:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},1274:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(7700),a=n(665),o=n(3632),l=n(914);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},914:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(3632),i=n(2830),r=n(665);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=6178,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[219,198],{6178:(e,t,n)=>{"use strict";var s=n(538),i=n(3298),r=(n(131),n(7166)),a=n.n(r),o=n(5675),l=n(1625),c=window.nsState,d=window.nsScreen,u=window.ns.cssFiles,f=window.nsExtraComponents,p={name:"_blank",specs:["fullscreen=yes","titlebar=yes","scrollbars=yes"],styles:["/css/".concat(u["app.css"]),"/css/".concat(u["light.css"]),"/css/".concat(u["grid.css"]),"/css/".concat(u["typography.css"])]};window.nsHotPress=new l.e,s.default.use(o.Z,p);var h=s.default.component("vue-apex-charts",a()),m=Object.assign(Object.assign({nsModules:function(){return n.e(333).then(n.bind(n,2333))},nsRewardsSystem:function(){return n.e(694).then(n.bind(n,1694))},nsCreateCoupons:function(){return n.e(298).then(n.bind(n,298))},nsManageProducts:function(){return n.e(413).then(n.bind(n,4413))},nsSettings:function(){return n.e(914).then(n.bind(n,7353))},nsReset:function(){return n.e(517).then(n.bind(n,5517))},nsPermissions:function(){return n.e(496).then(n.bind(n,2496))},nsProcurement:function(){return n.e(204).then(n.bind(n,3204))},nsProcurementInvoice:function(){return n.e(716).then(n.bind(n,7716))},nsMedia:function(){return Promise.resolve().then(n.bind(n,9542))},nsDashboardCards:function(){return n.e(270).then(n.bind(n,4270))},nsCashierDashboard:function(){return n.e(987).then(n.bind(n,7987))},nsBestCustomers:function(){return n.e(352).then(n.bind(n,5352))},nsBestCashiers:function(){return n.e(458).then(n.bind(n,8458))},nsOrdersSummary:function(){return n.e(901).then(n.bind(n,7901))},nsOrdersChart:function(){return n.e(522).then(n.bind(n,5522))},nsNotifications:function(){return n.e(665).then(n.bind(n,1665))},nsSaleReport:function(){return n.e(939).then(n.bind(n,9939))},nsSoldStockReport:function(){return n.e(967).then(n.bind(n,1967))},nsProfitReport:function(){return n.e(730).then(n.bind(n,9730))},nsCashFlowReport:function(){return n.e(537).then(n.bind(n,7537))},nsYearlyReport:function(){return n.e(59).then(n.bind(n,5059))},nsPaymentTypesReport:function(){return n.e(945).then(n.bind(n,4948))},nsBestProductsReport:function(){return n.e(521).then(n.bind(n,5521))},nsLowStockReport:function(){return n.e(399).then(n.bind(n,399))},nsStockAdjustment:function(){return n.e(114).then(n.bind(n,2114))},nsPromptPopup:function(){return n.e(33).then(n.bind(n,3033))},nsAlertPopup:function(){return n.e(634).then(n.bind(n,7634))},nsConfirmPopup:function(){return Promise.resolve().then(n.bind(n,914))},nsPOSLoadingPopup:function(){return n.e(409).then(n.bind(n,409))},nsOrderInvoice:function(){return n.e(69).then(n.bind(n,2069))},VueApexCharts:h},i),f);for(var v in m)void 0!==m[v].name&&"VueComponent"!==m[v].name&&s.default.component(m[v].name,m[v]);var b=new s.default({el:"#dashboard-aside",data:{sidebar:"visible"},components:m,mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))}});window.nsDashboardAside=b,window.nsDashboardOverlay=new s.default({el:"#dashboard-overlay",data:{sidebar:null},components:m,mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))},methods:{closeMenu:function(){c.setState({sidebar:"hidden"===this.sidebar?"visible":"hidden"})}}}),window.nsDashboardHeader=new s.default({el:"#dashboard-header",data:{menuToggled:!1,sidebar:"visible"},components:m,methods:{toggleMenu:function(){this.menuToggled=!this.menuToggled},toggleSideMenu:function(){["lg","xl"].includes(d.breakpoint),c.setState({sidebar:"hidden"===this.sidebar?"visible":"hidden"})}},mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))}}),window.nsComponents=Object.assign(m,i),window.nsDashboardContent=new s.default({el:"#dashboard-content",components:m})},7700:(e,t,n)=>{"use strict";n.d(t,{l:()=>Y,kq:()=>Z,ih:()=>z,kX:()=>H});var s=n(6486),i=n(8945),r=n(6300),a=n(8345),o=n(9093),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=Z.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),S=n(9020),E=n(7794);function P(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),N=new b({sidebar:["xs","sm","md"].includes(I.breakpoint)?"hidden":"visible"});z.defineClient(i.Z),window.nsEvent=Y,window.nsHttpClient=z,window.nsSnackBar=H,window.nsCurrency=S.W,window.nsTruncate=E.b,window.nsRawCurrency=S.f,window.nsAbbreviate=$,window.nsState=N,window.nsUrl=L,window.nsScreen=I,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=R},3298:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(7700),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(3632),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(6979),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(4679),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(4110),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(9542),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),S=n(1272),E=n.n(S),P=n(5234),D=n.n(P),O=s.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:E().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),M=n(3164),A=n(5318),q=n(7757),V=n.n(q),Y=n(914),z=n(665),H=n(2830);const L={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:z.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var R=n(1900);const Z=(0,R.Z)(L,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var I=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const N={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occurred.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(Y.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return I(this,void 0,void 0,V().mark((function e(){var t,n=this;return V().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(Z),e.next=4,new Promise((function(e,t){h.G.show(Z,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,R.Z)(N,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full text-sm h-10 px-3 outline-none border ns-crud-button",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(7751),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,R.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=n(328),J=n(2404),ee=n(9045),te=n(3502);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occurred.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,R.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},4110:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(328),r=n(5318),a=n(3164),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n '})},9020:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},7794:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},4679:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3632:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},1625:(e,t,n)=>{"use strict";function s(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);nc});var c=function(){function e(){var t=this;a(this,e),this.listeners=new Object,document.addEventListener("keydown",(function(e){return t.processEvent(e)}))}return l(e,[{key:"processEvent",value:function(e){var t=this;for(var n in this.listeners){var s=this.listeners[n].getConfig();if(s.hidden.length>0)if(s.hidden.filter((function(e){return e instanceof HTMLElement==!1&&null===document.querySelector(e)})).length!==s.hidden.length)continue;if(s.visible.length>0)if(!(s.visible.filter((function(e){return e instanceof HTMLElement==!0||null!==document.querySelector(e)})).length===s.visible.length))continue;s.callbacks.forEach((function(e){"string"==typeof e.action?t.processSingleAction({action:e.action.trim(),callback:e.callback}):"object"===r(e.action)&&null!==e.action&&e.action.length>0&&e.action.forEach((function(n){t.processSingleAction({action:n.toString().trim(),callback:e.callback})}))}))}}},{key:"processSingleAction",value:function(e){var t=e.action,n=e.callback,s=t.split("+"),i={ctrlKey:!1,altKey:!1,shiftKey:!1};s.forEach((function(e){switch(e){case"ctrl":i.ctrlKey=!0;break;case"alt":i.altKey=!0;break;case"shift":i.shiftKey=!0}}));var r=s.filter((function(e){return!["ctrl","alt","shift"].includes(e)}));this.executeCallback({event,combinableKeys:i,callback:n,key:r[0]})}},{key:"executeCallback",value:function(e){var t=e.event,n=e.callback,s=e.combinableKeys,i=e.key;if(void 0!==t.key&&t.key.toLowerCase()===i.toLowerCase()){var r=!0;for(var a in s)t[a]!==s[a]&&(r=!1);r&&n(t,i)}}},{key:"create",value:function(e){return this.listeners[e]=new d}},{key:"destroy",value:function(e){delete this.listeners[e]}}]),e}(),d=function(){function e(){a(this,e),this.visible=[],this.hidden=[],this.callbacks=[]}return l(e,[{key:"whenVisible",value:function(e){var t;"object"===r(e)?(t=this.visible).push.apply(t,s(e)):this.visible.push(e);return this}},{key:"clearVisible",value:function(){return this.visible=[],this}},{key:"whenNotVisible",value:function(e){var t;e.length>0?(t=this.hidden).push.apply(t,s(e)):this.hidden.push(e);return this}},{key:"clearHidden",value:function(){return this.hidden=[],this}},{key:"whenPressed",value:function(e,t){this.callbacks.push({action:e,callback:t})}},{key:"clearCallbacks",value:function(){return this.callbacks=[],this}},{key:"getConfig",value:function(){return{callbacks:this.callbacks,hidden:this.hidden,visible:this.visible}}}]),e}()},665:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},2830:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},6979:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9093:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},131:(e,t,n)=>{"use strict";var s=n(381),i=n.n(s);ns.date.moment=i()(ns.date.current),ns.date.interval=setInterval((function(){ns.date.moment.add(1,"seconds"),ns.date.current=i()(ns.date.current).add(1,"seconds").format("YYYY-MM-DD HH:mm:ss")}),1e3),ns.date.getNowString=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e).format("YYYY-MM-DD HH:mm:ss")},ns.date.getMoment=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e)}},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":1793,"./ru.js":1793,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},328:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(3632));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},5318:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(3632).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thu")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},9045:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(3632).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thu")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},2404:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},7751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(3632);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3502:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},3164:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},9542:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(7700),a=n(665),o=n(3632),l=n(914);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},914:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(3632),i=n(2830),r=n(665);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=6178,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/auth.min.js b/public/js/auth.min.js index 705dca806..f7ea629c6 100644 --- a/public/js/auth.min.js +++ b/public/js/auth.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[743,198],{6623:(e,t,n)=>{"use strict";var s=n(538),i=n(8829),r=function(){return n.e(380).then(n.bind(n,6084))},a=function(){return n.e(202).then(n.bind(n,7202))},o=function(){return n.e(877).then(n.bind(n,4877))},l=function(){return n.e(919).then(n.bind(n,5919))},c=(window.nsState,window.nsScreen,window.nsExtraComponents);window.nsComponents=Object.assign(i,c,{nsRegister:r,nsLogin:a,nsPasswordLost:o,nsNewPassword:l}),window.authVueComponent=new s.default({el:"#page-container",components:Object.assign(Object.assign({nsLogin:a,nsRegister:r,nsPasswordLost:o,nsNewPassword:l},c),i)})},7700:(e,t,n)=>{"use strict";n.d(t,{l:()=>V,kq:()=>Z,ih:()=>Y,kX:()=>H});var s=n(6486),i=n(8945),r=n(6300),a=n(8345),o=n(9093),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=Z.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),E=n(9020),S=n(7794);function P(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),I=new b({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});Y.defineClient(i.Z),window.nsEvent=V,window.nsHttpClient=Y,window.nsSnackBar=H,window.nsCurrency=E.W,window.nsTruncate=S.b,window.nsRawCurrency=E.f,window.nsAbbreviate=$,window.nsState=I,window.nsUrl=L,window.nsScreen=N,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=R},8829:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>J.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>K.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(7700),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(3632),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(6979),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(4679),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(4110),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(1274),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),E=n(1272),S=n.n(E),P=n(5234),D=n.n(P),O=s.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:S().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),M=n(3164),A=n(9765),q=n(7757),z=n.n(q),V=n(914),Y=n(665),H=n(2830);const L={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:Y.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var R=n(1900);const Z=(0,R.Z)(L,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var N=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const I={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(V.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return N(this,void 0,void 0,z().mark((function e(){var t,n=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(Z),e.next=4,new Promise((function(e,t){h.G.show(Z,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,R.Z)(I,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full text-sm h-10 px-3 outline-none border ns-crud-button",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(7751),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,R.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var J=n(328),K=n(2404),ee=n(4915),te=n(3502);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,R.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},4110:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(328),r=n(9765),a=n(3164),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n '})},9020:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},7794:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},4679:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3632:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},665:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},2830:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},6979:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9093:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":1793,"./ru.js":1793,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},328:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(3632));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},9765:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(3632).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},4915:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(3632).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},2404:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},7751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(3632);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3502:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},3164:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},1274:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(7700),a=n(665),o=n(3632),l=n(914);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},914:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(3632),i=n(2830),r=n(665);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=6623,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[743,198],{6623:(e,t,n)=>{"use strict";var s=n(538),i=n(3298),r=function(){return n.e(380).then(n.bind(n,6084))},a=function(){return n.e(701).then(n.bind(n,1701))},o=function(){return n.e(465).then(n.bind(n,3465))},l=function(){return n.e(58).then(n.bind(n,2775))},c=(window.nsState,window.nsScreen,window.nsExtraComponents);window.nsComponents=Object.assign(i,c,{nsRegister:r,nsLogin:a,nsPasswordLost:o,nsNewPassword:l}),window.authVueComponent=new s.default({el:"#page-container",components:Object.assign(Object.assign({nsLogin:a,nsRegister:r,nsPasswordLost:o,nsNewPassword:l},c),i)})},7700:(e,t,n)=>{"use strict";n.d(t,{l:()=>V,kq:()=>Z,ih:()=>Y,kX:()=>H});var s=n(6486),i=n(8945),r=n(6300),a=n(8345),o=n(9093),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=Z.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),E=n(9020),S=n(7794);function P(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),I=new b({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});Y.defineClient(i.Z),window.nsEvent=V,window.nsHttpClient=Y,window.nsSnackBar=H,window.nsCurrency=E.W,window.nsTruncate=S.b,window.nsRawCurrency=E.f,window.nsAbbreviate=$,window.nsState=I,window.nsUrl=L,window.nsScreen=N,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=R},3298:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>J.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>K.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(7700),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(3632),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(6979),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(4679),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(4110),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(9542),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),E=n(1272),S=n.n(E),P=n(5234),D=n.n(P),O=s.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:S().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),M=n(3164),A=n(5318),q=n(7757),z=n.n(q),V=n(914),Y=n(665),H=n(2830);const L={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:Y.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var R=n(1900);const Z=(0,R.Z)(L,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var N=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const I={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occurred.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(V.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return N(this,void 0,void 0,z().mark((function e(){var t,n=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(Z),e.next=4,new Promise((function(e,t){h.G.show(Z,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,R.Z)(I,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full text-sm h-10 px-3 outline-none border ns-crud-button",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(7751),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,R.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var J=n(328),K=n(2404),ee=n(9045),te=n(3502);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occurred.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,R.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},4110:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(328),r=n(5318),a=n(3164),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n '})},9020:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},7794:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},4679:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3632:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},665:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},2830:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},6979:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9093:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":1793,"./ru.js":1793,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},328:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(3632));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},5318:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(3632).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thu")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},9045:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(3632).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thu")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},2404:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},7751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(3632);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3502:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},3164:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},9542:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(7700),a=n(665),o=n(3632),l=n(914);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},914:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(3632),i=n(2830),r=n(665);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=6623,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/bootstrap.min/117.js b/public/js/bootstrap.min/117.js index 31e646d43..710708d69 100644 --- a/public/js/bootstrap.min/117.js +++ b/public/js/bootstrap.min/117.js @@ -1 +1 @@ -"use strict";(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[117,33,409,741,804],{4678:(e,t,s)=>{function r(e){POS.changeVisibleSection(e)}s.d(t,{Z:()=>r})},282:(e,t,s)=>{function r(e,t){for(var s=0;sn});var n=function(){function e(t){var s=t.settings,r=t.options,n=t.type;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.printingURL={refund:"refund_printing_url",sale:"sale_printing_url",payment:"payment_printing_url"},this.settings=s,this.options=r,this.type=n||"refund"}var t,s,n;return t=e,(s=[{key:"processRegularPrinting",value:function(e){var t=document.querySelector("printing-section");t&&t.remove();var s=this.settings[this.printingURL[this.type]].replace("{reference_id}",e),r=document.createElement("iframe");r.id="printing-section",r.className="hidden",r.src=s,document.body.appendChild(r),setTimeout((function(){document.querySelector("#printing-section").remove()}),5e3)}},{key:"printOrder",value:function(e){"default"===this.options.ns_pos_printing_gateway?this.processRegularPrinting(e):this.processCustomPrinting(e,this.options.ns_pos_printing_gateway)}},{key:"processCustomPrinting",value:function(e,t){nsHooks.applyFilters("ns-order-custom-refund-print",{printed:!1,reference_id:e,gateway:t}).printed||nsSnackBar.error(__("Unsupported print gateway.")).subscribe()}}])&&r(t.prototype,s),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5502:(e,t,s)=>{s.d(t,{$:()=>c});var r=s(7700),n=s(3632),i=s(6979),o=s(4739);function a(e,t){for(var s=0;sparseFloat(e.$quantities().quantity)-u)return r.kX.error((0,n.__)("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",(e.$quantities().quantity-u).toString())).subscribe()}s({quantity:1})}else c.open(o.Z,{resolve:s,reject:a,product:l,data:e})}))}}])&&a(t.prototype,s),c&&a(t,c),Object.defineProperty(t,"prototype",{writable:!1}),e}()},8909:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(3632);const n={name:"ns-numpad-plus",props:["value","currency","limit"],data:function(){return{screenValue:0,order:null,cursor:parseInt(ns.currency.ns_currency_precision),orderSubscription:null,allSelected:!0,keyRows:[[7,8,9].map((function(e){return{identifier:e,value:e}})),[4,5,6].map((function(e){return{identifier:e,value:e}})),[1,2,3].map((function(e){return{identifier:e,value:e}})),[{identifier:".",value:"."},{identifier:0,value:0},{identifier:"backspace",icon:"la-backspace"}],[{identifier:"next",value:(0,r.__)("Enter")}]]}},mounted:function(){var e=this;this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-dot").whenVisible([".is-popup"]).whenPressed(".",(function(){return e.inputValue({identifier:"."})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save"),nsHotPress.destroy("numpad-dot")},methods:{increaseBy:function(e){this.screenValue=(parseFloat(e.value)+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if("."===e.identifier)this.allSelected?(this.screenValue="0.",this.allSelected=!1):null===this.screenValue.toString().match(/^[0-9][1-9]*\.[0-9]*$/)&&(this.screenValue=this.screenValue+=".");else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}this.$emit("changed",this.screenValue)}else this.$emit("next",this.screenValue)}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"numpad-holder"}},e._l(e.keyRows,(function(t,r){return s("div",{key:r},[s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 text-lg",attrs:{id:"numpad"}},[e._l(t,(function(r,n){return s("div",{key:n,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",class:1===t.length?"col-span-3":"",on:{click:function(t){return e.inputValue(r)}}},[void 0!==r.value?s("span",[e._v(e._s(r.value))]):e._e(),e._v(" "),r.icon?s("i",{staticClass:"las",class:r.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)])})),0)}),[],!1,null,null,null).exports},9741:(e,t,s)=>{s.r(t),s.d(t,{default:()=>xe});var r=s(7757),n=s.n(r),i=s(6979),o=s(2830),a=s(3632);function c(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return l(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,r=new Array(t);s100?100:this.finalValue))}}};var d=s(1900);const p=(0,d.Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow min-h-2/5-screen w-6/7-screen md:w-3/5-screen lg:w-3/5-screen xl:w-2/5-screen relative",attrs:{id:"discount-popup"}},[s("div",{staticClass:"flex-shrink-0 flex justify-between items-center p-2 border-b ns-box-header"},[s("div",["product"===e.type?s("h1",{staticClass:"text-xl font-bold text-primary text-center"},[e._v(e._s(e.__("Product Discount")))]):e._e(),e._v(" "),"cart"===e.type?s("h1",{staticClass:"text-xl font-bold text-primary text-center"},[e._v(e._s(e.__("Cart Discount")))]):e._e()]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"h-16 ns-box-body text-white flex items-center justify-center",attrs:{id:"screen"}},[s("h1",{staticClass:"font-bold text-3xl"},["flat"===e.mode?s("span",[e._v(e._s(e._f("currency")(e.finalValue)))]):e._e(),e._v(" "),"percentage"===e.mode?s("span",[e._v(e._s(e.finalValue)+"%")]):e._e()])]),e._v(" "),s("div",{staticClass:"flex",attrs:{id:"switch-mode"}},[s("button",{staticClass:"outline-none w-1/2 py-2 flex items-center justify-center",class:"flat"===e.mode?"bg-tab-active":"bg-tab-inactive text-tertiary",on:{click:function(t){return e.setPercentageType("flat")}}},[e._v(e._s(e.__("Flat")))]),e._v(" "),s("hr",{staticClass:"border-r border-box-edge"}),e._v(" "),s("button",{staticClass:"outline-none w-1/2 py-2 flex items-center justify-center",class:"percentage"===e.mode?"bg-tab-active":"bg-tab-inactive text-tertiary",on:{click:function(t){return e.setPercentageType("percentage")}}},[e._v(e._s(e.__("Percentage")))])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},e._l(e.keys,(function(t,r){return s("div",{key:r,staticClass:"text-primary ns-numpad-key info text-xl font-bold border h-24 flex items-center justify-center cursor-pointer",on:{click:function(s){return e.inputValue(t)}}},[void 0!==t.value?s("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?s("i",{staticClass:"las",class:t.icon}):e._e()])})),0)])}),[],!1,null,null,null).exports;var f=s(914),_=s(7700);function v(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return m(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,r=new Array(t);s100?100:this.backValue))),"0"===this.backValue&&(this.backValue="")}}};const h=(0,d.Z)(b,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-full w-full py-2"},[e.order?s("div",{staticClass:"px-2 pb-2"},[s("div",{staticClass:"grid grid-cols-2 gap-2"},[s("div",{staticClass:"h-16 flex justify-between items-center border elevation-surface info text-xl md:text-3xl p-2",attrs:{id:"details"}},[s("span",[e._v(e._s(e.__("Total"))+" : ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.total)))])]),e._v(" "),s("div",{staticClass:"cursor-pointer h-16 flex justify-between items-center border elevation-surface error text-xl md:text-3xl p-2",attrs:{id:"discount"},on:{click:function(t){return e.toggleDiscount()}}},[s("span",[e._v(e._s(e.__("Discount"))+" : ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.discount)))])]),e._v(" "),s("div",{staticClass:"h-16 flex justify-between items-center border elevation-surface success text-xl md:text-3xl p-2",attrs:{id:"paid"}},[s("span",[e._v(e._s(e.__("Paid"))+" : ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.tendered)))])]),e._v(" "),s("div",{staticClass:"h-16 flex justify-between items-center border elevation-surface warning text-xl md:text-3xl p-2",attrs:{id:"change"}},[s("span",[e._v(e._s(e.__("Change"))+" : ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.change)))])]),e._v(" "),s("div",{staticClass:"col-span-2 h-16 flex justify-between items-center elevation-surface border text-xl md:text-3xl p-2",attrs:{id:"change"}},[s("span",[e._v(e._s(e.__("Screen"))+" : ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.backValue/e.number)))])])])]):e._e(),e._v(" "),s("div",{staticClass:"px-2 pb-2"},[s("div",{staticClass:"-mx-2 flex flex-wrap"},[s("div",{staticClass:"pl-2 pr-1 flex-auto"},[s("div",{staticClass:"grid grid-flow-row grid-cols-3 gap-2 grid-rows-3",staticStyle:{padding:"1px"},attrs:{id:"numpad"}},[e._l(e.keys,(function(t,r){return s("div",{key:r,staticClass:"ns-numpad-key text-2xl border h-16 flex items-center justify-center cursor-pointer",staticStyle:{margin:"-1px"},on:{click:function(s){return e.inputValue(t)}}},[void 0!==t.value?s("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?s("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),s("div",{staticClass:"hover:bg-green-500 col-span-3 bg-success-secondary border-success-tertiary text-2xl text-white border h-16 flex items-center justify-center cursor-pointer",on:{click:function(t){return e.makeFullPayment()}}},[e._v("\n "+e._s(e.__("Full Payment")))])],2)]),e._v(" "),s("div",{staticClass:"w-1/2 md:w-72 pr-2 pl-1"},[s("div",{staticClass:"grid grid-flow-row grid-rows-1 gap-2"},e._l(e.amountShortcuts,(function(t,r){return s("div",{key:r,staticClass:"ns-numpad-key text-2xl border h-16 flex items-center justify-center cursor-pointer",on:{click:function(s){return e.increaseBy({value:t})}}},[s("span",[e._v(e._s(e._f("currency")(t)))])])})),0)])])])])}),[],!1,null,null,null).exports,y={name:"cash-payment",props:["identifier","label"],components:{samplePayment:h}};const x=(0,d.Z)(y,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("sample-payment",{attrs:{identifier:e.identifier,label:e.label},on:{submit:function(t){return e.$emit("submit")}}})}),[],!1,null,null,null).exports;const g={name:"creditcart-payment",props:["identifier"]};const C=(0,d.Z)(g,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("h1",[e._v("Credit Card")])}),[],!1,null,null,null).exports;const w={name:"bank-payment",props:["identifier","label"],components:{samplePayment:h}};const P=(0,d.Z)(w,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("sample-payment",{attrs:{identifier:e.identifier,label:e.label},on:{submit:function(t){return e.$emit("submit")}}})}),[],!1,null,null,null).exports;var k=s(7751);const S={name:"ns-account-payment",components:{nsNumpad:k.Z},props:["identifier","label"],data:function(){return{subscription:null,screenValue:0,order:null}},methods:{__:a.__,handleChange:function(e){this.screenValue=e},proceedAddingPayment:function(e){var t=parseFloat(e),s=this.order.payments;return t<=0?_.kX.error((0,a.__)("Please provide a valid payment amount.")).subscribe():s.filter((function(e){return"account-payment"===e.identifier})).length>0?_.kX.error((0,a.__)("The customer account can only be used once per order. Consider deleting the previously used payment.")).subscribe():t>this.order.customer.account_amount?_.kX.error((0,a.__)("Not enough funds to add {amount} as a payment. Available balance {balance}.").replace("{amount}",this.$options.filters.currency(t)).replace("{balance}",this.$options.filters.currency(this.order.customer.account_amount))).subscribe():(POS.addPayment({value:t,identifier:"account-payment",selected:!1,label:this.label,readonly:!1}),this.order.customer.account_amount-=t,POS.selectCustomer(this.order.customer),void this.$emit("submit"))},proceedFullPayment:function(){this.proceedAddingPayment(this.order.total)},makeFullPayment:function(){var e=this;Popup.show(f.default,{title:(0,a.__)("Confirm Full Payment"),message:(0,a.__)("You're about to use {amount} from the customer account to make a payment. Would you like to proceed ?").replace("{amount}",this.$options.filters.currency(this.order.total)),onAction:function(t){t&&e.proceedFullPayment()}})}},mounted:function(){var e=this;this.subscription=POS.order.subscribe((function(t){return e.order=t}))},destroyed:function(){this.subscription.unsubscribe()}};const O=(0,d.Z)(S,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-full w-full py-2"},[e.order?s("div",{staticClass:"px-2 pb-2"},[s("div",{staticClass:"grid grid-cols-2 gap-2"},[s("div",{staticClass:"h-16 flex justify-between items-center elevation-surface border info text-xl md:text-3xl p-2",attrs:{id:"details"}},[s("span",[e._v(e._s(e.__("Total"))+" : ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.total)))])]),e._v(" "),s("div",{staticClass:"cursor-pointer h-16 flex justify-between items-center elevation-surface error border text-xl md:text-3xl p-2",attrs:{id:"discount"},on:{click:function(t){return e.toggleDiscount()}}},[s("span",[e._v(e._s(e.__("Discount"))+" : ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.discount)))])]),e._v(" "),s("div",{staticClass:"h-16 flex justify-between items-center elevation-surface success border text-xl md:text-3xl p-2",attrs:{id:"paid"}},[s("span",[e._v(e._s(e.__("Paid"))+" : ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.tendered)))])]),e._v(" "),s("div",{staticClass:"h-16 flex justify-between items-center elevation-surface warning border text-xl md:text-3xl p-2",attrs:{id:"change"}},[s("span",[e._v(e._s(e.__("Change"))+" : ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.change)))])]),e._v(" "),s("div",{staticClass:"col-span-2 h-16 flex justify-between items-center elevation-surface border success text-xl md:text-3xl p-2",attrs:{id:"change"}},[s("span",[e._v(e._s(e.__("Current Balance"))+" : ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.customer.account_amount)))])]),e._v(" "),s("div",{staticClass:"col-span-2 h-16 flex justify-between items-center elevation-surface border text-primary text-xl md:text-3xl p-2",attrs:{id:"change"}},[s("span",[e._v(e._s(e.__("Screen"))+" : ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.screenValue)))])])])]):e._e(),e._v(" "),s("div",{staticClass:"px-2 pb-2"},[s("div",{staticClass:"-mx-2 flex flex-wrap"},[s("div",{staticClass:"pl-2 pr-1 flex-auto"},[s("ns-numpad",{attrs:{floating:!0},on:{changed:function(t){return e.handleChange(t)},next:function(t){return e.proceedAddingPayment(t)}},scopedSlots:e._u([{key:"numpad-footer",fn:function(){return[s("div",{staticClass:"hover:bg-success-tertiary col-span-3 bg-success-secondary text-2xl text-white border border-success-secondary h-16 flex items-center justify-center cursor-pointer",on:{click:function(t){return e.makeFullPayment()}}},[e._v("\n "+e._s(e.__("Full Payment")))])]},proxy:!0}])})],1),e._v(" "),s("div",{staticClass:"w-1/2 md:w-72 pr-2 pl-1"},[s("div",{staticClass:"grid grid-flow-row grid-rows-1 gap-2"},[s("div",{staticClass:"elevation-surface border hoverable text-2xl text-primary h-16 flex items-center justify-center cursor-pointer",on:{click:function(t){return e.increaseBy({value:100})}}},[s("span",[e._v(e._s(e._f("currency")(100)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border hoverable text-2xl text-primary h-16 flex items-center justify-center cursor-pointer",on:{click:function(t){return e.increaseBy({value:500})}}},[s("span",[e._v(e._s(e._f("currency")(500)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border hoverable text-2xl text-primary h-16 flex items-center justify-center cursor-pointer",on:{click:function(t){return e.increaseBy({value:1e3})}}},[s("span",[e._v(e._s(e._f("currency")(1e3)))])])])])])])])}),[],!1,null,null,null).exports;var j=s(409),T=s(2614);function $(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,r)}return s}function V(e){for(var t=1;t0&&e[0]},expectedPayment:function(){var e=this.order.customer.group.minimal_credit_payment;return this.order.total*e/100}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){if("click-overlay"===t.event)e.closePopup()})),this.order=this.$popupParams.order,this.paymentTypesSubscription=POS.paymentsType.subscribe((function(t){e.paymentsType=t,t.filter((function(e){e.selected&&POS.selectedPaymentType.next(e)}))})),nsHooks.doAction("ns-pos-payment-mounted",this)},watch:{activePayment:function(e){this.loadPaymentComponent(e)}},destroyed:function(){this.paymentTypesSubscription.unsubscribe(),nsHooks.doAction("ns-pos-payment-destroyed",this)},methods:{__:a.__,resolveIfQueued:o.Z,loadPaymentComponent:function(e){switch(e.identifier){case"cash-payment":this.currentPaymentComponent=x;break;case"creditcard-payment":this.currentPaymentComponent=C;break;case"bank-payment":this.currentPaymentComponent=P;break;case"account-payment":this.currentPaymentComponent=O;break;default:this.currentPaymentComponent=h}},selectPayment:function(){var e,t=this;return(e=n().mark((function e(){var s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,new Promise((function(e,s){i.G.show(T.Z,{label:(0,a.__)("Select Payment Gateway"),options:t.paymentsType.map((function(e){return{label:e.label,value:e.identifier}})),value:t.activePayment.identifier,resolve:e,reject:s})}));case 3:s=e.sent,t.select(t.paymentsType.filter((function(e){return e.identifier===s[0].value}))[0]),e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})),function(){var t=this,s=arguments;return new Promise((function(r,n){var i=e.apply(t,s);function o(e){Z(i,r,n,o,a,"next",e)}function a(e){Z(i,r,n,o,a,"throw",e)}o(void 0)}))})()},select:function(e){this.showPayment=!1,POS.setPaymentActive(e)},closePopup:function(){this.$popup.close(),POS.selectedPaymentType.next(null)},deletePayment:function(e){POS.removePayment(e)},selectPaymentAsActive:function(e){this.select(this.paymentsType.filter((function(t){return t.identifier===e.target.value}))[0])},submitOrder:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=i.G.show(j.default);try{var r=V(V({},POS.order.getValue()),t);POS.submitOrder(r).then((function(t){s.close(),_.kX.success(t.message).subscribe(),POS.printOrderReceipt(t.data.order),e.$popup.close()}),(function(e){s.close(),_.kX.error(e.message).subscribe()}))}catch(e){s.close(),_.kX.error(error.message).subscribe()}}}};const D=(0,d.Z)(F,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.order?s("div",{staticClass:"w-screen h-screen p-4 flex overflow-hidden",attrs:{id:"ns-payment-popup"}},[s("div",{staticClass:"flex flex-col flex-auto lg:flex-row shadow-xl"},[s("div",{staticClass:"w-full lg:w-56 lg:h-full flex justify-between px-2 lg:px-0 lg:block items-center lg:items-start"},[s("h3",{staticClass:"lg:hidden text-xl text-center my-4 font-bold lg:my-8"},[e._v(e._s(e.__("Gateway"))+" "),s("span",[e._v(": "+e._s(e.activePayment.label))])]),e._v(" "),s("div",{staticClass:"h-16 hidden lg:block"}),e._v(" "),s("ul",{staticClass:"hidden lg:block"},[e._l(e.paymentsType,(function(t){return s("li",{key:t.identifier,staticClass:"cursor-pointer ns-payment-gateway py-2 px-3",class:t.selected&&!e.showPayment?"ns-visible":"",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})),e._v(" "),s("li",{staticClass:"cursor-pointer py-2 px-3 ns-payment-list border-t mt-4 flex items-center justify-between",class:e.showPayment?"ns-visible":"",on:{click:function(t){e.showPayment=!0}}},[s("span",[e._v(e._s(e.__("Payment List")))]),e._v(" "),s("span",{staticClass:"px-2 rounded-full h-8 w-8 flex items-center justify-center ns-label"},[e._v(e._s(e.order.payments.length))])])],2),e._v(" "),s("ns-close-button",{staticClass:"lg:hidden",on:{click:function(t){return e.closePopup()}}})],1),e._v(" "),s("div",{staticClass:"overflow-hidden flex flex-col flex-auto"},[s("div",{staticClass:"flex flex-col flex-auto overflow-hidden"},[s("div",{staticClass:"h-12 hidden items-center justify-between lg:flex"},[s("div",[s("h3",{staticClass:"text-xl hidden lg:block text-center my-4 font-bold lg:my-8"},[e._v(e._s(e.__("Gateway"))+" "),s("span",{staticClass:"hidden-md"},[e._v(": "+e._s(e.activePayment.label))])])]),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),e.showPayment?e._e():s("div",{staticClass:"flex flex-auto ns-payment-wrapper overflow-y-auto"},[s(e.currentPaymentComponent,{tag:"component",attrs:{label:e.activePayment.label,identifier:e.activePayment.identifier},on:{submit:function(t){return e.submitOrder()}}})],1),e._v(" "),e.showPayment?s("div",{staticClass:"flex flex-auto ns-payment-wrapper overflow-y-auto p-2 flex-col"},[s("h3",{staticClass:"text-center font-bold py-2"},[e._v(e._s(e.__("List Of Payments")))]),e._v(" "),s("ul",{staticClass:"flex-auto"},[0===e.order.payments.length?s("li",{staticClass:"p-2 flex justify-center mb-2 items-center"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("No Payment added.")))])]):e._e(),e._v(" "),e._l(e.order.payments,(function(t,r){return s("li",{key:r,staticClass:"p-2 flex justify-between mb-2 items-center"},[s("span",[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex items-center"},[s("span",[e._v(e._s(e._f("currency")(t.value)))]),e._v(" "),s("button",{staticClass:"rounded-full h-8 w-8 flex items-center justify-center ml-2",on:{click:function(s){return e.deletePayment(t)}}},[s("i",{staticClass:"las la-trash-alt"})])])])}))],2)]):e._e()]),e._v(" "),s("div",{staticClass:"flex lg:hidden ns-payment-buttons"},[s("button",{staticClass:"flex items-center justify-center w-1/3 text-2xl flex-auto h-12 font-bold ns-payment-type-button",on:{click:function(t){return e.selectPayment()}}},[s("span",{staticClass:"text-sm"},[e._v(e._s(e.__("Payment Type")))])]),e._v(" "),e.order.tendered>=e.order.total?s("button",{staticClass:"flex items-center justify-center w-1/3 text-2xl flex-auto h-12 ns-submit-button font-bold",on:{click:function(t){return e.submitOrder()}}},[s("span",{staticClass:"text-sm"},[e._v(e._s(e.__("Submit Payment")))])]):e._e(),e._v(" "),e.order.tendered