diff --git a/public/build/assets/app-2f0e443c.js b/public/build/assets/app-7b31b481.js similarity index 84% rename from public/build/assets/app-2f0e443c.js rename to public/build/assets/app-7b31b481.js index 5a188db9a..8b0e52448 100644 --- a/public/build/assets/app-2f0e443c.js +++ b/public/build/assets/app-7b31b481.js @@ -1,4 +1,4 @@ -import{_ as e}from"./preload-helper-41c905a7.js";import"./time-ccbcc647.js";import{b as w,n as I,a as L}from"./components-ef1ba55f.js";import{c as m,n as y}from"./bootstrap-8be442b1.js";import{N as V}from"./ns-hotpress-fbaed768.js";import{d as t}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";function O(o,_){_.forEach(a=>{let r=o.document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href",a),o.document.getElementsByTagName("head")[0].appendChild(r)})}const S={install(o,_={}){o.config.globalProperties.$htmlToPaper=(a,r,D=()=>!0)=>{let P="_blank",v=["fullscreen=yes","titlebar=yes","scrollbars=yes"],R=!0,A=[],{name:u=P,specs:i=v,replace:T=R,styles:p=A}=_;r&&(r.name&&(u=r.name),r.specs&&(i=r.specs),r.replace&&(T=r.replace),r.styles&&(p=r.styles)),i=i.length?i.join(","):"";const l=window.document.getElementById(a);if(!l){alert(`Element to print #${a} not found!`);return}const f="",s=window.open(f,u,i);return s.document.write(` +import{_ as e}from"./preload-helper-41c905a7.js";import"./time-ccbcc647.js";import{b as w,n as I,a as L}from"./components-50630f18.js";import{c as m,n as y}from"./bootstrap-8be442b1.js";import{N as V}from"./ns-hotpress-fbaed768.js";import{d as t}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";function O(o,_){_.forEach(a=>{let r=o.document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href",a),o.document.getElementsByTagName("head")[0].appendChild(r)})}const S={install(o,_={}){o.config.globalProperties.$htmlToPaper=(a,r,D=()=>!0)=>{let P="_blank",v=["fullscreen=yes","titlebar=yes","scrollbars=yes"],R=!0,A=[],{name:u=P,specs:i=v,replace:T=R,styles:p=A}=_;r&&(r.name&&(u=r.name),r.specs&&(i=r.specs),r.replace&&(T=r.replace),r.styles&&(p=r.styles)),i=i.length?i.join(","):"";const l=window.document.getElementById(a);if(!l){alert(`Element to print #${a} not found!`);return}const f="",s=window.open(f,u,i);return s.document.write(` ${window.document.title} @@ -7,4 +7,4 @@ import{_ as e}from"./preload-helper-41c905a7.js";import"./time-ccbcc647.js";impo ${l.innerHTML} - `),O(s,p),setTimeout(()=>{s.document.close(),s.focus(),s.print(),s.close(),D()},1e3),!0}}},g=t(()=>e(()=>import("./rewards-system-fac66d99.js"),["./rewards-system-fac66d99.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),C=t(()=>e(()=>import("./create-coupons-f729626b.js"),["./create-coupons-f729626b.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),k=t(()=>e(()=>import("./ns-settings-a4c45132.js"),["./ns-settings-a4c45132.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),H=t(()=>e(()=>import("./reset-5070ff9f.js"),["./reset-5070ff9f.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),M=t(()=>e(()=>import("./modules-b5fed665.js"),["./modules-b5fed665.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),j=t(()=>e(()=>import("./ns-permissions-96631af1.js"),["./ns-permissions-96631af1.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),N=t(()=>e(()=>import("./ns-procurement-791c80fe.js"),["./ns-procurement-791c80fe.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./manage-products-bcbb478a.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./select-api-entities-c72f4497.js","./join-array-4b30b096.js","./index.es-25aa42ee.js"],import.meta.url)),q=t(()=>e(()=>import("./manage-products-bcbb478a.js"),["./manage-products-bcbb478a.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),x=t(()=>e(()=>import("./ns-procurement-invoice-b9a1ca34.js"),[],import.meta.url)),$=t(()=>e(()=>import("./ns-notifications-39f1777d.js"),["./ns-notifications-39f1777d.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js"],import.meta.url)),B=t(()=>e(()=>import("./components-ef1ba55f.js").then(o=>o.i),["./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./currency-f8bd78d1.js","./_plugin-vue_export-helper-c27b6911.js","./runtime-core.esm-bundler-b48de70a.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./bootstrap-8be442b1.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),F=t(()=>e(()=>import("./ns-transaction-41cc182e.js"),["./ns-transaction-41cc182e.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),Y=t(()=>e(()=>import("./ns-dashboard-4a768a15.js"),["./ns-dashboard-4a768a15.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),z=t(()=>e(()=>import("./ns-low-stock-report-585a8342.js"),["./ns-low-stock-report-585a8342.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./join-array-4b30b096.js"],import.meta.url)),G=t(()=>e(()=>import("./ns-sale-report-41e30de6.js"),["./ns-sale-report-41e30de6.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./join-array-4b30b096.js"],import.meta.url)),J=t(()=>e(()=>import("./ns-sold-stock-report-f37081a1.js"),["./ns-sold-stock-report-f37081a1.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./select-api-entities-c72f4497.js","./join-array-4b30b096.js"],import.meta.url)),K=t(()=>e(()=>import("./ns-profit-report-a9e68261.js"),["./ns-profit-report-a9e68261.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./select-api-entities-c72f4497.js","./join-array-4b30b096.js"],import.meta.url)),Q=t(()=>e(()=>import("./ns-stock-combined-report-dc25d7cd.js"),["./ns-stock-combined-report-dc25d7cd.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./select-api-entities-c72f4497.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./join-array-4b30b096.js"],import.meta.url)),U=t(()=>e(()=>import("./ns-cash-flow-report-d8680316.js"),["./ns-cash-flow-report-d8680316.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),W=t(()=>e(()=>import("./ns-yearly-report-14b5e6ca.js"),["./ns-yearly-report-14b5e6ca.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),X=t(()=>e(()=>import("./ns-best-products-report-9979457f.js"),["./ns-best-products-report-9979457f.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),Z=t(()=>e(()=>import("./ns-payment-types-report-3fa90e99.js"),["./ns-payment-types-report-3fa90e99.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),ee=t(()=>e(()=>import("./ns-customers-statement-report-154a2535.js"),["./ns-customers-statement-report-154a2535.js","./currency-f8bd78d1.js","./_plugin-vue_export-helper-c27b6911.js","./runtime-core.esm-bundler-b48de70a.js"],import.meta.url)),te=t(()=>e(()=>import("./ns-stock-adjustment-879e0777.js"),["./ns-stock-adjustment-879e0777.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-procurement-quantity-ecf5ad70.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),oe=t(()=>e(()=>import("./ns-order-invoice-bf57ed55.js"),["./ns-order-invoice-bf57ed55.js","./currency-f8bd78d1.js","./_plugin-vue_export-helper-c27b6911.js","./runtime-core.esm-bundler-b48de70a.js"],import.meta.url)),re=t(()=>e(()=>import("./ns-print-label-53077c3e.js"),["./ns-print-label-53077c3e.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./bootstrap-8be442b1.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),n=window.nsState,se=window.nsScreen;nsExtraComponents.nsToken=t(()=>e(()=>import("./ns-token-8f108109.js"),["./ns-token-8f108109.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url));window.nsHotPress=new V;const d=Object.assign({nsModules:M,nsRewardsSystem:g,nsCreateCoupons:C,nsManageProducts:q,nsSettings:k,nsReset:H,nsPermissions:j,nsProcurement:N,nsProcurementInvoice:x,nsMedia:B,nsTransaction:F,nsDashboard:Y,nsPrintLabel:re,nsNotifications:$,nsSaleReport:G,nsSoldStockReport:J,nsProfitReport:K,nsStockCombinedReport:Q,nsCashFlowReport:U,nsYearlyReport:W,nsPaymentTypesReport:Z,nsBestProductsReport:X,nsLowStockReport:z,nsCustomersStatementReport:ee,nsStockAdjustment:te,nsOrderInvoice:oe,...w},nsExtraComponents);window.nsDashboardAside=m({data(){return{sidebar:"visible",popups:[]}},components:{nsMenu:I,nsSubmenu:L},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardOverlay=m({data(){return{sidebar:null,popups:[]}},components:d,mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})},methods:{closeMenu(){n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}}});window.nsDashboardHeader=m({data(){return{menuToggled:!1,sidebar:null}},components:d,methods:{toggleMenu(){this.menuToggled=!this.menuToggled},toggleSideMenu(){["lg","xl"].includes(se.breakpoint)?n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"}):n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardContent=m({});for(let o in d)window.nsDashboardContent.component(o,d[o]);window.nsDashboardContent.use(S,{styles:Object.values(window.ns.cssFiles)});window.nsComponents=Object.assign(d,w);y.doAction("ns-before-mount");const c=document.querySelector("#dashboard-aside");window.nsDashboardAside&&c&&window.nsDashboardAside.mount(c);const b=document.querySelector("#dashboard-overlay");window.nsDashboardOverlay&&b&&window.nsDashboardOverlay.mount(b);const E=document.querySelector("#dashboard-header");window.nsDashboardHeader&&E&&window.nsDashboardHeader.mount(E);const h=document.querySelector("#dashboard-content");window.nsDashboardContent&&h&&window.nsDashboardContent.mount(h); + `),O(s,p),setTimeout(()=>{s.document.close(),s.focus(),s.print(),s.close(),D()},1e3),!0}}},g=t(()=>e(()=>import("./rewards-system-fac66d99.js"),["./rewards-system-fac66d99.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),C=t(()=>e(()=>import("./create-coupons-f729626b.js"),["./create-coupons-f729626b.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),k=t(()=>e(()=>import("./ns-settings-f7f35eda.js"),["./ns-settings-f7f35eda.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./components-50630f18.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),H=t(()=>e(()=>import("./reset-5070ff9f.js"),["./reset-5070ff9f.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),M=t(()=>e(()=>import("./modules-b5fed665.js"),["./modules-b5fed665.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),j=t(()=>e(()=>import("./ns-permissions-96631af1.js"),["./ns-permissions-96631af1.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),N=t(()=>e(()=>import("./ns-procurement-791c80fe.js"),["./ns-procurement-791c80fe.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./manage-products-bcbb478a.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./select-api-entities-c72f4497.js","./join-array-4b30b096.js","./index.es-25aa42ee.js"],import.meta.url)),q=t(()=>e(()=>import("./manage-products-bcbb478a.js"),["./manage-products-bcbb478a.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),x=t(()=>e(()=>import("./ns-procurement-invoice-b9a1ca34.js"),[],import.meta.url)),$=t(()=>e(()=>import("./ns-notifications-ce6033c8.js"),["./ns-notifications-ce6033c8.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./components-50630f18.js","./ns-alert-popup-5493aad8.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js"],import.meta.url)),B=t(()=>e(()=>import("./components-50630f18.js").then(o=>o.i),["./components-50630f18.js","./ns-alert-popup-5493aad8.js","./currency-f8bd78d1.js","./_plugin-vue_export-helper-c27b6911.js","./runtime-core.esm-bundler-b48de70a.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./bootstrap-8be442b1.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),F=t(()=>e(()=>import("./ns-transaction-41cc182e.js"),["./ns-transaction-41cc182e.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),Y=t(()=>e(()=>import("./ns-dashboard-4a768a15.js"),["./ns-dashboard-4a768a15.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),z=t(()=>e(()=>import("./ns-low-stock-report-2d8101fa.js"),["./ns-low-stock-report-2d8101fa.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-50630f18.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./join-array-4b30b096.js"],import.meta.url)),G=t(()=>e(()=>import("./ns-sale-report-5b586d47.js"),["./ns-sale-report-5b586d47.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-50630f18.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./join-array-4b30b096.js"],import.meta.url)),J=t(()=>e(()=>import("./ns-sold-stock-report-177054bb.js"),["./ns-sold-stock-report-177054bb.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-50630f18.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./select-api-entities-c72f4497.js","./join-array-4b30b096.js"],import.meta.url)),K=t(()=>e(()=>import("./ns-profit-report-f2ead29c.js"),["./ns-profit-report-f2ead29c.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-50630f18.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./select-api-entities-c72f4497.js","./join-array-4b30b096.js"],import.meta.url)),Q=t(()=>e(()=>import("./ns-stock-combined-report-dc25d7cd.js"),["./ns-stock-combined-report-dc25d7cd.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./select-api-entities-c72f4497.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./join-array-4b30b096.js"],import.meta.url)),U=t(()=>e(()=>import("./ns-cash-flow-report-7c9dff88.js"),["./ns-cash-flow-report-7c9dff88.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-50630f18.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),W=t(()=>e(()=>import("./ns-yearly-report-e9f907c8.js"),["./ns-yearly-report-e9f907c8.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-50630f18.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),X=t(()=>e(()=>import("./ns-best-products-report-a3c9ec80.js"),["./ns-best-products-report-a3c9ec80.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-50630f18.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),Z=t(()=>e(()=>import("./ns-payment-types-report-9807dea4.js"),["./ns-payment-types-report-9807dea4.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-50630f18.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),ee=t(()=>e(()=>import("./ns-customers-statement-report-154a2535.js"),["./ns-customers-statement-report-154a2535.js","./currency-f8bd78d1.js","./_plugin-vue_export-helper-c27b6911.js","./runtime-core.esm-bundler-b48de70a.js"],import.meta.url)),te=t(()=>e(()=>import("./ns-stock-adjustment-879e0777.js"),["./ns-stock-adjustment-879e0777.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-procurement-quantity-ecf5ad70.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),oe=t(()=>e(()=>import("./ns-order-invoice-bf57ed55.js"),["./ns-order-invoice-bf57ed55.js","./currency-f8bd78d1.js","./_plugin-vue_export-helper-c27b6911.js","./runtime-core.esm-bundler-b48de70a.js"],import.meta.url)),re=t(()=>e(()=>import("./ns-print-label-53077c3e.js"),["./ns-print-label-53077c3e.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./bootstrap-8be442b1.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),n=window.nsState,se=window.nsScreen;nsExtraComponents.nsToken=t(()=>e(()=>import("./ns-token-8f108109.js"),["./ns-token-8f108109.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url));window.nsHotPress=new V;const d=Object.assign({nsModules:M,nsRewardsSystem:g,nsCreateCoupons:C,nsManageProducts:q,nsSettings:k,nsReset:H,nsPermissions:j,nsProcurement:N,nsProcurementInvoice:x,nsMedia:B,nsTransaction:F,nsDashboard:Y,nsPrintLabel:re,nsNotifications:$,nsSaleReport:G,nsSoldStockReport:J,nsProfitReport:K,nsStockCombinedReport:Q,nsCashFlowReport:U,nsYearlyReport:W,nsPaymentTypesReport:Z,nsBestProductsReport:X,nsLowStockReport:z,nsCustomersStatementReport:ee,nsStockAdjustment:te,nsOrderInvoice:oe,...w},nsExtraComponents);window.nsDashboardAside=m({data(){return{sidebar:"visible",popups:[]}},components:{nsMenu:I,nsSubmenu:L},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardOverlay=m({data(){return{sidebar:null,popups:[]}},components:d,mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})},methods:{closeMenu(){n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}}});window.nsDashboardHeader=m({data(){return{menuToggled:!1,sidebar:null}},components:d,methods:{toggleMenu(){this.menuToggled=!this.menuToggled},toggleSideMenu(){["lg","xl"].includes(se.breakpoint)?n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"}):n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardContent=m({});for(let o in d)window.nsDashboardContent.component(o,d[o]);window.nsDashboardContent.use(S,{styles:Object.values(window.ns.cssFiles)});window.nsComponents=Object.assign(d,w);y.doAction("ns-before-mount");const c=document.querySelector("#dashboard-aside");window.nsDashboardAside&&c&&window.nsDashboardAside.mount(c);const b=document.querySelector("#dashboard-overlay");window.nsDashboardOverlay&&b&&window.nsDashboardOverlay.mount(b);const E=document.querySelector("#dashboard-header");window.nsDashboardHeader&&E&&window.nsDashboardHeader.mount(E);const h=document.querySelector("#dashboard-content");window.nsDashboardContent&&h&&window.nsDashboardContent.mount(h); diff --git a/public/build/assets/auth-415a13f9.js b/public/build/assets/auth-85852227.js similarity index 96% rename from public/build/assets/auth-415a13f9.js rename to public/build/assets/auth-85852227.js index b9dfb5411..c419d0696 100644 --- a/public/build/assets/auth-415a13f9.js +++ b/public/build/assets/auth-85852227.js @@ -1 +1 @@ -import{_ as o}from"./preload-helper-41c905a7.js";import{b as n}from"./components-ef1ba55f.js";import{N as e}from"./ns-hotpress-fbaed768.js";import{c as m}from"./bootstrap-8be442b1.js";import{d as t}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";nsExtraComponents.nsRegister=t(()=>o(()=>import("./ns-register-1025a0d4.js"),["./ns-register-1025a0d4.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));nsExtraComponents.nsLogin=t(()=>o(()=>import("./ns-login-20974704.js"),["./ns-login-20974704.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));nsExtraComponents.nsPasswordLost=t(()=>o(()=>import("./ns-password-lost-11a5d453.js"),["./ns-password-lost-11a5d453.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));nsExtraComponents.nsNewPassword=t(()=>o(()=>import("./ns-new-password-218c1f96.js"),["./ns-new-password-218c1f96.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));window.nsHotPress=new e;window.nsHttpClient=nsHttpClient;window.authVueComponent=m({components:{...nsExtraComponents,...n}});for(let r in n)window.authVueComponent.component(r,n[r]);window.authVueComponent.mount("#page-container"); +import{_ as o}from"./preload-helper-41c905a7.js";import{b as n}from"./components-50630f18.js";import{N as e}from"./ns-hotpress-fbaed768.js";import{c as m}from"./bootstrap-8be442b1.js";import{d as t}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";nsExtraComponents.nsRegister=t(()=>o(()=>import("./ns-register-1025a0d4.js"),["./ns-register-1025a0d4.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));nsExtraComponents.nsLogin=t(()=>o(()=>import("./ns-login-20974704.js"),["./ns-login-20974704.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));nsExtraComponents.nsPasswordLost=t(()=>o(()=>import("./ns-password-lost-11a5d453.js"),["./ns-password-lost-11a5d453.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));nsExtraComponents.nsNewPassword=t(()=>o(()=>import("./ns-new-password-218c1f96.js"),["./ns-new-password-218c1f96.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));window.nsHotPress=new e;window.nsHttpClient=nsHttpClient;window.authVueComponent=m({components:{...nsExtraComponents,...n}});for(let r in n)window.authVueComponent.component(r,n[r]);window.authVueComponent.mount("#page-container"); diff --git a/public/build/assets/components-ef1ba55f.js b/public/build/assets/components-50630f18.js similarity index 99% rename from public/build/assets/components-ef1ba55f.js rename to public/build/assets/components-50630f18.js index d5495ef0c..854e2e63d 100644 --- a/public/build/assets/components-ef1ba55f.js +++ b/public/build/assets/components-50630f18.js @@ -1 +1 @@ -import se from"./ns-alert-popup-5493aad8.js";import{_}from"./currency-f8bd78d1.js";import{n as ve}from"./ns-avatar-image-35303576.js";import{_ as C}from"./_plugin-vue_export-helper-c27b6911.js";import{o as i,c as a,a as l,t as h,f as T,r as w,A as v,e as u,n as m,F as p,b as D,B as R,i as y,w as M,g as E,d as ke,j as G,C as we,D as ne,E as le,G as xe,H as J,I as ee,h as q,J as De,K as Ce,s as te,L as Me}from"./runtime-core.esm-bundler-b48de70a.js";import{h as x,b as $,v as A,F as ie,g as ae,p as re,P as L,w as Y,i as H,a as U,n as de,j as Te,k as Se,l as oe,e as W,S as $e}from"./bootstrap-8be442b1.js";import{n as V,g as Ee,e as z,b as Re,f as ue,h as Fe,i as Oe,a as Pe,j as Ae,c as je,k as He,d as Ue}from"./ns-prompt-popup-100414c5.js";import"./index.es-25aa42ee.js";const Le={methods:{__:_},components:{nsAvatarImage:ve},name:"ns-avatar",data(){return{svg:""}},computed:{avatarUrl(){return this.url.length===0?"":this.url}},props:["url","display-name"]},Ye={class:"flex justify-between items-center flex-shrink-0"},Ve={class:"hidden md:inline-block px-2"},Be={class:"md:hidden px-2"},Ie={class:"px-2"},Ne={class:"overflow-hidden rounded-full bg-gray-600"};function ze(e,t,s,c,d,n){const r=w("ns-avatar-image");return i(),a("div",Ye,[l("span",Ve,h(n.__("Howdy, {name}").replace("{name}",this.displayName)),1),l("span",Be,h(e.displayName),1),l("div",Ie,[l("div",Ne,[T(r,{url:n.avatarUrl,name:e.displayName},null,8,["url","name"])])])])}const qe=C(Le,[["render",ze]]),We={data:()=>({clicked:!1,_save:0}),props:["type","disabled","link","href","routerLink","to","target"],mounted(){},computed:{isDisabled(){return this.disabled&&(this.disabled.length===0||this.disabled==="disabled"||this.disabled)}}},Ge=["disabled"],Ke=["target","href"];function Qe(e,t,s,c,d,n){return i(),a("div",{class:m(["flex ns-button",s.type?s.type:"default"])},[!s.link&&!s.href?(i(),a("button",{key:0,disabled:n.isDisabled,class:"flex rounded items-center py-2 px-3 font-semibold"},[v(e.$slots,"default")],8,Ge)):u("",!0),s.href?(i(),a("a",{key:1,target:s.target,href:s.href,class:"flex rounded items-center py-2 px-3 font-semibold"},[v(e.$slots,"default")],8,Ke)):u("",!0)],2)}const Ze=C(We,[["render",Qe]]),Xe={name:"ns-calendar",props:["date","field","visible","range","selected-range","side"],data(){return{calendar:[[]],currentDay:x(),daysOfWeek:new Array(7).fill("").map((e,t)=>t),hours:0,minutes:0,currentView:"days",clickedOnCalendar:!1,moment:x,months:new Array(12).fill("").map((e,t)=>t)}},computed:{momentCopy(){return x()}},beforeUnmount(){document.removeEventListener("click",this.checkClickedItem)},mounted(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null,""].includes(this.date)?x():x(this.date),this.hours=this.currentDay.hours(),this.minutes=this.currentDay.minutes(),this.build(),this.toggleView("days")},methods:{__:_,handleCalendarClick(){this.clickedOnCalendar=!0},getDayClass({day:e,_dayIndex:t,dayOfWeek:s,_index:c,currentDay:d}){const n=[];return(x(this.date).isSame(e.date,"day")||this.isRangeEdge(e))&&!this.isInvalidRange()?n.push("bg-info-secondary text-primary border-info-secondary text-white"):n.push("hover:bg-numpad-hover"),this.isInvalidRange()&&this.isRangeEdge(e)&&n.push("bg-error-secondary text-white"),c===0&&n.push("border-t border-tab-table-th"),this.isInRange(e)&&!this.isRangeEdge(e)?n.push("bg-info-primary"):e.isDifferentMonth&&!this.isRangeEdge(e)&&n.push("bg-tab-table-th"),n.join(" ")},erase(){this.selectDate({date:x(ns.date.current)})},isInRange(e){return this.range&&this.range.length===2&&this.range[0]&&this.range[1]?x(e.date).isSameOrAfter(this.range[0])&&x(e.date).isSameOrBefore(this.range[1]):!1},isInvalidRange(){return this.selectedRange&&this.selectedRange.endDate?x(this.selectedRange.startDate).isAfter(x(this.selectedRange.endDate))||x(this.selectedRange.endDate).isBefore(x(this.selectedRange.startDate)):!1},isRangeEdge(e){return this.range&&this.range.length===2&&this.range[0]&&this.range[1]?x(e.date).isSame(this.range[0],"day")||x(e.date).isSame(this.range[1],"day"):!1},setYear(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.selectDate({date:this.currentDay.clone()}))},subYear(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.selectDate({date:this.currentDay.clone()}))},addYear(){this.currentDay.add(1,"year"),this.selectDate({date:this.currentDay.clone()})},toggleView(e){this.currentView=e,this.currentView==="years"&&setTimeout(()=>{this.$refs.year.select()},100),this.currentView==="days"&&setTimeout(()=>{this.$refs.hours.addEventListener("focus",function(t){this.select()}),this.$refs.minutes.addEventListener("focus",function(t){this.select()})},100)},setMonth(e){this.currentDay.month(e),this.selectDate({date:this.currentDay.clone()})},detectHoursChange(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.selectDate({date:this.currentDay.clone()})},detectMinuteChange(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.selectDate({date:this.currentDay.clone()})},checkClickedItem(e){this.$parent.$el.getAttribute("class").split(" ").includes("picker")&&(!this.$parent.$el.contains(e.srcElement)&&!this.clickedOnCalendar&&this.visible&&this.$emit("onClickOut",!0),setTimeout(()=>{this.clickedOnCalendar=!1},100))},selectDate(e){if([void 0].includes(e))this.$emit("set",null);else{if(this.side==="left"&&x(this.selectedRange.endDate).isValid()&&e.date.isAfter(this.selectedRange.endDate))return $.error(_("The left range will be invalid.")).subscribe(),!1;if(this.side==="right"&&x(this.selectedRange.startDate).isValid()&&e.date.isBefore(this.selectedRange.startDate))return $.error(_("The right range will be invalid.")).subscribe(),!1;this.currentDay=e.date,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.$emit("set",this.currentDay.format("YYYY-MM-DD HH:mm:ss"))}this.build()},subMonth(){this.currentDay.subtract(1,"month"),this.build()},addMonth(){this.currentDay.add(1,"month"),this.build()},resetCalendar(){this.calendar=[[]]},build(){this.resetCalendar(),this.currentDay.clone().startOf("month");const e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");for(;;){e.day()===0&&this.calendar[0].length>0&&this.calendar.push([]);let s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(x.now(),"day"),isDifferentMonth:!1,isNextMonth:!1,isPreviousMonth:!1}),e.isSame(t,"day"))break;e.add(1,"day")}if(this.calendar[0].length<7){const s=7-this.calendar[0].length,c=this.calendar[0][0].date.clone(),d=[];for(let n=0;nn.handleCalendarClick()),class:"flex bg-box-background flex-col rounded-lg overflow-hidden"},[d.currentView==="years"?(i(),a("div",Je,[l("div",et,[l("div",null,[l("button",{onClick:t[0]||(t[0]=r=>n.subMonth()),class:"w-8 h-8 ns-inset-button border outline-none text-numpad-text rounded"},st)]),l("div",nt,[l("span",{class:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",onClick:t[1]||(t[1]=r=>n.toggleView("months"))},h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[2]||(t[2]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[3]||(t[3]=r=>n.addMonth()),class:"w-8 h-8 ns-inset-button border outline-none text-numpad-text rounded"},it)])]),l("div",at,[l("div",rt,[l("button",{onClick:t[4]||(t[4]=r=>n.subYear()),class:"px-2 py-2"},ot),l("div",ut,[l("input",{type:"text",ref:"year",class:"p-2 flex-auto w-full text-center outline-none",onChange:t[5]||(t[5]=r=>n.setYear(r)),value:d.currentDay.format("YYYY")},null,40,ct)]),l("button",{onClick:t[6]||(t[6]=r=>n.addYear()),class:"px-2 py-2"},ft)])]),l("div",mt,[l("button",{onClick:t[7]||(t[7]=r=>n.toggleView("days")),class:"p-2 w-full ns-inset-button border text-sm error hover:text-white rounded flex items-center justify-center"},h(n.__("Return To Calendar")),1)])])):u("",!0),d.currentView==="months"?(i(),a("div",gt,[l("div",bt,[l("div",null,[l("button",{onClick:t[8]||(t[8]=r=>n.subYear()),class:"w-8 h-8 ns-inset-button outline-none border rounded"},pt)]),l("div",yt,[l("span",vt,h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[9]||(t[9]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[10]||(t[10]=r=>n.addYear()),class:"w-8 h-8 ns-inset-button outline-none border rounded"},wt)])]),l("div",xt,[(i(!0),a(p,null,D(d.months,(r,o)=>(i(),a("div",{key:o,class:"h-8 flex justify-center items-center text-sm border-box-background"},[l("div",Dt,[l("div",{class:m([n.momentCopy.month(r).format("MM")===d.currentDay.format("MM")?"bg-info-secondary text-white":"hover:bg-numpad-hover","h-full w-full border-box-background flex items-center justify-center cursor-pointer"]),onClick:f=>n.setMonth(r)},h(n.momentCopy.format("MMM")),11,Ct)])]))),128))]),l("div",Mt,[l("button",{onClick:t[11]||(t[11]=r=>n.toggleView("days")),class:"p-2 w-full ns-inset-button border text-sm error rounded flex items-center justify-center"},h(n.__("Return To Calendar")),1)])])):u("",!0),d.currentView==="days"?(i(),a("div",Tt,[l("div",St,[l("div",null,[l("button",{onClick:t[12]||(t[12]=r=>n.subMonth()),class:"w-8 h-8 ns-inset-button border rounded"},Et)]),l("div",Rt,[l("span",{class:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",onClick:t[13]||(t[13]=r=>n.toggleView("months"))},h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[14]||(t[14]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[15]||(t[15]=r=>n.addMonth()),class:"w-8 h-8 ns-inset-button border rounded"},Ot)])]),l("div",Pt,[l("div",At,h(n.__("Sun")),1),l("div",jt,h(n.__("Mon")),1),l("div",Ht,h(n.__("Tue")),1),l("div",Ut,h(n.__("Wed")),1),l("div",Lt,h(n.__("Thr")),1),l("div",Yt,h(n.__("Fri")),1),l("div",Vt,h(n.__("Sat")),1)]),(i(!0),a(p,null,D(d.calendar,(r,o)=>(i(),a("div",{key:o,class:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary divide-x divide-y"},[(i(!0),a(p,null,D(d.daysOfWeek,(f,g)=>(i(),a("div",{key:g,class:"md:h-10 h-8 flex justify-center items-center text-sm border-tab-table-th"},[(i(!0),a(p,null,D(r,(b,S)=>(i(),a(p,null,[b.dayOfWeek===f?(i(),a("div",{key:S,class:m([n.getDayClass({day:b,_dayIndex:S,dayOfWeek:f,_index:g,currentDay:d.currentDay}),"h-full w-full flex items-center justify-center cursor-pointer"]),onClick:F=>n.selectDate(b)},[b.isDifferentMonth?u("",!0):(i(),a("span",It,h(b.date.format("DD")),1)),b.isDifferentMonth?(i(),a("span",Nt,h(b.date.format("DD")),1)):u("",!0)],10,Bt)):u("",!0)],64))),256))]))),128))]))),128))])):u("",!0),l("div",zt,[l("div",qt,[l("div",Wt,[l("div",Gt,[l("div",Kt,[l("button",{onClick:t[16]||(t[16]=r=>n.erase()),class:"border ns-inset-button text-sm error rounded md:w-10 w-8 md:h-10 h-8 flex items-center justify-center"},Zt)])])]),l("div",Xt,[d.currentView==="days"?(i(),a("div",Jt,[es,R(l("input",{placeholder:"HH",ref:"hours",onChange:t[17]||(t[17]=r=>n.detectHoursChange(r)),class:"w-12 p-1 text-center border border-numpad-edge bg-input-background outline-none text-sm active:border-numpad-edge","onUpdate:modelValue":t[18]||(t[18]=r=>d.hours=r),type:"number"},null,544),[[A,d.hours]]),ts,R(l("input",{placeholder:"mm",ref:"minutes",onChange:t[19]||(t[19]=r=>n.detectMinuteChange(r)),class:"w-12 p-1 text-center border border-numpad-edge bg-input-background outline-none text-sm active:border-numpad-edge","onUpdate:modelValue":t[20]||(t[20]=r=>d.minutes=r),type:"number"},null,544),[[A,d.minutes]])])):u("",!0)])])])])}const ce=C(Xe,[["render",ss]]),ls={data:()=>({}),props:["checked","field","label"],computed:{isChecked(){return this.field?this.field.value:this.checked},hasError(){return this.field.errors!==void 0&&this.field.errors.length>0}},methods:{toggleIt(){this.field!==void 0&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}},is={class:"w-6 h-6 flex bg-input-background border-input-edge border-2 items-center justify-center cursor-pointer"},as={key:0,class:"las la-check"};function rs(e,t,s,c,d,n){return i(),a("div",{class:"flex ns-checkbox items-center justify-center cursor-pointer",onClick:t[0]||(t[0]=r=>n.toggleIt())},[l("div",is,[n.isChecked?(i(),a("i",as)):u("",!0)]),s.label?(i(),a("label",{key:0,class:m([n.hasError?"has-error":"is-pristine","mx-2"])},h(s.label),3)):u("",!0),s.field?(i(),a("label",{key:1,class:m([n.hasError?"has-error":"is-pristine","mx-2"])},h(s.field.label),3)):u("",!0)])}const ds=C(ls,[["render",rs]]),os={name:"ns-close-button",methods:{}},us={class:"outline-none ns-close-button hover:border-transparent border rounded-full h-8 min-w-[2rem] items-center justify-center"},cs=l("i",{class:"las la-times"},null,-1);function hs(e,t,s,c,d,n){return i(),a("button",us,[cs,y(),v(e.$slots,"default")])}const fs=C(os,[["render",hs]]),ms={data(){return{fields:[],validation:new ie}},props:["popup"],methods:{__:_,popupCloser:ae,popupResolver:re,closePopup(){this.popupResolver(!1)},useFilters(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters(){this.fields.forEach(e=>e.value=""),this.popupResolver(null)}},mounted(){this.fields=this.validation.createFields(this.popup.params.queryFilters),this.popupCloser()}},gs={class:"ns-box shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-5/6-screen flex flex-col"},bs={class:"p-2 border-b ns-box-header flex justify-between items-center"},_s={class:"p-2 ns-box-body flex-auto"},ps={class:"p-2 flex justify-between ns-box-footer border-t"};function ys(e,t,s,c,d,n){const r=w("ns-close-button"),o=w("ns-field"),f=w("ns-button");return i(),a("div",gs,[l("div",bs,[l("h3",null,h(n.__("Search Filters")),1),l("div",null,[T(r,{onClick:t[0]||(t[0]=g=>n.closePopup())})])]),l("div",_s,[(i(!0),a(p,null,D(d.fields,(g,b)=>(i(),E(o,{field:g,key:b},null,8,["field"]))),128))]),l("div",ps,[l("div",null,[T(f,{onClick:t[1]||(t[1]=g=>n.clearFilters()),type:"error"},{default:M(()=>[y(h(n.__("Clear Filters")),1)]),_:1})]),l("div",null,[T(f,{onClick:t[2]||(t[2]=g=>n.useFilters()),type:"info"},{default:M(()=>[y(h(n.__("Use Filters")),1)]),_:1})])])])}const vs=C(ms,[["render",ys]]),ks={data:()=>({prependOptions:!1,showOptions:!0,showCheckboxes:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],headerButtons:[],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(){this.identifier!==void 0&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","createUrl","mode","identifier","queryParams","popup"],computed:{getParsedSrc(){return`${this.src}?${this.sortColumn}${this.searchQuery}${this.queryFiltersString}${this.queryPage}${this.getQueryParams()?"&"+this.getQueryParams():""}`},showQueryFilters(){return this.queryFilters.length>0},getSelectedAction(){const e=this.bulkActions.filter(t=>t.identifier===this.bulkAction);return e.length>0?e[0]:!1},pagination(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage(){return this.result?`&page=${this.page}`:""},resultInfo(){return _("displaying {perPage} on {items} items").replace("{perPage}",this.result.per_page||0).replace("{items}",this.result.total||0)},headerButtonsComponents(){return this.headerButtons.map(e=>ke(()=>new Promise(t=>{t(nsExtraComponents[e])})))}},methods:{__:_,getQueryParams(){return this.queryParams?Object.keys(this.queryParams).map(e=>`${e}=${this.queryParams[e]}`).join("&"):""},pageNumbers(e,t){var s=[];t-3>1&&s.push(1,"...");for(let c=1;c<=e;c++)t+3>c&&t-3c>0||typeof c=="string")},downloadContent(){nsHttpClient.post(`${this.src}/export?${this.getParsedSrc}`,{entries:this.selectedEntries.map(e=>e.$id)}).subscribe(e=>{setTimeout(()=>document.location=e.url,300),$.success(_("The document has been generated.")).subscribe()},e=>{$.error(e.message||_("Unexpected error occurred.")).subscribe()})},clearSelectedEntries(){L.show(V,{title:_("Clear Selected Entries ?"),message:_("Would you like to clear all selected entries ?"),onAction:e=>{e&&(this.selectedEntries=[],this.handleGlobalChange(!1))}})},refreshRow(e){if(console.log({row:e}),e.$checked===!0)this.selectedEntries.filter(s=>s.$id===e.$id).length===0&&this.selectedEntries.push(e);else{const t=this.selectedEntries.filter(s=>s.$id===e.$id);if(t.length>0){const s=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(s,1)}}},handleShowOptions(e){this.result.data.forEach(t=>{t.$id!==e.$id&&(t.$toggled=!1)})},handleGlobalChange(e){this.globallyChecked=e,this.result.data.forEach(t=>{t.$checked=e,this.refreshRow(t)})},loadConfig(){nsHttpClient.get(`${this.src}/config?${this.getQueryParams()}`).subscribe(t=>{this.columns=t.columns,this.bulkActions=t.bulkActions,this.queryFilters=t.queryFilters,this.prependOptions=t.prependOptions,this.showOptions=t.showOptions,this.showCheckboxes=t.showCheckboxes,this.headerButtons=t.headerButtons||[],this.refresh()},t=>{$.error(t.message,"OK",{duration:!1}).subscribe()})},cancelSearch(){this.searchInput="",this.search()},search(){this.searchInput?this.searchQuery=`&search=${this.searchInput}`:this.searchQuery="",this.page=1,this.refresh()},sort(e){if(this.columns[e].$sort===!1)return $.error(_("Sorting is explicitely disabled on this column")).subscribe();for(let 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"":default:this.columns[e].$direction="asc";break}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn=`active=${e}&direction=${this.columns[e].$direction}`:this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo(){if(this.bulkAction)if(this.selectedEntries.length>0){if(confirm(this.getSelectedAction.confirm||_("Would you like to perform the selected bulk action on the selected entries ?")))return nsHttpClient.post(`${this.src}/bulk-actions`,{action:this.bulkAction,entries:this.selectedEntries.map(e=>e.$id)}).subscribe({next:e=>{$.info(e.message).subscribe(),this.selectedEntries=[],this.refresh()},error:e=>{$.error(e.message).subscribe()}})}else return $.error(_("No selection has been made.")).subscribe();else return $.error(_("No action has been selected.")).subscribe()},async openQueryFilter(){try{const e=await new Promise((t,s)=>{L.show(vs,{resolve:t,reject:s,queryFilters:this.queryFilters})});this.withFilters=!1,this.queryFiltersString="",e!==null&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(e))),this.refresh()}catch{}},refresh(){this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get(`${this.getParsedSrc}`).subscribe(t=>{t.data=t.data.map(s=>(this.selectedEntries.filter(d=>d.$id===s.$id).length>0&&(s.$checked=!0),s)),this.isRefreshing=!1,this.result=t,this.page=t.current_page},t=>{this.isRefreshing=!1,$.error(t.message).subscribe()})}}},ws={key:0,id:"crud-table-header",class:"p-2 border-b flex flex-col md:flex-row justify-between flex-wrap"},xs={id:"crud-search-box",class:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex"},Ds={key:0,class:"px-2 flex items-center justify-center"},Cs=["href"],Ms=l("i",{class:"las la-plus"},null,-1),Ts=[Ms],Ss={class:"px-2"},$s={class:"rounded-full p-1 ns-crud-input flex"},Es=l("i",{class:"las la-search"},null,-1),Rs=[Es],Fs=l("i",{class:"las la-times text-white"},null,-1),Os=[Fs],Ps={class:"px-2 flex items-center justify-center"},As={key:1,class:"px-2 flex items-center"},js={key:0,class:"las la-filter"},Hs={key:1,class:"las la-check"},Us={key:2,class:"ml-1"},Ls={key:3,class:"ml-1"},Ys={key:2,id:"custom-buttons"},Vs={id:"crud-buttons",class:"-mx-1 flex flex-wrap w-full md:w-auto"},Bs={key:0,class:"px-1 flex items-center"},Is=l("i",{class:"lar la-check-square"},null,-1),Ns={class:"px-1 flex items-center"},zs=l("i",{class:"las la-download"},null,-1),qs={class:"flex p-2"},Ws={class:"overflow-x-auto flex-auto"},Gs={key:0,class:"table ns-table w-full"},Ks={key:0,class:"text-center px-2 border w-16 py-2"},Qs={key:1,class:"text-left px-2 py-2 w-16 border"},Zs=["onClick"],Xs={class:"w-full flex justify-between items-center"},Js={class:"flex"},en={class:"h-6 w-6 flex justify-center items-center"},tn={key:0,class:"las la-sort-amount-up"},sn={key:1,class:"las la-sort-amount-down"},nn={key:2,class:"text-left px-2 py-2 w-16 border"},ln={key:1},an=["colspan"],rn={class:"p-2 flex border-t flex-col md:flex-row justify-between footer"},dn={key:0,id:"grouped-actions",class:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1"},on={class:"bg-input-disabled",selected:"",value:""},un=["value"],cn={class:"flex"},hn={class:"items-center flex text-primary mx-4"},fn={id:"pagination",class:"flex items-center -mx-1"},mn=l("i",{class:"las la-angle-double-left"},null,-1),gn=[mn],bn=["onClick"],_n=l("i",{class:"las la-angle-double-right"},null,-1),pn=[_n];function yn(e,t,s,c,d,n){const r=w("ns-checkbox"),o=w("ns-table-row");return i(),a("div",{id:"crud-table",class:m(["w-full rounded-lg",s.mode!=="light"?"shadow mb-8":""])},[s.mode!=="light"?(i(),a("div",ws,[l("div",xs,[s.createUrl?(i(),a("div",Ds,[l("a",{href:s.createUrl||"#",class:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border"},Ts,8,Cs)])):u("",!0),l("div",Ss,[l("div",$s,[R(l("input",{onKeypress:t[0]||(t[0]=Y(f=>n.search(),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=f=>e.searchInput=f),type:"text",class:"w-36 md:w-auto bg-transparent outline-none px-2"},null,544),[[A,e.searchInput]]),l("button",{onClick:t[2]||(t[2]=f=>n.search()),class:"rounded-full w-8 h-8 outline-none ns-crud-input-button"},Rs),e.searchQuery?(i(),a("button",{key:0,onClick:t[3]||(t[3]=f=>n.cancelSearch()),class:"ml-1 rounded-full w-8 h-8 bg-error-secondary outline-none hover:bg-error-tertiary"},Os)):u("",!0)])]),l("div",Ps,[l("button",{onClick:t[4]||(t[4]=f=>n.refresh()),class:"rounded-full text-sm h-10 px-3 outline-none border ns-crud-button"},[l("i",{class:m([e.isRefreshing?"animate-spin":"","las la-sync"])},null,2)])]),n.showQueryFilters?(i(),a("div",As,[l("button",{onClick:t[5]||(t[5]=f=>n.openQueryFilter()),class:m([e.withFilters?"table-filters-enabled":"table-filters-disabled","ns-crud-button border rounded-full text-sm h-10 px-3 outline-none"])},[e.withFilters?u("",!0):(i(),a("i",js)),e.withFilters?(i(),a("i",Hs)):u("",!0),e.withFilters?u("",!0):(i(),a("span",Us,h(n.__("Filters")),1)),e.withFilters?(i(),a("span",Ls,h(n.__("Has Filters")),1)):u("",!0)],2)])):u("",!0),n.headerButtonsComponents.length>0?(i(),a("div",Ys,[(i(!0),a(p,null,D(n.headerButtonsComponents,(f,g)=>(i(),E(G(f),{onRefresh:t[6]||(t[6]=b=>n.refresh()),result:e.result,key:g},null,40,["result"]))),128))])):u("",!0)]),l("div",Vs,[e.selectedEntries.length>0?(i(),a("div",Bs,[l("button",{onClick:t[7]||(t[7]=f=>n.clearSelectedEntries()),class:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border"},[Is,y(" "+h(n.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length)),1)])])):u("",!0),l("div",Ns,[l("button",{onClick:t[8]||(t[8]=f=>n.downloadContent()),class:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none"},[zs,y(" "+h(n.__("Download")),1)])])])])):u("",!0),l("div",qs,[l("div",Ws,[Object.values(e.columns).length>0?(i(),a("table",Gs,[l("thead",null,[l("tr",null,[e.showCheckboxes?(i(),a("th",Ks,[T(r,{checked:e.globallyChecked,onChange:t[9]||(t[9]=f=>n.handleGlobalChange(f))},null,8,["checked"])])):u("",!0),e.prependOptions&&e.showOptions?(i(),a("th",Qs)):u("",!0),(i(!0),a(p,null,D(e.columns,(f,g)=>(i(),a("th",{key:g,onClick:b=>n.sort(g),style:we({width:f.width||"auto","max-width":f.maxWidth||"auto","min-width":f.minWidth||"auto"}),class:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2"},[l("div",Xs,[l("span",Js,h(f.label),1),l("span",en,[f.$direction==="desc"?(i(),a("i",tn)):u("",!0),f.$direction==="asc"?(i(),a("i",sn)):u("",!0)])])],12,Zs))),128)),!e.prependOptions&&e.showOptions?(i(),a("th",nn)):u("",!0)])]),l("tbody",null,[e.result.data!==void 0&&e.result.data.length>0?(i(!0),a(p,{key:0},D(e.result.data,(f,g)=>(i(),E(o,{key:g,onUpdated:t[10]||(t[10]=b=>n.refreshRow(b)),columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,showCheckboxes:e.showCheckboxes,row:f,onReload:t[11]||(t[11]=b=>n.refresh()),onToggled:t[12]||(t[12]=b=>n.handleShowOptions(b))},null,8,["columns","prependOptions","showOptions","showCheckboxes","row"]))),128)):u("",!0),!e.result||e.result.data.length===0?(i(),a("tr",ln,[l("td",{colspan:Object.values(e.columns).length+2,class:"text-center border py-3"},h(n.__("There is nothing to display...")),9,an)])):u("",!0)])])):u("",!0)])]),l("div",rn,[e.bulkActions.length>0?(i(),a("div",dn,[R(l("select",{class:"outline-none bg-transparent","onUpdate:modelValue":t[13]||(t[13]=f=>e.bulkAction=f),id:"grouped-actions"},[l("option",on,[v(e.$slots,"bulk-label",{},()=>[y(h(n.__("Bulk Actions")),1)])]),(i(!0),a(p,null,D(e.bulkActions,(f,g)=>(i(),a("option",{class:"bg-input-disabled",key:g,value:f.identifier},h(f.label),9,un))),128))],512),[[H,e.bulkAction]]),l("button",{onClick:t[14]||(t[14]=f=>n.bulkDo()),class:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center"},[v(e.$slots,"bulk-go",{},()=>[y(h(n.__("Apply")),1)])])])):u("",!0),l("div",cn,[l("div",hn,h(n.resultInfo),1),l("div",fn,[e.result.current_page?(i(),a(p,{key:0},[l("a",{href:"javascript:void(0)",onClick:t[15]||(t[15]=f=>{e.page=e.result.first_page,n.refresh()}),class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow"},gn),(i(!0),a(p,null,D(n.pagination,(f,g)=>(i(),a(p,null,[e.page!=="..."?(i(),a("a",{key:g,class:m([e.page==f?"bg-info-tertiary border-transparent text-white":"","mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border"]),onClick:b=>{e.page=f,n.refresh()},href:"javascript:void(0)"},h(f),11,bn)):u("",!0),e.page==="..."?(i(),a("a",{key:g,href:"javascript:void(0)",class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border"},"...")):u("",!0)],64))),256)),l("a",{href:"javascript:void(0)",onClick:t[16]||(t[16]=f=>{e.page=e.result.last_page,n.refresh()}),class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow"},pn)],64)):u("",!0)])])])],2)}const vn=C(ks,[["render",yn]]),kn={data:()=>({form:{},globallyChecked:!1,formValidation:new ie,rows:[]}),emits:["updated","saved"],mounted(){this.loadForm()},props:["src","createUrl","fieldClass","returnUrl","submitUrl","submitMethod","disableTabs","queryParams","popup","optionAttributes"],computed:{activeTabFields(){for(let e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]},activeTabIdentifier(){for(let e in this.form.tabs)if(this.form.tabs[e].active)return e;return{}}},methods:{__:_,popupResolver:re,toggle(e){for(let t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},async handleSaved(e,t,s){this.form.tabs[t].fields.filter(c=>{c.name===s.name&&e.data.entry&&(c.options.push({label:e.data.entry[this.optionAttributes.label],value:e.data.entry[this.optionAttributes.value]}),c.value=e.data.entry.id)})},handleClose(){this.popup&&this.popupResolver(!1)},submit(){if(this.formValidation.validateForm(this.form).length>0)return $.error(_("Unable to proceed the form is not valid"),_("Close")).subscribe();if(this.formValidation.disableForm(this.form),this.submitUrl===void 0)return $.error(_("No submit URL was provided"),_("Okay")).subscribe();U[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.appendQueryParamas(this.submitUrl),this.formValidation.extractForm(this.form)).subscribe(e=>{if(e.status==="success")if(this.popup)this.popupResolver(e);else{if(this.submitMethod&&this.submitMethod.toLowerCase()==="post"&&this.returnUrl!==!1)return document.location=e.data.editUrl||this.returnUrl;$.info(e.message,_("Okay"),{duration:3e3}).subscribe(),this.$emit("saved",e)}this.formValidation.enableForm(this.form)},e=>{$.error(e.message,void 0,{duration:5e3}).subscribe(),e.data!==void 0&&this.formValidation.triggerError(this.form,e.data),this.formValidation.enableForm(this.form)})},handleGlobalChange(e){this.globallyChecked=e,this.rows.forEach(t=>t.$checked=e)},loadForm(){return new Promise((e,t)=>{U.get(`${this.appendQueryParamas(this.src)}`).subscribe({next:c=>{e(c),this.form=this.parseForm(c.form),de.doAction("ns-crud-form-loaded",this),this.$emit("updated",this.form)},error:c=>{t(c),$.error(c.message,_("Okay"),{duration:0}).subscribe()}})})},appendQueryParamas(e){if(this.queryParams===void 0)return e;const t=Object.keys(this.queryParams).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(this.queryParams[s])}`).join("&");return e.includes("?")?`${e}&${t}`:`${e}?${t}`},parseForm(e){e.main.value=e.main.value===void 0?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];let t=0;for(let s in e.tabs)t===0&&(e.tabs[s].active=!0),e.tabs[s].active=e.tabs[s].active===void 0?!1:e.tabs[s].active,e.tabs[s].fields=this.formValidation.createFields(e.tabs[s].fields),t++;return e}}},wn={key:0,class:"flex items-center justify-center h-full"},xn={key:0,class:"box-header border-b border-box-edge box-border p-2 flex justify-between items-center"},Dn={class:"text-primary font-bold text-lg"},Cn={class:"flex flex-col"},Mn={key:0,class:"flex justify-between items-center"},Tn={for:"title",class:"font-bold my-2 text-primary"},Sn={key:0},$n={for:"title",class:"text-sm my-2"},En=["href"],Rn=["disabled"],Fn=["disabled"],On={key:0,class:"text-xs text-primary py-1"},Pn={key:0},An={key:1},jn={class:"header flex ml-4",style:{"margin-bottom":"-1px"}},Hn=["onClick"],Un={class:"ns-tab-item"},Ln={class:"border p-4 rounded"},Yn={class:"-mx-4 flex flex-wrap"},Vn={key:0,class:"flex justify-end"},Bn=["disabled"];function In(e,t,s,c,d,n){const r=w("ns-spinner"),o=w("ns-close-button"),f=w("ns-field");return i(),a(p,null,[Object.values(e.form).length===0?(i(),a("div",wn,[T(r)])):u("",!0),Object.values(e.form).length>0?(i(),a("div",{key:1,class:m(["form flex-auto",s.popup?"bg-box-background w-95vw md:w-2/3-screen":""]),id:"crud-form"},[s.popup?(i(),a("div",xn,[l("h2",Dn,h(s.popup.params.title),1),l("div",null,[T(o,{onClick:t[0]||(t[0]=g=>n.handleClose())})])])):u("",!0),Object.values(e.form).length>0?(i(),a("div",{key:1,class:m(s.popup?"p-2":"")},[l("div",Cn,[e.form.main?(i(),a("div",Mn,[l("label",Tn,[e.form.main.name?(i(),a("span",Sn,h(e.form.main.label),1)):u("",!0)]),l("div",$n,[s.returnUrl&&!s.popup?(i(),a("a",{key:0,href:s.returnUrl,class:"rounded-full border px-2 py-1 ns-inset-button error"},h(n.__("Go Back")),9,En)):u("",!0)])])):u("",!0),e.form.main.name?(i(),a(p,{key:1},[l("div",{class:m([e.form.main.disabled?"disabled":e.form.main.errors.length>0?"error":"info","input-group flex border-2 rounded overflow-hidden"])},[R(l("input",{"onUpdate:modelValue":t[1]||(t[1]=g=>e.form.main.value=g),onKeydown:t[2]||(t[2]=Y(g=>n.submit(),["enter"])),onKeypress:t[3]||(t[3]=g=>e.formValidation.checkField(e.form.main)),onBlur:t[4]||(t[4]=g=>e.formValidation.checkField(e.form.main)),onChange:t[5]||(t[5]=g=>e.formValidation.checkField(e.form.main)),disabled:e.form.main.disabled,type:"text",class:"flex-auto outline-none h-10 px-2"},null,40,Rn),[[A,e.form.main.value]]),l("button",{disabled:e.form.main.disabled,class:m([e.form.main.disabled?"disabled":e.form.main.errors.length>0?"error":"","outline-none px-4 h-10 text-white"]),onClick:t[6]||(t[6]=g=>n.submit())},h(n.__("Save")),11,Fn)],2),e.form.main.description&&e.form.main.errors.length===0?(i(),a("p",On,h(e.form.main.description),1)):u("",!0),(i(!0),a(p,null,D(e.form.main.errors,(g,b)=>(i(),a("p",{key:b,class:"text-xs py-1 text-error-tertiary"},[g.identifier==="required"?(i(),a("span",Pn,[v(e.$slots,"error-required",{},()=>[y(h(g.identifier),1)])])):u("",!0),g.identifier==="invalid"?(i(),a("span",An,[v(e.$slots,"error-invalid",{},()=>[y(h(g.message),1)])])):u("",!0)]))),128))],64)):u("",!0)]),s.disableTabs!=="true"?(i(),a("div",{key:0,id:"tabs-container",class:m([s.popup?"mt-5":"my-5","ns-tab"])},[l("div",jn,[(i(!0),a(p,null,D(e.form.tabs,(g,b)=>(i(),a("div",{key:b,onClick:S=>n.toggle(b),class:m([g.active?"active border border-b-transparent":"inactive border","tab rounded-tl rounded-tr border px-3 py-2 cursor-pointer"]),style:{"margin-right":"-1px"}},h(g.label),11,Hn))),128))]),l("div",Un,[l("div",Ln,[l("div",Yn,[(i(!0),a(p,null,D(n.activeTabFields,(g,b)=>(i(),a("div",{key:`${n.activeTabIdentifier}-${b}`,class:m(s.fieldClass||"px-4 w-full md:w-1/2 lg:w-1/3")},[T(f,{onSaved:S=>n.handleSaved(S,n.activeTabIdentifier,g),onBlur:S=>e.formValidation.checkField(g),onChange:S=>e.formValidation.checkField(g),field:g},null,8,["onSaved","onBlur","onChange","field"])],2))),128))]),e.form.main.name?u("",!0):(i(),a("div",Vn,[l("div",{class:m(["ns-button",e.form.main.disabled?"default":e.form.main.errors.length>0?"error":"info"])},[l("button",{disabled:e.form.main.disabled,onClick:t[7]||(t[7]=g=>n.submit()),class:"outline-none px-4 h-10 border-l"},h(n.__("Save")),9,Bn)],2)]))])])],2)):u("",!0)],2)):u("",!0)],2)):u("",!0)],64)}const Nn=C(kn,[["render",In]]),zn={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},qn={class:"flex flex-auto flex-col mb-2"},Wn=["for"],Gn={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Kn={class:"sm:text-sm sm:leading-5"},Qn=["disabled","id","placeholder"];function Zn(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",qn,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Wn),l("div",{class:m([n.hasError?"border-error-primary":"border-input-edge","bg-input-background text-secondary mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",Gn,[l("span",Kn,h(s.leading),1)])):u("",!0),R(l("input",{disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),onBlur:t[1]||(t[1]=o=>e.$emit("blur",this)),onChange:t[2]||(t[2]=o=>e.$emit("change",this)),id:s.field.name,type:"date",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.placeholder},null,42,Qn),[[A,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const Xn=C(zn,[["render",Zn]]),he={isSame:(e,t,s)=>{let c=new Date(e),d=new Date(t);return s==="date"&&(c.setHours(0,0,0,0),d.setHours(0,0,0,0)),c.getTime()===d.getTime()},daysInMonth:(e,t)=>new Date(e,t,0).getDate(),weekNumber:e=>Ee(e),format:(e,t)=>z(e,t),nextMonth:e=>{let t=new Date(e.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t},prevMonth:e=>{let t=new Date(e.getTime());return t.setDate(1),t.setMonth(t.getMonth()-1),t},validateDateRange:(e,t,s)=>{let c=new Date(s),d=new Date(t);return s&&e.getTime()>c.getTime()?c:t&&e.getTime()({...{direction:"ltr",format:"mm/dd/yyyy",separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:z.i18n.dayNames.slice(0,7).map(s=>s.substring(0,2)),monthNames:z.i18n.monthNames.slice(0,12),firstDay:0},...e}),yearMonth:e=>{let t=e.getMonth()+1;return e.getFullYear()+(t<10?"0":"")+t},isValidDate:e=>e instanceof Date&&!isNaN(e)},K={props:{dateUtil:{type:[Object,String],default:"native"}},created(){this.$dateUtil=he}},Jn={mixins:[K],name:"calendar",props:{monthDate:Date,localeData:Object,start:Date,end:Date,minDate:Date,maxDate:Date,showDropdowns:{type:Boolean,default:!1},showWeekNumbers:{type:Boolean,default:!1},dateFormat:{type:Function,default:null}},data(){let e=this.monthDate||this.start||new Date;return{currentMonthDate:e,year_text:e.getFullYear()}},methods:{prevMonthClick(){this.changeMonthDate(this.$dateUtil.prevMonth(this.currentMonthDate))},nextMonthClick(){this.changeMonthDate(this.$dateUtil.nextMonth(this.currentMonthDate))},changeMonthDate(e,t=!0){let s=this.$dateUtil.yearMonth(this.currentMonthDate);this.currentMonthDate=this.$dateUtil.validateDateRange(e,this.minDate,this.maxDate),t&&s!==this.$dateUtil.yearMonth(this.currentMonthDate)&&this.$emit("change-month",{month:this.currentMonthDate.getMonth()+1,year:this.currentMonthDate.getFullYear()}),this.checkYear()},dayClass(e){let t=new Date(e);t.setHours(0,0,0,0);let s=new Date(this.start);s.setHours(0,0,0,0);let c=new Date(this.end);c.setHours(0,0,0,0);let d={off:e.getMonth()+1!==this.month,weekend:e.getDay()===6||e.getDay()===0,today:t.setHours(0,0,0,0)==new Date().setHours(0,0,0,0),active:t.setHours(0,0,0,0)==new Date(this.start).setHours(0,0,0,0)||t.setHours(0,0,0,0)==new Date(this.end).setHours(0,0,0,0),"in-range":t>=s&&t<=c,"start-date":t.getTime()===s.getTime(),"end-date":t.getTime()===c.getTime(),disabled:this.minDate&&t.getTime()this.maxDate.getTime()};return this.dateFormat?this.dateFormat(d,e):d},checkYear(){this.$refs.yearSelect!==document.activeElement&&this.$nextTick(()=>{this.year_text=this.monthDate.getFullYear()})}},computed:{monthName(){return this.locale.monthNames[this.currentMonthDate.getMonth()]},year:{get(){return this.year_text},set(e){this.year_text=e;let t=this.$dateUtil.validateDateRange(new Date(e,this.month,1),this.minDate,this.maxDate);this.$dateUtil.isValidDate(t)&&this.$emit("change-month",{month:t.getMonth(),year:t.getFullYear()})}},month:{get(){return this.currentMonthDate.getMonth()+1},set(e){let t=this.$dateUtil.validateDateRange(new Date(this.year,e-1,1),this.minDate,this.maxDate);this.$emit("change-month",{month:t.getMonth()+1,year:t.getFullYear()})}},calendar(){let e=this.month,t=this.currentMonthDate.getFullYear(),s=new Date(t,e-1,1),c=this.$dateUtil.prevMonth(s).getMonth()+1,d=this.$dateUtil.prevMonth(s).getFullYear(),n=new Date(d,e-1,0).getDate(),r=s.getDay(),o=[];for(let b=0;b<6;b++)o[b]=[];let f=n-r+this.locale.firstDay+1;f>n&&(f-=7),r===this.locale.firstDay&&(f=n-6);let g=new Date(d,c-1,f,12,0,0);for(let b=0,S=0,F=0;b<6*7;b++,S++,g.setDate(g.getDate()+1))b>0&&S%7===0&&(S=0,F++),o[F][S]=new Date(g.getTime());return o},months(){let e=this.locale.monthNames.map((t,s)=>({label:t,value:s}));if(this.maxDate&&this.minDate){let t=this.maxDate.getFullYear()-this.minDate.getFullYear();if(t<2){let s=[];if(t<1)for(let c=this.minDate.getMonth();c<=this.maxDate.getMonth();c++)s.push(c);else{for(let c=0;c<=this.maxDate.getMonth();c++)s.push(c);for(let c=this.minDate.getMonth();c<12;c++)s.push(c)}if(s.length>0)return e.filter(c=>s.find(d=>c.value===d)>-1)}}return e},locale(){return this.$dateUtil.localeData(this.localeData)}},watch:{monthDate(e){this.currentMonthDate.getTime()!==e.getTime()&&this.changeMonthDate(e,!1)}}},fe=e=>(ne("data-v-66e2a2e7"),e=e(),le(),e),el={class:"table-condensed"},tl=fe(()=>l("span",null,null,-1)),sl=[tl],nl=["colspan"],ll={class:"row mx-1"},il=["value"],al=["colspan"],rl=fe(()=>l("span",null,null,-1)),dl=[rl],ol={key:0,class:"week"},ul={key:0,class:"week"},cl=["onClick","onMouseover"];function hl(e,t,s,c,d,n){return i(),a("table",el,[l("thead",null,[l("tr",null,[l("th",{class:"prev available",onClick:t[0]||(t[0]=(...r)=>n.prevMonthClick&&n.prevMonthClick(...r)),tabindex:"0"},sl),s.showDropdowns?(i(),a("th",{key:0,colspan:s.showWeekNumbers?6:5,class:"month"},[l("div",ll,[R(l("select",{"onUpdate:modelValue":t[1]||(t[1]=r=>n.month=r),class:"monthselect col"},[(i(!0),a(p,null,D(n.months,r=>(i(),a("option",{key:r.value,value:r.value+1},h(r.label),9,il))),128))],512),[[H,n.month]]),R(l("input",{ref:"yearSelect",type:"number","onUpdate:modelValue":t[2]||(t[2]=r=>n.year=r),onBlur:t[3]||(t[3]=(...r)=>n.checkYear&&n.checkYear(...r)),class:"yearselect col"},null,544),[[A,n.year]])])],8,nl)):(i(),a("th",{key:1,colspan:s.showWeekNumbers?6:5,class:"month"},h(n.monthName)+" "+h(n.year),9,al)),l("th",{class:"next available",onClick:t[4]||(t[4]=(...r)=>n.nextMonthClick&&n.nextMonthClick(...r)),tabindex:"0"},dl)])]),l("tbody",null,[l("tr",null,[s.showWeekNumbers?(i(),a("th",ol,h(n.locale.weekLabel),1)):u("",!0),(i(!0),a(p,null,D(n.locale.daysOfWeek,r=>(i(),a("th",{key:r},h(r),1))),128))]),(i(!0),a(p,null,D(n.calendar,(r,o)=>(i(),a("tr",{key:o},[s.showWeekNumbers&&(o%7||o===0)?(i(),a("td",ul,h(e.$dateUtil.weekNumber(r[0])),1)):u("",!0),(i(!0),a(p,null,D(r,(f,g)=>(i(),a("td",{class:m(n.dayClass(f)),onClick:b=>e.$emit("dateClick",f),onMouseover:b=>e.$emit("hoverDate",f),key:g},[v(e.$slots,"date-slot",{date:f},()=>[y(h(f.getDate()),1)],!0)],42,cl))),128))]))),128))])])}const fl=C(Jn,[["render",hl],["__scopeId","data-v-66e2a2e7"]]),ml={props:{miniuteIncrement:{type:Number,default:5},hour24:{type:Boolean,default:!0},secondPicker:{type:Boolean,default:!1},currentTime:{default(){return new Date}},readonly:{type:Boolean,default:!1}},data(){let e=this.currentTime?this.currentTime:new Date,t=e.getHours();return{hour:this.hour24?t:t%12||12,minute:e.getMinutes()-e.getMinutes()%this.miniuteIncrement,second:e.getSeconds(),ampm:t<12?"AM":"PM"}},computed:{hours(){let e=[],t=this.hour24?24:12;for(let s=0;se<10?"0"+e.toString():e.toString(),getHour(){return this.hour24?this.hour:this.hour===12?this.ampm==="AM"?0:12:this.hour+(this.ampm==="PM"?12:0)},onChange(){this.$emit("update",{hours:this.getHour(),minutes:this.minute,seconds:this.second})}}},gl={class:"calendar-time"},bl=["disabled"],_l=["value"],pl=["disabled"],yl=["value"],vl=["disabled"],kl=["value"],wl=["disabled"],xl=l("option",{value:"AM"},"AM",-1),Dl=l("option",{value:"PM"},"PM",-1),Cl=[xl,Dl];function Ml(e,t,s,c,d,n){return i(),a("div",gl,[R(l("select",{"onUpdate:modelValue":t[0]||(t[0]=r=>d.hour=r),class:"hourselect form-control mr-1",disabled:s.readonly},[(i(!0),a(p,null,D(n.hours,r=>(i(),a("option",{key:r,value:r},h(n.formatNumber(r)),9,_l))),128))],8,bl),[[H,d.hour]]),y(" :"),R(l("select",{"onUpdate:modelValue":t[1]||(t[1]=r=>d.minute=r),class:"minuteselect form-control ml-1",disabled:s.readonly},[(i(!0),a(p,null,D(n.minutes,r=>(i(),a("option",{key:r,value:r},h(n.formatNumber(r)),9,yl))),128))],8,pl),[[H,d.minute]]),s.secondPicker?(i(),a(p,{key:0},[y(" :"),R(l("select",{"onUpdate:modelValue":t[2]||(t[2]=r=>d.second=r),class:"secondselect form-control ml-1",disabled:s.readonly},[(i(),a(p,null,D(60,r=>l("option",{key:r-1,value:r-1},h(n.formatNumber(r-1)),9,kl)),64))],8,vl),[[H,d.second]])],64)):u("",!0),s.hour24?u("",!0):R((i(),a("select",{key:1,"onUpdate:modelValue":t[3]||(t[3]=r=>d.ampm=r),class:"ampmselect",disabled:s.readonly},Cl,8,wl)),[[H,d.ampm]])])}const Tl=C(ml,[["render",Ml]]),Sl={mixins:[K],props:{ranges:Object,selected:Object,localeData:Object,alwaysShowCalendars:Boolean},data(){return{customRangeActive:!1}},methods:{clickRange(e){this.customRangeActive=!1,this.$emit("clickRange",e)},clickCustomRange(){this.customRangeActive=!0,this.$emit("showCustomRange")},range_class(e){return{active:e.selected===!0}}},computed:{listedRanges(){return this.ranges?Object.keys(this.ranges).map(e=>({label:e,value:this.ranges[e],selected:this.$dateUtil.isSame(this.selected.startDate,this.ranges[e][0])&&this.$dateUtil.isSame(this.selected.endDate,this.ranges[e][1])})):!1},selectedRange(){return this.listedRanges.find(e=>e.selected===!0)},showCustomRangeLabel(){return!this.alwaysShowCalendars}}},$l={class:"ranges"},El={key:0},Rl=["onClick","data-range-key"];function Fl(e,t,s,c,d,n){return i(),a("div",$l,[s.ranges?(i(),a("ul",El,[(i(!0),a(p,null,D(n.listedRanges,r=>(i(),a("li",{onClick:o=>n.clickRange(r.value),"data-range-key":r.label,key:r.label,class:m(n.range_class(r)),tabindex:"0"},h(r.label),11,Rl))),128)),n.showCustomRangeLabel?(i(),a("li",{key:0,class:m({active:d.customRangeActive||!n.selectedRange}),onClick:t[0]||(t[0]=(...r)=>n.clickCustomRange&&n.clickCustomRange(...r)),tabindex:"0"},h(s.localeData.customRangeLabel),3)):u("",!0)])):u("",!0)])}const Ol=C(Sl,[["render",Fl]]),Pl={mounted(e,{instance:t}){if(t.appendToBody){const{height:s,top:c,left:d,width:n,right:r}=t.$refs.toggle.getBoundingClientRect();e.unbindPosition=t.calculatePosition(e,t,{width:n,top:window.scrollY+c+s,left:window.scrollX+d,right:r}),document.body.appendChild(e)}else t.$el.appendChild(e)},unmounted(e,{instance:t}){t.appendToBody&&(e.unbindPosition&&typeof e.unbindPosition=="function"&&e.unbindPosition(),e.parentNode&&e.parentNode.removeChild(e))}},Al={inheritAttrs:!1,components:{Calendar:fl,CalendarTime:Tl,CalendarRanges:Ol},mixins:[K],directives:{appendToBody:Pl},emits:["update:modelValue","toggle","hoverDate","startSelection","select","change-month","finishSelection"],props:{modelValue:{type:Object},minDate:{type:[String,Date],default(){return null}},maxDate:{type:[String,Date],default(){return null}},showWeekNumbers:{type:Boolean,default:!1},linkedCalendars:{type:Boolean,default:!0},singleDatePicker:{type:[Boolean,String],default:!1},showDropdowns:{type:Boolean,default:!1},timePicker:{type:Boolean,default:!1},timePickerIncrement:{type:Number,default:5},timePicker24Hour:{type:Boolean,default:!0},timePickerSeconds:{type:Boolean,default:!1},autoApply:{type:Boolean,default:!1},localeData:{type:Object,default(){return{}}},dateRange:{type:[Object],default:null,required:!0},ranges:{type:[Object,Boolean],default(){let e=new Date;e.setHours(0,0,0,0);let t=new Date;t.setHours(11,59,59,999);let s=new Date;s.setDate(e.getDate()-1),s.setHours(0,0,0,0);let c=new Date;c.setDate(e.getDate()-1),c.setHours(11,59,59,999);let d=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,0,11,59,59,999);return{Today:[e,t],Yesterday:[s,c],"This month":[d,n],"This year":[new Date(e.getFullYear(),0,1),new Date(e.getFullYear(),11,31,11,59,59,999)],"Last month":[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0,11,59,59,999)]}}},opens:{type:String,default:"center"},dateFormat:Function,alwaysShowCalendars:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},controlContainerClass:{type:[Object,String],default:"form-control reportrange-text"},appendToBody:{type:Boolean,default:!1},calculatePosition:{type:Function,default(e,t,{width:s,top:c,left:d,right:n}){t.opens==="center"?e.style.left=d+s/2+"px":t.opens==="left"?e.style.right=window.innerWidth-n+"px":t.opens==="right"&&(e.style.left=d+"px"),e.style.top=c+"px"}},closeOnEsc:{type:Boolean,default:!0},readonly:{type:Boolean}},data(){const e=he;let t={locale:e.localeData({...this.localeData})},s=this.dateRange.startDate||null,c=this.dateRange.endDate||null;if(t.monthDate=s?new Date(s):new Date,t.nextMonthDate=e.nextMonth(t.monthDate),t.start=s?new Date(s):null,this.singleDatePicker&&this.singleDatePicker!=="range"?t.end=t.start:t.end=c?new Date(c):null,t.in_selection=!1,t.open=!1,t.showCustomRangeCalendars=!1,t.locale.firstDay!==0){let d=t.locale.firstDay,n=[...t.locale.daysOfWeek];for(;d>0;)n.push(n.shift()),d--;t.locale.daysOfWeek=n}return t},methods:{dateFormatFn(e,t){let s=new Date(t);s.setHours(0,0,0,0);let c=new Date(this.start);c.setHours(0,0,0,0);let d=new Date(this.end);return d.setHours(0,0,0,0),e["in-range"]=s>=c&&s<=d,this.dateFormat?this.dateFormat(e,t):e},changeLeftMonth(e){let t=new Date(e.year,e.month-1,1);this.monthDate=t,(this.linkedCalendars||this.$dateUtil.yearMonth(this.monthDate)>=this.$dateUtil.yearMonth(this.nextMonthDate))&&(this.nextMonthDate=this.$dateUtil.validateDateRange(this.$dateUtil.nextMonth(t),this.minDate,this.maxDate),(!this.singleDatePicker||this.singleDatePicker==="range")&&this.$dateUtil.yearMonth(this.monthDate)===this.$dateUtil.yearMonth(this.nextMonthDate)&&(this.monthDate=this.$dateUtil.validateDateRange(this.$dateUtil.prevMonth(this.monthDate),this.minDate,this.maxDate))),this.$emit("change-month",this.monthDate,0)},changeRightMonth(e){let t=new Date(e.year,e.month-1,1);this.nextMonthDate=t,(this.linkedCalendars||this.$dateUtil.yearMonth(this.nextMonthDate)<=this.$dateUtil.yearMonth(this.monthDate))&&(this.monthDate=this.$dateUtil.validateDateRange(this.$dateUtil.prevMonth(t),this.minDate,this.maxDate),this.$dateUtil.yearMonth(this.monthDate)===this.$dateUtil.yearMonth(this.nextMonthDate)&&(this.nextMonthDate=this.$dateUtil.validateDateRange(this.$dateUtil.nextMonth(this.nextMonthDate),this.minDate,this.maxDate))),this.$emit("change-month",this.monthDate,1)},normalizeDatetime(e,t){let s=new Date(e);return this.timePicker&&t&&(s.setHours(t.getHours()),s.setMinutes(t.getMinutes()),s.setSeconds(t.getSeconds()),s.setMilliseconds(t.getMilliseconds())),s},dateClick(e){if(this.readonly)return!1;this.in_selection?(this.in_selection=!1,this.end=this.normalizeDatetime(e,this.end),this.end=this.start&&(this.end=t),this.$emit("hoverDate",e)},onClickPicker(){this.disabled||this.togglePicker(null,!0)},togglePicker(e,t){typeof e=="boolean"?this.open=e:this.open=!this.open,t===!0&&this.$emit("toggle",this.open,this.togglePicker)},clickedApply(){this.togglePicker(!1,!0),this.$emit("update:modelValue",{startDate:this.start,endDate:this.singleDatePicker&&this.singleDatePicker!=="range"?this.start:this.end})},clickCancel(){if(this.open){let e=this.dateRange.startDate,t=this.dateRange.endDate;this.start=e?new Date(e):null,this.end=t?new Date(t):null,this.in_selection=!1,this.togglePicker(!1,!0)}},onSelect(){this.$emit("select",{startDate:this.start,endDate:this.end})},clickAway(e){e&&e.target&&!this.$el.contains(e.target)&&this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&this.clickCancel()},clickRange(e){this.in_selection=!1,this.$dateUtil.isValidDate(e[0])&&this.$dateUtil.isValidDate(e[1])?(this.start=this.$dateUtil.validateDateRange(new Date(e[0]),this.minDate,this.maxDate),this.end=this.$dateUtil.validateDateRange(new Date(e[1]),this.minDate,this.maxDate),this.changeLeftMonth({month:this.start.getMonth()+1,year:this.start.getFullYear()}),this.linkedCalendars===!1&&this.changeRightMonth({month:this.end.getMonth()+1,year:this.end.getFullYear()})):(this.start=null,this.end=null),this.onSelect(),this.autoApply&&this.clickedApply()},onUpdateStartTime(e){let t=new Date(this.start);t.setHours(e.hours),t.setMinutes(e.minutes),t.setSeconds(e.seconds),this.start=this.$dateUtil.validateDateRange(t,this.minDate,this.maxDate),this.autoApply&&this.$emit("update:modelValue",{startDate:this.start,endDate:this.singleDatePicker&&this.singleDatePicker!=="range"?this.start:this.end})},onUpdateEndTime(e){let t=new Date(this.end);t.setHours(e.hours),t.setMinutes(e.minutes),t.setSeconds(e.seconds),this.end=this.$dateUtil.validateDateRange(t,this.minDate,this.maxDate),this.autoApply&&this.$emit("update:modelValue",{startDate:this.start,endDate:this.end})},handleEscape(e){this.open&&e.keyCode===27&&this.closeOnEsc&&this.clickCancel()}},computed:{showRanges(){return this.ranges!==!1&&!this.readonly},showCalendars(){return this.alwaysShowCalendars||this.showCustomRangeCalendars},startText(){return this.start===null?"":this.$dateUtil.format(this.start,this.locale.format)},endText(){return this.end===null?"":this.$dateUtil.format(this.end,this.locale.format)},rangeText(){let e=this.startText;return(!this.singleDatePicker||this.singleDatePicker==="range")&&(e+=this.locale.separator+this.endText),e},min(){return this.minDate?new Date(this.minDate):null},max(){return this.maxDate?new Date(this.maxDate):null},pickerStyles(){return{"show-calendar":this.open||this.opens==="inline","show-ranges":this.showRanges,"show-weeknumbers":this.showWeekNumbers,single:this.singleDatePicker,["opens"+this.opens]:!0,linked:this.linkedCalendars,"hide-calendars":!this.showCalendars}},isClear(){return!this.dateRange.startDate||!this.dateRange.endDate},isDirty(){let e=new Date(this.dateRange.startDate),t=new Date(this.dateRange.endDate);return!this.isClear&&(this.start.getTime()!==e.getTime()||this.end.getTime()!==t.getTime())}},watch:{minDate(){let e=this.$dateUtil.validateDateRange(this.monthDate,this.minDate||new Date,this.maxDate);this.changeLeftMonth({year:e.getFullYear(),month:e.getMonth()+1})},maxDate(){let e=this.$dateUtil.validateDateRange(this.nextMonthDate,this.minDate,this.maxDate||new Date);this.changeRightMonth({year:e.getFullYear(),month:e.getMonth()+1})},"dateRange.startDate"(e){this.$dateUtil.isValidDate(new Date(e))&&(this.start=e&&!this.isClear&&this.$dateUtil.isValidDate(new Date(e))?new Date(e):null,this.isClear?(this.start=null,this.end=null):(this.start=new Date(this.dateRange.startDate),this.end=new Date(this.dateRange.endDate)))},"dateRange.endDate"(e){this.$dateUtil.isValidDate(new Date(e))&&(this.end=e&&!this.isClear?new Date(e):null,this.isClear?(this.start=null,this.end=null):(this.start=new Date(this.dateRange.startDate),this.end=new Date(this.dateRange.endDate)))},open:{handler(e){typeof document=="object"&&this.$nextTick(()=>{e?document.body.addEventListener("click",this.clickAway):document.body.removeEventListener("click",this.clickAway),e?document.addEventListener("keydown",this.handleEscape):document.removeEventListener("keydown",this.handleEscape),!this.alwaysShowCalendars&&this.ranges&&(this.showCustomRangeCalendars=!Object.keys(this.ranges).find(t=>this.$dateUtil.isSame(this.start,this.ranges[t][0],"date")&&this.$dateUtil.isSame(this.end,this.ranges[t][1],"date")))})},immediate:!0}}},me=e=>(ne("data-v-577c3804"),e=e(),le(),e),jl=me(()=>l("i",{class:"glyphicon glyphicon-calendar fa fa-calendar"},null,-1)),Hl=me(()=>l("b",{class:"caret"},null,-1)),Ul={class:"calendars"},Ll={key:1,class:"calendars-container"};const Yl={class:"calendar-table"},Vl={key:0,class:"drp-calendar col right"};const Bl={class:"calendar-table"},Il={key:0,class:"drp-buttons"},Nl={key:0,class:"drp-selected"},zl=["disabled"];function ql(e,t,s,c,d,n){const r=w("calendar-ranges"),o=w("calendar"),f=w("calendar-time"),g=xe("append-to-body");return i(),a("div",{class:m(["vue-daterange-picker",{inline:s.opens==="inline"}])},[l("div",{class:m(s.controlContainerClass),onClick:t[0]||(t[0]=(...b)=>n.onClickPicker&&n.onClickPicker(...b)),ref:"toggle"},[v(e.$slots,"input",{startDate:e.start,endDate:e.end,ranges:s.ranges,rangeText:n.rangeText},()=>[jl,y("  "),l("span",null,h(n.rangeText),1),Hl],!0)],2),T(Te,{name:"slide-fade",mode:"out-in"},{default:M(()=>[e.open||s.opens==="inline"?R((i(),a("div",{key:0,class:m(["daterangepicker ltr",n.pickerStyles]),ref:"dropdown"},[v(e.$slots,"header",{rangeText:n.rangeText,locale:e.locale,clickCancel:n.clickCancel,clickApply:n.clickedApply,in_selection:e.in_selection,autoApply:s.autoApply},void 0,!0),l("div",Ul,[n.showRanges?v(e.$slots,"ranges",{key:0,startDate:e.start,endDate:e.end,ranges:s.ranges,clickRange:n.clickRange},()=>[T(r,{onClickRange:n.clickRange,onShowCustomRange:t[1]||(t[1]=b=>e.showCustomRangeCalendars=!0),"always-show-calendars":s.alwaysShowCalendars,"locale-data":e.locale,ranges:s.ranges,selected:{startDate:e.start,endDate:e.end}},null,8,["onClickRange","always-show-calendars","locale-data","ranges","selected"])],!0):u("",!0),n.showCalendars?(i(),a("div",Ll,[l("div",{class:m(["drp-calendar col left",{single:s.singleDatePicker}])},[u("",!0),l("div",Yl,[T(o,{monthDate:e.monthDate,"locale-data":e.locale,start:e.start,end:e.end,minDate:n.min,maxDate:n.max,"show-dropdowns":s.showDropdowns,onChangeMonth:n.changeLeftMonth,"date-format":n.dateFormatFn,onDateClick:n.dateClick,onHoverDate:n.hoverDate,showWeekNumbers:s.showWeekNumbers},{default:M(()=>[v(e.$slots,"date",J(ee(e.data)),void 0,!0)]),_:3},8,["monthDate","locale-data","start","end","minDate","maxDate","show-dropdowns","onChangeMonth","date-format","onDateClick","onHoverDate","showWeekNumbers"])]),s.timePicker&&e.start?(i(),E(f,{key:1,onUpdate:n.onUpdateStartTime,"miniute-increment":s.timePickerIncrement,hour24:s.timePicker24Hour,"second-picker":s.timePickerSeconds,"current-time":e.start,readonly:s.readonly},null,8,["onUpdate","miniute-increment","hour24","second-picker","current-time","readonly"])):u("",!0)],2),s.singleDatePicker?u("",!0):(i(),a("div",Vl,[u("",!0),l("div",Bl,[T(o,{monthDate:e.nextMonthDate,"locale-data":e.locale,start:e.start,end:e.end,minDate:n.min,maxDate:n.max,"show-dropdowns":s.showDropdowns,onChangeMonth:n.changeRightMonth,"date-format":n.dateFormatFn,onDateClick:n.dateClick,onHoverDate:n.hoverDate,showWeekNumbers:s.showWeekNumbers},{default:M(()=>[v(e.$slots,"date",J(ee(e.data)),void 0,!0)]),_:3},8,["monthDate","locale-data","start","end","minDate","maxDate","show-dropdowns","onChangeMonth","date-format","onDateClick","onHoverDate","showWeekNumbers"])]),s.timePicker&&e.end?(i(),E(f,{key:1,onUpdate:n.onUpdateEndTime,"miniute-increment":s.timePickerIncrement,hour24:s.timePicker24Hour,"second-picker":s.timePickerSeconds,"current-time":e.end,readonly:s.readonly},null,8,["onUpdate","miniute-increment","hour24","second-picker","current-time","readonly"])):u("",!0)]))])):u("",!0)]),v(e.$slots,"footer",{rangeText:n.rangeText,locale:e.locale,clickCancel:n.clickCancel,clickApply:n.clickedApply,in_selection:e.in_selection,autoApply:s.autoApply},()=>[s.autoApply?u("",!0):(i(),a("div",Il,[n.showCalendars?(i(),a("span",Nl,h(n.rangeText),1)):u("",!0),s.readonly?u("",!0):(i(),a("button",{key:1,class:"cancelBtn btn btn-sm btn-secondary",type:"button",onClick:t[2]||(t[2]=(...b)=>n.clickCancel&&n.clickCancel(...b))},h(e.locale.cancelLabel),1)),s.readonly?u("",!0):(i(),a("button",{key:2,class:"applyBtn btn btn-sm btn-success",disabled:e.in_selection,type:"button",onClick:t[3]||(t[3]=(...b)=>n.clickedApply&&n.clickedApply(...b))},h(e.locale.applyLabel),9,zl))]))],!0)],2)),[[g]]):u("",!0)]),_:3})],2)}const Wl=C(Al,[["render",ql],["__scopeId","data-v-577c3804"]]),Gl={name:"ns-date-range-picker",data(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:Wl},mounted(){this.field.value!==void 0&&(this.dateRange=this.field.value)},watch:{dateRange(){const e={startDate:x(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:x(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:_,getFormattedDate(e){return e!==null?x(e).format("YYYY-MM-DD HH:mm"):_("N/D")},clearDate(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},Kl={class:"flex flex-auto flex-col mb-2 ns-date-range-picker"},Ql=["for"],Zl={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Xl={class:"text-primary sm:text-sm sm:leading-5"},Jl=l("i",{class:"las la-times"},null,-1),ei=[Jl],ti={class:"flex justify-between items-center w-full py-2"},si={class:"text-xs"},ni={class:"text-xs"};function li(e,t,s,c,d,n){const r=w("date-range-picker"),o=w("ns-field-description");return i(),a("div",Kl,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Ql),l("div",{class:m([n.hasError?"error":"","mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm"])},[s.leading?(i(),a("div",Zl,[l("span",Xl,h(s.leading),1)])):u("",!0),l("button",{class:"px-3 outline-none bg-error-secondary font-semibold text-white",onClick:t[0]||(t[0]=f=>n.clearDate())},ei),T(r,{class:"w-full flex items-center bg-input-background",ref:"picker","locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,modelValue:d.dateRange,"onUpdate:modelValue":t[1]||(t[1]=f=>d.dateRange=f),disabled:s.field.disabled,linkedCalendars:!0},{input:M(f=>[l("div",ti,[l("span",si,h(n.__("Range Starts"))+" : "+h(n.getFormattedDate(f.startDate)),1),l("span",ni,h(n.__("Range Ends"))+" : "+h(n.getFormattedDate(f.endDate)),1)])]),_:1},8,["modelValue","disabled"])],2),T(o,{field:s.field},null,8,["field"])])}const ge=C(Gl,[["render",li]]),ii={name:"ns-date-time-picker",props:["field","date"],data(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:x}},computed:{fieldDate(){return this.field?x(this.field.value).isValid()?x(this.field.value):x():this.date?x(this.date):x()}},mounted(){let e=x(this.field.value);e.isValid()?this.setDate(e.format("YYYY-MM-DD HH:mm:ss")):this.setDate(x(ns.date.current).format("YYYY-MM-DD HH:mm:ss"))},methods:{__:_,setDate(e){this.field.value=e}}},ai={class:"picker mb-2"},ri={key:0,class:"block leading-5 font-medium text-primary"},di={class:"ns-button"},oi=l("i",{class:"las la-clock text-xl"},null,-1),ui={key:0,class:"mx-1 text-sm"},ci={key:0},hi={key:1},fi={key:1,class:"mx-1 text-sm"},mi={key:0},gi={key:1},bi={key:1,class:"text-sm text-secondary py-1"},_i={key:2,class:"relative z-10 h-0 w-0"};function pi(e,t,s,c,d,n){const r=w("ns-calendar");return i(),a("div",ai,[s.field&&s.field.label&&s.field.label.length>0?(i(),a("label",ri,h(s.field.label),1)):u("",!0),l("div",di,[l("button",{onClick:t[0]||(t[0]=o=>d.visible=!d.visible),class:m([s.field&&s.field.label&&s.field.label.length>0?"mt-1 border border-input-edge":"","shadow rounded cursor-pointer w-full p-1 flex items-center text-primary"])},[oi,s.field?(i(),a("span",ui,[[null,"",void 0].includes(s.field.value)?u("",!0):(i(),a("span",ci,h(n.fieldDate.format("YYYY-MM-DD HH:mm")),1)),[null,"",void 0].includes(s.field.value)?(i(),a("span",hi,"N/A")):u("",!0)])):u("",!0),s.date?(i(),a("span",fi,[[null,"",void 0].includes(s.date)?u("",!0):(i(),a("span",mi,h(n.fieldDate.format("YYYY-MM-DD HH:mm")),1)),[null,"",void 0].includes(s.date)?(i(),a("span",gi,"N/A")):u("",!0)])):u("",!0)],2)]),s.field?(i(),a("p",bi,h(s.field.description),1)):u("",!0),d.visible?(i(),a("div",_i,[l("div",{class:m([s.field&&s.field.label&&s.field.label.length>0?"-mt-4":"mt-2","absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col"])},[s.field?(i(),E(r,{key:0,onOnClickOut:t[1]||(t[1]=o=>d.visible=!1),onSet:t[2]||(t[2]=o=>n.setDate(o)),visible:d.visible,date:s.field.value},null,8,["visible","date"])):u("",!0),s.date?(i(),E(r,{key:1,onOnClickOut:t[3]||(t[3]=o=>d.visible=!1),onSet:t[4]||(t[4]=o=>n.setDate(o)),visible:d.visible,date:s.date},null,8,["visible","date"])):u("",!0)],2)])):u("",!0)])}const be=C(ii,[["render",pi]]),yi={name:"ns-datepicker",components:{nsCalendar:ce},props:["label","date","format"],computed:{formattedDate(){return x(this.date).format(this.format||"YYYY-MM-DD HH:mm:ss")}},data(){return{visible:!1}},mounted(){},methods:{__:_,setDate(e){this.$emit("set",e)}}},vi={class:"picker"},ki={class:"ns-button"},wi=l("i",{class:"las la-clock text-2xl"},null,-1),xi={class:"mx-1 text-sm"},Di={key:0},Ci={key:1},Mi={key:0,class:"relative h-0 w-0 -mb-2"},Ti={class:"w-72 mt-2 shadow-lg anim-duration-300 zoom-in-entrance flex flex-col ns-floating-panel"};function Si(e,t,s,c,d,n){const r=w("ns-calendar");return i(),a("div",vi,[l("div",ki,[l("button",{onClick:t[0]||(t[0]=o=>d.visible=!d.visible),class:"rounded cursor-pointer border border-input-edge shadow w-full px-1 py-1 flex items-center text-primary"},[wi,l("span",xi,[l("span",null,h(s.label||n.__("Date"))+" : ",1),s.date?(i(),a("span",Di,h(n.formattedDate),1)):(i(),a("span",Ci,h(n.__("N/A")),1))])])]),d.visible?(i(),a("div",Mi,[l("div",Ti,[T(r,{visible:d.visible,onOnClickOut:t[1]||(t[1]=o=>d.visible=!1),date:s.date,onSet:t[2]||(t[2]=o=>n.setDate(o))},null,8,["visible","date"])])])):u("",!0)])}const $i=C(yi,[["render",Si]]),Ei={name:"ns-daterange-picker",data(){return{leftCalendar:x(),rightCalendar:x().add(1,"months"),rangeViewToggled:!1,clickedOnCalendar:!1}},mounted(){this.field.value||this.clearDate(),document.addEventListener("click",this.checkClickedItem)},beforeUnmount(){document.removeEventListener("click",this.checkClickedItem)},watch:{leftCalendar(){this.leftCalendar.isSame(this.rightCalendar,"month")&&this.rightCalendar.add(1,"months")},rightCalendar(){this.rightCalendar.isSame(this.leftCalendar,"month")&&this.leftCalendar.sub(1,"months")}},methods:{__:_,setDateRange(e,t){this.field.value[e]=t,x(this.field.value.startDate).isBefore(x(this.field.value.endDate))&&this.$emit("change",this.field)},getFormattedDate(e){return e!==null?x(e).format("YYYY-MM-DD HH:mm"):_("N/D")},clearDate(){this.field.value={startDate:null,endDate:null}},toggleRangeView(){this.rangeViewToggled=!this.rangeViewToggled},handleDateRangeClick(){this.clickedOnCalendar=!0},checkClickedItem(e){this.$el.getAttribute("class").split(" ").includes("ns-daterange-picker")&&(!this.$el.contains(e.srcElement)&&!this.clickedOnCalendar&&this.rangeViewToggled&&(this.$emit("blur",this.field),this.toggleRangeView()),setTimeout(()=>{this.clickedOnCalendar=!1},100))}},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"},startDateFormatted(){return this.field.value!==void 0&&x(this.field.value.startDate).isValid()?x(this.field.value.startDate).format("YYYY-MM-DD HH:mm"):!1},endDateFormatted(){return this.field.value!==void 0&&x(this.field.value.endDate).isValid()?x(this.field.value.endDate).format("YYYY-MM-DD HH:mm"):!1}},props:["placeholder","leading","type","field"]},Ri=["for"],Fi={class:"border border-input-edge rounded-tl rounded-bl flex-auto flex"},Oi={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Pi={class:"text-primary sm:text-sm sm:leading-5"},Ai=l("span",{class:"mr-1"},[l("i",{class:"las la-clock text-2xl"})],-1),ji={class:""},Hi=l("span",{class:"mx-2"},"—",-1),Ui=l("span",{class:"mr-1"},[l("i",{class:"las la-clock text-2xl"})],-1),Li={class:""},Yi=l("i",{class:"las la-times"},null,-1),Vi=[Yi],Bi={key:0,class:"relative h-0 w-0"},Ii={class:"z-10 absolute md:w-[550px] w-[225px] mt-2 shadow-lg anim-duration-300 zoom-in-entrance flex flex-col"},Ni={class:"flex flex-col md:flex-row bg-box-background rounded-lg"},zi=l("div",{class:"flex-auto border-l border-r"},null,-1);function qi(e,t,s,c,d,n){const r=w("ns-calendar"),o=w("ns-field-description");return i(),a("div",{onClick:t[4]||(t[4]=f=>n.handleDateRangeClick()),class:"flex flex-auto flex-col mb-2 ns-daterange-picker"},[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Ri),l("div",{class:m([n.hasError?"error":"","mt-1 relative flex input-group bg-input-background rounded overflow-hidden shadow focus:shadow-sm"])},[l("div",Fi,[s.leading?(i(),a("div",Oi,[l("span",Pi,h(s.leading),1)])):u("",!0),l("div",{class:"flex flex-auto p-1 text-primary text-sm items-center cursor-pointer",onClick:t[0]||(t[0]=f=>n.toggleRangeView())},[Ai,l("span",ji,h(n.startDateFormatted||n.__("N/A")),1),Hi,Ui,l("span",Li,h(n.endDateFormatted||n.__("N/A")),1)])]),l("button",{class:"px-3 outline-none font-bold bg-error-tertiary",onClick:t[1]||(t[1]=f=>n.clearDate())},Vi)],2),d.rangeViewToggled?(i(),a("div",Bi,[l("div",Ii,[l("div",Ni,[T(r,{class:"md:w-1/2 w-full",range:[n.startDateFormatted,n.endDateFormatted],side:"left",date:s.field.value.startDate,"selected-range":s.field.value,onSet:t[2]||(t[2]=f=>n.setDateRange("startDate",f))},null,8,["range","date","selected-range"]),zi,T(r,{class:"md:w-1/2 w-full",range:[n.startDateFormatted,n.endDateFormatted],side:"right",date:s.field.value.endDate,"selected-range":s.field.value,onSet:t[3]||(t[3]=f=>n.setDateRange("endDate",f))},null,8,["range","date","selected-range"])])])])):u("",!0),T(o,{field:s.field},null,8,["field"])])}const Wi=C(Ei,[["render",qi]]),Gi={name:"ns-dropzone",emits:["dropped"],mounted(){},setup(e,{emit:t}){return{dropZone:q(null),handleDrop:d=>{const n=d.dataTransfer.getData("text");t("dropped",n)}}}};function Ki(e,t,s,c,d,n){return i(),a("div",{ref:"dropZone",class:"ns-drop-zone mb-4",onDragover:t[0]||(t[0]=Se(()=>{},["prevent"]))},[v(e.$slots,"default",{},void 0,!0)],544)}const Qi=C(Gi,[["render",Ki],["__scopeId","data-v-0817a409"]]),Zi={emits:["drag-start","drag-end"],name:"ns-draggable",props:{widget:{required:!0}},setup(e,{emit:t}){const s=q(null),c=q(null);let d=null,n=0,r=0,o=0,f=0;const g=F=>{const P=F.srcElement.closest(".ns-draggable-item"),O=P.getBoundingClientRect();d=P.cloneNode(!0),d.setAttribute("class","ns-ghost"),d.style.display="none",d.style.position="fixed",d.style.top=`${O.top}px`,d.style.left=`${O.left}px`,d.style.width=`${O.width}px`,d.style.height=`${O.height}px`,P.closest(".ns-drop-zone").appendChild(d),n=F.clientX-o,r=F.clientY-f,c.value={dom:P},t("drag-start",e.widget)},b=F=>{if(c.value===null)return;const P=c.value.dom.closest(".ns-drop-zone").querySelector(".ns-ghost"),O=P.querySelector("div");Array.from(O.classList).filter(j=>j.startsWith("shadow")).forEach(j=>O.classList.remove(j)),o=F.clientX-n,f=F.clientY-r,O.style.boxShadow="0px 4px 10px 5px rgb(0 0 0 / 48%)",P.style.display="block",P.style.transform=`translate(${o}px, ${f}px)`,P.style.cursor="grabbing",document.querySelectorAll(".ns-drop-zone").forEach(j=>{j.getBoundingClientRect();const{left:I,top:N,right:k,bottom:ye}=j.getBoundingClientRect(),{clientX:Z,clientY:X}=F;Z>=I&&Z<=k&&X>=N&&X<=ye?j.setAttribute("hovered","true"):j.setAttribute("hovered","false")})},S=F=>{if(c.value===null)return;const O=c.value.dom.closest(".ns-drop-zone").querySelector(".ns-ghost");O&&O.remove(),c.value=null,o=0,f=0,F.srcElement.closest(".ns-drop-zone"),t("drag-end",e.widget)};return De(()=>{s.value&&(document.addEventListener("mousemove",F=>b(F)),document.addEventListener("mouseup",F=>S(F)))}),Ce(()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",S)}),{draggable:s,startDrag:g}}};function Xi(e,t,s,c,d,n){return i(),a("div",{ref:"draggable",class:"ns-draggable-item",onMousedown:t[0]||(t[0]=(...r)=>c.startDrag&&c.startDrag(...r))},[v(e.$slots,"default")],544)}const Ji=C(Zi,[["render",Xi]]),ea={name:"ns-dragzone",props:["raw-widgets","raw-columns"],components:{nsDropzone:Qi,nsDraggable:Ji},data(){return{widgets:[],theme:ns.theme,dragged:null,columns:[]}},mounted(){this.widgets=this.rawWidgets.map(e=>({name:e.name,"component-name":e["component-name"],"class-name":e["class-name"],component:te(window[e["component-name"]])})),this.columns=this.rawColumns.map(e=>(e.widgets.forEach(t=>{t.component=te(window[t.identifier]),t["class-name"]=t.class_name,t["component-name"]=t.identifier}),e)),setTimeout(()=>{var e=document.querySelectorAll(".widget-placeholder");document.addEventListener("mousemove",t=>{for(var s=0;s=c.left&&t.clientX<=c.right&&t.clientY>=c.top&&t.clientY<=c.bottom){e[s].setAttribute("hovered","true");break}else e[s].setAttribute("hovered","false")}})},10)},computed:{hasUnusedWidgets(){const e=this.columns.map(t=>t.widgets).flat();return this.widgets.filter(t=>!e.map(c=>c["component-name"]).includes(t["component-name"])).length>0}},methods:{__:_,handleEndDragging(e){const t=document.querySelector('.ns-drop-zone[hovered="true"]');if(t){const d=t.closest("[column-name]").getAttribute("column-name"),n=this.columns.filter(O=>O.name===d),r=n[0].widgets.filter(O=>O["component-name"]===t.querySelector(".ns-draggable-item").getAttribute("component-name")),o=document.querySelector(`[component-name="${e["component-name"]}"]`),g=o.closest("[column-name]").getAttribute("column-name"),b=this.columns.filter(O=>O.name===g),S=b[0].widgets.filter(O=>O["component-name"]===o.getAttribute("component-name"));if(S[0]["component-name"]===r[0]["component-name"])return;const F=S[0].position,P=r[0].position;S[0].column=d,S[0].position=P,r[0].column=g,r[0].position=F,n[0].widgets[P]=S[0],b[0].widgets[F]=r[0],this.handleChange(n[0]),this.handleChange(b[0]),t.setAttribute("hovered","false")}const s=document.querySelector('.widget-placeholder[hovered="true"]');if(s){const c=s.closest("[column-name]").getAttribute("column-name");if(e===c){console.log("The widget is already in the same column.");return}const d=this.columns.filter(o=>o.name===e.column)[0],n=d.widgets.indexOf(e);d.widgets.splice(n,1);const r=this.columns.filter(o=>o.name===c)[0];e.position=r.widgets.length,e.column=c,r.widgets.push(e),this.handleChange(d),this.handleChange(r)}},handleChange(e,t){setTimeout(()=>{nsHttpClient.post("/api/users/widgets",{column:e}).subscribe(s=>{},s=>$.error(s.message||_("An unpexpected error occured while using the widget.")).subscribe())},100)},handleRemoveWidget(e,t){const s=t.widgets.indexOf(e);t.widgets.splice(s,1),this.handleChange(t)},async openWidgetAdded(e){try{const t=this.columns.filter(r=>r.name!==e.name?(console.log(r.name),r.widgets.length>0):!1).map(r=>r.widgets).flat(),s=e.widgets.map(r=>r["component-name"]),c=this.widgets.filter(r=>{const o=t.map(f=>f["component-name"]);return o.push(...s),!o.includes(r["component-name"])}).map(r=>({value:r,label:r.name})),d=await new Promise((r,o)=>{const f=c.filter(g=>s.includes(g["component-name"]));Popup.show(Re,{value:f,resolve:r,reject:o,type:"multiselect",options:c,label:_("Choose Widget"),description:_("Select with widget you want to add to the column.")})}),n=this.columns.indexOf(e);this.columns[n].widgets=[...this.columns[n].widgets,...d].map((r,o)=>(r.position=o,r.column=e.name,r)),this.handleChange(this.columns[n])}catch(t){console.log(t)}}}},ta={class:"flex md:-mx-2 flex-wrap"},sa=["column-name"],na=["onClick"],la={class:"text-sm text-primary",type:"info"};function ia(e,t,s,c,d,n){const r=w("ns-draggable"),o=w("ns-dropzone");return i(),a("div",ta,[(i(!0),a(p,null,D(d.columns,(f,g)=>(i(),a("div",{class:"w-full md:px-2 md:w-1/2 lg:w-1/3 xl:1/4","column-name":f.name,key:f.name},[(i(!0),a(p,null,D(f.widgets,b=>(i(),E(o,null,{default:M(()=>[T(r,{"component-name":b["component-name"],onDragEnd:t[0]||(t[0]=S=>n.handleEndDragging(S)),widget:b},{default:M(()=>[(i(),E(G(b.component),{onOnRemove:S=>n.handleRemoveWidget(b,f),widget:b},null,40,["onOnRemove","widget"]))]),_:2},1032,["component-name","widget"])]),_:2},1024))),256)),n.hasUnusedWidgets?(i(),a("div",{key:0,onClick:b=>n.openWidgetAdded(f),class:"widget-placeholder cursor-pointer border-2 border-dashed h-16 flex items-center justify-center"},[l("span",la,h(n.__("Click here to add widgets")),1)],8,na)):u("",!0)],8,sa))),128))])}const aa=C(ea,[["render",ia],["__scopeId","data-v-8fa76ad4"]]),ra={emits:["blur","change","saved","keypress"],data:()=>({}),mounted(){},components:{nsDateRangePicker:ge,nsDateTimePicker:be,nsSwitch:ue},computed:{isInputField(){return["text","password","email","number","tel"].includes(this.field.type)},isHiddenField(){return["hidden"].includes(this.field.type)},isDateField(){return["date"].includes(this.field.type)},isSelectField(){return["select"].includes(this.field.type)},isSearchField(){return["search-select"].includes(this.field.type)},isTextarea(){return["textarea"].includes(this.field.type)},isCheckbox(){return["checkbox"].includes(this.field.type)},isMultiselect(){return["multiselect"].includes(this.field.type)},isInlineMultiselect(){return["inline-multiselect"].includes(this.field.type)},isSelectAudio(){return["select-audio"].includes(this.field.type)},isSwitch(){return["switch"].includes(this.field.type)},isMedia(){return["media"].includes(this.field.type)},isCkEditor(){return["ckeditor"].includes(this.field.type)},isDateTimePicker(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker(){return["daterangepicker"].includes(this.field.type)},isCustom(){return["custom"].includes(this.field.type)}},props:["field"],methods:{handleSaved(e,t){this.$emit("saved",t)},addOption(e){this.field.type==="select"&&this.field.options.forEach(s=>s.selected=!1),e.selected=!0;const 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})},changeTouchedState(e,t){t.stopPropagation&&t.stopPropagation(),e.touched=!0,this.$emit("change",e)},refreshMultiselect(){this.field.value=this.field.options.filter(e=>e.selected).map(e=>e.value)},removeOption(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}}},da=["name","value"],oa={key:1,class:"flex flex-auto mb-2"},ua=["innerHTML"],ca=["innerHTML"],ha=["innerHTML"],fa=["innerHTML"],ma=["innerHTML"],ga=["innerHTML"],ba=["innerHTML"],_a=["innerHTML"],pa=["innerHTML"],ya=["innerHTML"],va=["innerHTML"],ka=["innerHTML"],wa=["innerHTML"],xa=["innerHTML"];function Da(e,t,s,c,d,n){const r=w("ns-input"),o=w("ns-date-time-picker"),f=w("ns-date"),g=w("ns-media-input"),b=w("ns-select"),S=w("ns-search-select"),F=w("ns-daterange-picker"),P=w("ns-select-audio"),O=w("ns-textarea"),B=w("ns-checkbox"),Q=w("ns-inline-multiselect"),j=w("ns-multiselect"),I=w("ns-ckeditor"),N=w("ns-switch");return i(),a(p,null,[n.isHiddenField?(i(),a("input",{key:0,type:"hidden",name:s.field.name,value:s.field.value},null,8,da)):u("",!0),n.isHiddenField?u("",!0):(i(),a("div",oa,[n.isInputField?(i(),E(r,{key:0,onKeypress:t[0]||(t[0]=k=>n.changeTouchedState(s.field,k)),onChange:t[1]||(t[1]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ua)]),_:1},8,["field"])):u("",!0),n.isDateTimePicker?(i(),E(o,{key:1,onBlur:t[2]||(t[2]=k=>e.$emit("blur",s.field)),onChange:t[3]||(t[3]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ca)]),_:1},8,["field"])):u("",!0),n.isDateField?(i(),E(f,{key:2,onBlur:t[4]||(t[4]=k=>e.$emit("blur",s.field)),onChange:t[5]||(t[5]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ha)]),_:1},8,["field"])):u("",!0),n.isMedia?(i(),E(g,{key:3,onBlur:t[6]||(t[6]=k=>e.$emit("blur",s.field)),onChange:t[7]||(t[7]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,fa)]),_:1},8,["field"])):u("",!0),n.isSelectField?(i(),E(b,{key:4,onChange:t[8]||(t[8]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ma)]),_:1},8,["field"])):u("",!0),n.isSearchField?(i(),E(S,{key:5,field:s.field,onSaved:t[9]||(t[9]=k=>n.handleSaved(s.field,k)),onChange:t[10]||(t[10]=k=>n.changeTouchedState(s.field,k))},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ga)]),_:1},8,["field"])):u("",!0),n.isDateRangePicker?(i(),E(F,{key:6,onBlur:t[11]||(t[11]=k=>e.$emit("blur",s.field)),onChange:t[12]||(t[12]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ba)]),_:1},8,["field"])):u("",!0),n.isSelectAudio?(i(),E(P,{key:7,onBlur:t[13]||(t[13]=k=>e.$emit("blur",s.field)),onChange:t[14]||(t[14]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,_a)]),_:1},8,["field"])):u("",!0),n.isTextarea?(i(),E(O,{key:8,onBlur:t[15]||(t[15]=k=>e.$emit("blur",s.field)),onChange:t[16]||(t[16]=k=>n.changeTouchedState(s.field,k)),field:s.field},{description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,pa)]),default:M(()=>[l("template",null,[y(h(s.field.label),1)])]),_:1},8,["field"])):u("",!0),n.isCheckbox?(i(),E(B,{key:9,onBlur:t[17]||(t[17]=k=>e.$emit("blur",s.field)),onChange:t[18]||(t[18]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ya)]),_:1},8,["field"])):u("",!0),n.isInlineMultiselect?(i(),E(Q,{key:10,onBlur:t[19]||(t[19]=k=>e.$emit("blur",s.field)),onUpdate:t[20]||(t[20]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,va)]),_:1},8,["field"])):u("",!0),n.isMultiselect?(i(),E(j,{key:11,onAddOption:t[21]||(t[21]=k=>n.addOption(k)),onRemoveOption:t[22]||(t[22]=k=>n.removeOption(k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ka)]),_:1},8,["field"])):u("",!0),n.isCkEditor?(i(),E(I,{key:12,field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,wa)]),_:1},8,["field"])):u("",!0),n.isSwitch?(i(),E(N,{key:13,field:s.field,onChange:t[23]||(t[23]=k=>n.changeTouchedState(s.field,k))},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,xa)]),_:1},8,["field"])):u("",!0),n.isCustom?(i(),E(Me,{key:14},[(i(),E(G(s.field.component),{field:s.field,onBlur:t[24]||(t[24]=k=>e.$emit("blur",s.field)),onChange:t[25]||(t[25]=k=>n.changeTouchedState(s.field,k))},null,40,["field"]))],1024)):u("",!0)]))],64)}const Ca=C(ra,[["render",Da]]),Ma={name:"ns-field-detail",props:["field"],methods:{__:_}},Ta={key:0,class:"text-xs ns-description"};function Sa(e,t,s,c,d,n){return i(),a(p,null,[!s.field.errors||s.field.errors.length===0?(i(),a("p",Ta,h(s.field.description),1)):u("",!0),(i(!0),a(p,null,D(s.field.errors,(r,o)=>(i(),a("p",{key:o,class:"text-xs ns-error"},[r.identifier==="required"?v(e.$slots,r.identifier,{key:0},()=>[y(h(n.__("This field is required.")),1)]):u("",!0),r.identifier==="email"?v(e.$slots,r.identifier,{key:1},()=>[y(h(n.__("This field must contain a valid email address.")),1)]):u("",!0),r.identifier==="invalid"?v(e.$slots,r.identifier,{key:2},()=>[y(h(r.message),1)]):u("",!0),r.identifier==="same"?v(e.$slots,r.identifier,{key:3},()=>[y(h(n.__('This field must be similar to "{other}""').replace("{other}",r.fields.filter(f=>f.name===r.rule.value)[0].label)),1)]):u("",!0),r.identifier==="min"?v(e.$slots,r.identifier,{key:4},()=>[y(h(n.__('This field must have at least "{length}" characters"').replace("{length}",r.rule.value)),1)]):u("",!0),r.identifier==="max"?v(e.$slots,r.identifier,{key:5},()=>[y(h(n.__('This field must have at most "{length}" characters"').replace("{length}",r.rule.value)),1)]):u("",!0),r.identifier==="different"?v(e.$slots,r.identifier,{key:6},()=>[y(h(n.__('This field must be different from "{other}""').replace("{other}",r.fields.filter(f=>f.name===r.rule.value)[0].label)),1)]):u("",!0)]))),128))],64)}const $a=C(Ma,[["render",Sa]]),Ea={props:["className","buttonClass","type"]};function Ra(e,t,s,c,d,n){return i(),a("button",{class:m([s.type?s.type:s.buttonClass,"ns-inset-button rounded-full h-8 w-8 border items-center justify-center"])},[l("i",{class:m([s.className,"las"])},null,2)],2)}const Fa=C(Ea,[["render",Ra]]),Oa={name:"ns-input-label",props:["field"],data(){return{tags:[],searchField:"",focused:!1,optionsToKeyValue:{}}},methods:{addOption(e){let t;this.optionSuggestions.length===1&&e===void 0?t=this.optionSuggestions[0]:e!==void 0&&(t=e),t!==void 0&&(this.field.value.filter(c=>c===t.value).length>0||(this.searchField="",this.field.value.push(t.value),this.$emit("change",this.field)))},removeOption(e){const t=this.field.value.filter(s=>s!==e);this.field.value=t}},mounted(){if(this.$refs.searchField.addEventListener("focus",e=>{this.focused=!0}),this.$refs.searchField.addEventListener("blur",e=>{setTimeout(()=>{this.focused=!1},200)}),this.field.value.length===void 0)try{this.field.value=JSON.parse(this.field.value)}catch{this.field.value=[]}this.field.options.forEach(e=>{this.optionsToKeyValue[e.value]=e.label})},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},optionSuggestions(){if(typeof this.field.value.map=="function"){const e=this.field.value.map(t=>t.value);return this.field.options.filter(t=>!e.includes(t.value)&&this.focused>0&&(t.label.search(this.searchField)>-1||t.value.search(this.searchField)>-1))}return[]},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":""}},props:["placeholder","leading","type","field"]},Pa={class:"flex flex-col mb-2 flex-auto ns-input"},Aa=["for"],ja={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Ha={class:"leading sm:text-sm sm:leading-5"},Ua=["disabled","id","type","placeholder"],La={class:"rounded shadow bg-box-elevation-hover flex mr-1 mb-1"},Ya={class:"p-2 flex items-center text-primary"},Va={class:"flex items-center justify-center px-2"},Ba=["onClick"],Ia=l("i",{class:"las la-times-circle"},null,-1),Na=[Ia],za={class:"relative"},qa=["placeholder"],Wa={class:"h-0 absolute w-full z-10"},Ga={class:"shadow bg-box-background absoluve bottom-0 w-full max-h-80 overflow-y-auto"},Ka=["onClick"];function Qa(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Pa,[s.field.label&&s.field.label.length>0?(i(),a("label",{key:0,for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Aa)):u("",!0),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.description||s.field.errors>0?"mb-2":""),"mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",ja,[l("span",Ha,h(s.leading),1)])):u("",!0),l("div",{disabled:s.field.disabled,id:s.field.name,type:s.field.type,class:m([n.inputClass,"flex sm:text-sm sm:leading-5 p-1 flex-wrap"]),placeholder:s.field.placeholder||""},[(i(!0),a(p,null,D(s.field.value,o=>(i(),a("div",La,[l("div",Ya,h(d.optionsToKeyValue[o]),1),l("div",Va,[l("div",{onClick:f=>n.removeOption(o),class:"cursor-pointer rounded-full bg-error-tertiary h-5 w-5 flex items-center justify-center"},Na,8,Ba)])]))),256)),l("div",za,[R(l("input",{onChange:t[0]||(t[0]=o=>o.stopPropagation()),onKeydown:t[1]||(t[1]=Y(o=>n.addOption(),["enter"])),ref:"searchField","onUpdate:modelValue":t[2]||(t[2]=o=>d.searchField=o),type:"text",class:"w-auto p-2 border-b border-dashed bg-transparent",placeholder:s.field.placeholder||"Start searching here..."},null,40,qa),[[A,d.searchField]]),l("div",Wa,[l("div",Ga,[l("ul",null,[(i(!0),a(p,null,D(n.optionSuggestions,o=>(i(),a("li",{onClick:f=>n.addOption(o),class:"p-2 hover:bg-box-elevation-hover text-primary cursor-pointer"},h(o.label),9,Ka))),256))])])])])],10,Ua)],2),T(r,{field:s.field},null,8,["field"])])}const Za=C(Oa,[["render",Qa]]),Xa={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},Ja={class:"flex flex-col mb-2 flex-auto ns-input"},er=["for"],tr={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},sr={class:"leading sm:text-sm sm:leading-5"},nr=["disabled","id","type","placeholder"];function lr(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Ja,[s.field.label&&s.field.label.length>0?(i(),a("label",{key:0,for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,er)):u("",!0),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.description||s.field.errors>0?"mb-2":""),"mt-1 relative overflow-hidden border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",tr,[l("span",sr,h(s.leading),1)])):u("",!0),R(l("input",{disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.field.placeholder||""},null,10,nr),[[oe,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const ir=C(Xa,[["render",lr]]),ar={data:()=>({clicked:!1,_save:0}),props:["type","to","href","target"],computed:{buttonclass(){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"}}}},rr={class:"flex"},dr=["target","href"];function or(e,t,s,c,d,n){return i(),a("div",rr,[s.href?(i(),a("a",{key:0,target:s.target,href:s.href,class:m([n.buttonclass,"rounded cursor-pointer py-2 px-3 font-semibold"])},[v(e.$slots,"default")],10,dr)):u("",!0)])}const ur=C(ar,[["render",or]]),_e={zip:"la-file-archive",tar:"la-file-archive",bz:"la-file-archive","7z":"la-file-archive",css:"la-file-code",js:"la-file-code",json:"la-file-code",docx:"la-file-word",doc:"la-file-word",mp3:"la-file-audio",aac:"la-file-audio",ods:"la-file-audio",pdf:"la-file-pdf",csv:"la-file-csv",avi:"la-file-video",mpeg:"la-file-video",mpkg:"la-file-video",unknown:"la-file"},cr={name:"ns-media",props:["popup"],data(){return{searchFieldDebounce:null,searchField:"",pages:[{label:_("Upload"),name:"upload",selected:!1},{label:_("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},fileIcons:_e,queryPage:1,bulkSelect:!1,files:[]}},mounted(){this.popupCloser();const e=this.pages.filter(t=>t.name==="gallery")[0];this.select(e)},watch:{searchField(){clearTimeout(this.searchFieldDebounce),this.searchFieldDebounce=setTimeout(()=>{this.loadGallery(1)},500)},files:{handler(){this.uploadFiles()},deep:!0}},computed:{postMedia(){return de.applyFilters("http-client-url","/api/medias")},currentPage(){return this.pages.filter(e=>e.selected)[0]},hasOneSelected(){return this.response.data.filter(e=>e.selected).length>0},selectedResource(){return this.response.data.filter(e=>e.selected)[0]},csrf(){return ns.authentication.csrf},isPopup(){return typeof this.popup<"u"},user_id(){return this.isPopup&&this.popup.params.user_id||0},panelOpened(){return!this.bulkSelect&&this.hasOneSelected},popupInstance(){return this.popup}},methods:{popupCloser:ae,__:_,cancelBulkSelect(){this.bulkSelect=!1,this.response.data.forEach(e=>e.selected=!1)},openError(e){L.show(se,{title:_("An error occured"),message:e.error.message||_("An unexpected error occured.")})},deleteSelected(){L.show(V,{title:_("Confirm Your Action"),message:_("You're about to delete selected resources. Would you like to proceed?"),onAction:e=>{e&&U.post("/api/medias/bulk-delete",{ids:this.response.data.filter(t=>t.selected).map(t=>t.id)}).subscribe({next:t=>{$.success(t.message).subscribe(),this.loadGallery()},error:t=>{$.error(t.message).subscribe()}})}})},loadUploadScreen(){setTimeout(()=>{this.setDropZone()},1e3)},setDropZone(){const e=document.getElementById("dropping-zone");e.addEventListener("dragenter",s=>this.preventDefaults(s),!1),e.addEventListener("dragleave",s=>this.preventDefaults(s),!1),e.addEventListener("dragover",s=>this.preventDefaults(s),!1),e.addEventListener("drop",s=>this.preventDefaults(s),!1),["dragenter","dragover"].forEach(s=>{e.addEventListener(s,()=>{this.isDragging=!0})}),["dragleave","drop"].forEach(s=>{e.addEventListener(s,()=>{this.isDragging=!1})}),e.addEventListener("drop",s=>this.handleDrop(s),!1),this.$refs.files.addEventListener("change",s=>this.processFiles(s.currentTarget.files))},async uploadFiles(){const e=this.files.filter(t=>t.uploaded===!1&&t.progress===0&&t.failed===!1);for(let t=0;t{const r=new FormData;r.append("file",s.file),U.post("/api/medias",r,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:o=>{s.uploaded=!0,s.progress=100,d(o)},error:o=>{e[t].failed=!0,e[t].error=o}})})}catch{s.failed=!0}}},handleDrop(e){this.processFiles(e.dataTransfer.files),e.preventDefault(),e.stopPropagation()},preventDefaults(e){e.preventDefault(),e.stopPropagation()},getAllParents(e){let t=[];for(;e.parentNode&&e.parentNode.nodeName.toLowerCase()!="body";)e=e.parentNode,t.push(e);return t},triggerManualUpload(e){const t=e.target;if(t!==null){const c=this.getAllParents(t).map(d=>{const n=d.getAttribute("class");if(n)return n.split(" ")});if(t.getAttribute("class")){const d=t.getAttribute("class").split(" ");c.push(d)}c.flat().includes("ns-scrollbar")||this.$refs.files.click()}},processFiles(e){Array.from(e).filter(c=>(console.log(this),Object.values(window.ns.medias.mimes).includes(c.type))).forEach(c=>{this.files.unshift({file:c,uploaded:!1,failed:!1,progress:0})})},select(e){this.pages.forEach(t=>t.selected=!1),e.selected=!0,e.name==="gallery"?this.loadGallery():e.name==="upload"&&this.loadUploadScreen()},loadGallery(e=null){e=e===null?this.queryPage:e,this.queryPage=e,U.get(`/api/medias?page=${e}&user_id=${this.user_id}${this.searchField.length>0?`&search=${this.searchField}`:""}`).subscribe(t=>{t.data.forEach(s=>s.selected=!1),this.response=t})},submitChange(e,t){U.put(`/api/medias/${t.id}`,{name:e.srcElement.textContent}).subscribe({next:s=>{t.fileEdit=!1,$.success(s.message,"OK").subscribe()},error:s=>{t.fileEdit=!1,$.success(s.message||_("An unexpected error occured."),"OK").subscribe()}})},useSelectedEntries(){this.popup.params.resolve({event:"use-selected",value:this.response.data.filter(e=>e.selected)}),this.popup.close()},selectResource(e){this.bulkSelect||this.response.data.forEach((t,s)=>{s!==this.response.data.indexOf(e)&&(t.selected=!1)}),e.fileEdit=!1,e.selected=!e.selected},isImage(e){return Object.keys(ns.medias.imageMimes).includes(e.extension)}}},hr={class:"sidebar w-48 md:h-full flex-shrink-0"},fr={class:"text-xl font-bold my-4 text-center"},mr={class:"sidebar-menus flex md:block mt-8"},gr=["onClick"],br={key:0,class:"content flex-auto w-full flex-col overflow-hidden flex"},_r={key:0,class:"p-2 flex bg-box-background flex-shrink-0 justify-between"},pr=l("div",null,null,-1),yr={class:"cursor-pointer text-lg md:text-xl font-bold text-center text-primary mb-4"},vr={style:{display:"none"},type:"file",name:"",multiple:"",ref:"files",id:""},kr={class:"rounded bg-box-background shadow w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},wr={key:0},xr={key:0,class:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},Dr=["onClick"],Cr=l("i",{class:"las la-eye"},null,-1),Mr={class:"ml-2"},Tr={key:1,class:"h-full w-full items-center justify-center flex text-center text-soft-tertiary"},Sr={key:1,class:"content flex-auto flex-col w-full overflow-hidden flex"},$r={key:0,class:"p-2 flex bg-box-background flex-shrink-0 justify-between"},Er=l("div",null,null,-1),Rr={class:"flex flex-auto overflow-hidden"},Fr={class:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},Or={class:"p-2 border-b border-box-background"},Pr={class:"ns-input border-2 rounded border-input-edge bg-input-background flex"},Ar=["placeholder"],jr={key:0,class:"flex items-center justify-center w-20 p-1"},Hr={class:"flex flex-auto"},Ur={class:"p-2 overflow-x-auto"},Lr={class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"},Yr={class:"p-2"},Vr=["onClick"],Br=["src","alt"],Ir={key:1,class:"object-cover h-full flex items-center justify-center"},Nr={key:0,class:"flex flex-auto items-center justify-center"},zr={class:"text-2xl font-bold"},qr={id:"preview",class:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0"},Wr={key:0,class:"h-64 bg-gray-800 flex items-center justify-center"},Gr=["src","alt"],Kr={key:1,class:"object-cover h-full flex items-center justify-center"},Qr={key:1,id:"details",class:"p-4 text-gray-700 text-sm"},Zr={class:"flex flex-col mb-2"},Xr={class:"font-bold block"},Jr=["contenteditable"],ed={class:"flex flex-col mb-2"},td={class:"font-bold block"},sd={class:"flex flex-col mb-2"},nd={class:"font-bold block"},ld={class:"py-2 pr-2 flex ns-media-footer flex-shrink-0 justify-between"},id={class:"flex -mx-2 flex-shrink-0"},ad={key:0,class:"px-2"},rd={class:"ns-button shadow rounded overflow-hidden info"},dd=l("i",{class:"las la-times"},null,-1),od={key:1,class:"px-2"},ud={class:"ns-button shadow rounded overflow-hidden info"},cd=l("i",{class:"las la-check-circle"},null,-1),hd={key:2,class:"px-2"},fd={class:"ns-button shadow rounded overflow-hidden warning"},md=l("i",{class:"las la-trash"},null,-1),gd={class:"flex-shrink-0 -mx-2 flex"},bd={class:"px-2"},_d={class:"rounded shadow overflow-hidden flex text-sm"},pd=["disabled"],yd=l("hr",{class:"border-r border-gray-700"},null,-1),vd=["disabled"],kd={key:0,class:"px-2"},wd={class:"ns-button info"};function xd(e,t,s,c,d,n){const r=w("ns-close-button");return i(),a("div",{class:m(["flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",n.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full"]),id:"ns-media"},[l("div",hr,[l("h3",fr,h(n.__("Medias Manager")),1),l("ul",mr,[(i(!0),a(p,null,D(d.pages,(o,f)=>(i(),a("li",{onClick:g=>n.select(o),class:m(["py-2 px-3 cursor-pointer border-l-8",o.selected?"active":""]),key:f},h(o.label),11,gr))),128))])]),n.currentPage.name==="upload"?(i(),a("div",br,[n.isPopup?(i(),a("div",_r,[pr,l("div",null,[T(r,{onClick:t[0]||(t[0]=o=>n.popupInstance.close())})])])):u("",!0),l("div",{id:"dropping-zone",onClick:t[1]||(t[1]=o=>n.triggerManualUpload(o)),class:m([d.isDragging?"border-dashed border-2":"","flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center"])},[l("h3",yr,h(n.__("Click Here Or Drop Your File To Upload")),1),l("input",vr,null,512),l("div",kr,[d.files.length>0?(i(),a("ul",wr,[(i(!0),a(p,null,D(d.files,(o,f)=>(i(),a("li",{class:m([o.failed===!1?"border-info-secondary":"border-error-secondary","p-2 mb-2 border-b-2 flex items-center justify-between"]),key:f},[l("span",null,h(o.file.name),1),o.failed===!1?(i(),a("span",xr,h(o.progress)+"%",1)):u("",!0),o.failed===!0?(i(),a("div",{key:1,onClick:g=>n.openError(o),class:"rounded bg-error-primary hover:bg-error-secondary hover:text-white flex items-center justify-center text-xs p-2 cursor-pointer"},[Cr,y(),l("span",Mr,h(n.__("See Error")),1)],8,Dr)):u("",!0)],2))),128))])):u("",!0),d.files.length===0?(i(),a("div",Tr,h(n.__("Your uploaded files will displays here.")),1)):u("",!0)])],2)])):u("",!0),n.currentPage.name==="gallery"?(i(),a("div",Sr,[n.isPopup?(i(),a("div",$r,[Er,l("div",null,[T(r,{onClick:t[2]||(t[2]=o=>n.popupInstance.close())})])])):u("",!0),l("div",Rr,[l("div",Fr,[l("div",Or,[l("div",Pr,[R(l("input",{id:"search",type:"text","onUpdate:modelValue":t[3]||(t[3]=o=>d.searchField=o),placeholder:n.__("Search Medias"),class:"px-4 block w-full sm:text-sm sm:leading-5 h-10"},null,8,Ar),[[A,d.searchField]]),d.searchField.length>0?(i(),a("div",jr,[l("button",{onClick:t[4]||(t[4]=o=>d.searchField=""),class:"h-full w-full rounded-tr rounded-br overflow-hidden"},h(n.__("Cancel")),1)])):u("",!0)])]),l("div",Hr,[l("div",Ur,[l("div",Lr,[(i(!0),a(p,null,D(d.response.data,(o,f)=>(i(),a("div",{key:f,class:""},[l("div",Yr,[l("div",{onClick:g=>n.selectResource(o),class:m([o.selected?"ns-media-image-selected ring-4":"","rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center"])},[n.isImage(o)?(i(),a("img",{key:0,class:"object-cover h-full",src:o.sizes.thumb,alt:o.name},null,8,Br)):u("",!0),n.isImage(o)?u("",!0):(i(),a("div",Ir,[l("i",{class:m([d.fileIcons[o.extension]||d.fileIcons.unknown,"las text-8xl text-white"])},null,2)]))],10,Vr)])]))),128))])]),d.response.data.length===0?(i(),a("div",Nr,[l("h3",zr,h(n.__("Nothing has already been uploaded")),1)])):u("",!0)])]),l("div",qr,[n.panelOpened?(i(),a("div",Wr,[n.isImage(n.selectedResource)?(i(),a("img",{key:0,class:"object-cover h-full",src:n.selectedResource.sizes.thumb,alt:n.selectedResource.name},null,8,Gr)):u("",!0),n.isImage(n.selectedResource)?u("",!0):(i(),a("div",Kr,[l("i",{class:m([d.fileIcons[n.selectedResource.extension]||d.fileIcons.unknown,"las text-8xl text-white"])},null,2)]))])):u("",!0),n.panelOpened?(i(),a("div",Qr,[l("p",Zr,[l("strong",Xr,h(n.__("File Name"))+": ",1),l("span",{class:m(["p-2",n.selectedResource.fileEdit?"border-b border-input-edge bg-input-background":""]),onBlur:t[5]||(t[5]=o=>n.submitChange(o,n.selectedResource)),contenteditable:n.selectedResource.fileEdit?"true":"false",onClick:t[6]||(t[6]=o=>n.selectedResource.fileEdit=!0)},h(n.selectedResource.name),43,Jr)]),l("p",ed,[l("strong",td,h(n.__("Uploaded At"))+":",1),l("span",null,h(n.selectedResource.created_at),1)]),l("p",sd,[l("strong",nd,h(n.__("By"))+" :",1),l("span",null,h(n.selectedResource.user.username),1)])])):u("",!0)])]),l("div",ld,[l("div",id,[d.bulkSelect?(i(),a("div",ad,[l("div",rd,[l("button",{onClick:t[7]||(t[7]=o=>n.cancelBulkSelect()),class:"py-2 px-3"},[dd,y(" "+h(n.__("Cancel")),1)])])])):u("",!0),n.hasOneSelected&&!d.bulkSelect?(i(),a("div",od,[l("div",ud,[l("button",{onClick:t[8]||(t[8]=o=>d.bulkSelect=!0),class:"py-2 px-3"},[cd,y(" "+h(n.__("Bulk Select")),1)])])])):u("",!0),n.hasOneSelected?(i(),a("div",hd,[l("div",fd,[l("button",{onClick:t[9]||(t[9]=o=>n.deleteSelected()),class:"py-2 px-3"},[md,y(" "+h(n.__("Delete")),1)])])])):u("",!0)]),l("div",gd,[l("div",bd,[l("div",_d,[l("div",{class:m(["ns-button",d.response.current_page===1?"disabled cursor-not-allowed":"info"])},[l("button",{disabled:d.response.current_page===1,onClick:t[10]||(t[10]=o=>n.loadGallery(d.response.current_page-1)),class:"p-2"},h(n.__("Previous")),9,pd)],2),yd,l("div",{class:m(["ns-button",d.response.current_page===d.response.last_page?"disabled cursor-not-allowed":"info"])},[l("button",{disabled:d.response.current_page===d.response.last_page,onClick:t[11]||(t[11]=o=>n.loadGallery(d.response.current_page+1)),class:"p-2"},h(n.__("Next")),9,vd)],2)])]),n.isPopup&&n.hasOneSelected?(i(),a("div",kd,[l("div",wd,[l("button",{class:"rounded shadow p-2 text-sm",onClick:t[12]||(t[12]=o=>n.useSelectedEntries())},h(n.__("Use Selected")),1)])])):u("",!0)])])])):u("",!0)],2)}const pe=C(cr,[["render",xd]]),vc=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"})),Dd={computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},data(){return{fileIcons:_e}},props:["placeholder","leading","type","field"],mounted(){},methods:{isImage(e){return Object.keys(ns.medias.imageMimes).includes(e.extension)},toggleMedia(){new Promise((t,s)=>{L.show(pe,{resolve:t,reject:s,...this.field.data||{}})}).then(t=>{t.event==="use-selected"&&(!this.field.data||this.field.data.type==="url"?this.field.value=t.value[0].sizes.original:!this.field.data||this.field.data.type==="model"?(this.field.value=t.value[0].id,this.field.data.model=t.value[0]):this.field.value=t.value[0].sizes.original,this.$forceUpdate())})}}},Cd={class:"flex flex-col mb-2 flex-auto ns-media"},Md=["for"],Td={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Sd={class:"text-primary sm:text-sm sm:leading-5"},$d={class:"rounded overflow-hidden flex"},Ed={key:0,class:"form-input flex w-full sm:text-sm items-center sm:leading-5 h-10"},Rd=["src","alt"],Fd={key:1,class:"object-cover flex items-center justify-center"},Od={class:"text-xs text-secondary"},Pd=["disabled","id","type","placeholder"],Ad=l("i",{class:"las la-photo-video"},null,-1),jd=[Ad];function Hd(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Cd,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Md),l("div",{class:m([n.hasError?"has-error":"is-pristine","mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",Td,[l("span",Sd,h(s.leading),1)])):u("",!0),l("div",$d,[s.field.data&&s.field.data.type==="model"?(i(),a("div",Ed,[s.field.value&&s.field.data.model.name?(i(),a(p,{key:0},[n.isImage(s.field.data.model)?(i(),a("img",{key:0,class:"w-8 h-8 m-1",src:s.field.data.model.sizes.thumb,alt:s.field.data.model.name},null,8,Rd)):u("",!0),n.isImage(s.field.data.model)?u("",!0):(i(),a("div",Fd,[l("i",{class:m([d.fileIcons[s.field.data.model.extension]||d.fileIcons.unknown,"las text-3xl"])},null,2)])),l("span",Od,h(s.field.data.model.name),1)],64)):u("",!0)])):u("",!0),!s.field.data||s.field.data.type==="undefined"||s.field.data.type==="url"?R((i(),a("input",{key:1,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),disabled:s.field.disabled,onBlur:t[1]||(t[1]=o=>e.$emit("blur",this)),onChange:t[2]||(t[2]=o=>e.$emit("change",this)),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.placeholder},null,42,Pd)),[[oe,s.field.value]]):u("",!0),l("button",{onClick:t[3]||(t[3]=o=>n.toggleMedia(s.field)),class:"w-10 h-10 flex items-center justify-center border-l-2 outline-none"},jd)])],2),T(r,{field:s.field},null,8,["field"])])}const Ud=C(Dd,[["render",Hd]]),Ld={data:()=>({defaultToggledState:!1,_save:0,hasChildren:!1}),props:["href","to","label","icon","notification","toggled","identifier"],mounted(){this.hasChildren=this.$el.querySelectorAll(".submenu").length>0,this.defaultToggledState=this.toggled!==void 0?this.toggled:this.defaultToggledState,W.subject().subscribe(e=>{e.value!==this.identifier&&(this.defaultToggledState=!1)})},methods:{toggleEmit(){this.toggle().then(e=>{e&&W.emit({identifier:"side-menu.open",value:this.identifier})})},goTo(e,t){return this.$router.push(e),t.preventDefault(),!1},toggle(){return new Promise((e,t)=>{(!this.href||this.href.length===0)&&(this.defaultToggledState=!this.defaultToggledState,e(this.defaultToggledState))})}}},Yd=["href"],Vd={class:"flex items-center"},Bd={key:0,class:"rounded-full notification-label font-bold w-6 h-6 text-xs justify-center items-center flex"},Id=["href"],Nd={class:"flex items-center"},zd={key:0,class:"rounded-full notification-label font-bold w-6 h-6 text-xs justify-center items-center flex"};function qd(e,t,s,c,d,n){var r,o;return i(),a("div",null,[s.to&&!e.hasChildren?(i(),a("a",{key:0,onClick:t[0]||(t[0]=f=>n.goTo(s.to,f)),href:s.to,class:m([e.defaultToggledState?"toggled":"normal","flex justify-between py-2 border-l-8 px-3 font-bold ns-aside-menu"])},[l("span",Vd,[l("i",{class:m(["las text-lg mr-2",((r=s.icon)==null?void 0:r.length)>0?s.icon:"la-star"])},null,2),y(" "+h(s.label),1)]),s.notification>0?(i(),a("span",Bd,h(s.notification),1)):u("",!0)],10,Yd)):(i(),a("a",{key:1,onClick:t[1]||(t[1]=f=>n.toggleEmit()),href:s.href||"javascript:void(0)",class:m([e.defaultToggledState?"toggled":"normal","flex justify-between py-2 border-l-8 px-3 font-bold ns-aside-menu"])},[l("span",Nd,[l("i",{class:m(["las text-lg mr-2",((o=s.icon)==null?void 0:o.length)>0?s.icon:"la-star"])},null,2),y(" "+h(s.label),1)]),s.notification>0?(i(),a("span",zd,h(s.notification),1)):u("",!0)],10,Id)),l("ul",{class:m([e.defaultToggledState?"":"hidden","submenu-wrapper"])},[v(e.$slots,"default")],2)])}const Wd=C(Ld,[["render",qd]]),Gd={data(){return{showPanel:!1,search:"",eventListener:null}},emits:["change","blur"],props:["field"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},_filtredOptions(){let e=this._options;return this.search.length>0&&(e=this._options.filter(t=>t.label.toLowerCase().search(this.search.toLowerCase())!==-1)),e.filter(t=>t.selected===!1)},_options(){return this.field.options.map(e=>(e.selected=e.selected===void 0?!1:e.selected,this.field.value&&this.field.value.includes(e.value)&&(e.selected=!0),e))}},methods:{__:_,togglePanel(){this.field.disabled||(this.showPanel=!this.showPanel)},selectAvailableOptionIfPossible(){this._filtredOptions.length>0&&this.addOption(this._filtredOptions[0])},addOption(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout(()=>{this.search=""},100))},removeOption(e,t){if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout(()=>{this.search=""},100),!1}},mounted(){this.field.value&&this.field.value.reverse().forEach(t=>{const s=this.field.options.filter(c=>c.value===t);s.length>0&&this.addOption(s[0])}),this.eventListener=document.addEventListener("click",e=>{let s=e.target.parentElement,c=!1;if(this.showPanel){for(;s;){if(s&&s.classList.contains("ns-multiselect")&&!s.classList.contains("arrows")){c=!0;break}s=s.parentElement}c===!1&&this.togglePanel()}})}},Kd={class:"flex flex-col ns-multiselect"},Qd=["for"],Zd={class:"flex flex-col"},Xd={class:"flex -mx-1 -my-1 flex-wrap"},Jd={class:"rounded bg-info-secondary text-white flex justify-between p-1 items-center"},eo={class:"pr-8"},to=["onClick"],so=l("i",{class:"las la-times"},null,-1),no=[so],lo={class:"arrows ml-1"},io={class:"ns-dropdown shadow"},ao={class:"search border-b border-input-option-hover"},ro={class:"h-40 overflow-y-auto"},oo=["onClick"],uo={key:0,class:"las la-check"},co={key:0,class:"p-2 text-center text-primary"},ho={class:"my-2"};function fo(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Kd,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-secondary":"text-primary","block mb-1 leading-5 font-medium"])},[v(e.$slots,"default")],10,Qd),l("div",Zd,[l("div",{onClick:t[0]||(t[0]=o=>n.togglePanel()),class:m([s.field.disabled?"bg-input-disabled":"","overflow-y-auto flex select-preview justify-between rounded border-2 border-input-option-hover p-2 items-start"]),style:{"max-height":"150px"}},[l("div",Xd,[(i(!0),a(p,null,D(n._options.filter(o=>o.selected),(o,f)=>(i(),a("div",{key:f,class:"px-1 my-1"},[l("div",Jd,[l("span",eo,h(o.label),1),l("button",{onClick:g=>n.removeOption(o,g),class:"rounded outline-none hover:bg-info-tertiary h-6 w-6 flex items-center justify-center"},no,8,to)])]))),128))]),l("div",lo,[l("i",{class:m(["las la-angle-down",d.showPanel?"hidden":""])},null,2),l("i",{class:m(["las la-angle-up",d.showPanel?"":"hidden"])},null,2)])],2),d.showPanel?(i(),a("div",{key:0,class:m(["h-0 z-10",d.showPanel?"shadow":""])},[l("div",io,[l("div",ao,[R(l("input",{onKeypress:t[1]||(t[1]=Y(o=>n.selectAvailableOptionIfPossible(),["enter"])),"onUpdate:modelValue":t[2]||(t[2]=o=>d.search=o),class:"p-2 w-full bg-transparent text-primary outline-none",placeholder:"Search"},null,544),[[A,d.search]])]),l("div",ro,[(i(!0),a(p,null,D(n._filtredOptions,(o,f)=>(i(),a("div",{onClick:g=>n.addOption(o),key:f,class:m([o.selected?"bg-info-secondary text-white":"text-primary","option p-2 flex justify-between cursor-pointer hover:bg-info-tertiary hover:text-white"])},[l("span",null,h(o.label),1),l("span",null,[o.checked?(i(),a("i",uo)):u("",!0)])],10,oo))),128))]),n._options.length===0?(i(),a("div",co,h(n.__("Nothing to display")),1)):u("",!0)])],2)):u("",!0)]),l("div",ho,[T(r,{field:s.field},null,8,["field"])])])}const mo=C(Gd,[["render",fo]]),go={},bo={class:"my-4"},_o={class:"font-bold text-2xl"},po={class:"text-primary"};function yo(e,t){return i(),a("div",bo,[l("h2",_o,[v(e.$slots,"title")]),l("span",po,[v(e.$slots,"description")])])}const vo=C(go,[["render",yo]]),ko={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:_,selectOption(e){this.$emit("select",e),this.searchText="",this.results=[]},renderLabel(e,t){return typeof t=="object"?t.map(s=>e[s]).join(" "):e[t]}},watch:{searchText(){clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchText.length>0&&U[this.method||"post"](this.url,{[this.searchArgument||"search"]:this.searchText}).subscribe({next:e=>{this.results=e},error:e=>{$.error(e.message||_("An unexpected error occurred.")).subscribe()}})},1e3)}},mounted(){}},wo={class:"ns-search"},xo={class:"input-group info border-2"},Do=["placeholder"],Co={class:"relative"},Mo={class:"w-full absolute shadow-lg"},To={key:0,class:"ns-vertical-menu"},So=["onClick"];function $o(e,t,s,c,d,n){return i(),a("div",wo,[l("div",xo,[R(l("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=r=>d.searchText=r),class:"p-2 w-full outline-none",placeholder:s.placeholder||n.__("Search..."),id:""},null,8,Do),[[A,d.searchText]])]),l("div",Co,[l("div",Mo,[d.results.length>0&&d.searchText.length>0?(i(),a("ul",To,[(i(!0),a(p,null,D(d.results,(r,o)=>(i(),a("li",{class:"border-b p-2 cursor-pointer",onClick:f=>n.selectOption(r),key:o},h(n.renderLabel(r,s.label)),9,So))),128))])):u("",!0)])])])}const Eo=C(ko,[["render",$o]]),Ro={data:()=>({searchField:"",showResults:!1}),name:"ns-search-select",emits:["saved","change"],props:["name","placeholder","field","leading"],computed:{selectedOptionLabel(){if(this.field.value===null||this.field.value===void 0)return _("Choose...");const e=this.field.options.filter(t=>t.value===this.field.value);return e.length>0?e[0].label:_("Choose...")},filtredOptions(){return this.searchField.length>0?this.field.options.filter(e=>new RegExp(this.searchField,"i").test(e.label)).splice(0,10):this.field.options},hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},watch:{showResults(){this.showResults===!0&&setTimeout(()=>{this.$refs.searchInputField.select()},50)}},mounted(){const e=this.field.options.filter(t=>t.value===this.field.value);e.length>0&&[null,void 0].includes(this.field.value)&&this.selectOption(e[0]),document.addEventListener("click",t=>{this.$el.contains(t.target)===!1&&(this.showResults=!1)})},methods:{__:_,selectFirstOption(){this.filtredOptions.length>0&&this.selectOption(this.filtredOptions[0])},selectOption(e){this.field.value=e.value,this.$emit("change",e.value),this.searchField="",this.showResults=!1},async triggerDynamicComponent(e){try{this.showResults=!1;const t=nsExtraComponents[e.component]||nsComponents[e.component];t===void 0&&$.error(_(`The component ${e.component} cannot be loaded. Make sure it's injected on nsExtraComponents object.`)).subscribe();const s=await new Promise((c,d)=>{const n=L.show(t,{...e.props||{},field:this.field,resolve:c,reject:d})});this.$emit("saved",s)}catch{}}}},Fo={class:"flex flex-col flex-auto ns-select"},Oo=["for"],Po={class:"text-primary text-sm"},Ao=l("i",{class:"las la-plus"},null,-1),jo=[Ao],Ho={key:0,class:"relative"},Uo={class:"w-full overflow-hidden -top-[8px] border-r-2 border-l-2 border-t rounded-b-md border-b-2 border-input-edge bg-input-background shadow z-10 absolute"},Lo={class:"border-b border-input-edge border-dashed p-2"},Yo=["placeholder"],Vo={class:"h-60 overflow-y-auto"},Bo=["onClick"];function Io(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Fo,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Oo),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.disabled?"cursor-not-allowed":"cursor-default"),"border-2 mt-1 relative rounded-md shadow-sm mb-1 flex overflow-hidden"])},[l("div",{onClick:t[0]||(t[0]=o=>!s.field.disabled&&(e.showResults=!e.showResults)),class:m([s.field.disabled?"bg-input-disabled":"bg-input-background","flex-auto h-10 sm:leading-5 py-2 px-4 flex items-center"])},[l("span",Po,h(n.selectedOptionLabel),1)],2),s.field.component&&!s.field.disabled?(i(),a("div",{key:0,onClick:t[1]||(t[1]=o=>n.triggerDynamicComponent(s.field)),class:"flex items-center justify-center w-10 hover:cursor-pointer hover:bg-input-button-hover border-l-2 border-input-edge"},jo)):u("",!0)],2),e.showResults?(i(),a("div",Ho,[l("div",Uo,[l("div",Lo,[R(l("input",{onKeypress:t[2]||(t[2]=Y(o=>n.selectFirstOption(),["enter"])),ref:"searchInputField","onUpdate:modelValue":t[3]||(t[3]=o=>e.searchField=o),type:"text",placeholder:n.__("Search result")},null,40,Yo),[[A,e.searchField]])]),l("div",Vo,[l("ul",null,[(i(!0),a(p,null,D(n.filtredOptions,o=>(i(),a("li",{onClick:f=>n.selectOption(o),class:"py-1 px-2 hover:bg-info-primary cursor-pointer text-primary"},h(o.label),9,Bo))),256))])])])])):u("",!0),T(r,{field:s.field},null,8,["field"])])}const No=C(Ro,[["render",Io]]),zo={data:()=>({}),props:["name","placeholder","field","leading"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},mounted(){},methods:{__:_}},qo={class:"flex flex-col flex-auto ns-select"},Wo=["for"],Go=["disabled","name"],Ko={value:null},Qo=["value"];function Zo(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",qo,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Wo),l("div",{class:m([n.hasError?"has-error":"is-pristine","border-2 mt-1 relative rounded-md shadow-sm mb-1 overflow-hidden"])},[R(l("select",{disabled:s.field.disabled?s.field.disabled:!1,name:s.field.name,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),class:m([n.inputClass,"form-input block w-full pl-7 pr-12 sm:text-sm sm:leading-5 h-10 appearance-none"])},[l("option",Ko,h(n.__("Choose an option")),1),(i(!0),a(p,null,D(s.field.options,(o,f)=>(i(),a("option",{key:f,value:o.value,class:"py-2"},h(o.label),9,Qo))),128))],10,Go),[[H,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const Xo=C(zo,[["render",Zo]]),Jo={data:()=>({}),props:["name","placeholder","field","leading"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},methods:{__:_,playSelectedSound(){this.field.value!==null&&this.field.value.length>0&&new Audio(this.field.value).play()}}},eu={class:"flex flex-col flex-auto"},tu=["for"],su=l("button",{class:"w-10 flex item-center justify-center"},[l("i",{class:"las la-play text-2xl"})],-1),nu=[su],lu=["disabled","name"],iu=["value"];function au(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",eu,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,tu),l("div",{class:m([n.hasError?"border-error-primary":"border-input-edge","border-2 mt-1 flex relative overflow-hidden rounded-md shadow-sm mb-1 form-input"])},[l("div",{onClick:t[0]||(t[0]=o=>n.playSelectedSound()),class:"border-r-2 border-input-edge flex-auto flex items-center justify-center hover:bg-info-tertiary hover:text-white"},nu),R(l("select",{disabled:s.field.disabled?s.field.disabled:!1,onChange:t[1]||(t[1]=o=>e.$emit("change",o)),name:s.field.name,"onUpdate:modelValue":t[2]||(t[2]=o=>s.field.value=o),class:m([n.inputClass,"text-primary block w-full pl-7 pr-12 sm:text-sm sm:leading-5 h-10 outline-none"])},[(i(!0),a(p,null,D(s.field.options,(o,f)=>(i(),a("option",{key:f,value:o.value,class:"py-2"},h(o.label),9,iu))),128))],42,lu),[[H,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const ru=C(Jo,[["render",au]]),du={data:()=>({}),mounted(){},computed:{validatedSize(){return this.size||24},validatedBorder(){return this.border||8},validatedAnimation(){return this.animation||"fast"}},props:["color","size","border","animation"]},ou={class:"flex items-center justify-center"};function uu(e,t,s,c,d,n){return i(),a("div",ou,[l("div",{class:m(["loader ease-linear rounded-full border-gray-200",n.validatedAnimation+" border-4 border-t-4 w-"+n.validatedSize+" h-"+n.validatedSize])},null,2)])}const cu=C(du,[["render",uu]]),hu={data:()=>({}),props:["href","label","active","to"],mounted(){},methods:{goTo(e,t){return this.$router.push(e),t.preventDefault(),!1}}},fu={class:"submenu"},mu=["href"],gu=["href"];function bu(e,t,s,c,d,n){return i(),a("div",null,[l("li",fu,[s.href?(i(),a("a",{key:0,class:m([s.active?"font-bold active":"normal","py-2 border-l-8 px-3 block ns-aside-submenu"]),href:s.href},[v(e.$slots,"default")],10,mu)):s.to?(i(),a("a",{key:1,class:m([s.active?"font-bold active":"normal","py-2 border-l-8 px-3 block ns-aside-submenu"]),onClick:t[0]||(t[0]=r=>n.goTo(s.to,r)),href:s.to},[v(e.$slots,"default")],10,gu)):u("",!0)])])}const _u=C(hu,[["render",bu]]),pu={props:["options","row","columns","prependOptions","showOptions","showCheckboxes"],data:()=>({optionsToggled:!1}),mounted(){},methods:{__:_,sanitizeHTML(e){var t=document.createElement("div");t.innerHTML=e;for(var s=t.getElementsByTagName("script"),c=s.length;c--;)s[c].parentNode.removeChild(s[c]);return t.innerHTML},getElementOffset(e){const t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu(e){if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout(()=>{const t=this.$el.querySelectorAll(".relative > .absolute")[0],s=this.$el.querySelectorAll(".relative")[0],c=this.getElementOffset(s);t.style.top=c.top+"px",t.style.left=c.left+"px",s!==void 0&&(s.classList.remove("relative"),s.classList.add("dropdown-holder"))},100);else{const t=this.$el.querySelectorAll(".dropdown-holder")[0];t.classList.remove("dropdown-holder"),t.classList.add("relative")}},handleChanged(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync(e){e.confirm!==null?Popup.show(V,{title:e.confirm.title||_("Confirm Your Action"),message:e.confirm.message||_("Would you like to delete this entry?"),onAction:t=>{t&&U[e.type.toLowerCase()](e.url).subscribe(s=>{$.success(s.message).subscribe(),this.$emit("reload",this.row)},s=>{this.toggleMenu(),$.error(s.message).subscribe()})}}):(W.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup(e,t){const s=window.nsExtraComponents[e.component];if(e.component)return s?new Promise((c,d)=>{Popup.show(s,{resolve:c,reject:d,row:t,action:e})}):$.error(_(`Unable to load the component "${e.component}". Make sure the component is registered to "nsExtraComponents".`)).subscribe();this.triggerAsync(e)}}},yu={key:0,class:"font-sans p-2"},vu={key:1,class:"font-sans p-2"},ku={class:""},wu=l("i",{class:"las la-ellipsis-h"},null,-1),xu={class:"relative"},Du={key:0,class:"zoom-in-entrance border border-box-edge anim-duration-300 z-50 origin-bottom-right w-56 mt-2 absolute rounded-md shadow-lg ns-menu-wrapper"},Cu={class:"rounded-md shadow-xs"},Mu={class:"py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"},Tu=["href","target","innerHTML"],Su=["onClick","innerHTML"],$u=["href","innerHTML"],Eu=["innerHTML"],Ru={class:"flex md:-mx-1 md:flex-wrap flex-col md:flex-row text-xs"},Fu={class:"md:px-1 w-full md:w-1/2 lg:w-2/4"},Ou=["innerHTML"],Pu={key:2},Au={key:2,class:"font-sans p-2 flex flex-col items-center justify-center"},ju={class:""},Hu=l("i",{class:"las la-ellipsis-h"},null,-1),Uu={class:"relative"},Lu={key:0,class:"zoom-in-entrance border border-box-edge anim-duration-300 z-50 origin-bottom-right -ml-28 w-56 mt-2 absolute rounded-md shadow-lg ns-menu-wrapper"},Yu={class:"rounded-md shadow-xs"},Vu={class:"py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"},Bu=["href","target","innerHTML"],Iu=["onClick","innerHTML"];function Nu(e,t,s,c,d,n){const r=w("ns-checkbox");return i(),a("tr",{class:m(["ns-table-row border text-sm",s.row.$cssClass?s.row.$cssClass:""])},[s.showCheckboxes?(i(),a("td",yu,[T(r,{onChange:t[0]||(t[0]=o=>n.handleChanged(o)),checked:s.row.$checked},null,8,["checked"])])):u("",!0),s.prependOptions&&s.showOptions?(i(),a("td",vu,[l("div",ku,[l("button",{onClick:t[1]||(t[1]=o=>n.toggleMenu(o)),class:m([s.row.$toggled?"active":"","ns-inset-button outline-none rounded-full w-24 text-sm p-1 border"])},[wu,y(" "+h(n.__("Options")),1)],2),s.row.$toggled?(i(),a("div",{key:0,onClick:t[2]||(t[2]=o=>n.toggleMenu(o)),class:"absolute w-full h-full z-10 top-0 left-0"})):u("",!0),l("div",xu,[s.row.$toggled?(i(),a("div",Du,[l("div",Cu,[l("div",Mu,[(i(!0),a(p,null,D(s.row.$actions,(o,f)=>(i(),a(p,{key:f},[["GOTO","TAB"].includes(o.type)?(i(),a("a",{key:0,href:o.url,target:o.type==="TAB"?"_self":"_blank",class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Tu)):u("",!0),["GET","DELETE","POPUP"].includes(o.type)?(i(),a("a",{key:1,href:"javascript:void(0)",onClick:g=>n.triggerAsync(o),class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Su)):u("",!0)],64))),128))])])])):u("",!0)])])])):u("",!0),(i(!0),a(p,null,D(s.columns,(o,f)=>(i(),a("td",{key:f,class:"font-sans p-2"},[s.row[f]&&s.row[f].type&&s.row[f].type==="link"?(i(),a("a",{key:0,target:"_blank",href:s.row[f].href,innerHTML:n.sanitizeHTML(s.row[f].label)},null,8,$u)):u("",!0),typeof s.row[f]=="string"||typeof s.row[f]=="number"?(i(),a(p,{key:1},[o.attributes&&o.attributes.length>0?(i(),a(p,{key:0},[l("h3",{class:"fond-bold text-lg",innerHTML:n.sanitizeHTML(s.row[f])},null,8,Eu),l("div",Ru,[(i(!0),a(p,null,D(o.attributes,g=>(i(),a("div",Fu,[l("strong",null,h(g.label),1),y(": "+h(s.row[g.column]),1)]))),256))])],64)):(i(),a("div",{key:1,innerHTML:n.sanitizeHTML(s.row[f])},null,8,Ou))],64)):u("",!0),s.row[f]===null?(i(),a("div",Pu,h(n.__("Undefined")),1)):u("",!0)]))),128)),!s.prependOptions&&s.showOptions?(i(),a("td",Au,[l("div",ju,[l("button",{onClick:t[3]||(t[3]=o=>n.toggleMenu(o)),class:m([s.row.$toggled?"active":"","ns-inset-button outline-none rounded-full w-24 text-sm p-1 border"])},[Hu,y(" "+h(n.__("Options")),1)],2),s.row.$toggled?(i(),a("div",{key:0,onClick:t[4]||(t[4]=o=>n.toggleMenu(o)),class:"absolute w-full h-full z-10 top-0 left-0"})):u("",!0),l("div",Uu,[s.row.$toggled?(i(),a("div",Lu,[l("div",Yu,[l("div",Vu,[(i(!0),a(p,null,D(s.row.$actions,(o,f)=>(i(),a(p,{key:f},[["GOTO","TAB"].includes(o.type)?(i(),a("a",{key:0,href:o.url,target:o.type==="TAB"?"_self":"_blank",class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Bu)):u("",!0),["GET","DELETE","POPUP"].includes(o.type)?(i(),a("a",{key:1,href:"javascript:void(0)",onClick:g=>n.triggerAsync(o),class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Iu)):u("",!0)],64))),128))])])])):u("",!0)])])])):u("",!0)],2)}const zu=C(pu,[["render",Nu]]),qu={data(){return{childrens:[],tabState:new $e}},props:["active"],computed:{activeComponent(){const e=this.childrens.filter(t=>t.active);return e.length>0?e[0]:!1}},beforeUnmount(){this.tabState.unsubscribe()},watch:{active(e,t){this.childrens.forEach(s=>{s.active=s.identifier===e,s.active&&this.toggle(s)})}},mounted(){this.buildChildrens(this.active)},methods:{__:_,toggle(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier),this.tabState.next(e)},buildChildrens(e){this.childrens=Array.from(this.$el.querySelectorAll(".ns-tab-item")).map(s=>{const c=s.getAttribute("identifier")||void 0;let d=!0;return s.getAttribute("visible")&&(d=s.getAttribute("visible")==="true"),{el:s,active:!!(e&&e===c),identifier:c,initialized:!1,visible:d,label:s.getAttribute("label")||_("Unamed Tab")}}).filter(s=>s.visible),!(this.childrens.filter(s=>s.active).length>0)&&this.childrens.length>0&&(this.childrens[0].active=!0),this.childrens.forEach(s=>{s.active&&this.toggle(s)})}}},Wu=["selected-tab"],Gu={class:"header ml-4 flex justify-between",style:{"margin-bottom":"-1px"}},Ku={class:"flex flex-auto"},Qu=["onClick"];function Zu(e,t,s,c,d,n){return i(),a("div",{class:"tabs flex flex-col flex-auto ns-tab overflow-hidden","selected-tab":n.activeComponent.identifier},[l("div",Gu,[l("div",Ku,[(i(!0),a(p,null,D(d.childrens,(r,o)=>(i(),a("div",{key:r.identifier,onClick:f=>n.toggle(r),class:m([s.active===r.identifier?"border-b-0 active z-10":"border inactive","tab rounded-tl rounded-tr border px-3 py-2 cursor-pointer"]),style:{"margin-right":"-1px"}},h(r.label),11,Qu))),128))]),l("div",null,[v(e.$slots,"extra")])]),v(e.$slots,"default")],8,Wu)}const Xu=C(qu,[["render",Zu]]),Ju={data(){return{selectedTab:{},tabStateSubscriber:null}},computed:{},mounted(){this.tabStateSubscriber=this.$parent.tabState.subscribe(e=>{this.selectedTab=e})},unmounted(){this.tabStateSubscriber.unsubscribe()},props:["label","identifier","padding"]},ec=["label","identifier"];function tc(e,t,s,c,d,n){return i(),a("div",{class:m([d.selectedTab.identifier!==s.identifier?"hidden":"","ns-tab-item flex flex-auto overflow-hidden"]),label:s.label,identifier:s.identifier},[d.selectedTab.identifier===s.identifier?(i(),a("div",{key:0,class:m(["border rounded flex-auto overflow-y-auto",s.padding||"p-4"])},[v(e.$slots,"default")],2)):u("",!0)],10,ec)}const sc=C(Ju,[["render",tc]]),nc={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"]},lc={class:"flex flex-col mb-2 flex-auto ns-textarea"},ic=["for"],ac={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},rc={class:"text-secondary sm:text-sm sm:leading-5"},dc=["rows","disabled","id","type","placeholder"],oc={key:0,class:"text-xs text-secondary"};function uc(e,t,s,c,d,n){return i(),a("div",lc,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},h(s.field.label),11,ic),l("div",{class:m([n.hasError?"has-error":"is-pristine","mt-1 relative border-2 overflow-hidden rounded-md focus:shadow-sm mb-1"])},[s.leading?(i(),a("div",ac,[l("span",rc,h(s.leading),1)])):u("",!0),R(l("textarea",{rows:s.field.data&&s.field.data.rows||10,disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=r=>s.field.value=r),onBlur:t[1]||(t[1]=r=>e.$emit("blur",this)),onChange:t[2]||(t[2]=r=>e.$emit("change",this)),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5"]),placeholder:s.placeholder},null,42,dc),[[A,s.field.value]])],2),!s.field.errors||s.field.errors.length===0?(i(),a("p",oc,[v(e.$slots,"description")])):u("",!0),(i(!0),a(p,null,D(s.field.errors,(r,o)=>(i(),a("p",{key:o,class:"text-xs text-error-primary"},[r.identifier==="required"?v(e.$slots,r.identifier,{key:0},()=>[y("This field is required.")]):u("",!0),r.identifier==="email"?v(e.$slots,r.identifier,{key:1},()=>[y("This field must contain a valid email address.")]):u("",!0),r.identifier==="invalid"?v(e.$slots,r.identifier,{key:2},()=>[y(h(r.message),1)]):u("",!0)]))),128))])}const cc=C(nc,[["render",uc]]),kc=Object.freeze(Object.defineProperty({__proto__:null,nsAlertPopup:se,nsAvatar:qe,nsButton:Ze,nsCalendar:ce,nsCheckbox:ds,nsCkeditor:Fe,nsCloseButton:fs,nsConfirmPopup:V,nsCrud:vn,nsCrudForm:Nn,nsDate:Xn,nsDateRangePicker:ge,nsDateTimePicker:be,nsDatepicker:$i,nsDaterangePicker:Wi,nsDragzone:aa,nsField:Ca,nsFieldDescription:$a,nsIconButton:Fa,nsInlineMultiselect:Za,nsInput:ir,nsLink:ur,nsMediaInput:Ud,nsMenu:Wd,nsMultiselect:mo,nsNotice:Oe,nsNumpad:Pe,nsNumpadPlus:Ae,nsPOSLoadingPopup:je,nsPageTitle:vo,nsPaginate:He,nsPromptPopup:Ue,nsSearch:Eo,nsSearchSelect:No,nsSelect:Xo,nsSelectAudio:ru,nsSpinner:cu,nsSubmenu:_u,nsSwitch:ue,nsTableRow:zu,nsTabs:Xu,nsTabsItem:sc,nsTextarea:cc},Symbol.toStringTag,{value:"Module"}));export{_u as a,kc as b,$i as c,Wi as d,be as e,pe as f,Ca as g,fs as h,vc as i,Wd as n}; +import se from"./ns-alert-popup-5493aad8.js";import{_}from"./currency-f8bd78d1.js";import{n as ve}from"./ns-avatar-image-35303576.js";import{_ as C}from"./_plugin-vue_export-helper-c27b6911.js";import{o as i,c as a,a as l,t as h,f as T,r as w,A as v,e as u,n as m,F as p,b as D,B as R,i as y,w as M,g as E,d as ke,j as G,C as we,D as ne,E as le,G as xe,H as J,I as ee,h as q,J as De,K as Ce,s as te,L as Me}from"./runtime-core.esm-bundler-b48de70a.js";import{h as x,b as $,v as A,F as ie,g as ae,p as re,P as L,w as Y,i as H,a as U,n as de,j as Te,k as Se,l as oe,e as W,S as $e}from"./bootstrap-8be442b1.js";import{n as V,g as Ee,e as z,b as Re,f as ue,h as Fe,i as Oe,a as Pe,j as Ae,c as je,k as He,d as Ue}from"./ns-prompt-popup-100414c5.js";import"./index.es-25aa42ee.js";const Le={methods:{__:_},components:{nsAvatarImage:ve},name:"ns-avatar",data(){return{svg:""}},computed:{avatarUrl(){return this.url.length===0?"":this.url}},props:["url","display-name"]},Ye={class:"flex justify-between items-center flex-shrink-0"},Ve={class:"hidden md:inline-block px-2"},Be={class:"md:hidden px-2"},Ie={class:"px-2"},Ne={class:"overflow-hidden rounded-full bg-gray-600"};function ze(e,t,s,c,d,n){const r=w("ns-avatar-image");return i(),a("div",Ye,[l("span",Ve,h(n.__("Howdy, {name}").replace("{name}",this.displayName)),1),l("span",Be,h(e.displayName),1),l("div",Ie,[l("div",Ne,[T(r,{url:n.avatarUrl,name:e.displayName},null,8,["url","name"])])])])}const qe=C(Le,[["render",ze]]),We={data:()=>({clicked:!1,_save:0}),props:["type","disabled","link","href","routerLink","to","target"],mounted(){},computed:{isDisabled(){return this.disabled&&(this.disabled.length===0||this.disabled==="disabled"||this.disabled)}}},Ge=["disabled"],Ke=["target","href"];function Qe(e,t,s,c,d,n){return i(),a("div",{class:m(["flex ns-button",s.type?s.type:"default"])},[!s.link&&!s.href?(i(),a("button",{key:0,disabled:n.isDisabled,class:"flex rounded items-center py-2 px-3 font-semibold"},[v(e.$slots,"default")],8,Ge)):u("",!0),s.href?(i(),a("a",{key:1,target:s.target,href:s.href,class:"flex rounded items-center py-2 px-3 font-semibold"},[v(e.$slots,"default")],8,Ke)):u("",!0)],2)}const Ze=C(We,[["render",Qe]]),Xe={name:"ns-calendar",props:["date","field","visible","range","selected-range","side"],data(){return{calendar:[[]],currentDay:x(),daysOfWeek:new Array(7).fill("").map((e,t)=>t),hours:0,minutes:0,currentView:"days",clickedOnCalendar:!1,moment:x,months:new Array(12).fill("").map((e,t)=>t)}},computed:{momentCopy(){return x()}},beforeUnmount(){document.removeEventListener("click",this.checkClickedItem)},mounted(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null,""].includes(this.date)?x():x(this.date),this.hours=this.currentDay.hours(),this.minutes=this.currentDay.minutes(),this.build(),this.toggleView("days")},methods:{__:_,handleCalendarClick(){this.clickedOnCalendar=!0},getDayClass({day:e,_dayIndex:t,dayOfWeek:s,_index:c,currentDay:d}){const n=[];return(x(this.date).isSame(e.date,"day")||this.isRangeEdge(e))&&!this.isInvalidRange()?n.push("bg-info-secondary text-primary border-info-secondary text-white"):n.push("hover:bg-numpad-hover"),this.isInvalidRange()&&this.isRangeEdge(e)&&n.push("bg-error-secondary text-white"),c===0&&n.push("border-t border-tab-table-th"),this.isInRange(e)&&!this.isRangeEdge(e)?n.push("bg-info-primary"):e.isDifferentMonth&&!this.isRangeEdge(e)&&n.push("bg-tab-table-th"),n.join(" ")},erase(){this.selectDate({date:x(ns.date.current)})},isInRange(e){return this.range&&this.range.length===2&&this.range[0]&&this.range[1]?x(e.date).isSameOrAfter(this.range[0])&&x(e.date).isSameOrBefore(this.range[1]):!1},isInvalidRange(){return this.selectedRange&&this.selectedRange.endDate?x(this.selectedRange.startDate).isAfter(x(this.selectedRange.endDate))||x(this.selectedRange.endDate).isBefore(x(this.selectedRange.startDate)):!1},isRangeEdge(e){return this.range&&this.range.length===2&&this.range[0]&&this.range[1]?x(e.date).isSame(this.range[0],"day")||x(e.date).isSame(this.range[1],"day"):!1},setYear(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.selectDate({date:this.currentDay.clone()}))},subYear(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.selectDate({date:this.currentDay.clone()}))},addYear(){this.currentDay.add(1,"year"),this.selectDate({date:this.currentDay.clone()})},toggleView(e){this.currentView=e,this.currentView==="years"&&setTimeout(()=>{this.$refs.year.select()},100),this.currentView==="days"&&setTimeout(()=>{this.$refs.hours.addEventListener("focus",function(t){this.select()}),this.$refs.minutes.addEventListener("focus",function(t){this.select()})},100)},setMonth(e){this.currentDay.month(e),this.selectDate({date:this.currentDay.clone()})},detectHoursChange(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.selectDate({date:this.currentDay.clone()})},detectMinuteChange(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.selectDate({date:this.currentDay.clone()})},checkClickedItem(e){this.$parent.$el.getAttribute("class").split(" ").includes("picker")&&(!this.$parent.$el.contains(e.srcElement)&&!this.clickedOnCalendar&&this.visible&&this.$emit("onClickOut",!0),setTimeout(()=>{this.clickedOnCalendar=!1},100))},selectDate(e){if([void 0].includes(e))this.$emit("set",null);else{if(this.side==="left"&&x(this.selectedRange.endDate).isValid()&&e.date.isAfter(this.selectedRange.endDate))return $.error(_("The left range will be invalid.")).subscribe(),!1;if(this.side==="right"&&x(this.selectedRange.startDate).isValid()&&e.date.isBefore(this.selectedRange.startDate))return $.error(_("The right range will be invalid.")).subscribe(),!1;this.currentDay=e.date,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.$emit("set",this.currentDay.format("YYYY-MM-DD HH:mm:ss"))}this.build()},subMonth(){this.currentDay.subtract(1,"month"),this.build()},addMonth(){this.currentDay.add(1,"month"),this.build()},resetCalendar(){this.calendar=[[]]},build(){this.resetCalendar(),this.currentDay.clone().startOf("month");const e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");for(;;){e.day()===0&&this.calendar[0].length>0&&this.calendar.push([]);let s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(x.now(),"day"),isDifferentMonth:!1,isNextMonth:!1,isPreviousMonth:!1}),e.isSame(t,"day"))break;e.add(1,"day")}if(this.calendar[0].length<7){const s=7-this.calendar[0].length,c=this.calendar[0][0].date.clone(),d=[];for(let n=0;nn.handleCalendarClick()),class:"flex bg-box-background flex-col rounded-lg overflow-hidden"},[d.currentView==="years"?(i(),a("div",Je,[l("div",et,[l("div",null,[l("button",{onClick:t[0]||(t[0]=r=>n.subMonth()),class:"w-8 h-8 ns-inset-button border outline-none text-numpad-text rounded"},st)]),l("div",nt,[l("span",{class:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",onClick:t[1]||(t[1]=r=>n.toggleView("months"))},h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[2]||(t[2]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[3]||(t[3]=r=>n.addMonth()),class:"w-8 h-8 ns-inset-button border outline-none text-numpad-text rounded"},it)])]),l("div",at,[l("div",rt,[l("button",{onClick:t[4]||(t[4]=r=>n.subYear()),class:"px-2 py-2"},ot),l("div",ut,[l("input",{type:"text",ref:"year",class:"p-2 flex-auto w-full text-center outline-none",onChange:t[5]||(t[5]=r=>n.setYear(r)),value:d.currentDay.format("YYYY")},null,40,ct)]),l("button",{onClick:t[6]||(t[6]=r=>n.addYear()),class:"px-2 py-2"},ft)])]),l("div",mt,[l("button",{onClick:t[7]||(t[7]=r=>n.toggleView("days")),class:"p-2 w-full ns-inset-button border text-sm error hover:text-white rounded flex items-center justify-center"},h(n.__("Return To Calendar")),1)])])):u("",!0),d.currentView==="months"?(i(),a("div",gt,[l("div",bt,[l("div",null,[l("button",{onClick:t[8]||(t[8]=r=>n.subYear()),class:"w-8 h-8 ns-inset-button outline-none border rounded"},pt)]),l("div",yt,[l("span",vt,h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[9]||(t[9]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[10]||(t[10]=r=>n.addYear()),class:"w-8 h-8 ns-inset-button outline-none border rounded"},wt)])]),l("div",xt,[(i(!0),a(p,null,D(d.months,(r,o)=>(i(),a("div",{key:o,class:"h-8 flex justify-center items-center text-sm border-box-background"},[l("div",Dt,[l("div",{class:m([n.momentCopy.month(r).format("MM")===d.currentDay.format("MM")?"bg-info-secondary text-white":"hover:bg-numpad-hover","h-full w-full border-box-background flex items-center justify-center cursor-pointer"]),onClick:f=>n.setMonth(r)},h(n.momentCopy.format("MMM")),11,Ct)])]))),128))]),l("div",Mt,[l("button",{onClick:t[11]||(t[11]=r=>n.toggleView("days")),class:"p-2 w-full ns-inset-button border text-sm error rounded flex items-center justify-center"},h(n.__("Return To Calendar")),1)])])):u("",!0),d.currentView==="days"?(i(),a("div",Tt,[l("div",St,[l("div",null,[l("button",{onClick:t[12]||(t[12]=r=>n.subMonth()),class:"w-8 h-8 ns-inset-button border rounded"},Et)]),l("div",Rt,[l("span",{class:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",onClick:t[13]||(t[13]=r=>n.toggleView("months"))},h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[14]||(t[14]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[15]||(t[15]=r=>n.addMonth()),class:"w-8 h-8 ns-inset-button border rounded"},Ot)])]),l("div",Pt,[l("div",At,h(n.__("Sun")),1),l("div",jt,h(n.__("Mon")),1),l("div",Ht,h(n.__("Tue")),1),l("div",Ut,h(n.__("Wed")),1),l("div",Lt,h(n.__("Thr")),1),l("div",Yt,h(n.__("Fri")),1),l("div",Vt,h(n.__("Sat")),1)]),(i(!0),a(p,null,D(d.calendar,(r,o)=>(i(),a("div",{key:o,class:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary divide-x divide-y"},[(i(!0),a(p,null,D(d.daysOfWeek,(f,g)=>(i(),a("div",{key:g,class:"md:h-10 h-8 flex justify-center items-center text-sm border-tab-table-th"},[(i(!0),a(p,null,D(r,(b,S)=>(i(),a(p,null,[b.dayOfWeek===f?(i(),a("div",{key:S,class:m([n.getDayClass({day:b,_dayIndex:S,dayOfWeek:f,_index:g,currentDay:d.currentDay}),"h-full w-full flex items-center justify-center cursor-pointer"]),onClick:F=>n.selectDate(b)},[b.isDifferentMonth?u("",!0):(i(),a("span",It,h(b.date.format("DD")),1)),b.isDifferentMonth?(i(),a("span",Nt,h(b.date.format("DD")),1)):u("",!0)],10,Bt)):u("",!0)],64))),256))]))),128))]))),128))])):u("",!0),l("div",zt,[l("div",qt,[l("div",Wt,[l("div",Gt,[l("div",Kt,[l("button",{onClick:t[16]||(t[16]=r=>n.erase()),class:"border ns-inset-button text-sm error rounded md:w-10 w-8 md:h-10 h-8 flex items-center justify-center"},Zt)])])]),l("div",Xt,[d.currentView==="days"?(i(),a("div",Jt,[es,R(l("input",{placeholder:"HH",ref:"hours",onChange:t[17]||(t[17]=r=>n.detectHoursChange(r)),class:"w-12 p-1 text-center border border-numpad-edge bg-input-background outline-none text-sm active:border-numpad-edge","onUpdate:modelValue":t[18]||(t[18]=r=>d.hours=r),type:"number"},null,544),[[A,d.hours]]),ts,R(l("input",{placeholder:"mm",ref:"minutes",onChange:t[19]||(t[19]=r=>n.detectMinuteChange(r)),class:"w-12 p-1 text-center border border-numpad-edge bg-input-background outline-none text-sm active:border-numpad-edge","onUpdate:modelValue":t[20]||(t[20]=r=>d.minutes=r),type:"number"},null,544),[[A,d.minutes]])])):u("",!0)])])])])}const ce=C(Xe,[["render",ss]]),ls={data:()=>({}),props:["checked","field","label"],computed:{isChecked(){return this.field?this.field.value:this.checked},hasError(){return this.field.errors!==void 0&&this.field.errors.length>0}},methods:{toggleIt(){this.field!==void 0&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}},is={class:"w-6 h-6 flex bg-input-background border-input-edge border-2 items-center justify-center cursor-pointer"},as={key:0,class:"las la-check"};function rs(e,t,s,c,d,n){return i(),a("div",{class:"flex ns-checkbox items-center justify-center cursor-pointer",onClick:t[0]||(t[0]=r=>n.toggleIt())},[l("div",is,[n.isChecked?(i(),a("i",as)):u("",!0)]),s.label?(i(),a("label",{key:0,class:m([n.hasError?"has-error":"is-pristine","mx-2"])},h(s.label),3)):u("",!0),s.field?(i(),a("label",{key:1,class:m([n.hasError?"has-error":"is-pristine","mx-2"])},h(s.field.label),3)):u("",!0)])}const ds=C(ls,[["render",rs]]),os={name:"ns-close-button",methods:{}},us={class:"outline-none ns-close-button hover:border-transparent border rounded-full h-8 min-w-[2rem] items-center justify-center"},cs=l("i",{class:"las la-times"},null,-1);function hs(e,t,s,c,d,n){return i(),a("button",us,[cs,y(),v(e.$slots,"default")])}const fs=C(os,[["render",hs]]),ms={data(){return{fields:[],validation:new ie}},props:["popup"],methods:{__:_,popupCloser:ae,popupResolver:re,closePopup(){this.popupResolver(!1)},useFilters(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters(){this.fields.forEach(e=>e.value=""),this.popupResolver(null)}},mounted(){this.fields=this.validation.createFields(this.popup.params.queryFilters),this.popupCloser()}},gs={class:"ns-box shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-5/6-screen flex flex-col"},bs={class:"p-2 border-b ns-box-header flex justify-between items-center"},_s={class:"p-2 ns-box-body flex-auto"},ps={class:"p-2 flex justify-between ns-box-footer border-t"};function ys(e,t,s,c,d,n){const r=w("ns-close-button"),o=w("ns-field"),f=w("ns-button");return i(),a("div",gs,[l("div",bs,[l("h3",null,h(n.__("Search Filters")),1),l("div",null,[T(r,{onClick:t[0]||(t[0]=g=>n.closePopup())})])]),l("div",_s,[(i(!0),a(p,null,D(d.fields,(g,b)=>(i(),E(o,{field:g,key:b},null,8,["field"]))),128))]),l("div",ps,[l("div",null,[T(f,{onClick:t[1]||(t[1]=g=>n.clearFilters()),type:"error"},{default:M(()=>[y(h(n.__("Clear Filters")),1)]),_:1})]),l("div",null,[T(f,{onClick:t[2]||(t[2]=g=>n.useFilters()),type:"info"},{default:M(()=>[y(h(n.__("Use Filters")),1)]),_:1})])])])}const vs=C(ms,[["render",ys]]),ks={data:()=>({prependOptions:!1,showOptions:!0,showCheckboxes:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],headerButtons:[],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(){this.identifier!==void 0&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","createUrl","mode","identifier","queryParams","popup"],computed:{getParsedSrc(){return`${this.src}?${this.sortColumn}${this.searchQuery}${this.queryFiltersString}${this.queryPage}${this.getQueryParams()?"&"+this.getQueryParams():""}`},showQueryFilters(){return this.queryFilters.length>0},getSelectedAction(){const e=this.bulkActions.filter(t=>t.identifier===this.bulkAction);return e.length>0?e[0]:!1},pagination(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage(){return this.result?`&page=${this.page}`:""},resultInfo(){return _("displaying {perPage} on {items} items").replace("{perPage}",this.result.per_page||0).replace("{items}",this.result.total||0)},headerButtonsComponents(){return this.headerButtons.map(e=>ke(()=>new Promise(t=>{t(nsExtraComponents[e])})))}},methods:{__:_,getQueryParams(){return this.queryParams?Object.keys(this.queryParams).map(e=>`${e}=${this.queryParams[e]}`).join("&"):""},pageNumbers(e,t){var s=[];t-3>1&&s.push(1,"...");for(let c=1;c<=e;c++)t+3>c&&t-3c>0||typeof c=="string")},downloadContent(){nsHttpClient.post(`${this.src}/export?${this.getParsedSrc}`,{entries:this.selectedEntries.map(e=>e.$id)}).subscribe(e=>{setTimeout(()=>document.location=e.url,300),$.success(_("The document has been generated.")).subscribe()},e=>{$.error(e.message||_("Unexpected error occurred.")).subscribe()})},clearSelectedEntries(){L.show(V,{title:_("Clear Selected Entries ?"),message:_("Would you like to clear all selected entries ?"),onAction:e=>{e&&(this.selectedEntries=[],this.handleGlobalChange(!1))}})},refreshRow(e){if(console.log({row:e}),e.$checked===!0)this.selectedEntries.filter(s=>s.$id===e.$id).length===0&&this.selectedEntries.push(e);else{const t=this.selectedEntries.filter(s=>s.$id===e.$id);if(t.length>0){const s=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(s,1)}}},handleShowOptions(e){this.result.data.forEach(t=>{t.$id!==e.$id&&(t.$toggled=!1)})},handleGlobalChange(e){this.globallyChecked=e,this.result.data.forEach(t=>{t.$checked=e,this.refreshRow(t)})},loadConfig(){nsHttpClient.get(`${this.src}/config?${this.getQueryParams()}`).subscribe(t=>{this.columns=t.columns,this.bulkActions=t.bulkActions,this.queryFilters=t.queryFilters,this.prependOptions=t.prependOptions,this.showOptions=t.showOptions,this.showCheckboxes=t.showCheckboxes,this.headerButtons=t.headerButtons||[],this.refresh()},t=>{$.error(t.message,"OK",{duration:!1}).subscribe()})},cancelSearch(){this.searchInput="",this.search()},search(){this.searchInput?this.searchQuery=`&search=${this.searchInput}`:this.searchQuery="",this.page=1,this.refresh()},sort(e){if(this.columns[e].$sort===!1)return $.error(_("Sorting is explicitely disabled on this column")).subscribe();for(let 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"":default:this.columns[e].$direction="asc";break}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn=`active=${e}&direction=${this.columns[e].$direction}`:this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo(){if(this.bulkAction)if(this.selectedEntries.length>0){if(confirm(this.getSelectedAction.confirm||_("Would you like to perform the selected bulk action on the selected entries ?")))return nsHttpClient.post(`${this.src}/bulk-actions`,{action:this.bulkAction,entries:this.selectedEntries.map(e=>e.$id)}).subscribe({next:e=>{$.info(e.message).subscribe(),this.selectedEntries=[],this.refresh()},error:e=>{$.error(e.message).subscribe()}})}else return $.error(_("No selection has been made.")).subscribe();else return $.error(_("No action has been selected.")).subscribe()},async openQueryFilter(){try{const e=await new Promise((t,s)=>{L.show(vs,{resolve:t,reject:s,queryFilters:this.queryFilters})});this.withFilters=!1,this.queryFiltersString="",e!==null&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(e))),this.refresh()}catch{}},refresh(){this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get(`${this.getParsedSrc}`).subscribe(t=>{t.data=t.data.map(s=>(this.selectedEntries.filter(d=>d.$id===s.$id).length>0&&(s.$checked=!0),s)),this.isRefreshing=!1,this.result=t,this.page=t.current_page},t=>{this.isRefreshing=!1,$.error(t.message).subscribe()})}}},ws={key:0,id:"crud-table-header",class:"p-2 border-b flex flex-col md:flex-row justify-between flex-wrap"},xs={id:"crud-search-box",class:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex"},Ds={key:0,class:"px-2 flex items-center justify-center"},Cs=["href"],Ms=l("i",{class:"las la-plus"},null,-1),Ts=[Ms],Ss={class:"px-2"},$s={class:"rounded-full p-1 ns-crud-input flex"},Es=l("i",{class:"las la-search"},null,-1),Rs=[Es],Fs=l("i",{class:"las la-times text-white"},null,-1),Os=[Fs],Ps={class:"px-2 flex items-center justify-center"},As={key:1,class:"px-2 flex items-center"},js={key:0,class:"las la-filter"},Hs={key:1,class:"las la-check"},Us={key:2,class:"ml-1"},Ls={key:3,class:"ml-1"},Ys={key:2,id:"custom-buttons"},Vs={id:"crud-buttons",class:"-mx-1 flex flex-wrap w-full md:w-auto"},Bs={key:0,class:"px-1 flex items-center"},Is=l("i",{class:"lar la-check-square"},null,-1),Ns={class:"px-1 flex items-center"},zs=l("i",{class:"las la-download"},null,-1),qs={class:"flex p-2"},Ws={class:"overflow-x-auto flex-auto"},Gs={key:0,class:"table ns-table w-full"},Ks={key:0,class:"text-center px-2 border w-16 py-2"},Qs={key:1,class:"text-left px-2 py-2 w-16 border"},Zs=["onClick"],Xs={class:"w-full flex justify-between items-center"},Js={class:"flex"},en={class:"h-6 w-6 flex justify-center items-center"},tn={key:0,class:"las la-sort-amount-up"},sn={key:1,class:"las la-sort-amount-down"},nn={key:2,class:"text-left px-2 py-2 w-16 border"},ln={key:1},an=["colspan"],rn={class:"p-2 flex border-t flex-col md:flex-row justify-between footer"},dn={key:0,id:"grouped-actions",class:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1"},on={class:"bg-input-disabled",selected:"",value:""},un=["value"],cn={class:"flex"},hn={class:"items-center flex text-primary mx-4"},fn={id:"pagination",class:"flex items-center -mx-1"},mn=l("i",{class:"las la-angle-double-left"},null,-1),gn=[mn],bn=["onClick"],_n=l("i",{class:"las la-angle-double-right"},null,-1),pn=[_n];function yn(e,t,s,c,d,n){const r=w("ns-checkbox"),o=w("ns-table-row");return i(),a("div",{id:"crud-table",class:m(["w-full rounded-lg",s.mode!=="light"?"shadow mb-8":""])},[s.mode!=="light"?(i(),a("div",ws,[l("div",xs,[s.createUrl?(i(),a("div",Ds,[l("a",{href:s.createUrl||"#",class:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border"},Ts,8,Cs)])):u("",!0),l("div",Ss,[l("div",$s,[R(l("input",{onKeypress:t[0]||(t[0]=Y(f=>n.search(),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=f=>e.searchInput=f),type:"text",class:"w-36 md:w-auto bg-transparent outline-none px-2"},null,544),[[A,e.searchInput]]),l("button",{onClick:t[2]||(t[2]=f=>n.search()),class:"rounded-full w-8 h-8 outline-none ns-crud-input-button"},Rs),e.searchQuery?(i(),a("button",{key:0,onClick:t[3]||(t[3]=f=>n.cancelSearch()),class:"ml-1 rounded-full w-8 h-8 bg-error-secondary outline-none hover:bg-error-tertiary"},Os)):u("",!0)])]),l("div",Ps,[l("button",{onClick:t[4]||(t[4]=f=>n.refresh()),class:"rounded-full text-sm h-10 px-3 outline-none border ns-crud-button"},[l("i",{class:m([e.isRefreshing?"animate-spin":"","las la-sync"])},null,2)])]),n.showQueryFilters?(i(),a("div",As,[l("button",{onClick:t[5]||(t[5]=f=>n.openQueryFilter()),class:m([e.withFilters?"table-filters-enabled":"table-filters-disabled","ns-crud-button border rounded-full text-sm h-10 px-3 outline-none"])},[e.withFilters?u("",!0):(i(),a("i",js)),e.withFilters?(i(),a("i",Hs)):u("",!0),e.withFilters?u("",!0):(i(),a("span",Us,h(n.__("Filters")),1)),e.withFilters?(i(),a("span",Ls,h(n.__("Has Filters")),1)):u("",!0)],2)])):u("",!0),n.headerButtonsComponents.length>0?(i(),a("div",Ys,[(i(!0),a(p,null,D(n.headerButtonsComponents,(f,g)=>(i(),E(G(f),{onRefresh:t[6]||(t[6]=b=>n.refresh()),result:e.result,key:g},null,40,["result"]))),128))])):u("",!0)]),l("div",Vs,[e.selectedEntries.length>0?(i(),a("div",Bs,[l("button",{onClick:t[7]||(t[7]=f=>n.clearSelectedEntries()),class:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border"},[Is,y(" "+h(n.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length)),1)])])):u("",!0),l("div",Ns,[l("button",{onClick:t[8]||(t[8]=f=>n.downloadContent()),class:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none"},[zs,y(" "+h(n.__("Download")),1)])])])])):u("",!0),l("div",qs,[l("div",Ws,[Object.values(e.columns).length>0?(i(),a("table",Gs,[l("thead",null,[l("tr",null,[e.showCheckboxes?(i(),a("th",Ks,[T(r,{checked:e.globallyChecked,onChange:t[9]||(t[9]=f=>n.handleGlobalChange(f))},null,8,["checked"])])):u("",!0),e.prependOptions&&e.showOptions?(i(),a("th",Qs)):u("",!0),(i(!0),a(p,null,D(e.columns,(f,g)=>(i(),a("th",{key:g,onClick:b=>n.sort(g),style:we({width:f.width||"auto","max-width":f.maxWidth||"auto","min-width":f.minWidth||"auto"}),class:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2"},[l("div",Xs,[l("span",Js,h(f.label),1),l("span",en,[f.$direction==="desc"?(i(),a("i",tn)):u("",!0),f.$direction==="asc"?(i(),a("i",sn)):u("",!0)])])],12,Zs))),128)),!e.prependOptions&&e.showOptions?(i(),a("th",nn)):u("",!0)])]),l("tbody",null,[e.result.data!==void 0&&e.result.data.length>0?(i(!0),a(p,{key:0},D(e.result.data,(f,g)=>(i(),E(o,{key:g,onUpdated:t[10]||(t[10]=b=>n.refreshRow(b)),columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,showCheckboxes:e.showCheckboxes,row:f,onReload:t[11]||(t[11]=b=>n.refresh()),onToggled:t[12]||(t[12]=b=>n.handleShowOptions(b))},null,8,["columns","prependOptions","showOptions","showCheckboxes","row"]))),128)):u("",!0),!e.result||e.result.data.length===0?(i(),a("tr",ln,[l("td",{colspan:Object.values(e.columns).length+2,class:"text-center border py-3"},h(n.__("There is nothing to display...")),9,an)])):u("",!0)])])):u("",!0)])]),l("div",rn,[e.bulkActions.length>0?(i(),a("div",dn,[R(l("select",{class:"outline-none bg-transparent","onUpdate:modelValue":t[13]||(t[13]=f=>e.bulkAction=f),id:"grouped-actions"},[l("option",on,[v(e.$slots,"bulk-label",{},()=>[y(h(n.__("Bulk Actions")),1)])]),(i(!0),a(p,null,D(e.bulkActions,(f,g)=>(i(),a("option",{class:"bg-input-disabled",key:g,value:f.identifier},h(f.label),9,un))),128))],512),[[H,e.bulkAction]]),l("button",{onClick:t[14]||(t[14]=f=>n.bulkDo()),class:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center"},[v(e.$slots,"bulk-go",{},()=>[y(h(n.__("Apply")),1)])])])):u("",!0),l("div",cn,[l("div",hn,h(n.resultInfo),1),l("div",fn,[e.result.current_page?(i(),a(p,{key:0},[l("a",{href:"javascript:void(0)",onClick:t[15]||(t[15]=f=>{e.page=e.result.first_page,n.refresh()}),class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow"},gn),(i(!0),a(p,null,D(n.pagination,(f,g)=>(i(),a(p,null,[e.page!=="..."?(i(),a("a",{key:g,class:m([e.page==f?"bg-info-tertiary border-transparent text-white":"","mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border"]),onClick:b=>{e.page=f,n.refresh()},href:"javascript:void(0)"},h(f),11,bn)):u("",!0),e.page==="..."?(i(),a("a",{key:g,href:"javascript:void(0)",class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border"},"...")):u("",!0)],64))),256)),l("a",{href:"javascript:void(0)",onClick:t[16]||(t[16]=f=>{e.page=e.result.last_page,n.refresh()}),class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow"},pn)],64)):u("",!0)])])])],2)}const vn=C(ks,[["render",yn]]),kn={data:()=>({form:{},globallyChecked:!1,formValidation:new ie,rows:[]}),emits:["updated","saved"],mounted(){this.loadForm()},props:["src","createUrl","fieldClass","returnUrl","submitUrl","submitMethod","disableTabs","queryParams","popup","optionAttributes"],computed:{activeTabFields(){for(let e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]},activeTabIdentifier(){for(let e in this.form.tabs)if(this.form.tabs[e].active)return e;return{}}},methods:{__:_,popupResolver:re,toggle(e){for(let t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},async handleSaved(e,t,s){this.form.tabs[t].fields.filter(c=>{c.name===s.name&&e.data.entry&&(c.options.push({label:e.data.entry[this.optionAttributes.label],value:e.data.entry[this.optionAttributes.value]}),c.value=e.data.entry.id)})},handleClose(){this.popup&&this.popupResolver(!1)},submit(){if(this.formValidation.validateForm(this.form).length>0)return $.error(_("Unable to proceed the form is not valid"),_("Close")).subscribe();if(this.formValidation.disableForm(this.form),this.submitUrl===void 0)return $.error(_("No submit URL was provided"),_("Okay")).subscribe();U[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.appendQueryParamas(this.submitUrl),this.formValidation.extractForm(this.form)).subscribe(e=>{if(e.status==="success")if(this.popup)this.popupResolver(e);else{if(this.submitMethod&&this.submitMethod.toLowerCase()==="post"&&this.returnUrl!==!1)return document.location=e.data.editUrl||this.returnUrl;$.info(e.message,_("Okay"),{duration:3e3}).subscribe(),this.$emit("saved",e)}this.formValidation.enableForm(this.form)},e=>{$.error(e.message,void 0,{duration:5e3}).subscribe(),e.data!==void 0&&this.formValidation.triggerError(this.form,e.data),this.formValidation.enableForm(this.form)})},handleGlobalChange(e){this.globallyChecked=e,this.rows.forEach(t=>t.$checked=e)},loadForm(){return new Promise((e,t)=>{U.get(`${this.appendQueryParamas(this.src)}`).subscribe({next:c=>{e(c),this.form=this.parseForm(c.form),de.doAction("ns-crud-form-loaded",this),this.$emit("updated",this.form)},error:c=>{t(c),$.error(c.message,_("Okay"),{duration:0}).subscribe()}})})},appendQueryParamas(e){if(this.queryParams===void 0)return e;const t=Object.keys(this.queryParams).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(this.queryParams[s])}`).join("&");return e.includes("?")?`${e}&${t}`:`${e}?${t}`},parseForm(e){e.main.value=e.main.value===void 0?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];let t=0;for(let s in e.tabs)t===0&&(e.tabs[s].active=!0),e.tabs[s].active=e.tabs[s].active===void 0?!1:e.tabs[s].active,e.tabs[s].fields=this.formValidation.createFields(e.tabs[s].fields),t++;return e}}},wn={key:0,class:"flex items-center justify-center h-full"},xn={key:0,class:"box-header border-b border-box-edge box-border p-2 flex justify-between items-center"},Dn={class:"text-primary font-bold text-lg"},Cn={class:"flex flex-col"},Mn={key:0,class:"flex justify-between items-center"},Tn={for:"title",class:"font-bold my-2 text-primary"},Sn={key:0},$n={for:"title",class:"text-sm my-2"},En=["href"],Rn=["disabled"],Fn=["disabled"],On={key:0,class:"text-xs text-primary py-1"},Pn={key:0},An={key:1},jn={class:"header flex ml-4",style:{"margin-bottom":"-1px"}},Hn=["onClick"],Un={class:"ns-tab-item"},Ln={class:"border p-4 rounded"},Yn={class:"-mx-4 flex flex-wrap"},Vn={key:0,class:"flex justify-end"},Bn=["disabled"];function In(e,t,s,c,d,n){const r=w("ns-spinner"),o=w("ns-close-button"),f=w("ns-field");return i(),a(p,null,[Object.values(e.form).length===0?(i(),a("div",wn,[T(r)])):u("",!0),Object.values(e.form).length>0?(i(),a("div",{key:1,class:m(["form flex-auto",s.popup?"bg-box-background w-95vw md:w-2/3-screen":""]),id:"crud-form"},[s.popup?(i(),a("div",xn,[l("h2",Dn,h(s.popup.params.title),1),l("div",null,[T(o,{onClick:t[0]||(t[0]=g=>n.handleClose())})])])):u("",!0),Object.values(e.form).length>0?(i(),a("div",{key:1,class:m(s.popup?"p-2":"")},[l("div",Cn,[e.form.main?(i(),a("div",Mn,[l("label",Tn,[e.form.main.name?(i(),a("span",Sn,h(e.form.main.label),1)):u("",!0)]),l("div",$n,[s.returnUrl&&!s.popup?(i(),a("a",{key:0,href:s.returnUrl,class:"rounded-full border px-2 py-1 ns-inset-button error"},h(n.__("Go Back")),9,En)):u("",!0)])])):u("",!0),e.form.main.name?(i(),a(p,{key:1},[l("div",{class:m([e.form.main.disabled?"disabled":e.form.main.errors.length>0?"error":"info","input-group flex border-2 rounded overflow-hidden"])},[R(l("input",{"onUpdate:modelValue":t[1]||(t[1]=g=>e.form.main.value=g),onKeydown:t[2]||(t[2]=Y(g=>n.submit(),["enter"])),onKeypress:t[3]||(t[3]=g=>e.formValidation.checkField(e.form.main)),onBlur:t[4]||(t[4]=g=>e.formValidation.checkField(e.form.main)),onChange:t[5]||(t[5]=g=>e.formValidation.checkField(e.form.main)),disabled:e.form.main.disabled,type:"text",class:"flex-auto outline-none h-10 px-2"},null,40,Rn),[[A,e.form.main.value]]),l("button",{disabled:e.form.main.disabled,class:m([e.form.main.disabled?"disabled":e.form.main.errors.length>0?"error":"","outline-none px-4 h-10 text-white"]),onClick:t[6]||(t[6]=g=>n.submit())},h(n.__("Save")),11,Fn)],2),e.form.main.description&&e.form.main.errors.length===0?(i(),a("p",On,h(e.form.main.description),1)):u("",!0),(i(!0),a(p,null,D(e.form.main.errors,(g,b)=>(i(),a("p",{key:b,class:"text-xs py-1 text-error-tertiary"},[g.identifier==="required"?(i(),a("span",Pn,[v(e.$slots,"error-required",{},()=>[y(h(g.identifier),1)])])):u("",!0),g.identifier==="invalid"?(i(),a("span",An,[v(e.$slots,"error-invalid",{},()=>[y(h(g.message),1)])])):u("",!0)]))),128))],64)):u("",!0)]),s.disableTabs!=="true"?(i(),a("div",{key:0,id:"tabs-container",class:m([s.popup?"mt-5":"my-5","ns-tab"])},[l("div",jn,[(i(!0),a(p,null,D(e.form.tabs,(g,b)=>(i(),a("div",{key:b,onClick:S=>n.toggle(b),class:m([g.active?"active border border-b-transparent":"inactive border","tab rounded-tl rounded-tr border px-3 py-2 cursor-pointer"]),style:{"margin-right":"-1px"}},h(g.label),11,Hn))),128))]),l("div",Un,[l("div",Ln,[l("div",Yn,[(i(!0),a(p,null,D(n.activeTabFields,(g,b)=>(i(),a("div",{key:`${n.activeTabIdentifier}-${b}`,class:m(s.fieldClass||"px-4 w-full md:w-1/2 lg:w-1/3")},[T(f,{onSaved:S=>n.handleSaved(S,n.activeTabIdentifier,g),onBlur:S=>e.formValidation.checkField(g),onChange:S=>e.formValidation.checkField(g),field:g},null,8,["onSaved","onBlur","onChange","field"])],2))),128))]),e.form.main.name?u("",!0):(i(),a("div",Vn,[l("div",{class:m(["ns-button",e.form.main.disabled?"default":e.form.main.errors.length>0?"error":"info"])},[l("button",{disabled:e.form.main.disabled,onClick:t[7]||(t[7]=g=>n.submit()),class:"outline-none px-4 h-10 border-l"},h(n.__("Save")),9,Bn)],2)]))])])],2)):u("",!0)],2)):u("",!0)],2)):u("",!0)],64)}const Nn=C(kn,[["render",In]]),zn={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},qn={class:"flex flex-auto flex-col mb-2"},Wn=["for"],Gn={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Kn={class:"sm:text-sm sm:leading-5"},Qn=["disabled","id","placeholder"];function Zn(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",qn,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Wn),l("div",{class:m([n.hasError?"border-error-primary":"border-input-edge","bg-input-background text-secondary mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",Gn,[l("span",Kn,h(s.leading),1)])):u("",!0),R(l("input",{disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),onBlur:t[1]||(t[1]=o=>e.$emit("blur",this)),onChange:t[2]||(t[2]=o=>e.$emit("change",this)),id:s.field.name,type:"date",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.placeholder},null,42,Qn),[[A,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const Xn=C(zn,[["render",Zn]]),he={isSame:(e,t,s)=>{let c=new Date(e),d=new Date(t);return s==="date"&&(c.setHours(0,0,0,0),d.setHours(0,0,0,0)),c.getTime()===d.getTime()},daysInMonth:(e,t)=>new Date(e,t,0).getDate(),weekNumber:e=>Ee(e),format:(e,t)=>z(e,t),nextMonth:e=>{let t=new Date(e.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t},prevMonth:e=>{let t=new Date(e.getTime());return t.setDate(1),t.setMonth(t.getMonth()-1),t},validateDateRange:(e,t,s)=>{let c=new Date(s),d=new Date(t);return s&&e.getTime()>c.getTime()?c:t&&e.getTime()({...{direction:"ltr",format:"mm/dd/yyyy",separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:z.i18n.dayNames.slice(0,7).map(s=>s.substring(0,2)),monthNames:z.i18n.monthNames.slice(0,12),firstDay:0},...e}),yearMonth:e=>{let t=e.getMonth()+1;return e.getFullYear()+(t<10?"0":"")+t},isValidDate:e=>e instanceof Date&&!isNaN(e)},K={props:{dateUtil:{type:[Object,String],default:"native"}},created(){this.$dateUtil=he}},Jn={mixins:[K],name:"calendar",props:{monthDate:Date,localeData:Object,start:Date,end:Date,minDate:Date,maxDate:Date,showDropdowns:{type:Boolean,default:!1},showWeekNumbers:{type:Boolean,default:!1},dateFormat:{type:Function,default:null}},data(){let e=this.monthDate||this.start||new Date;return{currentMonthDate:e,year_text:e.getFullYear()}},methods:{prevMonthClick(){this.changeMonthDate(this.$dateUtil.prevMonth(this.currentMonthDate))},nextMonthClick(){this.changeMonthDate(this.$dateUtil.nextMonth(this.currentMonthDate))},changeMonthDate(e,t=!0){let s=this.$dateUtil.yearMonth(this.currentMonthDate);this.currentMonthDate=this.$dateUtil.validateDateRange(e,this.minDate,this.maxDate),t&&s!==this.$dateUtil.yearMonth(this.currentMonthDate)&&this.$emit("change-month",{month:this.currentMonthDate.getMonth()+1,year:this.currentMonthDate.getFullYear()}),this.checkYear()},dayClass(e){let t=new Date(e);t.setHours(0,0,0,0);let s=new Date(this.start);s.setHours(0,0,0,0);let c=new Date(this.end);c.setHours(0,0,0,0);let d={off:e.getMonth()+1!==this.month,weekend:e.getDay()===6||e.getDay()===0,today:t.setHours(0,0,0,0)==new Date().setHours(0,0,0,0),active:t.setHours(0,0,0,0)==new Date(this.start).setHours(0,0,0,0)||t.setHours(0,0,0,0)==new Date(this.end).setHours(0,0,0,0),"in-range":t>=s&&t<=c,"start-date":t.getTime()===s.getTime(),"end-date":t.getTime()===c.getTime(),disabled:this.minDate&&t.getTime()this.maxDate.getTime()};return this.dateFormat?this.dateFormat(d,e):d},checkYear(){this.$refs.yearSelect!==document.activeElement&&this.$nextTick(()=>{this.year_text=this.monthDate.getFullYear()})}},computed:{monthName(){return this.locale.monthNames[this.currentMonthDate.getMonth()]},year:{get(){return this.year_text},set(e){this.year_text=e;let t=this.$dateUtil.validateDateRange(new Date(e,this.month,1),this.minDate,this.maxDate);this.$dateUtil.isValidDate(t)&&this.$emit("change-month",{month:t.getMonth(),year:t.getFullYear()})}},month:{get(){return this.currentMonthDate.getMonth()+1},set(e){let t=this.$dateUtil.validateDateRange(new Date(this.year,e-1,1),this.minDate,this.maxDate);this.$emit("change-month",{month:t.getMonth()+1,year:t.getFullYear()})}},calendar(){let e=this.month,t=this.currentMonthDate.getFullYear(),s=new Date(t,e-1,1),c=this.$dateUtil.prevMonth(s).getMonth()+1,d=this.$dateUtil.prevMonth(s).getFullYear(),n=new Date(d,e-1,0).getDate(),r=s.getDay(),o=[];for(let b=0;b<6;b++)o[b]=[];let f=n-r+this.locale.firstDay+1;f>n&&(f-=7),r===this.locale.firstDay&&(f=n-6);let g=new Date(d,c-1,f,12,0,0);for(let b=0,S=0,F=0;b<6*7;b++,S++,g.setDate(g.getDate()+1))b>0&&S%7===0&&(S=0,F++),o[F][S]=new Date(g.getTime());return o},months(){let e=this.locale.monthNames.map((t,s)=>({label:t,value:s}));if(this.maxDate&&this.minDate){let t=this.maxDate.getFullYear()-this.minDate.getFullYear();if(t<2){let s=[];if(t<1)for(let c=this.minDate.getMonth();c<=this.maxDate.getMonth();c++)s.push(c);else{for(let c=0;c<=this.maxDate.getMonth();c++)s.push(c);for(let c=this.minDate.getMonth();c<12;c++)s.push(c)}if(s.length>0)return e.filter(c=>s.find(d=>c.value===d)>-1)}}return e},locale(){return this.$dateUtil.localeData(this.localeData)}},watch:{monthDate(e){this.currentMonthDate.getTime()!==e.getTime()&&this.changeMonthDate(e,!1)}}},fe=e=>(ne("data-v-66e2a2e7"),e=e(),le(),e),el={class:"table-condensed"},tl=fe(()=>l("span",null,null,-1)),sl=[tl],nl=["colspan"],ll={class:"row mx-1"},il=["value"],al=["colspan"],rl=fe(()=>l("span",null,null,-1)),dl=[rl],ol={key:0,class:"week"},ul={key:0,class:"week"},cl=["onClick","onMouseover"];function hl(e,t,s,c,d,n){return i(),a("table",el,[l("thead",null,[l("tr",null,[l("th",{class:"prev available",onClick:t[0]||(t[0]=(...r)=>n.prevMonthClick&&n.prevMonthClick(...r)),tabindex:"0"},sl),s.showDropdowns?(i(),a("th",{key:0,colspan:s.showWeekNumbers?6:5,class:"month"},[l("div",ll,[R(l("select",{"onUpdate:modelValue":t[1]||(t[1]=r=>n.month=r),class:"monthselect col"},[(i(!0),a(p,null,D(n.months,r=>(i(),a("option",{key:r.value,value:r.value+1},h(r.label),9,il))),128))],512),[[H,n.month]]),R(l("input",{ref:"yearSelect",type:"number","onUpdate:modelValue":t[2]||(t[2]=r=>n.year=r),onBlur:t[3]||(t[3]=(...r)=>n.checkYear&&n.checkYear(...r)),class:"yearselect col"},null,544),[[A,n.year]])])],8,nl)):(i(),a("th",{key:1,colspan:s.showWeekNumbers?6:5,class:"month"},h(n.monthName)+" "+h(n.year),9,al)),l("th",{class:"next available",onClick:t[4]||(t[4]=(...r)=>n.nextMonthClick&&n.nextMonthClick(...r)),tabindex:"0"},dl)])]),l("tbody",null,[l("tr",null,[s.showWeekNumbers?(i(),a("th",ol,h(n.locale.weekLabel),1)):u("",!0),(i(!0),a(p,null,D(n.locale.daysOfWeek,r=>(i(),a("th",{key:r},h(r),1))),128))]),(i(!0),a(p,null,D(n.calendar,(r,o)=>(i(),a("tr",{key:o},[s.showWeekNumbers&&(o%7||o===0)?(i(),a("td",ul,h(e.$dateUtil.weekNumber(r[0])),1)):u("",!0),(i(!0),a(p,null,D(r,(f,g)=>(i(),a("td",{class:m(n.dayClass(f)),onClick:b=>e.$emit("dateClick",f),onMouseover:b=>e.$emit("hoverDate",f),key:g},[v(e.$slots,"date-slot",{date:f},()=>[y(h(f.getDate()),1)],!0)],42,cl))),128))]))),128))])])}const fl=C(Jn,[["render",hl],["__scopeId","data-v-66e2a2e7"]]),ml={props:{miniuteIncrement:{type:Number,default:5},hour24:{type:Boolean,default:!0},secondPicker:{type:Boolean,default:!1},currentTime:{default(){return new Date}},readonly:{type:Boolean,default:!1}},data(){let e=this.currentTime?this.currentTime:new Date,t=e.getHours();return{hour:this.hour24?t:t%12||12,minute:e.getMinutes()-e.getMinutes()%this.miniuteIncrement,second:e.getSeconds(),ampm:t<12?"AM":"PM"}},computed:{hours(){let e=[],t=this.hour24?24:12;for(let s=0;se<10?"0"+e.toString():e.toString(),getHour(){return this.hour24?this.hour:this.hour===12?this.ampm==="AM"?0:12:this.hour+(this.ampm==="PM"?12:0)},onChange(){this.$emit("update",{hours:this.getHour(),minutes:this.minute,seconds:this.second})}}},gl={class:"calendar-time"},bl=["disabled"],_l=["value"],pl=["disabled"],yl=["value"],vl=["disabled"],kl=["value"],wl=["disabled"],xl=l("option",{value:"AM"},"AM",-1),Dl=l("option",{value:"PM"},"PM",-1),Cl=[xl,Dl];function Ml(e,t,s,c,d,n){return i(),a("div",gl,[R(l("select",{"onUpdate:modelValue":t[0]||(t[0]=r=>d.hour=r),class:"hourselect form-control mr-1",disabled:s.readonly},[(i(!0),a(p,null,D(n.hours,r=>(i(),a("option",{key:r,value:r},h(n.formatNumber(r)),9,_l))),128))],8,bl),[[H,d.hour]]),y(" :"),R(l("select",{"onUpdate:modelValue":t[1]||(t[1]=r=>d.minute=r),class:"minuteselect form-control ml-1",disabled:s.readonly},[(i(!0),a(p,null,D(n.minutes,r=>(i(),a("option",{key:r,value:r},h(n.formatNumber(r)),9,yl))),128))],8,pl),[[H,d.minute]]),s.secondPicker?(i(),a(p,{key:0},[y(" :"),R(l("select",{"onUpdate:modelValue":t[2]||(t[2]=r=>d.second=r),class:"secondselect form-control ml-1",disabled:s.readonly},[(i(),a(p,null,D(60,r=>l("option",{key:r-1,value:r-1},h(n.formatNumber(r-1)),9,kl)),64))],8,vl),[[H,d.second]])],64)):u("",!0),s.hour24?u("",!0):R((i(),a("select",{key:1,"onUpdate:modelValue":t[3]||(t[3]=r=>d.ampm=r),class:"ampmselect",disabled:s.readonly},Cl,8,wl)),[[H,d.ampm]])])}const Tl=C(ml,[["render",Ml]]),Sl={mixins:[K],props:{ranges:Object,selected:Object,localeData:Object,alwaysShowCalendars:Boolean},data(){return{customRangeActive:!1}},methods:{clickRange(e){this.customRangeActive=!1,this.$emit("clickRange",e)},clickCustomRange(){this.customRangeActive=!0,this.$emit("showCustomRange")},range_class(e){return{active:e.selected===!0}}},computed:{listedRanges(){return this.ranges?Object.keys(this.ranges).map(e=>({label:e,value:this.ranges[e],selected:this.$dateUtil.isSame(this.selected.startDate,this.ranges[e][0])&&this.$dateUtil.isSame(this.selected.endDate,this.ranges[e][1])})):!1},selectedRange(){return this.listedRanges.find(e=>e.selected===!0)},showCustomRangeLabel(){return!this.alwaysShowCalendars}}},$l={class:"ranges"},El={key:0},Rl=["onClick","data-range-key"];function Fl(e,t,s,c,d,n){return i(),a("div",$l,[s.ranges?(i(),a("ul",El,[(i(!0),a(p,null,D(n.listedRanges,r=>(i(),a("li",{onClick:o=>n.clickRange(r.value),"data-range-key":r.label,key:r.label,class:m(n.range_class(r)),tabindex:"0"},h(r.label),11,Rl))),128)),n.showCustomRangeLabel?(i(),a("li",{key:0,class:m({active:d.customRangeActive||!n.selectedRange}),onClick:t[0]||(t[0]=(...r)=>n.clickCustomRange&&n.clickCustomRange(...r)),tabindex:"0"},h(s.localeData.customRangeLabel),3)):u("",!0)])):u("",!0)])}const Ol=C(Sl,[["render",Fl]]),Pl={mounted(e,{instance:t}){if(t.appendToBody){const{height:s,top:c,left:d,width:n,right:r}=t.$refs.toggle.getBoundingClientRect();e.unbindPosition=t.calculatePosition(e,t,{width:n,top:window.scrollY+c+s,left:window.scrollX+d,right:r}),document.body.appendChild(e)}else t.$el.appendChild(e)},unmounted(e,{instance:t}){t.appendToBody&&(e.unbindPosition&&typeof e.unbindPosition=="function"&&e.unbindPosition(),e.parentNode&&e.parentNode.removeChild(e))}},Al={inheritAttrs:!1,components:{Calendar:fl,CalendarTime:Tl,CalendarRanges:Ol},mixins:[K],directives:{appendToBody:Pl},emits:["update:modelValue","toggle","hoverDate","startSelection","select","change-month","finishSelection"],props:{modelValue:{type:Object},minDate:{type:[String,Date],default(){return null}},maxDate:{type:[String,Date],default(){return null}},showWeekNumbers:{type:Boolean,default:!1},linkedCalendars:{type:Boolean,default:!0},singleDatePicker:{type:[Boolean,String],default:!1},showDropdowns:{type:Boolean,default:!1},timePicker:{type:Boolean,default:!1},timePickerIncrement:{type:Number,default:5},timePicker24Hour:{type:Boolean,default:!0},timePickerSeconds:{type:Boolean,default:!1},autoApply:{type:Boolean,default:!1},localeData:{type:Object,default(){return{}}},dateRange:{type:[Object],default:null,required:!0},ranges:{type:[Object,Boolean],default(){let e=new Date;e.setHours(0,0,0,0);let t=new Date;t.setHours(11,59,59,999);let s=new Date;s.setDate(e.getDate()-1),s.setHours(0,0,0,0);let c=new Date;c.setDate(e.getDate()-1),c.setHours(11,59,59,999);let d=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,0,11,59,59,999);return{Today:[e,t],Yesterday:[s,c],"This month":[d,n],"This year":[new Date(e.getFullYear(),0,1),new Date(e.getFullYear(),11,31,11,59,59,999)],"Last month":[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0,11,59,59,999)]}}},opens:{type:String,default:"center"},dateFormat:Function,alwaysShowCalendars:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},controlContainerClass:{type:[Object,String],default:"form-control reportrange-text"},appendToBody:{type:Boolean,default:!1},calculatePosition:{type:Function,default(e,t,{width:s,top:c,left:d,right:n}){t.opens==="center"?e.style.left=d+s/2+"px":t.opens==="left"?e.style.right=window.innerWidth-n+"px":t.opens==="right"&&(e.style.left=d+"px"),e.style.top=c+"px"}},closeOnEsc:{type:Boolean,default:!0},readonly:{type:Boolean}},data(){const e=he;let t={locale:e.localeData({...this.localeData})},s=this.dateRange.startDate||null,c=this.dateRange.endDate||null;if(t.monthDate=s?new Date(s):new Date,t.nextMonthDate=e.nextMonth(t.monthDate),t.start=s?new Date(s):null,this.singleDatePicker&&this.singleDatePicker!=="range"?t.end=t.start:t.end=c?new Date(c):null,t.in_selection=!1,t.open=!1,t.showCustomRangeCalendars=!1,t.locale.firstDay!==0){let d=t.locale.firstDay,n=[...t.locale.daysOfWeek];for(;d>0;)n.push(n.shift()),d--;t.locale.daysOfWeek=n}return t},methods:{dateFormatFn(e,t){let s=new Date(t);s.setHours(0,0,0,0);let c=new Date(this.start);c.setHours(0,0,0,0);let d=new Date(this.end);return d.setHours(0,0,0,0),e["in-range"]=s>=c&&s<=d,this.dateFormat?this.dateFormat(e,t):e},changeLeftMonth(e){let t=new Date(e.year,e.month-1,1);this.monthDate=t,(this.linkedCalendars||this.$dateUtil.yearMonth(this.monthDate)>=this.$dateUtil.yearMonth(this.nextMonthDate))&&(this.nextMonthDate=this.$dateUtil.validateDateRange(this.$dateUtil.nextMonth(t),this.minDate,this.maxDate),(!this.singleDatePicker||this.singleDatePicker==="range")&&this.$dateUtil.yearMonth(this.monthDate)===this.$dateUtil.yearMonth(this.nextMonthDate)&&(this.monthDate=this.$dateUtil.validateDateRange(this.$dateUtil.prevMonth(this.monthDate),this.minDate,this.maxDate))),this.$emit("change-month",this.monthDate,0)},changeRightMonth(e){let t=new Date(e.year,e.month-1,1);this.nextMonthDate=t,(this.linkedCalendars||this.$dateUtil.yearMonth(this.nextMonthDate)<=this.$dateUtil.yearMonth(this.monthDate))&&(this.monthDate=this.$dateUtil.validateDateRange(this.$dateUtil.prevMonth(t),this.minDate,this.maxDate),this.$dateUtil.yearMonth(this.monthDate)===this.$dateUtil.yearMonth(this.nextMonthDate)&&(this.nextMonthDate=this.$dateUtil.validateDateRange(this.$dateUtil.nextMonth(this.nextMonthDate),this.minDate,this.maxDate))),this.$emit("change-month",this.monthDate,1)},normalizeDatetime(e,t){let s=new Date(e);return this.timePicker&&t&&(s.setHours(t.getHours()),s.setMinutes(t.getMinutes()),s.setSeconds(t.getSeconds()),s.setMilliseconds(t.getMilliseconds())),s},dateClick(e){if(this.readonly)return!1;this.in_selection?(this.in_selection=!1,this.end=this.normalizeDatetime(e,this.end),this.end=this.start&&(this.end=t),this.$emit("hoverDate",e)},onClickPicker(){this.disabled||this.togglePicker(null,!0)},togglePicker(e,t){typeof e=="boolean"?this.open=e:this.open=!this.open,t===!0&&this.$emit("toggle",this.open,this.togglePicker)},clickedApply(){this.togglePicker(!1,!0),this.$emit("update:modelValue",{startDate:this.start,endDate:this.singleDatePicker&&this.singleDatePicker!=="range"?this.start:this.end})},clickCancel(){if(this.open){let e=this.dateRange.startDate,t=this.dateRange.endDate;this.start=e?new Date(e):null,this.end=t?new Date(t):null,this.in_selection=!1,this.togglePicker(!1,!0)}},onSelect(){this.$emit("select",{startDate:this.start,endDate:this.end})},clickAway(e){e&&e.target&&!this.$el.contains(e.target)&&this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&this.clickCancel()},clickRange(e){this.in_selection=!1,this.$dateUtil.isValidDate(e[0])&&this.$dateUtil.isValidDate(e[1])?(this.start=this.$dateUtil.validateDateRange(new Date(e[0]),this.minDate,this.maxDate),this.end=this.$dateUtil.validateDateRange(new Date(e[1]),this.minDate,this.maxDate),this.changeLeftMonth({month:this.start.getMonth()+1,year:this.start.getFullYear()}),this.linkedCalendars===!1&&this.changeRightMonth({month:this.end.getMonth()+1,year:this.end.getFullYear()})):(this.start=null,this.end=null),this.onSelect(),this.autoApply&&this.clickedApply()},onUpdateStartTime(e){let t=new Date(this.start);t.setHours(e.hours),t.setMinutes(e.minutes),t.setSeconds(e.seconds),this.start=this.$dateUtil.validateDateRange(t,this.minDate,this.maxDate),this.autoApply&&this.$emit("update:modelValue",{startDate:this.start,endDate:this.singleDatePicker&&this.singleDatePicker!=="range"?this.start:this.end})},onUpdateEndTime(e){let t=new Date(this.end);t.setHours(e.hours),t.setMinutes(e.minutes),t.setSeconds(e.seconds),this.end=this.$dateUtil.validateDateRange(t,this.minDate,this.maxDate),this.autoApply&&this.$emit("update:modelValue",{startDate:this.start,endDate:this.end})},handleEscape(e){this.open&&e.keyCode===27&&this.closeOnEsc&&this.clickCancel()}},computed:{showRanges(){return this.ranges!==!1&&!this.readonly},showCalendars(){return this.alwaysShowCalendars||this.showCustomRangeCalendars},startText(){return this.start===null?"":this.$dateUtil.format(this.start,this.locale.format)},endText(){return this.end===null?"":this.$dateUtil.format(this.end,this.locale.format)},rangeText(){let e=this.startText;return(!this.singleDatePicker||this.singleDatePicker==="range")&&(e+=this.locale.separator+this.endText),e},min(){return this.minDate?new Date(this.minDate):null},max(){return this.maxDate?new Date(this.maxDate):null},pickerStyles(){return{"show-calendar":this.open||this.opens==="inline","show-ranges":this.showRanges,"show-weeknumbers":this.showWeekNumbers,single:this.singleDatePicker,["opens"+this.opens]:!0,linked:this.linkedCalendars,"hide-calendars":!this.showCalendars}},isClear(){return!this.dateRange.startDate||!this.dateRange.endDate},isDirty(){let e=new Date(this.dateRange.startDate),t=new Date(this.dateRange.endDate);return!this.isClear&&(this.start.getTime()!==e.getTime()||this.end.getTime()!==t.getTime())}},watch:{minDate(){let e=this.$dateUtil.validateDateRange(this.monthDate,this.minDate||new Date,this.maxDate);this.changeLeftMonth({year:e.getFullYear(),month:e.getMonth()+1})},maxDate(){let e=this.$dateUtil.validateDateRange(this.nextMonthDate,this.minDate,this.maxDate||new Date);this.changeRightMonth({year:e.getFullYear(),month:e.getMonth()+1})},"dateRange.startDate"(e){this.$dateUtil.isValidDate(new Date(e))&&(this.start=e&&!this.isClear&&this.$dateUtil.isValidDate(new Date(e))?new Date(e):null,this.isClear?(this.start=null,this.end=null):(this.start=new Date(this.dateRange.startDate),this.end=new Date(this.dateRange.endDate)))},"dateRange.endDate"(e){this.$dateUtil.isValidDate(new Date(e))&&(this.end=e&&!this.isClear?new Date(e):null,this.isClear?(this.start=null,this.end=null):(this.start=new Date(this.dateRange.startDate),this.end=new Date(this.dateRange.endDate)))},open:{handler(e){typeof document=="object"&&this.$nextTick(()=>{e?document.body.addEventListener("click",this.clickAway):document.body.removeEventListener("click",this.clickAway),e?document.addEventListener("keydown",this.handleEscape):document.removeEventListener("keydown",this.handleEscape),!this.alwaysShowCalendars&&this.ranges&&(this.showCustomRangeCalendars=!Object.keys(this.ranges).find(t=>this.$dateUtil.isSame(this.start,this.ranges[t][0],"date")&&this.$dateUtil.isSame(this.end,this.ranges[t][1],"date")))})},immediate:!0}}},me=e=>(ne("data-v-577c3804"),e=e(),le(),e),jl=me(()=>l("i",{class:"glyphicon glyphicon-calendar fa fa-calendar"},null,-1)),Hl=me(()=>l("b",{class:"caret"},null,-1)),Ul={class:"calendars"},Ll={key:1,class:"calendars-container"};const Yl={class:"calendar-table"},Vl={key:0,class:"drp-calendar col right"};const Bl={class:"calendar-table"},Il={key:0,class:"drp-buttons"},Nl={key:0,class:"drp-selected"},zl=["disabled"];function ql(e,t,s,c,d,n){const r=w("calendar-ranges"),o=w("calendar"),f=w("calendar-time"),g=xe("append-to-body");return i(),a("div",{class:m(["vue-daterange-picker",{inline:s.opens==="inline"}])},[l("div",{class:m(s.controlContainerClass),onClick:t[0]||(t[0]=(...b)=>n.onClickPicker&&n.onClickPicker(...b)),ref:"toggle"},[v(e.$slots,"input",{startDate:e.start,endDate:e.end,ranges:s.ranges,rangeText:n.rangeText},()=>[jl,y("  "),l("span",null,h(n.rangeText),1),Hl],!0)],2),T(Te,{name:"slide-fade",mode:"out-in"},{default:M(()=>[e.open||s.opens==="inline"?R((i(),a("div",{key:0,class:m(["daterangepicker ltr",n.pickerStyles]),ref:"dropdown"},[v(e.$slots,"header",{rangeText:n.rangeText,locale:e.locale,clickCancel:n.clickCancel,clickApply:n.clickedApply,in_selection:e.in_selection,autoApply:s.autoApply},void 0,!0),l("div",Ul,[n.showRanges?v(e.$slots,"ranges",{key:0,startDate:e.start,endDate:e.end,ranges:s.ranges,clickRange:n.clickRange},()=>[T(r,{onClickRange:n.clickRange,onShowCustomRange:t[1]||(t[1]=b=>e.showCustomRangeCalendars=!0),"always-show-calendars":s.alwaysShowCalendars,"locale-data":e.locale,ranges:s.ranges,selected:{startDate:e.start,endDate:e.end}},null,8,["onClickRange","always-show-calendars","locale-data","ranges","selected"])],!0):u("",!0),n.showCalendars?(i(),a("div",Ll,[l("div",{class:m(["drp-calendar col left",{single:s.singleDatePicker}])},[u("",!0),l("div",Yl,[T(o,{monthDate:e.monthDate,"locale-data":e.locale,start:e.start,end:e.end,minDate:n.min,maxDate:n.max,"show-dropdowns":s.showDropdowns,onChangeMonth:n.changeLeftMonth,"date-format":n.dateFormatFn,onDateClick:n.dateClick,onHoverDate:n.hoverDate,showWeekNumbers:s.showWeekNumbers},{default:M(()=>[v(e.$slots,"date",J(ee(e.data)),void 0,!0)]),_:3},8,["monthDate","locale-data","start","end","minDate","maxDate","show-dropdowns","onChangeMonth","date-format","onDateClick","onHoverDate","showWeekNumbers"])]),s.timePicker&&e.start?(i(),E(f,{key:1,onUpdate:n.onUpdateStartTime,"miniute-increment":s.timePickerIncrement,hour24:s.timePicker24Hour,"second-picker":s.timePickerSeconds,"current-time":e.start,readonly:s.readonly},null,8,["onUpdate","miniute-increment","hour24","second-picker","current-time","readonly"])):u("",!0)],2),s.singleDatePicker?u("",!0):(i(),a("div",Vl,[u("",!0),l("div",Bl,[T(o,{monthDate:e.nextMonthDate,"locale-data":e.locale,start:e.start,end:e.end,minDate:n.min,maxDate:n.max,"show-dropdowns":s.showDropdowns,onChangeMonth:n.changeRightMonth,"date-format":n.dateFormatFn,onDateClick:n.dateClick,onHoverDate:n.hoverDate,showWeekNumbers:s.showWeekNumbers},{default:M(()=>[v(e.$slots,"date",J(ee(e.data)),void 0,!0)]),_:3},8,["monthDate","locale-data","start","end","minDate","maxDate","show-dropdowns","onChangeMonth","date-format","onDateClick","onHoverDate","showWeekNumbers"])]),s.timePicker&&e.end?(i(),E(f,{key:1,onUpdate:n.onUpdateEndTime,"miniute-increment":s.timePickerIncrement,hour24:s.timePicker24Hour,"second-picker":s.timePickerSeconds,"current-time":e.end,readonly:s.readonly},null,8,["onUpdate","miniute-increment","hour24","second-picker","current-time","readonly"])):u("",!0)]))])):u("",!0)]),v(e.$slots,"footer",{rangeText:n.rangeText,locale:e.locale,clickCancel:n.clickCancel,clickApply:n.clickedApply,in_selection:e.in_selection,autoApply:s.autoApply},()=>[s.autoApply?u("",!0):(i(),a("div",Il,[n.showCalendars?(i(),a("span",Nl,h(n.rangeText),1)):u("",!0),s.readonly?u("",!0):(i(),a("button",{key:1,class:"cancelBtn btn btn-sm btn-secondary",type:"button",onClick:t[2]||(t[2]=(...b)=>n.clickCancel&&n.clickCancel(...b))},h(e.locale.cancelLabel),1)),s.readonly?u("",!0):(i(),a("button",{key:2,class:"applyBtn btn btn-sm btn-success",disabled:e.in_selection,type:"button",onClick:t[3]||(t[3]=(...b)=>n.clickedApply&&n.clickedApply(...b))},h(e.locale.applyLabel),9,zl))]))],!0)],2)),[[g]]):u("",!0)]),_:3})],2)}const Wl=C(Al,[["render",ql],["__scopeId","data-v-577c3804"]]),Gl={name:"ns-date-range-picker",data(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:Wl},mounted(){this.field.value!==void 0&&(this.dateRange=this.field.value)},watch:{dateRange(){const e={startDate:x(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:x(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:_,getFormattedDate(e){return e!==null?x(e).format("YYYY-MM-DD HH:mm"):_("N/D")},clearDate(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},Kl={class:"flex flex-auto flex-col mb-2 ns-date-range-picker"},Ql=["for"],Zl={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Xl={class:"text-primary sm:text-sm sm:leading-5"},Jl=l("i",{class:"las la-times"},null,-1),ei=[Jl],ti={class:"flex justify-between items-center w-full py-2"},si={class:"text-xs"},ni={class:"text-xs"};function li(e,t,s,c,d,n){const r=w("date-range-picker"),o=w("ns-field-description");return i(),a("div",Kl,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Ql),l("div",{class:m([n.hasError?"error":"","mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm"])},[s.leading?(i(),a("div",Zl,[l("span",Xl,h(s.leading),1)])):u("",!0),l("button",{class:"px-3 outline-none bg-error-secondary font-semibold text-white",onClick:t[0]||(t[0]=f=>n.clearDate())},ei),T(r,{class:"w-full flex items-center bg-input-background",ref:"picker","locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,modelValue:d.dateRange,"onUpdate:modelValue":t[1]||(t[1]=f=>d.dateRange=f),disabled:s.field.disabled,linkedCalendars:!0},{input:M(f=>[l("div",ti,[l("span",si,h(n.__("Range Starts"))+" : "+h(n.getFormattedDate(f.startDate)),1),l("span",ni,h(n.__("Range Ends"))+" : "+h(n.getFormattedDate(f.endDate)),1)])]),_:1},8,["modelValue","disabled"])],2),T(o,{field:s.field},null,8,["field"])])}const ge=C(Gl,[["render",li]]),ii={name:"ns-date-time-picker",props:["field","date"],data(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:x}},computed:{fieldDate(){return this.field?x(this.field.value).isValid()?x(this.field.value):x():this.date?x(this.date):x()}},mounted(){let e=x(this.field.value);e.isValid()?this.setDate(e.format("YYYY-MM-DD HH:mm:ss")):this.setDate(x(ns.date.current).format("YYYY-MM-DD HH:mm:ss"))},methods:{__:_,setDate(e){this.field.value=e}}},ai={class:"picker mb-2"},ri={key:0,class:"block leading-5 font-medium text-primary"},di={class:"ns-button"},oi=l("i",{class:"las la-clock text-xl"},null,-1),ui={key:0,class:"mx-1 text-sm"},ci={key:0},hi={key:1},fi={key:1,class:"mx-1 text-sm"},mi={key:0},gi={key:1},bi={key:1,class:"text-sm text-secondary py-1"},_i={key:2,class:"relative z-10 h-0 w-0"};function pi(e,t,s,c,d,n){const r=w("ns-calendar");return i(),a("div",ai,[s.field&&s.field.label&&s.field.label.length>0?(i(),a("label",ri,h(s.field.label),1)):u("",!0),l("div",di,[l("button",{onClick:t[0]||(t[0]=o=>d.visible=!d.visible),class:m([s.field&&s.field.label&&s.field.label.length>0?"mt-1 border border-input-edge":"","shadow rounded cursor-pointer w-full p-1 flex items-center text-primary"])},[oi,s.field?(i(),a("span",ui,[[null,"",void 0].includes(s.field.value)?u("",!0):(i(),a("span",ci,h(n.fieldDate.format("YYYY-MM-DD HH:mm")),1)),[null,"",void 0].includes(s.field.value)?(i(),a("span",hi,"N/A")):u("",!0)])):u("",!0),s.date?(i(),a("span",fi,[[null,"",void 0].includes(s.date)?u("",!0):(i(),a("span",mi,h(n.fieldDate.format("YYYY-MM-DD HH:mm")),1)),[null,"",void 0].includes(s.date)?(i(),a("span",gi,"N/A")):u("",!0)])):u("",!0)],2)]),s.field?(i(),a("p",bi,h(s.field.description),1)):u("",!0),d.visible?(i(),a("div",_i,[l("div",{class:m([s.field&&s.field.label&&s.field.label.length>0?"-mt-4":"mt-2","absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col"])},[s.field?(i(),E(r,{key:0,onOnClickOut:t[1]||(t[1]=o=>d.visible=!1),onSet:t[2]||(t[2]=o=>n.setDate(o)),visible:d.visible,date:s.field.value},null,8,["visible","date"])):u("",!0),s.date?(i(),E(r,{key:1,onOnClickOut:t[3]||(t[3]=o=>d.visible=!1),onSet:t[4]||(t[4]=o=>n.setDate(o)),visible:d.visible,date:s.date},null,8,["visible","date"])):u("",!0)],2)])):u("",!0)])}const be=C(ii,[["render",pi]]),yi={name:"ns-datepicker",components:{nsCalendar:ce},props:["label","date","format"],computed:{formattedDate(){return x(this.date).format(this.format||"YYYY-MM-DD HH:mm:ss")}},data(){return{visible:!1}},mounted(){},methods:{__:_,setDate(e){this.$emit("set",e)}}},vi={class:"picker"},ki={class:"ns-button"},wi=l("i",{class:"las la-clock text-2xl"},null,-1),xi={class:"mx-1 text-sm"},Di={key:0},Ci={key:1},Mi={key:0,class:"relative h-0 w-0 -mb-2"},Ti={class:"w-72 mt-2 shadow-lg anim-duration-300 zoom-in-entrance flex flex-col ns-floating-panel"};function Si(e,t,s,c,d,n){const r=w("ns-calendar");return i(),a("div",vi,[l("div",ki,[l("button",{onClick:t[0]||(t[0]=o=>d.visible=!d.visible),class:"rounded cursor-pointer border border-input-edge shadow w-full px-1 py-1 flex items-center text-primary"},[wi,l("span",xi,[l("span",null,h(s.label||n.__("Date"))+" : ",1),s.date?(i(),a("span",Di,h(n.formattedDate),1)):(i(),a("span",Ci,h(n.__("N/A")),1))])])]),d.visible?(i(),a("div",Mi,[l("div",Ti,[T(r,{visible:d.visible,onOnClickOut:t[1]||(t[1]=o=>d.visible=!1),date:s.date,onSet:t[2]||(t[2]=o=>n.setDate(o))},null,8,["visible","date"])])])):u("",!0)])}const $i=C(yi,[["render",Si]]),Ei={name:"ns-daterange-picker",data(){return{leftCalendar:x(),rightCalendar:x().add(1,"months"),rangeViewToggled:!1,clickedOnCalendar:!1}},mounted(){this.field.value||this.clearDate(),document.addEventListener("click",this.checkClickedItem)},beforeUnmount(){document.removeEventListener("click",this.checkClickedItem)},watch:{leftCalendar(){this.leftCalendar.isSame(this.rightCalendar,"month")&&this.rightCalendar.add(1,"months")},rightCalendar(){this.rightCalendar.isSame(this.leftCalendar,"month")&&this.leftCalendar.sub(1,"months")}},methods:{__:_,setDateRange(e,t){this.field.value[e]=t,x(this.field.value.startDate).isBefore(x(this.field.value.endDate))&&this.$emit("change",this.field)},getFormattedDate(e){return e!==null?x(e).format("YYYY-MM-DD HH:mm"):_("N/D")},clearDate(){this.field.value={startDate:null,endDate:null}},toggleRangeView(){this.rangeViewToggled=!this.rangeViewToggled},handleDateRangeClick(){this.clickedOnCalendar=!0},checkClickedItem(e){this.$el.getAttribute("class").split(" ").includes("ns-daterange-picker")&&(!this.$el.contains(e.srcElement)&&!this.clickedOnCalendar&&this.rangeViewToggled&&(this.$emit("blur",this.field),this.toggleRangeView()),setTimeout(()=>{this.clickedOnCalendar=!1},100))}},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"},startDateFormatted(){return this.field.value!==void 0&&x(this.field.value.startDate).isValid()?x(this.field.value.startDate).format("YYYY-MM-DD HH:mm"):!1},endDateFormatted(){return this.field.value!==void 0&&x(this.field.value.endDate).isValid()?x(this.field.value.endDate).format("YYYY-MM-DD HH:mm"):!1}},props:["placeholder","leading","type","field"]},Ri=["for"],Fi={class:"border border-input-edge rounded-tl rounded-bl flex-auto flex"},Oi={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Pi={class:"text-primary sm:text-sm sm:leading-5"},Ai=l("span",{class:"mr-1"},[l("i",{class:"las la-clock text-2xl"})],-1),ji={class:""},Hi=l("span",{class:"mx-2"},"—",-1),Ui=l("span",{class:"mr-1"},[l("i",{class:"las la-clock text-2xl"})],-1),Li={class:""},Yi=l("i",{class:"las la-times"},null,-1),Vi=[Yi],Bi={key:0,class:"relative h-0 w-0"},Ii={class:"z-10 absolute md:w-[550px] w-[225px] mt-2 shadow-lg anim-duration-300 zoom-in-entrance flex flex-col"},Ni={class:"flex flex-col md:flex-row bg-box-background rounded-lg"},zi=l("div",{class:"flex-auto border-l border-r"},null,-1);function qi(e,t,s,c,d,n){const r=w("ns-calendar"),o=w("ns-field-description");return i(),a("div",{onClick:t[4]||(t[4]=f=>n.handleDateRangeClick()),class:"flex flex-auto flex-col mb-2 ns-daterange-picker"},[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Ri),l("div",{class:m([n.hasError?"error":"","mt-1 relative flex input-group bg-input-background rounded overflow-hidden shadow focus:shadow-sm"])},[l("div",Fi,[s.leading?(i(),a("div",Oi,[l("span",Pi,h(s.leading),1)])):u("",!0),l("div",{class:"flex flex-auto p-1 text-primary text-sm items-center cursor-pointer",onClick:t[0]||(t[0]=f=>n.toggleRangeView())},[Ai,l("span",ji,h(n.startDateFormatted||n.__("N/A")),1),Hi,Ui,l("span",Li,h(n.endDateFormatted||n.__("N/A")),1)])]),l("button",{class:"px-3 outline-none font-bold bg-error-tertiary",onClick:t[1]||(t[1]=f=>n.clearDate())},Vi)],2),d.rangeViewToggled?(i(),a("div",Bi,[l("div",Ii,[l("div",Ni,[T(r,{class:"md:w-1/2 w-full",range:[n.startDateFormatted,n.endDateFormatted],side:"left",date:s.field.value.startDate,"selected-range":s.field.value,onSet:t[2]||(t[2]=f=>n.setDateRange("startDate",f))},null,8,["range","date","selected-range"]),zi,T(r,{class:"md:w-1/2 w-full",range:[n.startDateFormatted,n.endDateFormatted],side:"right",date:s.field.value.endDate,"selected-range":s.field.value,onSet:t[3]||(t[3]=f=>n.setDateRange("endDate",f))},null,8,["range","date","selected-range"])])])])):u("",!0),T(o,{field:s.field},null,8,["field"])])}const Wi=C(Ei,[["render",qi]]),Gi={name:"ns-dropzone",emits:["dropped"],mounted(){},setup(e,{emit:t}){return{dropZone:q(null),handleDrop:d=>{const n=d.dataTransfer.getData("text");t("dropped",n)}}}};function Ki(e,t,s,c,d,n){return i(),a("div",{ref:"dropZone",class:"ns-drop-zone mb-4",onDragover:t[0]||(t[0]=Se(()=>{},["prevent"]))},[v(e.$slots,"default",{},void 0,!0)],544)}const Qi=C(Gi,[["render",Ki],["__scopeId","data-v-0817a409"]]),Zi={emits:["drag-start","drag-end"],name:"ns-draggable",props:{widget:{required:!0}},setup(e,{emit:t}){const s=q(null),c=q(null);let d=null,n=0,r=0,o=0,f=0;const g=F=>{const P=F.srcElement.closest(".ns-draggable-item"),O=P.getBoundingClientRect();d=P.cloneNode(!0),d.setAttribute("class","ns-ghost"),d.style.display="none",d.style.position="fixed",d.style.top=`${O.top}px`,d.style.left=`${O.left}px`,d.style.width=`${O.width}px`,d.style.height=`${O.height}px`,P.closest(".ns-drop-zone").appendChild(d),n=F.clientX-o,r=F.clientY-f,c.value={dom:P},t("drag-start",e.widget)},b=F=>{if(c.value===null)return;const P=c.value.dom.closest(".ns-drop-zone").querySelector(".ns-ghost"),O=P.querySelector("div");Array.from(O.classList).filter(j=>j.startsWith("shadow")).forEach(j=>O.classList.remove(j)),o=F.clientX-n,f=F.clientY-r,O.style.boxShadow="0px 4px 10px 5px rgb(0 0 0 / 48%)",P.style.display="block",P.style.transform=`translate(${o}px, ${f}px)`,P.style.cursor="grabbing",document.querySelectorAll(".ns-drop-zone").forEach(j=>{j.getBoundingClientRect();const{left:I,top:N,right:k,bottom:ye}=j.getBoundingClientRect(),{clientX:Z,clientY:X}=F;Z>=I&&Z<=k&&X>=N&&X<=ye?j.setAttribute("hovered","true"):j.setAttribute("hovered","false")})},S=F=>{if(c.value===null)return;const O=c.value.dom.closest(".ns-drop-zone").querySelector(".ns-ghost");O&&O.remove(),c.value=null,o=0,f=0,F.srcElement.closest(".ns-drop-zone"),t("drag-end",e.widget)};return De(()=>{s.value&&(document.addEventListener("mousemove",F=>b(F)),document.addEventListener("mouseup",F=>S(F)))}),Ce(()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",S)}),{draggable:s,startDrag:g}}};function Xi(e,t,s,c,d,n){return i(),a("div",{ref:"draggable",class:"ns-draggable-item",onMousedown:t[0]||(t[0]=(...r)=>c.startDrag&&c.startDrag(...r))},[v(e.$slots,"default")],544)}const Ji=C(Zi,[["render",Xi]]),ea={name:"ns-dragzone",props:["raw-widgets","raw-columns"],components:{nsDropzone:Qi,nsDraggable:Ji},data(){return{widgets:[],theme:ns.theme,dragged:null,columns:[]}},mounted(){this.widgets=this.rawWidgets.map(e=>({name:e.name,"component-name":e["component-name"],"class-name":e["class-name"],component:te(window[e["component-name"]])})),this.columns=this.rawColumns.map(e=>(e.widgets.forEach(t=>{t.component=te(window[t.identifier]),t["class-name"]=t.class_name,t["component-name"]=t.identifier}),e)),setTimeout(()=>{var e=document.querySelectorAll(".widget-placeholder");document.addEventListener("mousemove",t=>{for(var s=0;s=c.left&&t.clientX<=c.right&&t.clientY>=c.top&&t.clientY<=c.bottom){e[s].setAttribute("hovered","true");break}else e[s].setAttribute("hovered","false")}})},10)},computed:{hasUnusedWidgets(){const e=this.columns.map(t=>t.widgets).flat();return this.widgets.filter(t=>!e.map(c=>c["component-name"]).includes(t["component-name"])).length>0}},methods:{__:_,handleEndDragging(e){const t=document.querySelector('.ns-drop-zone[hovered="true"]');if(t){const d=t.closest("[column-name]").getAttribute("column-name"),n=this.columns.filter(O=>O.name===d),r=n[0].widgets.filter(O=>O["component-name"]===t.querySelector(".ns-draggable-item").getAttribute("component-name")),o=document.querySelector(`[component-name="${e["component-name"]}"]`),g=o.closest("[column-name]").getAttribute("column-name"),b=this.columns.filter(O=>O.name===g),S=b[0].widgets.filter(O=>O["component-name"]===o.getAttribute("component-name"));if(S[0]["component-name"]===r[0]["component-name"])return;const F=S[0].position,P=r[0].position;S[0].column=d,S[0].position=P,r[0].column=g,r[0].position=F,n[0].widgets[P]=S[0],b[0].widgets[F]=r[0],this.handleChange(n[0]),this.handleChange(b[0]),t.setAttribute("hovered","false")}const s=document.querySelector('.widget-placeholder[hovered="true"]');if(s){const c=s.closest("[column-name]").getAttribute("column-name");if(e===c){console.log("The widget is already in the same column.");return}const d=this.columns.filter(o=>o.name===e.column)[0],n=d.widgets.indexOf(e);d.widgets.splice(n,1);const r=this.columns.filter(o=>o.name===c)[0];e.position=r.widgets.length,e.column=c,r.widgets.push(e),this.handleChange(d),this.handleChange(r)}},handleChange(e,t){setTimeout(()=>{nsHttpClient.post("/api/users/widgets",{column:e}).subscribe(s=>{},s=>$.error(s.message||_("An unpexpected error occured while using the widget.")).subscribe())},100)},handleRemoveWidget(e,t){const s=t.widgets.indexOf(e);t.widgets.splice(s,1),this.handleChange(t)},async openWidgetAdded(e){try{const t=this.columns.filter(r=>r.name!==e.name?(console.log(r.name),r.widgets.length>0):!1).map(r=>r.widgets).flat(),s=e.widgets.map(r=>r["component-name"]),c=this.widgets.filter(r=>{const o=t.map(f=>f["component-name"]);return o.push(...s),!o.includes(r["component-name"])}).map(r=>({value:r,label:r.name})),d=await new Promise((r,o)=>{const f=c.filter(g=>s.includes(g["component-name"]));Popup.show(Re,{value:f,resolve:r,reject:o,type:"multiselect",options:c,label:_("Choose Widget"),description:_("Select with widget you want to add to the column.")})}),n=this.columns.indexOf(e);this.columns[n].widgets=[...this.columns[n].widgets,...d].map((r,o)=>(r.position=o,r.column=e.name,r)),this.handleChange(this.columns[n])}catch(t){console.log(t)}}}},ta={class:"flex md:-mx-2 flex-wrap"},sa=["column-name"],na=["onClick"],la={class:"text-sm text-primary",type:"info"};function ia(e,t,s,c,d,n){const r=w("ns-draggable"),o=w("ns-dropzone");return i(),a("div",ta,[(i(!0),a(p,null,D(d.columns,(f,g)=>(i(),a("div",{class:"w-full md:px-2 md:w-1/2 lg:w-1/3 xl:1/4","column-name":f.name,key:f.name},[(i(!0),a(p,null,D(f.widgets,b=>(i(),E(o,null,{default:M(()=>[T(r,{"component-name":b["component-name"],onDragEnd:t[0]||(t[0]=S=>n.handleEndDragging(S)),widget:b},{default:M(()=>[(i(),E(G(b.component),{onOnRemove:S=>n.handleRemoveWidget(b,f),widget:b},null,40,["onOnRemove","widget"]))]),_:2},1032,["component-name","widget"])]),_:2},1024))),256)),n.hasUnusedWidgets?(i(),a("div",{key:0,onClick:b=>n.openWidgetAdded(f),class:"widget-placeholder cursor-pointer border-2 border-dashed h-16 flex items-center justify-center"},[l("span",la,h(n.__("Click here to add widgets")),1)],8,na)):u("",!0)],8,sa))),128))])}const aa=C(ea,[["render",ia],["__scopeId","data-v-8fa76ad4"]]),ra={emits:["blur","change","saved","keypress"],data:()=>({}),mounted(){},components:{nsDateRangePicker:ge,nsDateTimePicker:be,nsSwitch:ue},computed:{isInputField(){return["text","password","email","number","tel"].includes(this.field.type)},isHiddenField(){return["hidden"].includes(this.field.type)},isDateField(){return["date"].includes(this.field.type)},isSelectField(){return["select"].includes(this.field.type)},isSearchField(){return["search-select"].includes(this.field.type)},isTextarea(){return["textarea"].includes(this.field.type)},isCheckbox(){return["checkbox"].includes(this.field.type)},isMultiselect(){return["multiselect"].includes(this.field.type)},isInlineMultiselect(){return["inline-multiselect"].includes(this.field.type)},isSelectAudio(){return["select-audio"].includes(this.field.type)},isSwitch(){return["switch"].includes(this.field.type)},isMedia(){return["media"].includes(this.field.type)},isCkEditor(){return["ckeditor"].includes(this.field.type)},isDateTimePicker(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker(){return["daterangepicker"].includes(this.field.type)},isCustom(){return["custom"].includes(this.field.type)}},props:["field"],methods:{handleSaved(e,t){this.$emit("saved",t)},addOption(e){this.field.type==="select"&&this.field.options.forEach(s=>s.selected=!1),e.selected=!0;const 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})},changeTouchedState(e,t){t.stopPropagation&&t.stopPropagation(),e.touched=!0,this.$emit("change",e)},refreshMultiselect(){this.field.value=this.field.options.filter(e=>e.selected).map(e=>e.value)},removeOption(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}}},da=["name","value"],oa={key:1,class:"flex flex-auto mb-2"},ua=["innerHTML"],ca=["innerHTML"],ha=["innerHTML"],fa=["innerHTML"],ma=["innerHTML"],ga=["innerHTML"],ba=["innerHTML"],_a=["innerHTML"],pa=["innerHTML"],ya=["innerHTML"],va=["innerHTML"],ka=["innerHTML"],wa=["innerHTML"],xa=["innerHTML"];function Da(e,t,s,c,d,n){const r=w("ns-input"),o=w("ns-date-time-picker"),f=w("ns-date"),g=w("ns-media-input"),b=w("ns-select"),S=w("ns-search-select"),F=w("ns-daterange-picker"),P=w("ns-select-audio"),O=w("ns-textarea"),B=w("ns-checkbox"),Q=w("ns-inline-multiselect"),j=w("ns-multiselect"),I=w("ns-ckeditor"),N=w("ns-switch");return i(),a(p,null,[n.isHiddenField?(i(),a("input",{key:0,type:"hidden",name:s.field.name,value:s.field.value},null,8,da)):u("",!0),n.isHiddenField?u("",!0):(i(),a("div",oa,[n.isInputField?(i(),E(r,{key:0,onKeypress:t[0]||(t[0]=k=>n.changeTouchedState(s.field,k)),onChange:t[1]||(t[1]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ua)]),_:1},8,["field"])):u("",!0),n.isDateTimePicker?(i(),E(o,{key:1,onBlur:t[2]||(t[2]=k=>e.$emit("blur",s.field)),onChange:t[3]||(t[3]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ca)]),_:1},8,["field"])):u("",!0),n.isDateField?(i(),E(f,{key:2,onBlur:t[4]||(t[4]=k=>e.$emit("blur",s.field)),onChange:t[5]||(t[5]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ha)]),_:1},8,["field"])):u("",!0),n.isMedia?(i(),E(g,{key:3,onBlur:t[6]||(t[6]=k=>e.$emit("blur",s.field)),onChange:t[7]||(t[7]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,fa)]),_:1},8,["field"])):u("",!0),n.isSelectField?(i(),E(b,{key:4,onChange:t[8]||(t[8]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ma)]),_:1},8,["field"])):u("",!0),n.isSearchField?(i(),E(S,{key:5,field:s.field,onSaved:t[9]||(t[9]=k=>n.handleSaved(s.field,k)),onChange:t[10]||(t[10]=k=>n.changeTouchedState(s.field,k))},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ga)]),_:1},8,["field"])):u("",!0),n.isDateRangePicker?(i(),E(F,{key:6,onBlur:t[11]||(t[11]=k=>e.$emit("blur",s.field)),onChange:t[12]||(t[12]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ba)]),_:1},8,["field"])):u("",!0),n.isSelectAudio?(i(),E(P,{key:7,onBlur:t[13]||(t[13]=k=>e.$emit("blur",s.field)),onChange:t[14]||(t[14]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,_a)]),_:1},8,["field"])):u("",!0),n.isTextarea?(i(),E(O,{key:8,onBlur:t[15]||(t[15]=k=>e.$emit("blur",s.field)),onChange:t[16]||(t[16]=k=>n.changeTouchedState(s.field,k)),field:s.field},{description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,pa)]),default:M(()=>[l("template",null,[y(h(s.field.label),1)])]),_:1},8,["field"])):u("",!0),n.isCheckbox?(i(),E(B,{key:9,onBlur:t[17]||(t[17]=k=>e.$emit("blur",s.field)),onChange:t[18]||(t[18]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ya)]),_:1},8,["field"])):u("",!0),n.isInlineMultiselect?(i(),E(Q,{key:10,onBlur:t[19]||(t[19]=k=>e.$emit("blur",s.field)),onUpdate:t[20]||(t[20]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,va)]),_:1},8,["field"])):u("",!0),n.isMultiselect?(i(),E(j,{key:11,onAddOption:t[21]||(t[21]=k=>n.addOption(k)),onRemoveOption:t[22]||(t[22]=k=>n.removeOption(k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ka)]),_:1},8,["field"])):u("",!0),n.isCkEditor?(i(),E(I,{key:12,field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,wa)]),_:1},8,["field"])):u("",!0),n.isSwitch?(i(),E(N,{key:13,field:s.field,onChange:t[23]||(t[23]=k=>n.changeTouchedState(s.field,k))},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,xa)]),_:1},8,["field"])):u("",!0),n.isCustom?(i(),E(Me,{key:14},[(i(),E(G(s.field.component),{field:s.field,onBlur:t[24]||(t[24]=k=>e.$emit("blur",s.field)),onChange:t[25]||(t[25]=k=>n.changeTouchedState(s.field,k))},null,40,["field"]))],1024)):u("",!0)]))],64)}const Ca=C(ra,[["render",Da]]),Ma={name:"ns-field-detail",props:["field"],methods:{__:_}},Ta={key:0,class:"text-xs ns-description"};function Sa(e,t,s,c,d,n){return i(),a(p,null,[!s.field.errors||s.field.errors.length===0?(i(),a("p",Ta,h(s.field.description),1)):u("",!0),(i(!0),a(p,null,D(s.field.errors,(r,o)=>(i(),a("p",{key:o,class:"text-xs ns-error"},[r.identifier==="required"?v(e.$slots,r.identifier,{key:0},()=>[y(h(n.__("This field is required.")),1)]):u("",!0),r.identifier==="email"?v(e.$slots,r.identifier,{key:1},()=>[y(h(n.__("This field must contain a valid email address.")),1)]):u("",!0),r.identifier==="invalid"?v(e.$slots,r.identifier,{key:2},()=>[y(h(r.message),1)]):u("",!0),r.identifier==="same"?v(e.$slots,r.identifier,{key:3},()=>[y(h(n.__('This field must be similar to "{other}""').replace("{other}",r.fields.filter(f=>f.name===r.rule.value)[0].label)),1)]):u("",!0),r.identifier==="min"?v(e.$slots,r.identifier,{key:4},()=>[y(h(n.__('This field must have at least "{length}" characters"').replace("{length}",r.rule.value)),1)]):u("",!0),r.identifier==="max"?v(e.$slots,r.identifier,{key:5},()=>[y(h(n.__('This field must have at most "{length}" characters"').replace("{length}",r.rule.value)),1)]):u("",!0),r.identifier==="different"?v(e.$slots,r.identifier,{key:6},()=>[y(h(n.__('This field must be different from "{other}""').replace("{other}",r.fields.filter(f=>f.name===r.rule.value)[0].label)),1)]):u("",!0)]))),128))],64)}const $a=C(Ma,[["render",Sa]]),Ea={props:["className","buttonClass","type"]};function Ra(e,t,s,c,d,n){return i(),a("button",{class:m([s.type?s.type:s.buttonClass,"ns-inset-button rounded-full h-8 w-8 border items-center justify-center"])},[l("i",{class:m([s.className,"las"])},null,2)],2)}const Fa=C(Ea,[["render",Ra]]),Oa={name:"ns-input-label",props:["field"],data(){return{tags:[],searchField:"",focused:!1,optionsToKeyValue:{}}},methods:{addOption(e){let t;this.optionSuggestions.length===1&&e===void 0?t=this.optionSuggestions[0]:e!==void 0&&(t=e),t!==void 0&&(this.field.value.filter(c=>c===t.value).length>0||(this.searchField="",this.field.value.push(t.value),this.$emit("change",this.field)))},removeOption(e){const t=this.field.value.filter(s=>s!==e);this.field.value=t}},mounted(){if(this.$refs.searchField.addEventListener("focus",e=>{this.focused=!0}),this.$refs.searchField.addEventListener("blur",e=>{setTimeout(()=>{this.focused=!1},200)}),this.field.value.length===void 0)try{this.field.value=JSON.parse(this.field.value)}catch{this.field.value=[]}this.field.options.forEach(e=>{this.optionsToKeyValue[e.value]=e.label})},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},optionSuggestions(){if(typeof this.field.value.map=="function"){const e=this.field.value.map(t=>t.value);return this.field.options.filter(t=>!e.includes(t.value)&&this.focused>0&&(t.label.search(this.searchField)>-1||t.value.search(this.searchField)>-1))}return[]},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":""}},props:["placeholder","leading","type","field"]},Pa={class:"flex flex-col mb-2 flex-auto ns-input"},Aa=["for"],ja={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Ha={class:"leading sm:text-sm sm:leading-5"},Ua=["disabled","id","type","placeholder"],La={class:"rounded shadow bg-box-elevation-hover flex mr-1 mb-1"},Ya={class:"p-2 flex items-center text-primary"},Va={class:"flex items-center justify-center px-2"},Ba=["onClick"],Ia=l("i",{class:"las la-times-circle"},null,-1),Na=[Ia],za={class:"relative"},qa=["placeholder"],Wa={class:"h-0 absolute w-full z-10"},Ga={class:"shadow bg-box-background absoluve bottom-0 w-full max-h-80 overflow-y-auto"},Ka=["onClick"];function Qa(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Pa,[s.field.label&&s.field.label.length>0?(i(),a("label",{key:0,for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Aa)):u("",!0),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.description||s.field.errors>0?"mb-2":""),"mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",ja,[l("span",Ha,h(s.leading),1)])):u("",!0),l("div",{disabled:s.field.disabled,id:s.field.name,type:s.field.type,class:m([n.inputClass,"flex sm:text-sm sm:leading-5 p-1 flex-wrap"]),placeholder:s.field.placeholder||""},[(i(!0),a(p,null,D(s.field.value,o=>(i(),a("div",La,[l("div",Ya,h(d.optionsToKeyValue[o]),1),l("div",Va,[l("div",{onClick:f=>n.removeOption(o),class:"cursor-pointer rounded-full bg-error-tertiary h-5 w-5 flex items-center justify-center"},Na,8,Ba)])]))),256)),l("div",za,[R(l("input",{onChange:t[0]||(t[0]=o=>o.stopPropagation()),onKeydown:t[1]||(t[1]=Y(o=>n.addOption(),["enter"])),ref:"searchField","onUpdate:modelValue":t[2]||(t[2]=o=>d.searchField=o),type:"text",class:"w-auto p-2 border-b border-dashed bg-transparent",placeholder:s.field.placeholder||"Start searching here..."},null,40,qa),[[A,d.searchField]]),l("div",Wa,[l("div",Ga,[l("ul",null,[(i(!0),a(p,null,D(n.optionSuggestions,o=>(i(),a("li",{onClick:f=>n.addOption(o),class:"p-2 hover:bg-box-elevation-hover text-primary cursor-pointer"},h(o.label),9,Ka))),256))])])])])],10,Ua)],2),T(r,{field:s.field},null,8,["field"])])}const Za=C(Oa,[["render",Qa]]),Xa={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},Ja={class:"flex flex-col mb-2 flex-auto ns-input"},er=["for"],tr={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},sr={class:"leading sm:text-sm sm:leading-5"},nr=["disabled","id","type","placeholder"];function lr(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Ja,[s.field.label&&s.field.label.length>0?(i(),a("label",{key:0,for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,er)):u("",!0),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.description||s.field.errors>0?"mb-2":""),"mt-1 relative overflow-hidden border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",tr,[l("span",sr,h(s.leading),1)])):u("",!0),R(l("input",{disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.field.placeholder||""},null,10,nr),[[oe,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const ir=C(Xa,[["render",lr]]),ar={data:()=>({clicked:!1,_save:0}),props:["type","to","href","target"],computed:{buttonclass(){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"}}}},rr={class:"flex"},dr=["target","href"];function or(e,t,s,c,d,n){return i(),a("div",rr,[s.href?(i(),a("a",{key:0,target:s.target,href:s.href,class:m([n.buttonclass,"rounded cursor-pointer py-2 px-3 font-semibold"])},[v(e.$slots,"default")],10,dr)):u("",!0)])}const ur=C(ar,[["render",or]]),_e={zip:"la-file-archive",tar:"la-file-archive",bz:"la-file-archive","7z":"la-file-archive",css:"la-file-code",js:"la-file-code",json:"la-file-code",docx:"la-file-word",doc:"la-file-word",mp3:"la-file-audio",aac:"la-file-audio",ods:"la-file-audio",pdf:"la-file-pdf",csv:"la-file-csv",avi:"la-file-video",mpeg:"la-file-video",mpkg:"la-file-video",unknown:"la-file"},cr={name:"ns-media",props:["popup"],data(){return{searchFieldDebounce:null,searchField:"",pages:[{label:_("Upload"),name:"upload",selected:!1},{label:_("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},fileIcons:_e,queryPage:1,bulkSelect:!1,files:[]}},mounted(){this.popupCloser();const e=this.pages.filter(t=>t.name==="gallery")[0];this.select(e)},watch:{searchField(){clearTimeout(this.searchFieldDebounce),this.searchFieldDebounce=setTimeout(()=>{this.loadGallery(1)},500)},files:{handler(){this.uploadFiles()},deep:!0}},computed:{postMedia(){return de.applyFilters("http-client-url","/api/medias")},currentPage(){return this.pages.filter(e=>e.selected)[0]},hasOneSelected(){return this.response.data.filter(e=>e.selected).length>0},selectedResource(){return this.response.data.filter(e=>e.selected)[0]},csrf(){return ns.authentication.csrf},isPopup(){return typeof this.popup<"u"},user_id(){return this.isPopup&&this.popup.params.user_id||0},panelOpened(){return!this.bulkSelect&&this.hasOneSelected},popupInstance(){return this.popup}},methods:{popupCloser:ae,__:_,cancelBulkSelect(){this.bulkSelect=!1,this.response.data.forEach(e=>e.selected=!1)},openError(e){L.show(se,{title:_("An error occured"),message:e.error.message||_("An unexpected error occured.")})},deleteSelected(){L.show(V,{title:_("Confirm Your Action"),message:_("You're about to delete selected resources. Would you like to proceed?"),onAction:e=>{e&&U.post("/api/medias/bulk-delete",{ids:this.response.data.filter(t=>t.selected).map(t=>t.id)}).subscribe({next:t=>{$.success(t.message).subscribe(),this.loadGallery()},error:t=>{$.error(t.message).subscribe()}})}})},loadUploadScreen(){setTimeout(()=>{this.setDropZone()},1e3)},setDropZone(){const e=document.getElementById("dropping-zone");e.addEventListener("dragenter",s=>this.preventDefaults(s),!1),e.addEventListener("dragleave",s=>this.preventDefaults(s),!1),e.addEventListener("dragover",s=>this.preventDefaults(s),!1),e.addEventListener("drop",s=>this.preventDefaults(s),!1),["dragenter","dragover"].forEach(s=>{e.addEventListener(s,()=>{this.isDragging=!0})}),["dragleave","drop"].forEach(s=>{e.addEventListener(s,()=>{this.isDragging=!1})}),e.addEventListener("drop",s=>this.handleDrop(s),!1),this.$refs.files.addEventListener("change",s=>this.processFiles(s.currentTarget.files))},async uploadFiles(){const e=this.files.filter(t=>t.uploaded===!1&&t.progress===0&&t.failed===!1);for(let t=0;t{const r=new FormData;r.append("file",s.file),U.post("/api/medias",r,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:o=>{s.uploaded=!0,s.progress=100,d(o)},error:o=>{e[t].failed=!0,e[t].error=o}})})}catch{s.failed=!0}}},handleDrop(e){this.processFiles(e.dataTransfer.files),e.preventDefault(),e.stopPropagation()},preventDefaults(e){e.preventDefault(),e.stopPropagation()},getAllParents(e){let t=[];for(;e.parentNode&&e.parentNode.nodeName.toLowerCase()!="body";)e=e.parentNode,t.push(e);return t},triggerManualUpload(e){const t=e.target;if(t!==null){const c=this.getAllParents(t).map(d=>{const n=d.getAttribute("class");if(n)return n.split(" ")});if(t.getAttribute("class")){const d=t.getAttribute("class").split(" ");c.push(d)}c.flat().includes("ns-scrollbar")||this.$refs.files.click()}},processFiles(e){Array.from(e).filter(c=>(console.log(this),Object.values(window.ns.medias.mimes).includes(c.type))).forEach(c=>{this.files.unshift({file:c,uploaded:!1,failed:!1,progress:0})})},select(e){this.pages.forEach(t=>t.selected=!1),e.selected=!0,e.name==="gallery"?this.loadGallery():e.name==="upload"&&this.loadUploadScreen()},loadGallery(e=null){e=e===null?this.queryPage:e,this.queryPage=e,U.get(`/api/medias?page=${e}&user_id=${this.user_id}${this.searchField.length>0?`&search=${this.searchField}`:""}`).subscribe(t=>{t.data.forEach(s=>s.selected=!1),this.response=t})},submitChange(e,t){U.put(`/api/medias/${t.id}`,{name:e.srcElement.textContent}).subscribe({next:s=>{t.fileEdit=!1,$.success(s.message,"OK").subscribe()},error:s=>{t.fileEdit=!1,$.success(s.message||_("An unexpected error occured."),"OK").subscribe()}})},useSelectedEntries(){this.popup.params.resolve({event:"use-selected",value:this.response.data.filter(e=>e.selected)}),this.popup.close()},selectResource(e){this.bulkSelect||this.response.data.forEach((t,s)=>{s!==this.response.data.indexOf(e)&&(t.selected=!1)}),e.fileEdit=!1,e.selected=!e.selected},isImage(e){return Object.keys(ns.medias.imageMimes).includes(e.extension)}}},hr={class:"sidebar w-48 md:h-full flex-shrink-0"},fr={class:"text-xl font-bold my-4 text-center"},mr={class:"sidebar-menus flex md:block mt-8"},gr=["onClick"],br={key:0,class:"content flex-auto w-full flex-col overflow-hidden flex"},_r={key:0,class:"p-2 flex bg-box-background flex-shrink-0 justify-between"},pr=l("div",null,null,-1),yr={class:"cursor-pointer text-lg md:text-xl font-bold text-center text-primary mb-4"},vr={style:{display:"none"},type:"file",name:"",multiple:"",ref:"files",id:""},kr={class:"rounded bg-box-background shadow w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},wr={key:0},xr={key:0,class:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},Dr=["onClick"],Cr=l("i",{class:"las la-eye"},null,-1),Mr={class:"ml-2"},Tr={key:1,class:"h-full w-full items-center justify-center flex text-center text-soft-tertiary"},Sr={key:1,class:"content flex-auto flex-col w-full overflow-hidden flex"},$r={key:0,class:"p-2 flex bg-box-background flex-shrink-0 justify-between"},Er=l("div",null,null,-1),Rr={class:"flex flex-auto overflow-hidden"},Fr={class:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},Or={class:"p-2 border-b border-box-background"},Pr={class:"ns-input border-2 rounded border-input-edge bg-input-background flex"},Ar=["placeholder"],jr={key:0,class:"flex items-center justify-center w-20 p-1"},Hr={class:"flex flex-auto"},Ur={class:"p-2 overflow-x-auto"},Lr={class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"},Yr={class:"p-2"},Vr=["onClick"],Br=["src","alt"],Ir={key:1,class:"object-cover h-full flex items-center justify-center"},Nr={key:0,class:"flex flex-auto items-center justify-center"},zr={class:"text-2xl font-bold"},qr={id:"preview",class:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0"},Wr={key:0,class:"h-64 bg-gray-800 flex items-center justify-center"},Gr=["src","alt"],Kr={key:1,class:"object-cover h-full flex items-center justify-center"},Qr={key:1,id:"details",class:"p-4 text-gray-700 text-sm"},Zr={class:"flex flex-col mb-2"},Xr={class:"font-bold block"},Jr=["contenteditable"],ed={class:"flex flex-col mb-2"},td={class:"font-bold block"},sd={class:"flex flex-col mb-2"},nd={class:"font-bold block"},ld={class:"py-2 pr-2 flex ns-media-footer flex-shrink-0 justify-between"},id={class:"flex -mx-2 flex-shrink-0"},ad={key:0,class:"px-2"},rd={class:"ns-button shadow rounded overflow-hidden info"},dd=l("i",{class:"las la-times"},null,-1),od={key:1,class:"px-2"},ud={class:"ns-button shadow rounded overflow-hidden info"},cd=l("i",{class:"las la-check-circle"},null,-1),hd={key:2,class:"px-2"},fd={class:"ns-button shadow rounded overflow-hidden warning"},md=l("i",{class:"las la-trash"},null,-1),gd={class:"flex-shrink-0 -mx-2 flex"},bd={class:"px-2"},_d={class:"rounded shadow overflow-hidden flex text-sm"},pd=["disabled"],yd=l("hr",{class:"border-r border-gray-700"},null,-1),vd=["disabled"],kd={key:0,class:"px-2"},wd={class:"ns-button info"};function xd(e,t,s,c,d,n){const r=w("ns-close-button");return i(),a("div",{class:m(["flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",n.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full"]),id:"ns-media"},[l("div",hr,[l("h3",fr,h(n.__("Medias Manager")),1),l("ul",mr,[(i(!0),a(p,null,D(d.pages,(o,f)=>(i(),a("li",{onClick:g=>n.select(o),class:m(["py-2 px-3 cursor-pointer border-l-8",o.selected?"active":""]),key:f},h(o.label),11,gr))),128))])]),n.currentPage.name==="upload"?(i(),a("div",br,[n.isPopup?(i(),a("div",_r,[pr,l("div",null,[T(r,{onClick:t[0]||(t[0]=o=>n.popupInstance.close())})])])):u("",!0),l("div",{id:"dropping-zone",onClick:t[1]||(t[1]=o=>n.triggerManualUpload(o)),class:m([d.isDragging?"border-dashed border-2":"","flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center"])},[l("h3",yr,h(n.__("Click Here Or Drop Your File To Upload")),1),l("input",vr,null,512),l("div",kr,[d.files.length>0?(i(),a("ul",wr,[(i(!0),a(p,null,D(d.files,(o,f)=>(i(),a("li",{class:m([o.failed===!1?"border-info-secondary":"border-error-secondary","p-2 mb-2 border-b-2 flex items-center justify-between"]),key:f},[l("span",null,h(o.file.name),1),o.failed===!1?(i(),a("span",xr,h(o.progress)+"%",1)):u("",!0),o.failed===!0?(i(),a("div",{key:1,onClick:g=>n.openError(o),class:"rounded bg-error-primary hover:bg-error-secondary hover:text-white flex items-center justify-center text-xs p-2 cursor-pointer"},[Cr,y(),l("span",Mr,h(n.__("See Error")),1)],8,Dr)):u("",!0)],2))),128))])):u("",!0),d.files.length===0?(i(),a("div",Tr,h(n.__("Your uploaded files will displays here.")),1)):u("",!0)])],2)])):u("",!0),n.currentPage.name==="gallery"?(i(),a("div",Sr,[n.isPopup?(i(),a("div",$r,[Er,l("div",null,[T(r,{onClick:t[2]||(t[2]=o=>n.popupInstance.close())})])])):u("",!0),l("div",Rr,[l("div",Fr,[l("div",Or,[l("div",Pr,[R(l("input",{id:"search",type:"text","onUpdate:modelValue":t[3]||(t[3]=o=>d.searchField=o),placeholder:n.__("Search Medias"),class:"px-4 block w-full sm:text-sm sm:leading-5 h-10"},null,8,Ar),[[A,d.searchField]]),d.searchField.length>0?(i(),a("div",jr,[l("button",{onClick:t[4]||(t[4]=o=>d.searchField=""),class:"h-full w-full rounded-tr rounded-br overflow-hidden"},h(n.__("Cancel")),1)])):u("",!0)])]),l("div",Hr,[l("div",Ur,[l("div",Lr,[(i(!0),a(p,null,D(d.response.data,(o,f)=>(i(),a("div",{key:f,class:""},[l("div",Yr,[l("div",{onClick:g=>n.selectResource(o),class:m([o.selected?"ns-media-image-selected ring-4":"","rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center"])},[n.isImage(o)?(i(),a("img",{key:0,class:"object-cover h-full",src:o.sizes.thumb,alt:o.name},null,8,Br)):u("",!0),n.isImage(o)?u("",!0):(i(),a("div",Ir,[l("i",{class:m([d.fileIcons[o.extension]||d.fileIcons.unknown,"las text-8xl text-white"])},null,2)]))],10,Vr)])]))),128))])]),d.response.data.length===0?(i(),a("div",Nr,[l("h3",zr,h(n.__("Nothing has already been uploaded")),1)])):u("",!0)])]),l("div",qr,[n.panelOpened?(i(),a("div",Wr,[n.isImage(n.selectedResource)?(i(),a("img",{key:0,class:"object-cover h-full",src:n.selectedResource.sizes.thumb,alt:n.selectedResource.name},null,8,Gr)):u("",!0),n.isImage(n.selectedResource)?u("",!0):(i(),a("div",Kr,[l("i",{class:m([d.fileIcons[n.selectedResource.extension]||d.fileIcons.unknown,"las text-8xl text-white"])},null,2)]))])):u("",!0),n.panelOpened?(i(),a("div",Qr,[l("p",Zr,[l("strong",Xr,h(n.__("File Name"))+": ",1),l("span",{class:m(["p-2",n.selectedResource.fileEdit?"border-b border-input-edge bg-input-background":""]),onBlur:t[5]||(t[5]=o=>n.submitChange(o,n.selectedResource)),contenteditable:n.selectedResource.fileEdit?"true":"false",onClick:t[6]||(t[6]=o=>n.selectedResource.fileEdit=!0)},h(n.selectedResource.name),43,Jr)]),l("p",ed,[l("strong",td,h(n.__("Uploaded At"))+":",1),l("span",null,h(n.selectedResource.created_at),1)]),l("p",sd,[l("strong",nd,h(n.__("By"))+" :",1),l("span",null,h(n.selectedResource.user.username),1)])])):u("",!0)])]),l("div",ld,[l("div",id,[d.bulkSelect?(i(),a("div",ad,[l("div",rd,[l("button",{onClick:t[7]||(t[7]=o=>n.cancelBulkSelect()),class:"py-2 px-3"},[dd,y(" "+h(n.__("Cancel")),1)])])])):u("",!0),n.hasOneSelected&&!d.bulkSelect?(i(),a("div",od,[l("div",ud,[l("button",{onClick:t[8]||(t[8]=o=>d.bulkSelect=!0),class:"py-2 px-3"},[cd,y(" "+h(n.__("Bulk Select")),1)])])])):u("",!0),n.hasOneSelected?(i(),a("div",hd,[l("div",fd,[l("button",{onClick:t[9]||(t[9]=o=>n.deleteSelected()),class:"py-2 px-3"},[md,y(" "+h(n.__("Delete")),1)])])])):u("",!0)]),l("div",gd,[l("div",bd,[l("div",_d,[l("div",{class:m(["ns-button",d.response.current_page===1?"disabled cursor-not-allowed":"info"])},[l("button",{disabled:d.response.current_page===1,onClick:t[10]||(t[10]=o=>n.loadGallery(d.response.current_page-1)),class:"p-2"},h(n.__("Previous")),9,pd)],2),yd,l("div",{class:m(["ns-button",d.response.current_page===d.response.last_page?"disabled cursor-not-allowed":"info"])},[l("button",{disabled:d.response.current_page===d.response.last_page,onClick:t[11]||(t[11]=o=>n.loadGallery(d.response.current_page+1)),class:"p-2"},h(n.__("Next")),9,vd)],2)])]),n.isPopup&&n.hasOneSelected?(i(),a("div",kd,[l("div",wd,[l("button",{class:"rounded shadow p-2 text-sm",onClick:t[12]||(t[12]=o=>n.useSelectedEntries())},h(n.__("Use Selected")),1)])])):u("",!0)])])])):u("",!0)],2)}const pe=C(cr,[["render",xd]]),vc=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"})),Dd={computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},data(){return{fileIcons:_e}},props:["placeholder","leading","type","field"],mounted(){},methods:{isImage(e){return Object.keys(ns.medias.imageMimes).includes(e.extension)},toggleMedia(){new Promise((t,s)=>{L.show(pe,{resolve:t,reject:s,...this.field.data||{}})}).then(t=>{t.event==="use-selected"&&(!this.field.data||this.field.data.type==="url"?this.field.value=t.value[0].sizes.original:!this.field.data||this.field.data.type==="model"?(this.field.value=t.value[0].id,this.field.data.model=t.value[0]):this.field.value=t.value[0].sizes.original,this.$forceUpdate())})}}},Cd={class:"flex flex-col mb-2 flex-auto ns-media"},Md=["for"],Td={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Sd={class:"text-primary sm:text-sm sm:leading-5"},$d={class:"rounded overflow-hidden flex"},Ed={key:0,class:"form-input flex w-full sm:text-sm items-center sm:leading-5 h-10"},Rd=["src","alt"],Fd={key:1,class:"object-cover flex items-center justify-center"},Od={class:"text-xs text-secondary"},Pd=["disabled","id","type","placeholder"],Ad=l("i",{class:"las la-photo-video"},null,-1),jd=[Ad];function Hd(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Cd,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Md),l("div",{class:m([n.hasError?"has-error":"is-pristine","mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",Td,[l("span",Sd,h(s.leading),1)])):u("",!0),l("div",$d,[s.field.data&&s.field.data.type==="model"?(i(),a("div",Ed,[s.field.value&&s.field.data.model.name?(i(),a(p,{key:0},[n.isImage(s.field.data.model)?(i(),a("img",{key:0,class:"w-8 h-8 m-1",src:s.field.data.model.sizes.thumb,alt:s.field.data.model.name},null,8,Rd)):u("",!0),n.isImage(s.field.data.model)?u("",!0):(i(),a("div",Fd,[l("i",{class:m([d.fileIcons[s.field.data.model.extension]||d.fileIcons.unknown,"las text-3xl"])},null,2)])),l("span",Od,h(s.field.data.model.name),1)],64)):u("",!0)])):u("",!0),!s.field.data||s.field.data.type==="undefined"||s.field.data.type==="url"?R((i(),a("input",{key:1,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),disabled:s.field.disabled,onBlur:t[1]||(t[1]=o=>e.$emit("blur",this)),onChange:t[2]||(t[2]=o=>e.$emit("change",this)),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.placeholder},null,42,Pd)),[[oe,s.field.value]]):u("",!0),l("button",{onClick:t[3]||(t[3]=o=>n.toggleMedia(s.field)),class:"w-10 h-10 flex items-center justify-center border-l-2 outline-none"},jd)])],2),T(r,{field:s.field},null,8,["field"])])}const Ud=C(Dd,[["render",Hd]]),Ld={data:()=>({defaultToggledState:!1,_save:0,hasChildren:!1}),props:["href","to","label","icon","notification","toggled","identifier"],mounted(){this.hasChildren=this.$el.querySelectorAll(".submenu").length>0,this.defaultToggledState=this.toggled!==void 0?this.toggled:this.defaultToggledState,W.subject().subscribe(e=>{e.value!==this.identifier&&(this.defaultToggledState=!1)})},methods:{toggleEmit(){this.toggle().then(e=>{e&&W.emit({identifier:"side-menu.open",value:this.identifier})})},goTo(e,t){return this.$router.push(e),t.preventDefault(),!1},toggle(){return new Promise((e,t)=>{(!this.href||this.href.length===0)&&(this.defaultToggledState=!this.defaultToggledState,e(this.defaultToggledState))})}}},Yd=["href"],Vd={class:"flex items-center"},Bd={key:0,class:"rounded-full notification-label font-bold w-6 h-6 text-xs justify-center items-center flex"},Id=["href"],Nd={class:"flex items-center"},zd={key:0,class:"rounded-full notification-label font-bold w-6 h-6 text-xs justify-center items-center flex"};function qd(e,t,s,c,d,n){var r,o;return i(),a("div",null,[s.to&&!e.hasChildren?(i(),a("a",{key:0,onClick:t[0]||(t[0]=f=>n.goTo(s.to,f)),href:s.to,class:m([e.defaultToggledState?"toggled":"normal","flex justify-between py-2 border-l-8 px-3 font-bold ns-aside-menu"])},[l("span",Vd,[l("i",{class:m(["las text-lg mr-2",((r=s.icon)==null?void 0:r.length)>0?s.icon:"la-star"])},null,2),y(" "+h(s.label),1)]),s.notification>0?(i(),a("span",Bd,h(s.notification),1)):u("",!0)],10,Yd)):(i(),a("a",{key:1,onClick:t[1]||(t[1]=f=>n.toggleEmit()),href:s.href||"javascript:void(0)",class:m([e.defaultToggledState?"toggled":"normal","flex justify-between py-2 border-l-8 px-3 font-bold ns-aside-menu"])},[l("span",Nd,[l("i",{class:m(["las text-lg mr-2",((o=s.icon)==null?void 0:o.length)>0?s.icon:"la-star"])},null,2),y(" "+h(s.label),1)]),s.notification>0?(i(),a("span",zd,h(s.notification),1)):u("",!0)],10,Id)),l("ul",{class:m([e.defaultToggledState?"":"hidden","submenu-wrapper"])},[v(e.$slots,"default")],2)])}const Wd=C(Ld,[["render",qd]]),Gd={data(){return{showPanel:!1,search:"",eventListener:null}},emits:["change","blur"],props:["field"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},_filtredOptions(){let e=this._options;return this.search.length>0&&(e=this._options.filter(t=>t.label.toLowerCase().search(this.search.toLowerCase())!==-1)),e.filter(t=>t.selected===!1)},_options(){return this.field.options.map(e=>(e.selected=e.selected===void 0?!1:e.selected,this.field.value&&this.field.value.includes(e.value)&&(e.selected=!0),e))}},methods:{__:_,togglePanel(){this.field.disabled||(this.showPanel=!this.showPanel)},selectAvailableOptionIfPossible(){this._filtredOptions.length>0&&this.addOption(this._filtredOptions[0])},addOption(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout(()=>{this.search=""},100))},removeOption(e,t){if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout(()=>{this.search=""},100),!1}},mounted(){this.field.value&&this.field.value.reverse().forEach(t=>{const s=this.field.options.filter(c=>c.value===t);s.length>0&&this.addOption(s[0])}),this.eventListener=document.addEventListener("click",e=>{let s=e.target.parentElement,c=!1;if(this.showPanel){for(;s;){if(s&&s.classList.contains("ns-multiselect")&&!s.classList.contains("arrows")){c=!0;break}s=s.parentElement}c===!1&&this.togglePanel()}})}},Kd={class:"flex flex-col ns-multiselect"},Qd=["for"],Zd={class:"flex flex-col"},Xd={class:"flex -mx-1 -my-1 flex-wrap"},Jd={class:"rounded bg-info-secondary text-white flex justify-between p-1 items-center"},eo={class:"pr-8"},to=["onClick"],so=l("i",{class:"las la-times"},null,-1),no=[so],lo={class:"arrows ml-1"},io={class:"ns-dropdown shadow"},ao={class:"search border-b border-input-option-hover"},ro={class:"h-40 overflow-y-auto"},oo=["onClick"],uo={key:0,class:"las la-check"},co={key:0,class:"p-2 text-center text-primary"},ho={class:"my-2"};function fo(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Kd,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-secondary":"text-primary","block mb-1 leading-5 font-medium"])},[v(e.$slots,"default")],10,Qd),l("div",Zd,[l("div",{onClick:t[0]||(t[0]=o=>n.togglePanel()),class:m([s.field.disabled?"bg-input-disabled":"","overflow-y-auto flex select-preview justify-between rounded border-2 border-input-option-hover p-2 items-start"]),style:{"max-height":"150px"}},[l("div",Xd,[(i(!0),a(p,null,D(n._options.filter(o=>o.selected),(o,f)=>(i(),a("div",{key:f,class:"px-1 my-1"},[l("div",Jd,[l("span",eo,h(o.label),1),l("button",{onClick:g=>n.removeOption(o,g),class:"rounded outline-none hover:bg-info-tertiary h-6 w-6 flex items-center justify-center"},no,8,to)])]))),128))]),l("div",lo,[l("i",{class:m(["las la-angle-down",d.showPanel?"hidden":""])},null,2),l("i",{class:m(["las la-angle-up",d.showPanel?"":"hidden"])},null,2)])],2),d.showPanel?(i(),a("div",{key:0,class:m(["h-0 z-10",d.showPanel?"shadow":""])},[l("div",io,[l("div",ao,[R(l("input",{onKeypress:t[1]||(t[1]=Y(o=>n.selectAvailableOptionIfPossible(),["enter"])),"onUpdate:modelValue":t[2]||(t[2]=o=>d.search=o),class:"p-2 w-full bg-transparent text-primary outline-none",placeholder:"Search"},null,544),[[A,d.search]])]),l("div",ro,[(i(!0),a(p,null,D(n._filtredOptions,(o,f)=>(i(),a("div",{onClick:g=>n.addOption(o),key:f,class:m([o.selected?"bg-info-secondary text-white":"text-primary","option p-2 flex justify-between cursor-pointer hover:bg-info-tertiary hover:text-white"])},[l("span",null,h(o.label),1),l("span",null,[o.checked?(i(),a("i",uo)):u("",!0)])],10,oo))),128))]),n._options.length===0?(i(),a("div",co,h(n.__("Nothing to display")),1)):u("",!0)])],2)):u("",!0)]),l("div",ho,[T(r,{field:s.field},null,8,["field"])])])}const mo=C(Gd,[["render",fo]]),go={},bo={class:"my-4"},_o={class:"font-bold text-2xl"},po={class:"text-primary"};function yo(e,t){return i(),a("div",bo,[l("h2",_o,[v(e.$slots,"title")]),l("span",po,[v(e.$slots,"description")])])}const vo=C(go,[["render",yo]]),ko={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:_,selectOption(e){this.$emit("select",e),this.searchText="",this.results=[]},renderLabel(e,t){return typeof t=="object"?t.map(s=>e[s]).join(" "):e[t]}},watch:{searchText(){clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchText.length>0&&U[this.method||"post"](this.url,{[this.searchArgument||"search"]:this.searchText}).subscribe({next:e=>{this.results=e},error:e=>{$.error(e.message||_("An unexpected error occurred.")).subscribe()}})},1e3)}},mounted(){}},wo={class:"ns-search"},xo={class:"input-group info border-2"},Do=["placeholder"],Co={class:"relative"},Mo={class:"w-full absolute shadow-lg"},To={key:0,class:"ns-vertical-menu"},So=["onClick"];function $o(e,t,s,c,d,n){return i(),a("div",wo,[l("div",xo,[R(l("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=r=>d.searchText=r),class:"p-2 w-full outline-none",placeholder:s.placeholder||n.__("Search..."),id:""},null,8,Do),[[A,d.searchText]])]),l("div",Co,[l("div",Mo,[d.results.length>0&&d.searchText.length>0?(i(),a("ul",To,[(i(!0),a(p,null,D(d.results,(r,o)=>(i(),a("li",{class:"border-b p-2 cursor-pointer",onClick:f=>n.selectOption(r),key:o},h(n.renderLabel(r,s.label)),9,So))),128))])):u("",!0)])])])}const Eo=C(ko,[["render",$o]]),Ro={data:()=>({searchField:"",showResults:!1}),name:"ns-search-select",emits:["saved","change"],props:["name","placeholder","field","leading"],computed:{selectedOptionLabel(){if(this.field.value===null||this.field.value===void 0)return _("Choose...");const e=this.field.options.filter(t=>t.value===this.field.value);return e.length>0?e[0].label:_("Choose...")},filtredOptions(){return this.searchField.length>0?this.field.options.filter(e=>new RegExp(this.searchField,"i").test(e.label)).splice(0,10):this.field.options},hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},watch:{showResults(){this.showResults===!0&&setTimeout(()=>{this.$refs.searchInputField.select()},50)}},mounted(){const e=this.field.options.filter(t=>t.value===this.field.value);e.length>0&&[null,void 0].includes(this.field.value)&&this.selectOption(e[0]),document.addEventListener("click",t=>{this.$el.contains(t.target)===!1&&(this.showResults=!1)})},methods:{__:_,selectFirstOption(){this.filtredOptions.length>0&&this.selectOption(this.filtredOptions[0])},selectOption(e){this.field.value=e.value,this.$emit("change",e.value),this.searchField="",this.showResults=!1},async triggerDynamicComponent(e){try{this.showResults=!1;const t=nsExtraComponents[e.component]||nsComponents[e.component];t===void 0&&$.error(_(`The component ${e.component} cannot be loaded. Make sure it's injected on nsExtraComponents object.`)).subscribe();const s=await new Promise((c,d)=>{const n=L.show(t,{...e.props||{},field:this.field,resolve:c,reject:d})});this.$emit("saved",s)}catch{}}}},Fo={class:"flex flex-col flex-auto ns-select"},Oo=["for"],Po={class:"text-primary text-sm"},Ao=l("i",{class:"las la-plus"},null,-1),jo=[Ao],Ho={key:0,class:"relative"},Uo={class:"w-full overflow-hidden -top-[8px] border-r-2 border-l-2 border-t rounded-b-md border-b-2 border-input-edge bg-input-background shadow z-10 absolute"},Lo={class:"border-b border-input-edge border-dashed p-2"},Yo=["placeholder"],Vo={class:"h-60 overflow-y-auto"},Bo=["onClick"];function Io(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Fo,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Oo),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.disabled?"cursor-not-allowed":"cursor-default"),"border-2 mt-1 relative rounded-md shadow-sm mb-1 flex overflow-hidden"])},[l("div",{onClick:t[0]||(t[0]=o=>!s.field.disabled&&(e.showResults=!e.showResults)),class:m([s.field.disabled?"bg-input-disabled":"bg-input-background","flex-auto h-10 sm:leading-5 py-2 px-4 flex items-center"])},[l("span",Po,h(n.selectedOptionLabel),1)],2),s.field.component&&!s.field.disabled?(i(),a("div",{key:0,onClick:t[1]||(t[1]=o=>n.triggerDynamicComponent(s.field)),class:"flex items-center justify-center w-10 hover:cursor-pointer hover:bg-input-button-hover border-l-2 border-input-edge"},jo)):u("",!0)],2),e.showResults?(i(),a("div",Ho,[l("div",Uo,[l("div",Lo,[R(l("input",{onKeypress:t[2]||(t[2]=Y(o=>n.selectFirstOption(),["enter"])),ref:"searchInputField","onUpdate:modelValue":t[3]||(t[3]=o=>e.searchField=o),type:"text",placeholder:n.__("Search result")},null,40,Yo),[[A,e.searchField]])]),l("div",Vo,[l("ul",null,[(i(!0),a(p,null,D(n.filtredOptions,o=>(i(),a("li",{onClick:f=>n.selectOption(o),class:"py-1 px-2 hover:bg-info-primary cursor-pointer text-primary"},h(o.label),9,Bo))),256))])])])])):u("",!0),T(r,{field:s.field},null,8,["field"])])}const No=C(Ro,[["render",Io]]),zo={data:()=>({}),props:["name","placeholder","field","leading"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},mounted(){},methods:{__:_}},qo={class:"flex flex-col flex-auto ns-select"},Wo=["for"],Go=["disabled","name"],Ko={value:null},Qo=["value"];function Zo(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",qo,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Wo),l("div",{class:m([n.hasError?"has-error":"is-pristine","border-2 mt-1 relative rounded-md shadow-sm mb-1 overflow-hidden"])},[R(l("select",{disabled:s.field.disabled?s.field.disabled:!1,name:s.field.name,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),class:m([n.inputClass,"form-input block w-full pl-7 pr-12 sm:text-sm sm:leading-5 h-10 appearance-none"])},[l("option",Ko,h(n.__("Choose an option")),1),(i(!0),a(p,null,D(s.field.options,(o,f)=>(i(),a("option",{key:f,value:o.value,class:"py-2"},h(o.label),9,Qo))),128))],10,Go),[[H,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const Xo=C(zo,[["render",Zo]]),Jo={data:()=>({}),props:["name","placeholder","field","leading"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},methods:{__:_,playSelectedSound(){this.field.value!==null&&this.field.value.length>0&&new Audio(this.field.value).play()}}},eu={class:"flex flex-col flex-auto"},tu=["for"],su=l("button",{class:"w-10 flex item-center justify-center"},[l("i",{class:"las la-play text-2xl"})],-1),nu=[su],lu=["disabled","name"],iu=["value"];function au(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",eu,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,tu),l("div",{class:m([n.hasError?"border-error-primary":"border-input-edge","border-2 mt-1 flex relative overflow-hidden rounded-md shadow-sm mb-1 form-input"])},[l("div",{onClick:t[0]||(t[0]=o=>n.playSelectedSound()),class:"border-r-2 border-input-edge flex-auto flex items-center justify-center hover:bg-info-tertiary hover:text-white"},nu),R(l("select",{disabled:s.field.disabled?s.field.disabled:!1,onChange:t[1]||(t[1]=o=>e.$emit("change",o)),name:s.field.name,"onUpdate:modelValue":t[2]||(t[2]=o=>s.field.value=o),class:m([n.inputClass,"text-primary block w-full pl-7 pr-12 sm:text-sm sm:leading-5 h-10 outline-none"])},[(i(!0),a(p,null,D(s.field.options,(o,f)=>(i(),a("option",{key:f,value:o.value,class:"py-2"},h(o.label),9,iu))),128))],42,lu),[[H,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const ru=C(Jo,[["render",au]]),du={data:()=>({}),mounted(){},computed:{validatedSize(){return this.size||24},validatedBorder(){return this.border||8},validatedAnimation(){return this.animation||"fast"}},props:["color","size","border","animation"]},ou={class:"flex items-center justify-center"};function uu(e,t,s,c,d,n){return i(),a("div",ou,[l("div",{class:m(["loader ease-linear rounded-full border-gray-200",n.validatedAnimation+" border-4 border-t-4 w-"+n.validatedSize+" h-"+n.validatedSize])},null,2)])}const cu=C(du,[["render",uu]]),hu={data:()=>({}),props:["href","label","active","to"],mounted(){},methods:{goTo(e,t){return this.$router.push(e),t.preventDefault(),!1}}},fu={class:"submenu"},mu=["href"],gu=["href"];function bu(e,t,s,c,d,n){return i(),a("div",null,[l("li",fu,[s.href?(i(),a("a",{key:0,class:m([s.active?"font-bold active":"normal","py-2 border-l-8 px-3 block ns-aside-submenu"]),href:s.href},[v(e.$slots,"default")],10,mu)):s.to?(i(),a("a",{key:1,class:m([s.active?"font-bold active":"normal","py-2 border-l-8 px-3 block ns-aside-submenu"]),onClick:t[0]||(t[0]=r=>n.goTo(s.to,r)),href:s.to},[v(e.$slots,"default")],10,gu)):u("",!0)])])}const _u=C(hu,[["render",bu]]),pu={props:["options","row","columns","prependOptions","showOptions","showCheckboxes"],data:()=>({optionsToggled:!1}),mounted(){},methods:{__:_,sanitizeHTML(e){var t=document.createElement("div");t.innerHTML=e;for(var s=t.getElementsByTagName("script"),c=s.length;c--;)s[c].parentNode.removeChild(s[c]);return t.innerHTML},getElementOffset(e){const t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu(e){if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout(()=>{const t=this.$el.querySelectorAll(".relative > .absolute")[0],s=this.$el.querySelectorAll(".relative")[0],c=this.getElementOffset(s);t.style.top=c.top+"px",t.style.left=c.left+"px",s!==void 0&&(s.classList.remove("relative"),s.classList.add("dropdown-holder"))},100);else{const t=this.$el.querySelectorAll(".dropdown-holder")[0];t.classList.remove("dropdown-holder"),t.classList.add("relative")}},handleChanged(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync(e){e.confirm!==null?Popup.show(V,{title:e.confirm.title||_("Confirm Your Action"),message:e.confirm.message||_("Would you like to delete this entry?"),onAction:t=>{t&&U[e.type.toLowerCase()](e.url).subscribe(s=>{$.success(s.message).subscribe(),this.$emit("reload",this.row)},s=>{this.toggleMenu(),$.error(s.message).subscribe()})}}):(W.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup(e,t){const s=window.nsExtraComponents[e.component];if(e.component)return s?new Promise((c,d)=>{Popup.show(s,{resolve:c,reject:d,row:t,action:e})}):$.error(_(`Unable to load the component "${e.component}". Make sure the component is registered to "nsExtraComponents".`)).subscribe();this.triggerAsync(e)}}},yu={key:0,class:"font-sans p-2"},vu={key:1,class:"font-sans p-2"},ku={class:""},wu=l("i",{class:"las la-ellipsis-h"},null,-1),xu={class:"relative"},Du={key:0,class:"zoom-in-entrance border border-box-edge anim-duration-300 z-50 origin-bottom-right w-56 mt-2 absolute rounded-md shadow-lg ns-menu-wrapper"},Cu={class:"rounded-md shadow-xs"},Mu={class:"py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"},Tu=["href","target","innerHTML"],Su=["onClick","innerHTML"],$u=["href","innerHTML"],Eu=["innerHTML"],Ru={class:"flex md:-mx-1 md:flex-wrap flex-col md:flex-row text-xs"},Fu={class:"md:px-1 w-full md:w-1/2 lg:w-2/4"},Ou=["innerHTML"],Pu={key:2},Au={key:2,class:"font-sans p-2 flex flex-col items-center justify-center"},ju={class:""},Hu=l("i",{class:"las la-ellipsis-h"},null,-1),Uu={class:"relative"},Lu={key:0,class:"zoom-in-entrance border border-box-edge anim-duration-300 z-50 origin-bottom-right -ml-28 w-56 mt-2 absolute rounded-md shadow-lg ns-menu-wrapper"},Yu={class:"rounded-md shadow-xs"},Vu={class:"py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"},Bu=["href","target","innerHTML"],Iu=["onClick","innerHTML"];function Nu(e,t,s,c,d,n){const r=w("ns-checkbox");return i(),a("tr",{class:m(["ns-table-row border text-sm",s.row.$cssClass?s.row.$cssClass:""])},[s.showCheckboxes?(i(),a("td",yu,[T(r,{onChange:t[0]||(t[0]=o=>n.handleChanged(o)),checked:s.row.$checked},null,8,["checked"])])):u("",!0),s.prependOptions&&s.showOptions?(i(),a("td",vu,[l("div",ku,[l("button",{onClick:t[1]||(t[1]=o=>n.toggleMenu(o)),class:m([s.row.$toggled?"active":"","ns-inset-button outline-none rounded-full w-24 text-sm p-1 border"])},[wu,y(" "+h(n.__("Options")),1)],2),s.row.$toggled?(i(),a("div",{key:0,onClick:t[2]||(t[2]=o=>n.toggleMenu(o)),class:"absolute w-full h-full z-10 top-0 left-0"})):u("",!0),l("div",xu,[s.row.$toggled?(i(),a("div",Du,[l("div",Cu,[l("div",Mu,[(i(!0),a(p,null,D(s.row.$actions,(o,f)=>(i(),a(p,{key:f},[["GOTO","TAB"].includes(o.type)?(i(),a("a",{key:0,href:o.url,target:o.type==="TAB"?"_blank":"_self",class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Tu)):u("",!0),["GET","DELETE","POPUP"].includes(o.type)?(i(),a("a",{key:1,href:"javascript:void(0)",onClick:g=>n.triggerAsync(o),class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Su)):u("",!0)],64))),128))])])])):u("",!0)])])])):u("",!0),(i(!0),a(p,null,D(s.columns,(o,f)=>(i(),a("td",{key:f,class:"font-sans p-2"},[s.row[f]&&s.row[f].type&&s.row[f].type==="link"?(i(),a("a",{key:0,target:"_blank",href:s.row[f].href,innerHTML:n.sanitizeHTML(s.row[f].label)},null,8,$u)):u("",!0),typeof s.row[f]=="string"||typeof s.row[f]=="number"?(i(),a(p,{key:1},[o.attributes&&o.attributes.length>0?(i(),a(p,{key:0},[l("h3",{class:"fond-bold text-lg",innerHTML:n.sanitizeHTML(s.row[f])},null,8,Eu),l("div",Ru,[(i(!0),a(p,null,D(o.attributes,g=>(i(),a("div",Fu,[l("strong",null,h(g.label),1),y(": "+h(s.row[g.column]),1)]))),256))])],64)):(i(),a("div",{key:1,innerHTML:n.sanitizeHTML(s.row[f])},null,8,Ou))],64)):u("",!0),s.row[f]===null?(i(),a("div",Pu,h(n.__("Undefined")),1)):u("",!0)]))),128)),!s.prependOptions&&s.showOptions?(i(),a("td",Au,[l("div",ju,[l("button",{onClick:t[3]||(t[3]=o=>n.toggleMenu(o)),class:m([s.row.$toggled?"active":"","ns-inset-button outline-none rounded-full w-24 text-sm p-1 border"])},[Hu,y(" "+h(n.__("Options")),1)],2),s.row.$toggled?(i(),a("div",{key:0,onClick:t[4]||(t[4]=o=>n.toggleMenu(o)),class:"absolute w-full h-full z-10 top-0 left-0"})):u("",!0),l("div",Uu,[s.row.$toggled?(i(),a("div",Lu,[l("div",Yu,[l("div",Vu,[(i(!0),a(p,null,D(s.row.$actions,(o,f)=>(i(),a(p,{key:f},[["GOTO","TAB"].includes(o.type)?(i(),a("a",{key:0,href:o.url,target:o.type==="TAB"?"_blank":"_self",class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Bu)):u("",!0),["GET","DELETE","POPUP"].includes(o.type)?(i(),a("a",{key:1,href:"javascript:void(0)",onClick:g=>n.triggerAsync(o),class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Iu)):u("",!0)],64))),128))])])])):u("",!0)])])])):u("",!0)],2)}const zu=C(pu,[["render",Nu]]),qu={data(){return{childrens:[],tabState:new $e}},props:["active"],computed:{activeComponent(){const e=this.childrens.filter(t=>t.active);return e.length>0?e[0]:!1}},beforeUnmount(){this.tabState.unsubscribe()},watch:{active(e,t){this.childrens.forEach(s=>{s.active=s.identifier===e,s.active&&this.toggle(s)})}},mounted(){this.buildChildrens(this.active)},methods:{__:_,toggle(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier),this.tabState.next(e)},buildChildrens(e){this.childrens=Array.from(this.$el.querySelectorAll(".ns-tab-item")).map(s=>{const c=s.getAttribute("identifier")||void 0;let d=!0;return s.getAttribute("visible")&&(d=s.getAttribute("visible")==="true"),{el:s,active:!!(e&&e===c),identifier:c,initialized:!1,visible:d,label:s.getAttribute("label")||_("Unamed Tab")}}).filter(s=>s.visible),!(this.childrens.filter(s=>s.active).length>0)&&this.childrens.length>0&&(this.childrens[0].active=!0),this.childrens.forEach(s=>{s.active&&this.toggle(s)})}}},Wu=["selected-tab"],Gu={class:"header ml-4 flex justify-between",style:{"margin-bottom":"-1px"}},Ku={class:"flex flex-auto"},Qu=["onClick"];function Zu(e,t,s,c,d,n){return i(),a("div",{class:"tabs flex flex-col flex-auto ns-tab overflow-hidden","selected-tab":n.activeComponent.identifier},[l("div",Gu,[l("div",Ku,[(i(!0),a(p,null,D(d.childrens,(r,o)=>(i(),a("div",{key:r.identifier,onClick:f=>n.toggle(r),class:m([s.active===r.identifier?"border-b-0 active z-10":"border inactive","tab rounded-tl rounded-tr border px-3 py-2 cursor-pointer"]),style:{"margin-right":"-1px"}},h(r.label),11,Qu))),128))]),l("div",null,[v(e.$slots,"extra")])]),v(e.$slots,"default")],8,Wu)}const Xu=C(qu,[["render",Zu]]),Ju={data(){return{selectedTab:{},tabStateSubscriber:null}},computed:{},mounted(){this.tabStateSubscriber=this.$parent.tabState.subscribe(e=>{this.selectedTab=e})},unmounted(){this.tabStateSubscriber.unsubscribe()},props:["label","identifier","padding"]},ec=["label","identifier"];function tc(e,t,s,c,d,n){return i(),a("div",{class:m([d.selectedTab.identifier!==s.identifier?"hidden":"","ns-tab-item flex flex-auto overflow-hidden"]),label:s.label,identifier:s.identifier},[d.selectedTab.identifier===s.identifier?(i(),a("div",{key:0,class:m(["border rounded flex-auto overflow-y-auto",s.padding||"p-4"])},[v(e.$slots,"default")],2)):u("",!0)],10,ec)}const sc=C(Ju,[["render",tc]]),nc={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"]},lc={class:"flex flex-col mb-2 flex-auto ns-textarea"},ic=["for"],ac={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},rc={class:"text-secondary sm:text-sm sm:leading-5"},dc=["rows","disabled","id","type","placeholder"],oc={key:0,class:"text-xs text-secondary"};function uc(e,t,s,c,d,n){return i(),a("div",lc,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},h(s.field.label),11,ic),l("div",{class:m([n.hasError?"has-error":"is-pristine","mt-1 relative border-2 overflow-hidden rounded-md focus:shadow-sm mb-1"])},[s.leading?(i(),a("div",ac,[l("span",rc,h(s.leading),1)])):u("",!0),R(l("textarea",{rows:s.field.data&&s.field.data.rows||10,disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=r=>s.field.value=r),onBlur:t[1]||(t[1]=r=>e.$emit("blur",this)),onChange:t[2]||(t[2]=r=>e.$emit("change",this)),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5"]),placeholder:s.placeholder},null,42,dc),[[A,s.field.value]])],2),!s.field.errors||s.field.errors.length===0?(i(),a("p",oc,[v(e.$slots,"description")])):u("",!0),(i(!0),a(p,null,D(s.field.errors,(r,o)=>(i(),a("p",{key:o,class:"text-xs text-error-primary"},[r.identifier==="required"?v(e.$slots,r.identifier,{key:0},()=>[y("This field is required.")]):u("",!0),r.identifier==="email"?v(e.$slots,r.identifier,{key:1},()=>[y("This field must contain a valid email address.")]):u("",!0),r.identifier==="invalid"?v(e.$slots,r.identifier,{key:2},()=>[y(h(r.message),1)]):u("",!0)]))),128))])}const cc=C(nc,[["render",uc]]),kc=Object.freeze(Object.defineProperty({__proto__:null,nsAlertPopup:se,nsAvatar:qe,nsButton:Ze,nsCalendar:ce,nsCheckbox:ds,nsCkeditor:Fe,nsCloseButton:fs,nsConfirmPopup:V,nsCrud:vn,nsCrudForm:Nn,nsDate:Xn,nsDateRangePicker:ge,nsDateTimePicker:be,nsDatepicker:$i,nsDaterangePicker:Wi,nsDragzone:aa,nsField:Ca,nsFieldDescription:$a,nsIconButton:Fa,nsInlineMultiselect:Za,nsInput:ir,nsLink:ur,nsMediaInput:Ud,nsMenu:Wd,nsMultiselect:mo,nsNotice:Oe,nsNumpad:Pe,nsNumpadPlus:Ae,nsPOSLoadingPopup:je,nsPageTitle:vo,nsPaginate:He,nsPromptPopup:Ue,nsSearch:Eo,nsSearchSelect:No,nsSelect:Xo,nsSelectAudio:ru,nsSpinner:cu,nsSubmenu:_u,nsSwitch:ue,nsTableRow:zu,nsTabs:Xu,nsTabsItem:sc,nsTextarea:cc},Symbol.toStringTag,{value:"Module"}));export{_u as a,kc as b,$i as c,Wi as d,be as e,pe as f,Ca as g,fs as h,vc as i,Wd as n}; diff --git a/public/build/assets/dev-0f5ad8b1.js b/public/build/assets/dev-c3d47426.js similarity index 98% rename from public/build/assets/dev-0f5ad8b1.js rename to public/build/assets/dev-c3d47426.js index aa3e31a11..1951f6c0f 100644 --- a/public/build/assets/dev-0f5ad8b1.js +++ b/public/build/assets/dev-c3d47426.js @@ -1 +1 @@ -import{c as A,d as B,e as H,b as h}from"./components-ef1ba55f.js";import{h as $,c as y}from"./bootstrap-8be442b1.js";import{c as G,a as M}from"./vue-router-fe7700e6.js";import{_ as d}from"./_plugin-vue_export-helper-c27b6911.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";import{r as o,o as u,c as f,f as e,w as l,i as s,F as g,a as D,t as k}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./ns-avatar-image-35303576.js";const T={name:"date",components:{nsDatepicker:A},computed:{formattedDate(){return $(this.date).format("YYYY-MM-DD HH:MM:ss")}},data(){return{active:"demo",date:$().format(),field:{label:"Date",name:"range",description:"a date range picker",value:{startDate:$().clone().subtract(1,"week").format(),endDate:$().format()}}}}};function w(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-datepicker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Picker")]),description:l(()=>[s("A simple date picker")]),_:1}),e(p,{active:t.active,onActive:n[1]||(n[1]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{onSet:n[0]||(n[0]=i=>t.date=i),date:t.date},null,8,["date"])]),_:1})]),_:1},8,["active"])],64)}const F=d(T,[["render",w]]),P={name:"datepicker",components:{nsDaterangePicker:B},data(){return{active:"demo",field:{label:"Date",name:"range",description:"a date range picker"}}}};function C(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-daterange-picker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Range Picker")]),description:l(()=>[s("selects a range as a date.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const I=d(P,[["render",C]]),S={components:{nsDateTimePicker:H},data(){return{active:"demo",field:{label:"Date",name:"date",description:"a sample datetime field",value:""}}}};function Y(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-date-time-picker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Time Picker")]),description:l(()=>[s("A date time picker.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const L=d(S,[["render",Y]]),N={name:"index"};function R(_,n,m,b,t,v){return u(),f("h1",null,"Index")}const V=d(N,[["render",R]]),U={name:"input-label",data(){return{console,active:"demo",field:{label:"Tag Selector",name:"tag_selector",type:"inline-multiselect",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function E(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-inline-multiselect"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[2]||(n[2]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{onChange:n[0]||(n[0]=i=>console.log(i)),onBlur:n[1]||(n[1]=i=>console.log(i)),field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const W=d(U,[["render",E]]),j={},q={class:"p-4 flex flex-col flex-auto"};function z(_,n){const m=o("router-view");return u(),f("div",q,[e(m)])}const J=d(j,[["render",z]]),K={name:"input-label",data(){return{active:"demo",field:{label:"Tag Selector",name:"tag_selector",type:"multiselect",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function O(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-field"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const Q=d(K,[["render",O]]),X={name:"input-label",data(){return{active:"demo",field:{label:"Upload",name:"uploader",type:"upload",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function Z(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-field"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const ee=d(X,[["render",Z]]),te=[{path:"/",component:V},{path:"/inputs",component:J,children:[{path:"date",component:F},{path:"daterange",component:I},{path:"datetime",component:L},{path:"inline-multiselect",component:W},{path:"multiselect",component:Q},{path:"upload",component:ee}]}],ne=G({history:M(),routes:te}),x=y({});for(const _ in h)x.component(_,h[_]);x.use(ne);x.mount("#dev-app"); +import{c as A,d as B,e as H,b as h}from"./components-50630f18.js";import{h as $,c as y}from"./bootstrap-8be442b1.js";import{c as G,a as M}from"./vue-router-fe7700e6.js";import{_ as d}from"./_plugin-vue_export-helper-c27b6911.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";import{r as o,o as u,c as f,f as e,w as l,i as s,F as g,a as D,t as k}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./ns-avatar-image-35303576.js";const T={name:"date",components:{nsDatepicker:A},computed:{formattedDate(){return $(this.date).format("YYYY-MM-DD HH:MM:ss")}},data(){return{active:"demo",date:$().format(),field:{label:"Date",name:"range",description:"a date range picker",value:{startDate:$().clone().subtract(1,"week").format(),endDate:$().format()}}}}};function w(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-datepicker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Picker")]),description:l(()=>[s("A simple date picker")]),_:1}),e(p,{active:t.active,onActive:n[1]||(n[1]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{onSet:n[0]||(n[0]=i=>t.date=i),date:t.date},null,8,["date"])]),_:1})]),_:1},8,["active"])],64)}const F=d(T,[["render",w]]),P={name:"datepicker",components:{nsDaterangePicker:B},data(){return{active:"demo",field:{label:"Date",name:"range",description:"a date range picker"}}}};function C(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-daterange-picker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Range Picker")]),description:l(()=>[s("selects a range as a date.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const I=d(P,[["render",C]]),S={components:{nsDateTimePicker:H},data(){return{active:"demo",field:{label:"Date",name:"date",description:"a sample datetime field",value:""}}}};function Y(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-date-time-picker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Time Picker")]),description:l(()=>[s("A date time picker.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const L=d(S,[["render",Y]]),N={name:"index"};function R(_,n,m,b,t,v){return u(),f("h1",null,"Index")}const V=d(N,[["render",R]]),U={name:"input-label",data(){return{console,active:"demo",field:{label:"Tag Selector",name:"tag_selector",type:"inline-multiselect",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function E(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-inline-multiselect"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[2]||(n[2]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{onChange:n[0]||(n[0]=i=>console.log(i)),onBlur:n[1]||(n[1]=i=>console.log(i)),field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const W=d(U,[["render",E]]),j={},q={class:"p-4 flex flex-col flex-auto"};function z(_,n){const m=o("router-view");return u(),f("div",q,[e(m)])}const J=d(j,[["render",z]]),K={name:"input-label",data(){return{active:"demo",field:{label:"Tag Selector",name:"tag_selector",type:"multiselect",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function O(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-field"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const Q=d(K,[["render",O]]),X={name:"input-label",data(){return{active:"demo",field:{label:"Upload",name:"uploader",type:"upload",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function Z(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-field"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const ee=d(X,[["render",Z]]),te=[{path:"/",component:V},{path:"/inputs",component:J,children:[{path:"date",component:F},{path:"daterange",component:I},{path:"datetime",component:L},{path:"inline-multiselect",component:W},{path:"multiselect",component:Q},{path:"upload",component:ee}]}],ne=G({history:M(),routes:te}),x=y({});for(const _ in h)x.component(_,h[_]);x.use(ne);x.mount("#dev-app"); diff --git a/public/build/assets/ns-best-products-report-9979457f.js b/public/build/assets/ns-best-products-report-a3c9ec80.js similarity index 98% rename from public/build/assets/ns-best-products-report-9979457f.js rename to public/build/assets/ns-best-products-report-a3c9ec80.js index 8b64b16f4..e2222d893 100644 --- a/public/build/assets/ns-best-products-report-9979457f.js +++ b/public/build/assets/ns-best-products-report-a3c9ec80.js @@ -1 +1 @@ -import{a as y,b as f}from"./bootstrap-8be442b1.js";import{c as v,e as k}from"./components-ef1ba55f.js";import{_ as l,n as w}from"./currency-f8bd78d1.js";import{_ as D}from"./_plugin-vue_export-helper-c27b6911.js";import{r as b,o as n,c as a,a as e,f as p,t,F,b as C,n as _,e as i,i as u}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const N={name:"ns-best-products-report",mounted(){},components:{nsDatepicker:v,nsDateTimePicker:k},data(){return{ns:window.ns,startDateField:{name:"start_date",type:"datetime",value:ns.date.moment.startOf("day").format()},endDateField:{name:"end_date",type:"datetime",value:ns.date.moment.endOf("day").format()},report:null,sortField:{name:"sort",type:"select",label:l("Sort Results"),value:"using_quantity_asc",options:[{value:"using_quantity_asc",label:l("Using Quantity Ascending")},{value:"using_quantity_desc",label:l("Using Quantity Descending")},{value:"using_sales_asc",label:l("Using Sales Ascending")},{value:"using_sales_desc",label:l("Using Sales Descending")},{value:"using_name_asc",label:l("Using Name Ascending")},{value:"using_name_desc",label:l("Using Name Descending")}]}}},computed:{totalDebit(){return 0},totalCredit(){return 0}},props:["storeLogo","storeName"],methods:{nsCurrency:w,__:l,printSaleReport(){this.$htmlToPaper("best-products-report")},loadReport(){y.post("/api/reports/products-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,sort:this.sortField.value}).subscribe({next:d=>{d.current.products=Object.values(d.current.products),this.report=d},error:d=>{f.error(d.message).subscribe()}})}}},S={id:"report-section",class:"px-4"},B={class:"flex -mx-2"},P={class:"px-2"},R={class:"px-2"},U={class:"px-2"},q={class:"ns-button"},V=e("i",{class:"las la-sync-alt text-xl"},null,-1),j={class:"pl-2"},L={class:"px-2"},A={class:"ns-button"},O=e("i",{class:"las la-print text-xl"},null,-1),Q={class:"pl-2"},T={class:"flex -mx-2"},z={class:"px-2"},E={id:"best-products-report",class:"anim-duration-500 fade-in-entrance"},H={class:"flex w-full"},G={class:"my-4 flex justify-between w-full"},I={class:"text-primary"},J={class:"pb-1 border-b border-dashed"},K={class:"pb-1 border-b border-dashed"},M={class:"pb-1 border-b border-dashed"},W=["src","alt"],X={class:"my-4"},Y={class:"shadow ns-box"},Z={class:"ns-box-body"},$={class:"table ns-table border w-full"},ee={class:""},te={class:"p-2 text-left"},se={width:"150",class:"p-2 text-right"},re={width:"150",class:"p-2 text-right"},oe={width:"150",class:"p-2 text-right"},ne={width:"150",class:"p-2 text-right"},ae={key:0,class:""},le={class:"p-2 border"},ie={class:"p-2 border text-right"},de={class:"p-2 border text-right"},ce={class:"flex flex-col"},_e={key:0},ue={class:"p-2 border text-right"},pe={class:"flex flex-col"},he={key:0},me={key:0},be=e("i",{class:"las la-arrow-up"},null,-1),xe={key:1},ge=e("i",{class:"las la-arrow-down"},null,-1),ye={key:0,class:""},fe={colspan:"5",class:"border text-center p-2"},ve={key:1},ke={colspan:"5",class:"text-center p-2 border"},we={key:2,class:"font-semibold"},De=e("td",{colspan:"3",class:"p-2 border"},null,-1),Fe={class:"p-2 border text-right"},Ce=e("td",{class:"p-2 border text-right"},null,-1);function Ne(d,c,h,Se,o,r){const m=b("ns-date-time-picker"),x=b("ns-field");return n(),a("div",S,[e("div",B,[e("div",P,[p(m,{field:o.startDateField},null,8,["field"])]),e("div",R,[p(m,{field:o.endDateField},null,8,["field"])]),e("div",U,[e("div",q,[e("button",{onClick:c[0]||(c[0]=s=>r.loadReport()),class:"rounded flex justify-between border-box-background text-primary shadow py-1 items-center px-2"},[V,e("span",j,t(r.__("Load")),1)])])]),e("div",L,[e("div",A,[e("button",{onClick:c[1]||(c[1]=s=>r.printSaleReport()),class:"rounded flex justify-between border-box-background text-primary shadow py-1 items-center px-2"},[O,e("span",Q,t(r.__("Print")),1)])])])]),e("div",T,[e("div",z,[p(x,{field:o.sortField},null,8,["field"])])]),e("div",E,[e("div",H,[e("div",G,[e("div",I,[e("ul",null,[e("li",J,t(r.__("Date Range : {date1} - {date2}").replace("{date1}",o.startDateField.value).replace("{date2}",o.endDateField.value)),1),e("li",K,t(r.__("Document : Best Products")),1),e("li",M,t(r.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:h.storeLogo,alt:h.storeName},null,8,W)])])]),e("div",X,[e("div",Y,[e("div",Z,[e("table",$,[e("thead",ee,[e("tr",null,[e("th",te,t(r.__("Product")),1),e("th",se,t(r.__("Unit")),1),e("th",re,t(r.__("Quantity")),1),e("th",oe,t(r.__("Value")),1),e("th",ne,t(r.__("Progress")),1)])]),o.report?(n(),a("tbody",ae,[(n(!0),a(F,null,C(o.report.current.products,(s,g)=>(n(),a("tr",{key:g,class:_(s.evolution==="progress"?"bg-success-primary":"bg-error-primary")},[e("td",le,t(s.name),1),e("td",ie,t(s.unit_name),1),e("td",de,[e("div",ce,[e("span",null,[e("span",null,t(s.quantity),1)]),e("span",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-danger-light-tertiary","text-xs"])},[s.evolution==="progress"?(n(),a("span",_e,"+")):i("",!0),u(" "+t(s.quantity-s.old_quantity),1)],2)])]),e("td",ue,[e("div",pe,[e("span",null,t(r.nsCurrency(s.total_price)),1),e("span",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-danger-light-tertiary","text-xs"])},[s.evolution==="progress"?(n(),a("span",he,"+")):i("",!0),u(" "+t(r.nsCurrency(s.total_price-s.old_total_price)),1)],2)])]),e("td",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-error-light-tertiary","p-2 border text-right"])},[s.evolution==="progress"?(n(),a("span",me,[u(t(s.difference.toFixed(2))+"% ",1),be])):i("",!0),s.evolution==="regress"?(n(),a("span",xe,[u(t(s.difference.toFixed(2))+"% ",1),ge])):i("",!0)],2)],2))),128)),o.report.current.products.length===0?(n(),a("tr",ye,[e("td",fe,t(r.__("No results to show.")),1)])):i("",!0)])):i("",!0),o.report?i("",!0):(n(),a("tbody",ve,[e("tr",null,[e("td",ke,t(r.__("Start by choosing a range and loading the report.")),1)])])),o.report?(n(),a("tfoot",we,[e("tr",null,[De,e("td",Fe,t(r.nsCurrency(o.report.current.total_price)),1),Ce])])):i("",!0)])])])])])])}const Oe=D(N,[["render",Ne]]);export{Oe as default}; +import{a as y,b as f}from"./bootstrap-8be442b1.js";import{c as v,e as k}from"./components-50630f18.js";import{_ as l,n as w}from"./currency-f8bd78d1.js";import{_ as D}from"./_plugin-vue_export-helper-c27b6911.js";import{r as b,o as n,c as a,a as e,f as p,t,F,b as C,n as _,e as i,i as u}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const N={name:"ns-best-products-report",mounted(){},components:{nsDatepicker:v,nsDateTimePicker:k},data(){return{ns:window.ns,startDateField:{name:"start_date",type:"datetime",value:ns.date.moment.startOf("day").format()},endDateField:{name:"end_date",type:"datetime",value:ns.date.moment.endOf("day").format()},report:null,sortField:{name:"sort",type:"select",label:l("Sort Results"),value:"using_quantity_asc",options:[{value:"using_quantity_asc",label:l("Using Quantity Ascending")},{value:"using_quantity_desc",label:l("Using Quantity Descending")},{value:"using_sales_asc",label:l("Using Sales Ascending")},{value:"using_sales_desc",label:l("Using Sales Descending")},{value:"using_name_asc",label:l("Using Name Ascending")},{value:"using_name_desc",label:l("Using Name Descending")}]}}},computed:{totalDebit(){return 0},totalCredit(){return 0}},props:["storeLogo","storeName"],methods:{nsCurrency:w,__:l,printSaleReport(){this.$htmlToPaper("best-products-report")},loadReport(){y.post("/api/reports/products-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,sort:this.sortField.value}).subscribe({next:d=>{d.current.products=Object.values(d.current.products),this.report=d},error:d=>{f.error(d.message).subscribe()}})}}},S={id:"report-section",class:"px-4"},B={class:"flex -mx-2"},P={class:"px-2"},R={class:"px-2"},U={class:"px-2"},q={class:"ns-button"},V=e("i",{class:"las la-sync-alt text-xl"},null,-1),j={class:"pl-2"},L={class:"px-2"},A={class:"ns-button"},O=e("i",{class:"las la-print text-xl"},null,-1),Q={class:"pl-2"},T={class:"flex -mx-2"},z={class:"px-2"},E={id:"best-products-report",class:"anim-duration-500 fade-in-entrance"},H={class:"flex w-full"},G={class:"my-4 flex justify-between w-full"},I={class:"text-primary"},J={class:"pb-1 border-b border-dashed"},K={class:"pb-1 border-b border-dashed"},M={class:"pb-1 border-b border-dashed"},W=["src","alt"],X={class:"my-4"},Y={class:"shadow ns-box"},Z={class:"ns-box-body"},$={class:"table ns-table border w-full"},ee={class:""},te={class:"p-2 text-left"},se={width:"150",class:"p-2 text-right"},re={width:"150",class:"p-2 text-right"},oe={width:"150",class:"p-2 text-right"},ne={width:"150",class:"p-2 text-right"},ae={key:0,class:""},le={class:"p-2 border"},ie={class:"p-2 border text-right"},de={class:"p-2 border text-right"},ce={class:"flex flex-col"},_e={key:0},ue={class:"p-2 border text-right"},pe={class:"flex flex-col"},he={key:0},me={key:0},be=e("i",{class:"las la-arrow-up"},null,-1),xe={key:1},ge=e("i",{class:"las la-arrow-down"},null,-1),ye={key:0,class:""},fe={colspan:"5",class:"border text-center p-2"},ve={key:1},ke={colspan:"5",class:"text-center p-2 border"},we={key:2,class:"font-semibold"},De=e("td",{colspan:"3",class:"p-2 border"},null,-1),Fe={class:"p-2 border text-right"},Ce=e("td",{class:"p-2 border text-right"},null,-1);function Ne(d,c,h,Se,o,r){const m=b("ns-date-time-picker"),x=b("ns-field");return n(),a("div",S,[e("div",B,[e("div",P,[p(m,{field:o.startDateField},null,8,["field"])]),e("div",R,[p(m,{field:o.endDateField},null,8,["field"])]),e("div",U,[e("div",q,[e("button",{onClick:c[0]||(c[0]=s=>r.loadReport()),class:"rounded flex justify-between border-box-background text-primary shadow py-1 items-center px-2"},[V,e("span",j,t(r.__("Load")),1)])])]),e("div",L,[e("div",A,[e("button",{onClick:c[1]||(c[1]=s=>r.printSaleReport()),class:"rounded flex justify-between border-box-background text-primary shadow py-1 items-center px-2"},[O,e("span",Q,t(r.__("Print")),1)])])])]),e("div",T,[e("div",z,[p(x,{field:o.sortField},null,8,["field"])])]),e("div",E,[e("div",H,[e("div",G,[e("div",I,[e("ul",null,[e("li",J,t(r.__("Date Range : {date1} - {date2}").replace("{date1}",o.startDateField.value).replace("{date2}",o.endDateField.value)),1),e("li",K,t(r.__("Document : Best Products")),1),e("li",M,t(r.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:h.storeLogo,alt:h.storeName},null,8,W)])])]),e("div",X,[e("div",Y,[e("div",Z,[e("table",$,[e("thead",ee,[e("tr",null,[e("th",te,t(r.__("Product")),1),e("th",se,t(r.__("Unit")),1),e("th",re,t(r.__("Quantity")),1),e("th",oe,t(r.__("Value")),1),e("th",ne,t(r.__("Progress")),1)])]),o.report?(n(),a("tbody",ae,[(n(!0),a(F,null,C(o.report.current.products,(s,g)=>(n(),a("tr",{key:g,class:_(s.evolution==="progress"?"bg-success-primary":"bg-error-primary")},[e("td",le,t(s.name),1),e("td",ie,t(s.unit_name),1),e("td",de,[e("div",ce,[e("span",null,[e("span",null,t(s.quantity),1)]),e("span",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-danger-light-tertiary","text-xs"])},[s.evolution==="progress"?(n(),a("span",_e,"+")):i("",!0),u(" "+t(s.quantity-s.old_quantity),1)],2)])]),e("td",ue,[e("div",pe,[e("span",null,t(r.nsCurrency(s.total_price)),1),e("span",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-danger-light-tertiary","text-xs"])},[s.evolution==="progress"?(n(),a("span",he,"+")):i("",!0),u(" "+t(r.nsCurrency(s.total_price-s.old_total_price)),1)],2)])]),e("td",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-error-light-tertiary","p-2 border text-right"])},[s.evolution==="progress"?(n(),a("span",me,[u(t(s.difference.toFixed(2))+"% ",1),be])):i("",!0),s.evolution==="regress"?(n(),a("span",xe,[u(t(s.difference.toFixed(2))+"% ",1),ge])):i("",!0)],2)],2))),128)),o.report.current.products.length===0?(n(),a("tr",ye,[e("td",fe,t(r.__("No results to show.")),1)])):i("",!0)])):i("",!0),o.report?i("",!0):(n(),a("tbody",ve,[e("tr",null,[e("td",ke,t(r.__("Start by choosing a range and loading the report.")),1)])])),o.report?(n(),a("tfoot",we,[e("tr",null,[De,e("td",Fe,t(r.nsCurrency(o.report.current.total_price)),1),Ce])])):i("",!0)])])])])])])}const Oe=D(N,[["render",Ne]]);export{Oe as default}; diff --git a/public/build/assets/ns-cash-flow-report-d8680316.js b/public/build/assets/ns-cash-flow-report-7c9dff88.js similarity index 98% rename from public/build/assets/ns-cash-flow-report-d8680316.js rename to public/build/assets/ns-cash-flow-report-7c9dff88.js index 1340c1a5e..e5e4990f8 100644 --- a/public/build/assets/ns-cash-flow-report-d8680316.js +++ b/public/build/assets/ns-cash-flow-report-7c9dff88.js @@ -1 +1 @@ -import{h as b,a as y,b as f}from"./bootstrap-8be442b1.js";import{c as x,e as g}from"./components-ef1ba55f.js";import{_ as v,n as w}from"./currency-f8bd78d1.js";import{_ as D}from"./_plugin-vue_export-helper-c27b6911.js";import{r as C,o as a,c as d,a as t,f as u,t as e,F as p,b as m,i as l}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const F={name:"ns-cash-flow",props:["storeLogo","storeName"],mounted(){},components:{nsDatepicker:x,nsDateTimePicker:g},data(){return{startDateField:{value:b(ns.date.current).startOf("month").format("YYYY-MM-DD HH:mm:ss"),type:"datetimepicker"},endDateField:{value:b(ns.date.current).endOf("month").format("YYYY-MM-DD HH:mm:ss"),type:"datetimepicker"},report:new Object,ns:window.ns}},computed:{balance(){return Object.values(this.report).length===0?0:this.report.total_credit-this.report.total_debit},totalDebit(){return 0},totalCredit(){return 0}},methods:{__:v,nsCurrency:w,printSaleReport(){this.$htmlToPaper("report")},loadReport(){y.post("/api/reports/transactions",{startDate:this.startDateField.value,endDate:this.endDateField.value}).subscribe({next:c=>{this.report=c},error:c=>{f.error(c.message).subscribe()}})}}},k={id:"report-section",class:"px-4"},Y={class:"flex -mx-2"},B={class:"px-2"},R={class:"px-2"},S={class:"px-2"},j={class:"ns-button"},H=t("i",{class:"las la-sync-alt text-xl"},null,-1),N={class:"pl-2"},L={class:"px-2"},M={class:"ns-button"},O=t("i",{class:"las la-print text-xl"},null,-1),P={class:"pl-2"},T={id:"report",class:"anim-duration-500 fade-in-entrance"},V={class:"flex w-full"},A={class:"my-4 flex justify-between w-full"},E={class:"text-primary"},q={class:"pb-1 border-b border-dashed"},z={class:"pb-1 border-b border-dashed"},I={class:"pb-1 border-b border-dashed"},J=["src","alt"],K={class:"shadow rounded my-4"},Q={class:"ns-box"},U={class:"border-b ns-box-body"},W={class:"ns-table table w-full"},X={class:""},Z={class:"border p-2 text-left"},G={width:"150",class:"border border-error-secondary bg-error-primary p-2 text-right"},$={width:"150",class:"text-right border-success-secondary bg-success-primary border p-2"},tt={class:""},et={class:"p-2 border"},st=t("i",{class:"las la-arrow-right"},null,-1),rt={class:"p-2 border border-error-secondary bg-error-primary text-right"},ot={class:"p-2 border text-right border-success-secondary bg-success-primary"},at={class:"p-2 border"},dt=t("i",{class:"las la-arrow-right"},null,-1),ct={class:"p-2 border border-error-secondary bg-error-primary text-right"},nt={class:"p-2 border text-right border-success-secondary bg-success-primary"},lt={class:"font-semibold"},it={class:"p-2 border"},_t={class:"p-2 border border-error-secondary bg-error-primary text-right"},ht={class:"p-2 border text-right border-success-secondary bg-success-primary"},bt={class:"p-2 border"},ut={colspan:"2",class:"p-2 border text-right border-info-secondary bg-info-primary"};function pt(c,n,_,mt,r,s){const h=C("ns-field");return a(),d("div",k,[t("div",Y,[t("div",B,[u(h,{field:r.startDateField},null,8,["field"])]),t("div",R,[u(h,{field:r.endDateField},null,8,["field"])]),t("div",S,[t("div",j,[t("button",{onClick:n[0]||(n[0]=o=>s.loadReport()),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[H,t("span",N,e(s.__("Load")),1)])])]),t("div",L,[t("div",M,[t("button",{onClick:n[1]||(n[1]=o=>s.printSaleReport()),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[O,t("span",P,e(s.__("Print")),1)])])])]),t("div",T,[t("div",V,[t("div",A,[t("div",E,[t("ul",null,[t("li",q,e(s.__("Range : {date1} — {date2}").replace("{date1}",r.startDateField.value).replace("{date2}",r.endDateField.value)),1),t("li",z,e(s.__("Document : Sale By Payment")),1),t("li",I,e(s.__("By : {user}").replace("{user}",r.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:_.storeLogo,alt:_.storeName},null,8,J)])])]),t("div",K,[t("div",Q,[t("div",U,[t("table",W,[t("thead",X,[t("tr",null,[t("th",Z,e(s.__("Account")),1),t("th",G,e(s.__("Debit")),1),t("th",$,e(s.__("Credit")),1)])]),t("tbody",tt,[(a(!0),d(p,null,m(r.report.creditCashFlow,(o,i)=>(a(),d("tr",{key:i},[t("td",et,[st,l(),t("strong",null,e(o.account),1),l(" : "+e(o.name),1)]),t("td",rt,e(s.nsCurrency(0)),1),t("td",ot,e(s.nsCurrency(o.total)),1)]))),128)),(a(!0),d(p,null,m(r.report.debitCashFlow,(o,i)=>(a(),d("tr",{key:i},[t("td",at,[dt,l(),t("strong",null,e(o.account),1),l(" : "+e(o.name),1)]),t("td",ct,e(s.nsCurrency(o.total)),1),t("td",nt,e(s.nsCurrency(0)),1)]))),128))]),t("tfoot",lt,[t("tr",null,[t("td",it,e(s.__("Sub Total")),1),t("td",_t,e(s.nsCurrency(r.report.total_debit?r.report.total_debit:0)),1),t("td",ht,e(s.nsCurrency(r.report.total_credit?r.report.total_credit:0)),1)]),t("tr",null,[t("td",bt,e(s.__("Balance")),1),t("td",ut,e(s.nsCurrency(s.balance)),1)])])])])])])])])}const kt=D(F,[["render",pt]]);export{kt as default}; +import{h as b,a as y,b as f}from"./bootstrap-8be442b1.js";import{c as x,e as g}from"./components-50630f18.js";import{_ as v,n as w}from"./currency-f8bd78d1.js";import{_ as D}from"./_plugin-vue_export-helper-c27b6911.js";import{r as C,o as a,c as d,a as t,f as u,t as e,F as p,b as m,i as l}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const F={name:"ns-cash-flow",props:["storeLogo","storeName"],mounted(){},components:{nsDatepicker:x,nsDateTimePicker:g},data(){return{startDateField:{value:b(ns.date.current).startOf("month").format("YYYY-MM-DD HH:mm:ss"),type:"datetimepicker"},endDateField:{value:b(ns.date.current).endOf("month").format("YYYY-MM-DD HH:mm:ss"),type:"datetimepicker"},report:new Object,ns:window.ns}},computed:{balance(){return Object.values(this.report).length===0?0:this.report.total_credit-this.report.total_debit},totalDebit(){return 0},totalCredit(){return 0}},methods:{__:v,nsCurrency:w,printSaleReport(){this.$htmlToPaper("report")},loadReport(){y.post("/api/reports/transactions",{startDate:this.startDateField.value,endDate:this.endDateField.value}).subscribe({next:c=>{this.report=c},error:c=>{f.error(c.message).subscribe()}})}}},k={id:"report-section",class:"px-4"},Y={class:"flex -mx-2"},B={class:"px-2"},R={class:"px-2"},S={class:"px-2"},j={class:"ns-button"},H=t("i",{class:"las la-sync-alt text-xl"},null,-1),N={class:"pl-2"},L={class:"px-2"},M={class:"ns-button"},O=t("i",{class:"las la-print text-xl"},null,-1),P={class:"pl-2"},T={id:"report",class:"anim-duration-500 fade-in-entrance"},V={class:"flex w-full"},A={class:"my-4 flex justify-between w-full"},E={class:"text-primary"},q={class:"pb-1 border-b border-dashed"},z={class:"pb-1 border-b border-dashed"},I={class:"pb-1 border-b border-dashed"},J=["src","alt"],K={class:"shadow rounded my-4"},Q={class:"ns-box"},U={class:"border-b ns-box-body"},W={class:"ns-table table w-full"},X={class:""},Z={class:"border p-2 text-left"},G={width:"150",class:"border border-error-secondary bg-error-primary p-2 text-right"},$={width:"150",class:"text-right border-success-secondary bg-success-primary border p-2"},tt={class:""},et={class:"p-2 border"},st=t("i",{class:"las la-arrow-right"},null,-1),rt={class:"p-2 border border-error-secondary bg-error-primary text-right"},ot={class:"p-2 border text-right border-success-secondary bg-success-primary"},at={class:"p-2 border"},dt=t("i",{class:"las la-arrow-right"},null,-1),ct={class:"p-2 border border-error-secondary bg-error-primary text-right"},nt={class:"p-2 border text-right border-success-secondary bg-success-primary"},lt={class:"font-semibold"},it={class:"p-2 border"},_t={class:"p-2 border border-error-secondary bg-error-primary text-right"},ht={class:"p-2 border text-right border-success-secondary bg-success-primary"},bt={class:"p-2 border"},ut={colspan:"2",class:"p-2 border text-right border-info-secondary bg-info-primary"};function pt(c,n,_,mt,r,s){const h=C("ns-field");return a(),d("div",k,[t("div",Y,[t("div",B,[u(h,{field:r.startDateField},null,8,["field"])]),t("div",R,[u(h,{field:r.endDateField},null,8,["field"])]),t("div",S,[t("div",j,[t("button",{onClick:n[0]||(n[0]=o=>s.loadReport()),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[H,t("span",N,e(s.__("Load")),1)])])]),t("div",L,[t("div",M,[t("button",{onClick:n[1]||(n[1]=o=>s.printSaleReport()),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[O,t("span",P,e(s.__("Print")),1)])])])]),t("div",T,[t("div",V,[t("div",A,[t("div",E,[t("ul",null,[t("li",q,e(s.__("Range : {date1} — {date2}").replace("{date1}",r.startDateField.value).replace("{date2}",r.endDateField.value)),1),t("li",z,e(s.__("Document : Sale By Payment")),1),t("li",I,e(s.__("By : {user}").replace("{user}",r.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:_.storeLogo,alt:_.storeName},null,8,J)])])]),t("div",K,[t("div",Q,[t("div",U,[t("table",W,[t("thead",X,[t("tr",null,[t("th",Z,e(s.__("Account")),1),t("th",G,e(s.__("Debit")),1),t("th",$,e(s.__("Credit")),1)])]),t("tbody",tt,[(a(!0),d(p,null,m(r.report.creditCashFlow,(o,i)=>(a(),d("tr",{key:i},[t("td",et,[st,l(),t("strong",null,e(o.account),1),l(" : "+e(o.name),1)]),t("td",rt,e(s.nsCurrency(0)),1),t("td",ot,e(s.nsCurrency(o.total)),1)]))),128)),(a(!0),d(p,null,m(r.report.debitCashFlow,(o,i)=>(a(),d("tr",{key:i},[t("td",at,[dt,l(),t("strong",null,e(o.account),1),l(" : "+e(o.name),1)]),t("td",ct,e(s.nsCurrency(o.total)),1),t("td",nt,e(s.nsCurrency(0)),1)]))),128))]),t("tfoot",lt,[t("tr",null,[t("td",it,e(s.__("Sub Total")),1),t("td",_t,e(s.nsCurrency(r.report.total_debit?r.report.total_debit:0)),1),t("td",ht,e(s.nsCurrency(r.report.total_credit?r.report.total_credit:0)),1)]),t("tr",null,[t("td",bt,e(s.__("Balance")),1),t("td",ut,e(s.nsCurrency(s.balance)),1)])])])])])])])])}const kt=D(F,[["render",pt]]);export{kt as default}; diff --git a/public/build/assets/ns-low-stock-report-585a8342.js b/public/build/assets/ns-low-stock-report-2d8101fa.js similarity index 99% rename from public/build/assets/ns-low-stock-report-585a8342.js rename to public/build/assets/ns-low-stock-report-2d8101fa.js index 0e0a804ad..ac3a36230 100644 --- a/public/build/assets/ns-low-stock-report-585a8342.js +++ b/public/build/assets/ns-low-stock-report-2d8101fa.js @@ -1 +1 @@ -import{F as w,a as b,b as m}from"./bootstrap-8be442b1.js";import{c as k,e as R}from"./components-ef1ba55f.js";import{_ as u,n as v}from"./currency-f8bd78d1.js";import{k as T,b as x}from"./ns-prompt-popup-100414c5.js";import{j as N}from"./join-array-4b30b096.js";import{_ as C}from"./_plugin-vue_export-helper-c27b6911.js";import{r as P,o as c,c as i,a as e,t as s,e as h,F as y,b as f,f as S}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";const F={name:"ns-low-stock-report",props:["storeLogo","storeName"],mounted(){this.reportType=this.options[0].value,this.loadRelevantReport()},components:{nsDatepicker:k,nsDateTimePicker:R,nsPaginate:T},data(){return{ns:window.ns,products:[],options:[{label:u("Stock Report"),value:"stock_report"},{label:u("Low Stock Report"),value:"low_stock"}],stockReportResult:{},reportType:"",reportTypeName:"",unitNames:"",categoryName:"",categoryIds:[],unitIds:[],validation:new w}},watch:{reportType(){const l=this.options.filter(r=>r.value===this.reportType);l.length>0?this.reportTypeName=l[0].label:this.reportTypeName=u("N/A")}},methods:{__:u,nsCurrency:v,joinArray:N,async selectReport(){try{const l=await new Promise((r,d)=>{Popup.show(x,{label:u("Report Type"),options:this.options,resolve:r,reject:d})});this.reportType=l,this.loadRelevantReport()}catch{}},async selectUnits(){b.get("/api/units").subscribe({next:async l=>{try{const r=await new Promise((a,o)=>{Popup.show(x,{label:u("Select Units"),type:"multiselect",options:l.map(t=>({label:t.name,value:t.id})),resolve:a,reject:o})}),d=l.filter(a=>r.includes(a.id)).map(a=>a.name);this.unitNames=this.joinArray(d),this.unitIds=r,this.loadRelevantReport()}catch(r){console.log(r)}},error:l=>{m.error(u("An error has occured while loading the units.")).subscribe()}})},async selectCategories(){b.get("/api/categories").subscribe({next:async l=>{try{const r=await new Promise((a,o)=>{Popup.show(x,{label:u("Select Categories"),type:"multiselect",options:l.map(t=>({label:t.name,value:t.id})),resolve:a,reject:o})}),d=l.filter(a=>r.includes(a.id)).map(a=>a.name);this.categoryName=this.joinArray(d),this.categoryIds=r,this.loadRelevantReport()}catch(r){console.log(r)}},error:l=>{m.error(u("An error has occured while loading the categories.")).subscribe()}})},loadRelevantReport(){switch(this.reportType){case"stock_report":this.loadStockReport();break;case"low_stock":this.loadReport();break}},printSaleReport(){this.$htmlToPaper("low-stock-report")},loadStockReport(l=null){b.post(l||"/api/reports/stock-report",{categories:this.categoryIds,units:this.unitIds}).subscribe({next:r=>{this.stockReportResult=r},error:r=>{m.error(r.message).subscribe()}})},totalSum(l,r,d){if(l.data!==void 0){const o=l.data.map(t=>t.unit_quantities).map(t=>{const p=t.map(n=>n[r]*n[d]);return p.length>0?p.reduce((n,_)=>parseFloat(n)+parseFloat(_)):0});if(o.length>0)return o.reduce((t,p)=>parseFloat(t)+parseFloat(p))}return 0},sum(l,r){if(l.data!==void 0){const a=l.data.map(o=>o.unit_quantities).map(o=>{const t=o.map(p=>p[r]);return t.length>0?t.reduce((p,n)=>parseFloat(p)+parseFloat(n)):0});if(a.length>0)return a.reduce((o,t)=>parseFloat(o)+parseFloat(t))}return 0},loadReport(){b.post("/api/reports/low-stock",{categories:this.categoryIds,units:this.unitIds}).subscribe({next:l=>{this.products=l},error:l=>{m.error(l.message).subscribe()}})}}},j={id:"report-section",class:"px-4"},q={class:"flex -mx-2"},A={class:"px-2"},I={class:"ns-button"},L=e("i",{class:"las la-sync-alt text-xl"},null,-1),U={class:"pl-2"},B={class:"px-2"},D={class:"ns-button"},V=e("i",{class:"las la-print text-xl"},null,-1),E={class:"pl-2"},H={class:"px-2"},z={class:"ns-button"},G=e("i",{class:"las la-filter text-xl"},null,-1),J={class:"pl-2"},K={class:"px-2"},M={class:"ns-button"},O=e("i",{class:"las la-filter text-xl"},null,-1),W={class:"pl-2"},X={class:"px-2"},Y={class:"ns-button"},Z=e("i",{class:"las la-filter text-xl"},null,-1),Q={class:"pl-2"},$={id:"low-stock-report",class:"anim-duration-500 fade-in-entrance"},ee={class:"flex w-full"},te={class:"my-4 flex justify-between w-full"},se={class:"text-primary"},re={class:"pb-1 border-b border-dashed"},oe={class:"pb-1 border-b border-dashed"},le={class:"pb-1 border-b border-dashed"},ne=["src","alt"],ae={class:"text-primary shadow rounded my-4"},ce={class:"ns-box"},ie={key:0,class:"ns-box-body"},de={class:"table ns-table w-full"},pe={class:"border p-2 text-left"},_e={class:"border p-2 text-left"},ue={width:"150",class:"border p-2 text-right"},he={width:"150",class:"border border-info-secondary bg-info-primary p-2 text-right"},be={width:"150",class:"border border-success-secondary bg-success-primary p-2 text-right"},me={key:0},ye={colspan:"4",class:"p-2 border text-center"},xe={class:"p-2 border"},fe={class:"p-2 border"},ge={class:"p-2 border text-right"},we={class:"p-2 border text-right"},ke={class:"p-2 border border-success-secondary bg-success-primary text-right"},Re={key:1,class:"ns-box-body"},ve={class:"table ns-table w-full"},Te={class:"border p-2 text-left"},Ne={class:"border p-2 text-left"},Ce={width:"150",class:"border p-2 text-right"},Pe={width:"150",class:"border p-2 text-right"},Se={width:"150",class:"border p-2 text-right"},Fe={key:0},je={colspan:"5",class:"p-2 border text-center"},qe={class:"p-2 border"},Ae={class:"flex flex-col"},Ie={class:"p-2 border"},Le={class:"p-2 border text-right"},Ue={class:"p-2 border text-right"},Be={class:"p-2 border text-right"},De=e("td",{class:"p-2 border"},null,-1),Ve=e("td",{class:"p-2 border"},null,-1),Ee=e("td",{class:"p-2 border"},null,-1),He={class:"p-2 border text-right"},ze={class:"p-2 border text-right"},Ge={key:0,class:"flex justify-end p-2"};function Je(l,r,d,a,o,t){const p=P("ns-paginate");return c(),i("div",j,[e("div",q,[e("div",A,[e("div",I,[e("button",{onClick:r[0]||(r[0]=n=>t.loadRelevantReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[L,e("span",U,s(t.__("Load")),1)])])]),e("div",B,[e("div",D,[e("button",{onClick:r[1]||(r[1]=n=>t.printSaleReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[V,e("span",E,s(t.__("Print")),1)])])]),e("div",H,[e("div",z,[e("button",{onClick:r[2]||(r[2]=n=>t.selectReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[G,e("span",J,s(t.__("Report Type"))+" : "+s(o.reportTypeName),1)])])]),e("div",K,[e("div",M,[e("button",{onClick:r[3]||(r[3]=n=>t.selectCategories()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[O,e("span",W,s(t.__("Categories"))+" : "+s(o.categoryName||t.__("All Categories")),1)])])]),e("div",X,[e("div",Y,[e("button",{onClick:r[4]||(r[4]=n=>t.selectUnits()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[Z,e("span",Q,s(t.__("Units"))+" : "+s(o.unitNames||t.__("All Units")),1)])])])]),e("div",$,[e("div",ee,[e("div",te,[e("div",se,[e("ul",null,[e("li",re,s(t.__("Date : {date}").replace("{date}",o.ns.date.current)),1),e("li",oe,s(t.__("Document : {reportTypeName}").replace("{reportTypeName}",o.reportTypeName)),1),e("li",le,s(t.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:d.storeLogo,alt:d.storeName},null,8,ne)])])]),e("div",ae,[e("div",ce,[o.reportType==="low_stock"?(c(),i("div",ie,[e("table",de,[e("thead",null,[e("tr",null,[e("th",pe,s(t.__("Product")),1),e("th",_e,s(t.__("Unit")),1),e("th",ue,s(t.__("Threshold")),1),e("th",he,s(t.__("Quantity")),1),e("th",be,s(t.__("Price")),1)])]),e("tbody",null,[o.products.length===0?(c(),i("tr",me,[e("td",ye,[e("span",null,s(t.__("There is no product to display...")),1)])])):h("",!0),(c(!0),i(y,null,f(o.products,(n,_)=>(c(),i("tr",{key:_,class:"text-sm"},[e("td",xe,s(n.product.name),1),e("td",fe,s(n.unit.name),1),e("td",ge,s(n.low_quantity),1),e("td",we,s(n.quantity),1),e("td",ke,s(t.nsCurrency(n.quantity*n.sale_price)),1)]))),128))])])])):h("",!0),o.reportType==="stock_report"?(c(),i("div",Re,[e("table",ve,[e("thead",null,[e("tr",null,[e("th",Te,s(t.__("Product")),1),e("th",Ne,s(t.__("Unit")),1),e("th",Ce,s(t.__("Price")),1),e("th",Pe,s(t.__("Quantity")),1),e("th",Se,s(t.__("Total Price")),1)])]),e("tbody",null,[o.stockReportResult.data===void 0||o.stockReportResult.data.length===0?(c(),i("tr",Fe,[e("td",je,[e("span",null,s(t.__("There is no product to display...")),1)])])):h("",!0),o.stockReportResult.data!==void 0?(c(!0),i(y,{key:1},f(o.stockReportResult.data,n=>(c(),i(y,null,[(c(!0),i(y,null,f(n.unit_quantities,(_,g)=>(c(),i("tr",{key:g,class:"text-sm"},[e("td",qe,[e("div",Ae,[e("span",null,s(n.name),1)])]),e("td",Ie,s(_.unit.name),1),e("td",Le,s(t.nsCurrency(_.sale_price)),1),e("td",Ue,s(_.quantity),1),e("td",Be,s(t.nsCurrency(_.quantity*_.sale_price)),1)]))),128))],64))),256)):h("",!0)]),e("tfoot",null,[e("tr",null,[De,Ve,Ee,e("td",He,s(t.sum(o.stockReportResult,"quantity")),1),e("td",ze,s(t.nsCurrency(t.totalSum(o.stockReportResult,"sale_price","quantity"))),1)])])]),o.stockReportResult.data?(c(),i("div",Ge,[S(p,{onLoad:r[5]||(r[5]=n=>t.loadStockReport(n)),pagination:o.stockReportResult},null,8,["pagination"])])):h("",!0)])):h("",!0)])])])])}const tt=C(F,[["render",Je]]);export{tt as default}; +import{F as w,a as b,b as m}from"./bootstrap-8be442b1.js";import{c as k,e as R}from"./components-50630f18.js";import{_ as u,n as v}from"./currency-f8bd78d1.js";import{k as T,b as x}from"./ns-prompt-popup-100414c5.js";import{j as N}from"./join-array-4b30b096.js";import{_ as C}from"./_plugin-vue_export-helper-c27b6911.js";import{r as P,o as c,c as i,a as e,t as s,e as h,F as y,b as f,f as S}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";const F={name:"ns-low-stock-report",props:["storeLogo","storeName"],mounted(){this.reportType=this.options[0].value,this.loadRelevantReport()},components:{nsDatepicker:k,nsDateTimePicker:R,nsPaginate:T},data(){return{ns:window.ns,products:[],options:[{label:u("Stock Report"),value:"stock_report"},{label:u("Low Stock Report"),value:"low_stock"}],stockReportResult:{},reportType:"",reportTypeName:"",unitNames:"",categoryName:"",categoryIds:[],unitIds:[],validation:new w}},watch:{reportType(){const l=this.options.filter(r=>r.value===this.reportType);l.length>0?this.reportTypeName=l[0].label:this.reportTypeName=u("N/A")}},methods:{__:u,nsCurrency:v,joinArray:N,async selectReport(){try{const l=await new Promise((r,d)=>{Popup.show(x,{label:u("Report Type"),options:this.options,resolve:r,reject:d})});this.reportType=l,this.loadRelevantReport()}catch{}},async selectUnits(){b.get("/api/units").subscribe({next:async l=>{try{const r=await new Promise((a,o)=>{Popup.show(x,{label:u("Select Units"),type:"multiselect",options:l.map(t=>({label:t.name,value:t.id})),resolve:a,reject:o})}),d=l.filter(a=>r.includes(a.id)).map(a=>a.name);this.unitNames=this.joinArray(d),this.unitIds=r,this.loadRelevantReport()}catch(r){console.log(r)}},error:l=>{m.error(u("An error has occured while loading the units.")).subscribe()}})},async selectCategories(){b.get("/api/categories").subscribe({next:async l=>{try{const r=await new Promise((a,o)=>{Popup.show(x,{label:u("Select Categories"),type:"multiselect",options:l.map(t=>({label:t.name,value:t.id})),resolve:a,reject:o})}),d=l.filter(a=>r.includes(a.id)).map(a=>a.name);this.categoryName=this.joinArray(d),this.categoryIds=r,this.loadRelevantReport()}catch(r){console.log(r)}},error:l=>{m.error(u("An error has occured while loading the categories.")).subscribe()}})},loadRelevantReport(){switch(this.reportType){case"stock_report":this.loadStockReport();break;case"low_stock":this.loadReport();break}},printSaleReport(){this.$htmlToPaper("low-stock-report")},loadStockReport(l=null){b.post(l||"/api/reports/stock-report",{categories:this.categoryIds,units:this.unitIds}).subscribe({next:r=>{this.stockReportResult=r},error:r=>{m.error(r.message).subscribe()}})},totalSum(l,r,d){if(l.data!==void 0){const o=l.data.map(t=>t.unit_quantities).map(t=>{const p=t.map(n=>n[r]*n[d]);return p.length>0?p.reduce((n,_)=>parseFloat(n)+parseFloat(_)):0});if(o.length>0)return o.reduce((t,p)=>parseFloat(t)+parseFloat(p))}return 0},sum(l,r){if(l.data!==void 0){const a=l.data.map(o=>o.unit_quantities).map(o=>{const t=o.map(p=>p[r]);return t.length>0?t.reduce((p,n)=>parseFloat(p)+parseFloat(n)):0});if(a.length>0)return a.reduce((o,t)=>parseFloat(o)+parseFloat(t))}return 0},loadReport(){b.post("/api/reports/low-stock",{categories:this.categoryIds,units:this.unitIds}).subscribe({next:l=>{this.products=l},error:l=>{m.error(l.message).subscribe()}})}}},j={id:"report-section",class:"px-4"},q={class:"flex -mx-2"},A={class:"px-2"},I={class:"ns-button"},L=e("i",{class:"las la-sync-alt text-xl"},null,-1),U={class:"pl-2"},B={class:"px-2"},D={class:"ns-button"},V=e("i",{class:"las la-print text-xl"},null,-1),E={class:"pl-2"},H={class:"px-2"},z={class:"ns-button"},G=e("i",{class:"las la-filter text-xl"},null,-1),J={class:"pl-2"},K={class:"px-2"},M={class:"ns-button"},O=e("i",{class:"las la-filter text-xl"},null,-1),W={class:"pl-2"},X={class:"px-2"},Y={class:"ns-button"},Z=e("i",{class:"las la-filter text-xl"},null,-1),Q={class:"pl-2"},$={id:"low-stock-report",class:"anim-duration-500 fade-in-entrance"},ee={class:"flex w-full"},te={class:"my-4 flex justify-between w-full"},se={class:"text-primary"},re={class:"pb-1 border-b border-dashed"},oe={class:"pb-1 border-b border-dashed"},le={class:"pb-1 border-b border-dashed"},ne=["src","alt"],ae={class:"text-primary shadow rounded my-4"},ce={class:"ns-box"},ie={key:0,class:"ns-box-body"},de={class:"table ns-table w-full"},pe={class:"border p-2 text-left"},_e={class:"border p-2 text-left"},ue={width:"150",class:"border p-2 text-right"},he={width:"150",class:"border border-info-secondary bg-info-primary p-2 text-right"},be={width:"150",class:"border border-success-secondary bg-success-primary p-2 text-right"},me={key:0},ye={colspan:"4",class:"p-2 border text-center"},xe={class:"p-2 border"},fe={class:"p-2 border"},ge={class:"p-2 border text-right"},we={class:"p-2 border text-right"},ke={class:"p-2 border border-success-secondary bg-success-primary text-right"},Re={key:1,class:"ns-box-body"},ve={class:"table ns-table w-full"},Te={class:"border p-2 text-left"},Ne={class:"border p-2 text-left"},Ce={width:"150",class:"border p-2 text-right"},Pe={width:"150",class:"border p-2 text-right"},Se={width:"150",class:"border p-2 text-right"},Fe={key:0},je={colspan:"5",class:"p-2 border text-center"},qe={class:"p-2 border"},Ae={class:"flex flex-col"},Ie={class:"p-2 border"},Le={class:"p-2 border text-right"},Ue={class:"p-2 border text-right"},Be={class:"p-2 border text-right"},De=e("td",{class:"p-2 border"},null,-1),Ve=e("td",{class:"p-2 border"},null,-1),Ee=e("td",{class:"p-2 border"},null,-1),He={class:"p-2 border text-right"},ze={class:"p-2 border text-right"},Ge={key:0,class:"flex justify-end p-2"};function Je(l,r,d,a,o,t){const p=P("ns-paginate");return c(),i("div",j,[e("div",q,[e("div",A,[e("div",I,[e("button",{onClick:r[0]||(r[0]=n=>t.loadRelevantReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[L,e("span",U,s(t.__("Load")),1)])])]),e("div",B,[e("div",D,[e("button",{onClick:r[1]||(r[1]=n=>t.printSaleReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[V,e("span",E,s(t.__("Print")),1)])])]),e("div",H,[e("div",z,[e("button",{onClick:r[2]||(r[2]=n=>t.selectReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[G,e("span",J,s(t.__("Report Type"))+" : "+s(o.reportTypeName),1)])])]),e("div",K,[e("div",M,[e("button",{onClick:r[3]||(r[3]=n=>t.selectCategories()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[O,e("span",W,s(t.__("Categories"))+" : "+s(o.categoryName||t.__("All Categories")),1)])])]),e("div",X,[e("div",Y,[e("button",{onClick:r[4]||(r[4]=n=>t.selectUnits()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[Z,e("span",Q,s(t.__("Units"))+" : "+s(o.unitNames||t.__("All Units")),1)])])])]),e("div",$,[e("div",ee,[e("div",te,[e("div",se,[e("ul",null,[e("li",re,s(t.__("Date : {date}").replace("{date}",o.ns.date.current)),1),e("li",oe,s(t.__("Document : {reportTypeName}").replace("{reportTypeName}",o.reportTypeName)),1),e("li",le,s(t.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:d.storeLogo,alt:d.storeName},null,8,ne)])])]),e("div",ae,[e("div",ce,[o.reportType==="low_stock"?(c(),i("div",ie,[e("table",de,[e("thead",null,[e("tr",null,[e("th",pe,s(t.__("Product")),1),e("th",_e,s(t.__("Unit")),1),e("th",ue,s(t.__("Threshold")),1),e("th",he,s(t.__("Quantity")),1),e("th",be,s(t.__("Price")),1)])]),e("tbody",null,[o.products.length===0?(c(),i("tr",me,[e("td",ye,[e("span",null,s(t.__("There is no product to display...")),1)])])):h("",!0),(c(!0),i(y,null,f(o.products,(n,_)=>(c(),i("tr",{key:_,class:"text-sm"},[e("td",xe,s(n.product.name),1),e("td",fe,s(n.unit.name),1),e("td",ge,s(n.low_quantity),1),e("td",we,s(n.quantity),1),e("td",ke,s(t.nsCurrency(n.quantity*n.sale_price)),1)]))),128))])])])):h("",!0),o.reportType==="stock_report"?(c(),i("div",Re,[e("table",ve,[e("thead",null,[e("tr",null,[e("th",Te,s(t.__("Product")),1),e("th",Ne,s(t.__("Unit")),1),e("th",Ce,s(t.__("Price")),1),e("th",Pe,s(t.__("Quantity")),1),e("th",Se,s(t.__("Total Price")),1)])]),e("tbody",null,[o.stockReportResult.data===void 0||o.stockReportResult.data.length===0?(c(),i("tr",Fe,[e("td",je,[e("span",null,s(t.__("There is no product to display...")),1)])])):h("",!0),o.stockReportResult.data!==void 0?(c(!0),i(y,{key:1},f(o.stockReportResult.data,n=>(c(),i(y,null,[(c(!0),i(y,null,f(n.unit_quantities,(_,g)=>(c(),i("tr",{key:g,class:"text-sm"},[e("td",qe,[e("div",Ae,[e("span",null,s(n.name),1)])]),e("td",Ie,s(_.unit.name),1),e("td",Le,s(t.nsCurrency(_.sale_price)),1),e("td",Ue,s(_.quantity),1),e("td",Be,s(t.nsCurrency(_.quantity*_.sale_price)),1)]))),128))],64))),256)):h("",!0)]),e("tfoot",null,[e("tr",null,[De,Ve,Ee,e("td",He,s(t.sum(o.stockReportResult,"quantity")),1),e("td",ze,s(t.nsCurrency(t.totalSum(o.stockReportResult,"sale_price","quantity"))),1)])])]),o.stockReportResult.data?(c(),i("div",Ge,[S(p,{onLoad:r[5]||(r[5]=n=>t.loadStockReport(n)),pagination:o.stockReportResult},null,8,["pagination"])])):h("",!0)])):h("",!0)])])])])}const tt=C(F,[["render",Je]]);export{tt as default}; diff --git a/public/build/assets/ns-notifications-39f1777d.js b/public/build/assets/ns-notifications-ce6033c8.js similarity index 97% rename from public/build/assets/ns-notifications-39f1777d.js rename to public/build/assets/ns-notifications-ce6033c8.js index 68ea3a4b5..a6f308d8f 100644 --- a/public/build/assets/ns-notifications-39f1777d.js +++ b/public/build/assets/ns-notifications-ce6033c8.js @@ -1 +1 @@ -import{H as _,a as d,b}from"./bootstrap-8be442b1.js";import{_ as f,d as p}from"./currency-f8bd78d1.js";import{n as v}from"./ns-prompt-popup-100414c5.js";import{h as x}from"./components-ef1ba55f.js";import{_ as g}from"./_plugin-vue_export-helper-c27b6911.js";import{r as k,o as c,c as r,a as e,t as a,e as u,n as y,F as w,b as C,f as N}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";const B={name:"ns-notifications",data(){return{notifications:[],visible:!1,interval:null}},components:{nsCloseButton:x},mounted(){document.addEventListener("click",this.checkClickedItem),this.interval=setInterval(()=>{this.loadNotifications()},15e3),this.loadNotifications()},unmounted(){clearInterval(this.interval)},methods:{__:f,timespan:_,nsNumberAbbreviate:p,pushNotificationIfNew(s){this.notifications.filter(i=>i.id===s.id).length>0||this.notifications.push(s)},deleteNotificationIfExists(s){const t=this.notifications.filter(i=>i.id===s.id);if(t.length>0){const i=this.notifications.indexOf(t[0]);this.notifications.splice(i,1)}},deleteAll(){Popup.show(v,{title:f("Confirm Your Action"),message:f("Would you like to clear all the notifications ?"),onAction:s=>{s&&d.delete("/api/notifications/all").subscribe(t=>{b.success(t.message).subscribe()})}})},checkClickedItem(s){let t;document.getElementById("notification-center")?t=document.getElementById("notification-center").contains(s.srcElement):t=!1;const i=document.getElementById("notification-button").contains(s.srcElement);!t&&!i&&this.visible&&(this.visible=!1)},loadNotifications(){d.get("/api/notifications").subscribe(s=>{this.notifications=s})},triggerLink(s){if(s.url!=="url")return window.open(s.url,"_blank")},closeNotice(s,t){d.delete(`/api/notifications/${t.id}`).subscribe(i=>{this.loadNotifications()}),s.stopPropagation()}}},I={id:"notificaton-wrapper"},E={key:0,class:"relative float-right"},j={class:"absolute -ml-6 -mt-8"},A={class:"bg-info-tertiary text-white w-8 h-8 rounded-full text-xs flex items-center justify-center"},L=e("i",{class:"las la-bell"},null,-1),P={key:0,class:"h-0 w-0",id:"notification-center"},V={class:"absolute left-0 top-0 sm:relative w-screen zoom-out-entrance anim-duration-300 h-5/7-screen sm:w-64 sm:h-108 flex flex-row-reverse"},z={class:"z-50 sm:rounded-lg shadow-lg h-full w-full md:mt-2 overflow-y-hidden flex flex-col"},F=e("h3",{class:"font-semibold hover:text-info-primary"},"Close",-1),H=[F],S={class:"overflow-y-auto flex flex-col flex-auto"},D=["onClick"],O={class:"flex items-center justify-between"},W={class:"font-semibold"},Y={class:"py-1 text-sm"},q={class:"flex justify-end"},G={class:"text-xs date"},J={key:0,class:"h-full w-full flex items-center justify-center"},K={class:"flex flex-col items-center"},M=e("i",{class:"las la-laugh-wink text-5xl text-primary"},null,-1),Q={class:"text-secondary text-sm"},R={class:"cursor-pointer clear-all"};function T(s,t,i,U,o,l){const h=k("ns-close-button");return c(),r("div",I,[e("div",{id:"notification-button",onClick:t[0]||(t[0]=n=>o.visible=!o.visible),class:y([o.visible?"panel-visible border-0 shadow-lg":"border panel-hidden","hover:shadow-lg hover:border-opacity-0 rounded-full h-12 w-12 cursor-pointer font-bold text-2xl justify-center items-center flex"])},[o.notifications.length>0?(c(),r("div",E,[e("div",j,[e("div",A,a(l.nsNumberAbbreviate(o.notifications.length,"abbreviate")),1)])])):u("",!0),L],2),o.visible?(c(),r("div",P,[e("div",V,[e("div",z,[e("div",{onClick:t[1]||(t[1]=n=>o.visible=!1),class:"sm:hidden p-2 cursor-pointer flex items-center justify-center border-b border-gray-200"},H),e("div",S,[(c(!0),r(w,null,C(o.notifications,n=>(c(),r("div",{key:n.id,class:"notification-card notice border-b"},[e("div",{class:"p-2 cursor-pointer",onClick:m=>l.triggerLink(n)},[e("div",O,[e("h1",W,a(n.title),1),N(h,{onClick:m=>l.closeNotice(m,n)},null,8,["onClick"])]),e("p",Y,a(n.description),1),e("div",q,[e("span",G,a(l.timespan(n.updated_at)),1)])],8,D)]))),128)),o.notifications.length===0?(c(),r("div",J,[e("div",K,[M,e("p",Q,a(l.__("Nothing to care about !")),1)])])):u("",!0)]),e("div",R,[e("h3",{onClick:t[2]||(t[2]=n=>l.deleteAll()),class:"text-sm p-2 flex items-center justify-center w-full font-semibold"},a(l.__("Clear All")),1)])])])])):u("",!0)])}const le=g(B,[["render",T]]);export{le as default}; +import{H as _,a as d,b}from"./bootstrap-8be442b1.js";import{_ as f,d as p}from"./currency-f8bd78d1.js";import{n as v}from"./ns-prompt-popup-100414c5.js";import{h as x}from"./components-50630f18.js";import{_ as g}from"./_plugin-vue_export-helper-c27b6911.js";import{r as k,o as c,c as r,a as e,t as a,e as u,n as y,F as w,b as C,f as N}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";const B={name:"ns-notifications",data(){return{notifications:[],visible:!1,interval:null}},components:{nsCloseButton:x},mounted(){document.addEventListener("click",this.checkClickedItem),this.interval=setInterval(()=>{this.loadNotifications()},15e3),this.loadNotifications()},unmounted(){clearInterval(this.interval)},methods:{__:f,timespan:_,nsNumberAbbreviate:p,pushNotificationIfNew(s){this.notifications.filter(i=>i.id===s.id).length>0||this.notifications.push(s)},deleteNotificationIfExists(s){const t=this.notifications.filter(i=>i.id===s.id);if(t.length>0){const i=this.notifications.indexOf(t[0]);this.notifications.splice(i,1)}},deleteAll(){Popup.show(v,{title:f("Confirm Your Action"),message:f("Would you like to clear all the notifications ?"),onAction:s=>{s&&d.delete("/api/notifications/all").subscribe(t=>{b.success(t.message).subscribe()})}})},checkClickedItem(s){let t;document.getElementById("notification-center")?t=document.getElementById("notification-center").contains(s.srcElement):t=!1;const i=document.getElementById("notification-button").contains(s.srcElement);!t&&!i&&this.visible&&(this.visible=!1)},loadNotifications(){d.get("/api/notifications").subscribe(s=>{this.notifications=s})},triggerLink(s){if(s.url!=="url")return window.open(s.url,"_blank")},closeNotice(s,t){d.delete(`/api/notifications/${t.id}`).subscribe(i=>{this.loadNotifications()}),s.stopPropagation()}}},I={id:"notificaton-wrapper"},E={key:0,class:"relative float-right"},j={class:"absolute -ml-6 -mt-8"},A={class:"bg-info-tertiary text-white w-8 h-8 rounded-full text-xs flex items-center justify-center"},L=e("i",{class:"las la-bell"},null,-1),P={key:0,class:"h-0 w-0",id:"notification-center"},V={class:"absolute left-0 top-0 sm:relative w-screen zoom-out-entrance anim-duration-300 h-5/7-screen sm:w-64 sm:h-108 flex flex-row-reverse"},z={class:"z-50 sm:rounded-lg shadow-lg h-full w-full md:mt-2 overflow-y-hidden flex flex-col"},F=e("h3",{class:"font-semibold hover:text-info-primary"},"Close",-1),H=[F],S={class:"overflow-y-auto flex flex-col flex-auto"},D=["onClick"],O={class:"flex items-center justify-between"},W={class:"font-semibold"},Y={class:"py-1 text-sm"},q={class:"flex justify-end"},G={class:"text-xs date"},J={key:0,class:"h-full w-full flex items-center justify-center"},K={class:"flex flex-col items-center"},M=e("i",{class:"las la-laugh-wink text-5xl text-primary"},null,-1),Q={class:"text-secondary text-sm"},R={class:"cursor-pointer clear-all"};function T(s,t,i,U,o,l){const h=k("ns-close-button");return c(),r("div",I,[e("div",{id:"notification-button",onClick:t[0]||(t[0]=n=>o.visible=!o.visible),class:y([o.visible?"panel-visible border-0 shadow-lg":"border panel-hidden","hover:shadow-lg hover:border-opacity-0 rounded-full h-12 w-12 cursor-pointer font-bold text-2xl justify-center items-center flex"])},[o.notifications.length>0?(c(),r("div",E,[e("div",j,[e("div",A,a(l.nsNumberAbbreviate(o.notifications.length,"abbreviate")),1)])])):u("",!0),L],2),o.visible?(c(),r("div",P,[e("div",V,[e("div",z,[e("div",{onClick:t[1]||(t[1]=n=>o.visible=!1),class:"sm:hidden p-2 cursor-pointer flex items-center justify-center border-b border-gray-200"},H),e("div",S,[(c(!0),r(w,null,C(o.notifications,n=>(c(),r("div",{key:n.id,class:"notification-card notice border-b"},[e("div",{class:"p-2 cursor-pointer",onClick:m=>l.triggerLink(n)},[e("div",O,[e("h1",W,a(n.title),1),N(h,{onClick:m=>l.closeNotice(m,n)},null,8,["onClick"])]),e("p",Y,a(n.description),1),e("div",q,[e("span",G,a(l.timespan(n.updated_at)),1)])],8,D)]))),128)),o.notifications.length===0?(c(),r("div",J,[e("div",K,[M,e("p",Q,a(l.__("Nothing to care about !")),1)])])):u("",!0)]),e("div",R,[e("h3",{onClick:t[2]||(t[2]=n=>l.deleteAll()),class:"text-sm p-2 flex items-center justify-center w-full font-semibold"},a(l.__("Clear All")),1)])])])])):u("",!0)])}const le=g(B,[["render",T]]);export{le as default}; diff --git a/public/build/assets/ns-payment-types-report-3fa90e99.js b/public/build/assets/ns-payment-types-report-9807dea4.js similarity index 98% rename from public/build/assets/ns-payment-types-report-3fa90e99.js rename to public/build/assets/ns-payment-types-report-9807dea4.js index b4c9cb983..3bd78ef3d 100644 --- a/public/build/assets/ns-payment-types-report-3fa90e99.js +++ b/public/build/assets/ns-payment-types-report-9807dea4.js @@ -1 +1 @@ -import{h as l,b as d,a as h}from"./bootstrap-8be442b1.js";import{c as f,e as x}from"./components-ef1ba55f.js";import{_ as i,n as y}from"./currency-f8bd78d1.js";import{_ as v}from"./_plugin-vue_export-helper-c27b6911.js";import{r as D,o as c,c as _,a as e,f as u,t as s,F as g,b as k}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const w={name:"ns-payment-types-report",props:["storeName","storeLogo"],data(){return{startDateField:{type:"datetimepicker",value:l(ns.date.current).startOf("day").format("YYYY-MM-DD HH:mm:ss")},endDateField:{type:"datetimepicker",value:l(ns.date.current).endOf("day").format("YYYY-MM-DD HH:mm:ss")},report:[],ns:window.ns,field:{type:"datetimepicker",value:"2021-02-07",name:"date"}}},components:{nsDatepicker:f,nsDateTimePicker:x},computed:{},mounted(){},methods:{__:i,nsCurrency:y,printSaleReport(){this.$htmlToPaper("sale-report")},loadReport(){if(this.startDateField.value===null||this.endDateField.value===null)return d.error(i("Unable to proceed. Select a correct time range.")).subscribe();const p=l(this.startDateField.value);if(l(this.endDateField.value).isBefore(p))return d.error(i("Unable to proceed. The current time range is not valid.")).subscribe();h.post("/api/reports/payment-types",{startDate:this.startDateField.value,endDate:this.endDateField.value}).subscribe({next:r=>{this.report=r},error:r=>{d.error(r.message).subscribe()}})}}},F={id:"report-section",class:"px-4"},Y={class:"flex -mx-2"},C={class:"px-2"},M={class:"px-2"},T={class:"px-2"},B=e("i",{class:"las la-sync-alt text-xl"},null,-1),S={class:"pl-2"},H={class:"px-2"},P=e("i",{class:"las la-print text-xl"},null,-1),R={class:"pl-2"},L={id:"sale-report",class:"anim-duration-500 fade-in-entrance"},N={class:"flex w-full"},j={class:"my-4 flex justify-between w-full"},O={class:"text-secondary"},U={class:"pb-1 border-b border-dashed"},V={class:"pb-1 border-b border-dashed"},E={class:"pb-1 border-b border-dashed"},q=["src","alt"],z={class:"bg-box-background shadow rounded my-4"},A={class:"border-b border-box-edge"},G={class:"table ns-table w-full"},I={class:"text-primary"},J={class:"text-primary border p-2 text-left"},K={width:"150",class:"text-primary border p-2 text-right"},Q={class:"text-primary"},W={class:"p-2 border border-box-edge"},X={class:"p-2 border text-right"},Z={class:"text-primary font-semibold"},$={class:"p-2 border border-box-edge text-primary"},ee={class:"p-2 border text-right"};function te(p,a,r,se,o,t){const m=D("ns-field");return c(),_("div",F,[e("div",Y,[e("div",C,[u(m,{field:o.startDateField},null,8,["field"])]),e("div",M,[u(m,{field:o.endDateField},null,8,["field"])]),e("div",T,[e("button",{onClick:a[0]||(a[0]=n=>t.loadReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[B,e("span",S,s(t.__("Load")),1)])]),e("div",H,[e("button",{onClick:a[1]||(a[1]=n=>t.printSaleReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[P,e("span",R,s(t.__("Print")),1)])])]),e("div",L,[e("div",N,[e("div",j,[e("div",O,[e("ul",null,[e("li",U,s(t.__("Date : {date}").replace("{date}",o.ns.date.current)),1),e("li",V,s(t.__("Document : Payment Type")),1),e("li",E,s(t.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:r.storeLogo,alt:r.storeName},null,8,q)])])]),e("div",z,[e("div",A,[e("table",G,[e("thead",I,[e("tr",null,[e("th",J,s(t.__("Summary")),1),e("th",K,s(t.__("Total")),1)])]),e("tbody",Q,[(c(!0),_(g,null,k(o.report.summary,(n,b)=>(c(),_("tr",{key:b,class:"font-semibold"},[e("td",W,s(n.label),1),e("td",X,s(t.nsCurrency(n.total)),1)]))),128))]),e("tfoot",Z,[e("tr",null,[e("td",$,s(t.__("Total")),1),e("td",ee,s(t.nsCurrency(o.report.total)),1)])])])])])])])}const pe=v(w,[["render",te]]);export{pe as default}; +import{h as l,b as d,a as h}from"./bootstrap-8be442b1.js";import{c as f,e as x}from"./components-50630f18.js";import{_ as i,n as y}from"./currency-f8bd78d1.js";import{_ as v}from"./_plugin-vue_export-helper-c27b6911.js";import{r as D,o as c,c as _,a as e,f as u,t as s,F as g,b as k}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const w={name:"ns-payment-types-report",props:["storeName","storeLogo"],data(){return{startDateField:{type:"datetimepicker",value:l(ns.date.current).startOf("day").format("YYYY-MM-DD HH:mm:ss")},endDateField:{type:"datetimepicker",value:l(ns.date.current).endOf("day").format("YYYY-MM-DD HH:mm:ss")},report:[],ns:window.ns,field:{type:"datetimepicker",value:"2021-02-07",name:"date"}}},components:{nsDatepicker:f,nsDateTimePicker:x},computed:{},mounted(){},methods:{__:i,nsCurrency:y,printSaleReport(){this.$htmlToPaper("sale-report")},loadReport(){if(this.startDateField.value===null||this.endDateField.value===null)return d.error(i("Unable to proceed. Select a correct time range.")).subscribe();const p=l(this.startDateField.value);if(l(this.endDateField.value).isBefore(p))return d.error(i("Unable to proceed. The current time range is not valid.")).subscribe();h.post("/api/reports/payment-types",{startDate:this.startDateField.value,endDate:this.endDateField.value}).subscribe({next:r=>{this.report=r},error:r=>{d.error(r.message).subscribe()}})}}},F={id:"report-section",class:"px-4"},Y={class:"flex -mx-2"},C={class:"px-2"},M={class:"px-2"},T={class:"px-2"},B=e("i",{class:"las la-sync-alt text-xl"},null,-1),S={class:"pl-2"},H={class:"px-2"},P=e("i",{class:"las la-print text-xl"},null,-1),R={class:"pl-2"},L={id:"sale-report",class:"anim-duration-500 fade-in-entrance"},N={class:"flex w-full"},j={class:"my-4 flex justify-between w-full"},O={class:"text-secondary"},U={class:"pb-1 border-b border-dashed"},V={class:"pb-1 border-b border-dashed"},E={class:"pb-1 border-b border-dashed"},q=["src","alt"],z={class:"bg-box-background shadow rounded my-4"},A={class:"border-b border-box-edge"},G={class:"table ns-table w-full"},I={class:"text-primary"},J={class:"text-primary border p-2 text-left"},K={width:"150",class:"text-primary border p-2 text-right"},Q={class:"text-primary"},W={class:"p-2 border border-box-edge"},X={class:"p-2 border text-right"},Z={class:"text-primary font-semibold"},$={class:"p-2 border border-box-edge text-primary"},ee={class:"p-2 border text-right"};function te(p,a,r,se,o,t){const m=D("ns-field");return c(),_("div",F,[e("div",Y,[e("div",C,[u(m,{field:o.startDateField},null,8,["field"])]),e("div",M,[u(m,{field:o.endDateField},null,8,["field"])]),e("div",T,[e("button",{onClick:a[0]||(a[0]=n=>t.loadReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[B,e("span",S,s(t.__("Load")),1)])]),e("div",H,[e("button",{onClick:a[1]||(a[1]=n=>t.printSaleReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[P,e("span",R,s(t.__("Print")),1)])])]),e("div",L,[e("div",N,[e("div",j,[e("div",O,[e("ul",null,[e("li",U,s(t.__("Date : {date}").replace("{date}",o.ns.date.current)),1),e("li",V,s(t.__("Document : Payment Type")),1),e("li",E,s(t.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:r.storeLogo,alt:r.storeName},null,8,q)])])]),e("div",z,[e("div",A,[e("table",G,[e("thead",I,[e("tr",null,[e("th",J,s(t.__("Summary")),1),e("th",K,s(t.__("Total")),1)])]),e("tbody",Q,[(c(!0),_(g,null,k(o.report.summary,(n,b)=>(c(),_("tr",{key:b,class:"font-semibold"},[e("td",W,s(n.label),1),e("td",X,s(t.nsCurrency(n.total)),1)]))),128))]),e("tfoot",Z,[e("tr",null,[e("td",$,s(t.__("Total")),1),e("td",ee,s(t.nsCurrency(o.report.total)),1)])])])])])])])}const pe=v(w,[["render",te]]);export{pe as default}; diff --git a/public/build/assets/ns-profit-report-a9e68261.js b/public/build/assets/ns-profit-report-f2ead29c.js similarity index 99% rename from public/build/assets/ns-profit-report-a9e68261.js rename to public/build/assets/ns-profit-report-f2ead29c.js index b38cc8627..30e977a1a 100644 --- a/public/build/assets/ns-profit-report-a9e68261.js +++ b/public/build/assets/ns-profit-report-f2ead29c.js @@ -1 +1 @@ -import{I as na,J as ta,K as ia,L as ca,M as oa,N as da,O as pa,Q as la,R as va,U as ua,W as ma,X as fa,Y as Da,Z as ha,_ as ga,$ as ba,a0 as xa,a1 as ya,a2 as _a,a3 as Ca,a4 as Sa,a5 as Na,a6 as ka,a7 as Ta,a8 as Fa,a9 as Ma,aa as wa,ab as Ra,ac as Ea,ad as ja,ae as Aa,af as Pa,ag as Ia,ah as Oa,ai as qa,aj as La,ak as za,al as Ua,am as Ba,an as Qa,ao as Ha,ap as Wa,aq as Ga,ar as Va,as as Ya,at as Za,au as Xa,av as Ja,aw as Ka,ax as $a,ay as es,az as as,aA as ss,aB as rs,aC as ts,aD as is,aE as cs,aF as os,aG as ds,aH as ps,aI as ls,aJ as vs,aK as us,aL as ms,aM as fs,aN as Ds,aO as hs,aP as gs,aQ as bs,aR as xs,aS as ys,aT as _s,aU as Cs,aV as Ss,aW as Ns,aX as ks,aY as Ts,aZ as Fs,a_ as Ms,a$ as ws,b0 as Rs,b1 as Es,b2 as js,b3 as As,b4 as Ps,b5 as Is,b6 as Os,b7 as qs,b8 as Ls,b9 as zs,ba as Us,bb as Bs,bc as Qs,bd as Hs,be as Ws,bf as Gs,bg as Vs,bh as Ys,bi as Zs,bj as Xs,bk as Js,bl as Ks,bm as $s,bn as er,bo as ar,bp as sr,bq as rr,br as nr,bs as tr,bt as ir,bu as cr,bv as or,bw as dr,bx as pr,by as lr,bz as vr,bA as ur,bB as mr,bC as fr,bD as Dr,bE as hr,bF as gr,bG as br,bH as xr,bI as yr,bJ as _r,bK as Cr,bL as Sr,bM as Nr,bN as kr,bO as Tr,bP as Fr,bQ as Mr,bR as wr,bS as Rr,bT as Er,bU as jr,bV as Ar,bW as Pr,bX as Ir,bY as Or,bZ as qr,b_ as Lr,b$ as zr,c0 as Ur,c1 as Br,c2 as Qr,c3 as Hr,c4 as Wr,c5 as Gr,c6 as Vr,c7 as Yr,c8 as Zr,c9 as Xr,ca as Jr,cb as Kr,cc as $r,cd as en,ce as an,cf as sn,cg as rn,ch as nn,ci as tn,cj as cn,ck as on,cl as dn,cm as pn,cn as ln,co as vn,cp as un,cq as mn,cr as fn,cs as Dn,ct as hn,cu as gn,cv as bn,cw as xn,cx as yn,cy as _n,cz as Cn,cA as Sn,cB as Nn,cC as kn,cD as Tn,cE as Fn,cF as Mn,cG as wn,cH as Rn,cI as En,cJ as jn,cK as An,cL as Pn,cM as In,cN as On,cO as qn,cP as Ln,cQ as zn,cR as Un,cS as Bn,cT as Qn,cU as Hn,cV as Wn,cW as Gn,cX as Vn,cY as Yn,cZ as Zn,c_ as Xn,c$ as Jn,d0 as Kn,d1 as $n,d2 as et,d3 as at,d4 as st,d5 as rt,d6 as nt,d7 as tt,d8 as it,d9 as ct,da as ot,db as dt,dc as pt,dd as lt,de as vt,df as ut,dg as mt,dh as ft,di as Dt,dj as ht,dk as gt,dl as bt,dm as xt,dn as yt,dp as _t,dq as Ct,dr as St,ds as Nt,dt as kt,du as Tt,dv as Ft,dw as Mt,dx as wt,dy as Rt,dz as Et,dA as jt,dB as At,dC as Pt,dD as It,dE as Ot,dF as qt,dG as Lt,dH as zt,dI as Ut,dJ as Bt,dK as Qt,dL as Ht,dM as Wt,dN as Gt,dO as Vt,dP as Yt,dQ as Zt,dR as Xt,dS as Jt,dT as Kt,dU as $t,dV as ei,dW as ai,dX as si,dY as ri,dZ as ni,d_ as ti,d$ as ii,e0 as ci,e1 as oi,e2 as di,e3 as pi,e4 as li,e5 as vi,e6 as ui,e7 as mi,e8 as fi,e9 as Di,ea as hi,eb as gi,ec as bi,ed as xi,ee as yi,ef as _i,eg as Ci,eh as Si,ei as Ni,ej as ki,ek as Ti,el as Fi,em as Mi,en as wi,eo as Ri,ep as Ei,eq as ji,er as Ai,es as Pi,et as Ii,eu as Oi,ev as qi,ew as Li,ex as zi,ey as Ui,ez as Bi,eA as Qi,eB as Hi,eC as Wi,eD as Gi,eE as Vi,eF as Yi,eG as Zi,eH as Xi,eI as Ji,eJ as Ki,eK as $i,eL as ec,eM as ac,eN as sc,eO as rc,eP as nc,eQ as tc,eR as ic,eS as cc,eT as oc,eU as dc,eV as pc,eW as lc,eX as vc,eY as uc,eZ as mc,e_ as fc,e$ as Dc,f0 as hc,f1 as gc,f2 as bc,f3 as xc,f4 as yc,f5 as _c,f6 as Cc,f7 as Sc,f8 as Nc,f9 as kc,fa as Tc,fb as Fc,fc as Mc,fd as wc,fe as Rc,ff as Ec,fg as jc,fh as Ac,fi as Pc,fj as Ic,fk as Oc,fl as qc,fm as Lc,fn as zc,fo as Uc,fp as Bc,fq as Qc,fr as _e,fs as Ee,ft as xo,fu as ea,fv as Hc,fw as Wc,fx as Gc,fy as Vc,fz as Yc,fA as tp,fB as ip,fC as cp,fD as op,fE as dp,fF as yo,fG as So,fH as pp,fI as No,fJ as ko,fK as To,fL as Fo,fM as Mo,fN as wo,fO as Ro,fP as Eo,fQ as jo,fR as Ao,fS as Po,fT as Io,fU as Oo,fV as qo,fW as Lo,fX as zo,fY as Uo,fZ as Bo,f_ as Qo,f$ as Ho,g0 as Wo,g1 as Go,g2 as Vo,g3 as Yo,g4 as Zo,g5 as Xo,g6 as Jo,g7 as Ko,g8 as $o,g9 as ed,ga as ad,gb as sd,gc as rd,gd as nd,ge as td,gf as id,gg as lp,gh as vp,gi as up,gj as mp,gk as fp,gl as Dp,gm as hp,gn as gp,go as bp,gp as xp,gq as yp,gr as _p,gs as Cp,gt as Sp,gu as Np,gv as kp,gw as Tp,gx as Fp,gy as Mp,gz as wp,gA as Rp,gB as Ep,gC as jp,gD as Ap,gE as Pp,gF as Ip,gG as Op,gH as qp,gI as Lp,gJ as zp,gK as Up,gL as Bp,gM as Qp,gN as Hp,gO as Wp,gP as Gp,gQ as Vp,gR as Yp,gS as Zp,gT as Xp,gU as Jp,gV as Kp,gW as $p,gX as el,gY as al,gZ as sl,g_ as rl,g$ as nl,h0 as tl,h1 as il,h2 as cl,h3 as ol,h4 as dl,h5 as pl,h6 as ll,h7 as vl,h8 as ul,h9 as ml,ha as fl,hb as Dl,hc as hl,hd as gl,he as bl,hf as xl,hg as yl,hh as _l,hi as Cl,hj as Sl,hk as Nl,hl as kl,hm as Tl,hn as Fl,ho as Ml,hp as wl,hq as Rl,hr as El,hs as jl,ht as Al,hu as Pl,f as ra,hv as Il,hw as Ol,hx as ql,hy as Ll,hz as zl,hA as Ul,hB as Bl,hC as Ql,hD as Hl,hE as Wl,hF as Gl,hG as Vl,hH as Yl,hI as Zl,hJ as Xl,hK as Jl,hL as Kl,hM as $l,hN as ev,hO as av,hP as sv,hQ as rv,hR as nv,hS as tv,hT as iv,hU as cv,hV as ov,hW as dv,hX as pv,hY as lv,hZ as vv,h_ as uv,h$ as mv,i0 as fv,i1 as Dv,i2 as hv,i3 as gv,i4 as bv,i5 as xv,i6 as yv,i7 as _v,i8 as Cv,i9 as Sv,ia as Nv,ib as kv,ic as Tv,id as Fv,ie as Mv,ig as wv,ih as Rv,ii as Ev,ij as jv,ik as Av,il as Pv,im as Iv,io as Ov,ip as qv,iq as Lv,ir as zv,is as Uv,it as Bv,iu as Qv,iv as Hv,iw as Wv,ix as Gv,iy as Vv,iz as Yv,iA as Zv,iB as Xv,iC as Jv,iD as Kv,iE as $v,iF as eu,iG as au,iH as su,iI as ru,iJ as nu,iK as tu,iL as iu,iM as cu,iN as ou,iO as du,iP as pu,iQ as lu,iR as vu,iS as uu,iT as mu,iU as fu,iV as Du,iW as hu,iX as gu,iY as bu,iZ as xu,i_ as yu,i$ as _u,j0 as Cu,j1 as Su,j2 as Nu,j3 as ku,j4 as Tu,j5 as Fu,j6 as Mu,j7 as wu,j8 as Ru,j9 as Eu,ja as ju,jb as Au,jc as Pu,jd as Iu,je as Ou,jf as qu,jg as Lu,jh as zu,ji as Uu,jj as Bu,jk as Qu,jl as Hu,jm as Wu,jn as Gu,jo as Vu,jp as Yu,jq as Zu,jr as Xu,js as Ju,jt as Ku,ju as $u,jv as em,jw as am,jx as sm,jy as rm,jz as nm,jA as tm,jB as im,jC as cm,jD as om,jE as dm,jF as pm,jG as lm,jH as vm,jI as um,jJ as mm,jK as fm,jL as Dm,jM as hm,jN as gm,jO as bm,jP as xm,jQ as ym,jR as _m,jS as Cm,jT as Sm,jU as Nm,jV as km,jW as Tm,jX as Fm,jY as Mm,jZ as wm,j_ as Rm,j$ as Em,k0 as jm,k1 as Am,k2 as Pm,k3 as Im,k4 as Om,k5 as qm,k6 as Lm,k7 as zm,k8 as Um,k9 as Bm,ka as Qm,kb as Hm,kc as Wm,kd as Gm,ke as Vm,kf as Ym,kg as Zm,kh as Xm,ki as Jm,kj as Km,kk as $m,kl as ef,km as af,kn as sf,ko as rf,kp as nf,kq as tf,kr as cf,ks as of,kt as df,ku as pf,kv as lf,kw as vf,kx as uf,ky as mf,kz as ff,kA as Df,kB as hf,kC as gf,kD as bf,kE as xf,kF as yf,kG as _f,kH as Cf,kI as Sf,kJ as Nf,kK as kf,kL as Tf,kM as Ff,kN as Mf,kO as wf,kP as Rf,kQ as Ef,kR as jf,kS as Af,kT as Pf,kU as If,kV as Of,kW as qf,kX as Lf,kY as zf,kZ as Uf,k_ as Bf,k$ as Qf,l0 as Hf,l1 as Wf,l2 as Gf,l3 as Vf,l4 as Yf,l5 as Zf,l6 as Xf,l7 as Jf,l8 as Kf,l9 as $f,la as eD,lb as aD,lc as sD,ld as rD,le as nD,lf as tD,lg as iD,lh as cD,li as oD,lj as dD,lk as pD,ll as lD,lm as vD,ln as uD,lo as mD,lp as fD,lq as DD,lr as hD,ls as gD,lt as bD,lu as xD,lv as yD,lw as _D,lx as CD,ly as SD,h as Qe,b as Re,a as ND}from"./bootstrap-8be442b1.js";import{c as kD,e as TD}from"./components-ef1ba55f.js";import{_ as ve,n as FD}from"./currency-f8bd78d1.js";import{s as _o}from"./select-api-entities-c72f4497.js";import{_ as MD}from"./_plugin-vue_export-helper-c27b6911.js";import{r as wD,o as aa,c as sa,a as t,f as Co,t as g,F as RD,b as ED,n as jD}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";import"./join-array-4b30b096.js";const AD=Object.freeze(Object.defineProperty({__proto__:null,createAbs:na,createAccessorNode:ta,createAcos:ia,createAcosh:ca,createAcot:oa,createAcoth:da,createAcsc:pa,createAcsch:la,createAdd:va,createAddScalar:ua,createAnd:ma,createAndTransform:fa,createApply:Da,createApplyTransform:ha,createArg:ga,createArrayNode:ba,createAsec:xa,createAsech:ya,createAsin:_a,createAsinh:Ca,createAssignmentNode:Sa,createAtan:Na,createAtan2:ka,createAtanh:Ta,createAtomicMass:Fa,createAvogadro:Ma,createBellNumbers:wa,createBigNumberClass:Ra,createBignumber:Ea,createBin:ja,createBitAnd:Aa,createBitAndTransform:Pa,createBitNot:Ia,createBitOr:Oa,createBitOrTransform:qa,createBitXor:La,createBlockNode:za,createBohrMagneton:Ua,createBohrRadius:Ba,createBoltzmann:Qa,createBoolean:Ha,createCatalan:Wa,createCbrt:Ga,createCeil:Va,createChain:Ya,createChainClass:Za,createClassicalElectronRadius:Xa,createClone:Ja,createColumn:Ka,createColumnTransform:$a,createCombinations:es,createCombinationsWithRep:as,createCompare:ss,createCompareNatural:rs,createCompareText:ts,createCompile:is,createComplex:cs,createComplexClass:os,createComposition:ds,createConcat:ps,createConcatTransform:ls,createConditionalNode:vs,createConductanceQuantum:us,createConj:ms,createConstantNode:fs,createCorr:Ds,createCos:hs,createCosh:gs,createCot:bs,createCoth:xs,createCoulomb:ys,createCount:_s,createCreateUnit:Cs,createCross:Ss,createCsc:Ns,createCsch:ks,createCtranspose:Ts,createCube:Fs,createCumSum:Ms,createCumSumTransform:ws,createDeepEqual:Rs,createDenseMatrixClass:Es,createDerivative:js,createDet:As,createDeuteronMass:Ps,createDiag:Is,createDiff:Os,createDiffTransform:qs,createDistance:Ls,createDivide:zs,createDivideScalar:Us,createDot:Bs,createDotDivide:Qs,createDotMultiply:Hs,createDotPow:Ws,createE:Gs,createEfimovFactor:Vs,createEigs:Ys,createElectricConstant:Zs,createElectronMass:Xs,createElementaryCharge:Js,createEqual:Ks,createEqualScalar:$s,createEqualText:er,createErf:ar,createEvaluate:sr,createExp:rr,createExpm:nr,createExpm1:tr,createFactorial:ir,createFalse:cr,createFaraday:or,createFermiCoupling:dr,createFft:pr,createFibonacciHeapClass:lr,createFilter:vr,createFilterTransform:ur,createFineStructure:mr,createFirstRadiation:fr,createFix:Dr,createFlatten:hr,createFloor:gr,createForEach:br,createForEachTransform:xr,createFormat:yr,createFraction:_r,createFractionClass:Cr,createFreqz:Sr,createFunctionAssignmentNode:Nr,createFunctionNode:kr,createGamma:Tr,createGasConstant:Fr,createGcd:Mr,createGetMatrixDataType:wr,createGravitationConstant:Rr,createGravity:Er,createHartreeEnergy:jr,createHasNumericValue:Ar,createHelp:Pr,createHelpClass:Ir,createHex:Or,createHypot:qr,createI:Lr,createIdentity:zr,createIfft:Ur,createIm:Br,createImmutableDenseMatrixClass:Qr,createIndex:Hr,createIndexClass:Wr,createIndexNode:Gr,createIndexTransform:Vr,createInfinity:Yr,createIntersect:Zr,createInv:Xr,createInverseConductanceQuantum:Jr,createInvmod:Kr,createIsInteger:$r,createIsNaN:en,createIsNegative:an,createIsNumeric:sn,createIsPositive:rn,createIsPrime:nn,createIsZero:tn,createKldivergence:cn,createKlitzing:on,createKron:dn,createLN10:pn,createLN2:ln,createLOG10E:vn,createLOG2E:un,createLarger:mn,createLargerEq:fn,createLcm:Dn,createLeafCount:hn,createLeftShift:gn,createLgamma:bn,createLog:xn,createLog10:yn,createLog1p:_n,createLog2:Cn,createLoschmidt:Sn,createLsolve:Nn,createLsolveAll:kn,createLup:Tn,createLusolve:Fn,createLyap:Mn,createMad:wn,createMagneticConstant:Rn,createMagneticFluxQuantum:En,createMap:jn,createMapTransform:An,createMatrix:Pn,createMatrixClass:In,createMatrixFromColumns:On,createMatrixFromFunction:qn,createMatrixFromRows:Ln,createMax:zn,createMaxTransform:Un,createMean:Bn,createMeanTransform:Qn,createMedian:Hn,createMin:Wn,createMinTransform:Gn,createMod:Vn,createMode:Yn,createMolarMass:Zn,createMolarMassC12:Xn,createMolarPlanckConstant:Jn,createMolarVolume:Kn,createMultinomial:$n,createMultiply:et,createMultiplyScalar:at,createNaN:st,createNeutronMass:rt,createNode:nt,createNorm:tt,createNot:it,createNthRoot:ct,createNthRoots:ot,createNuclearMagneton:dt,createNull:pt,createNumber:lt,createNumeric:vt,createObjectNode:ut,createOct:mt,createOnes:ft,createOperatorNode:Dt,createOr:ht,createOrTransform:gt,createParenthesisNode:bt,createParse:xt,createParser:yt,createParserClass:_t,createPartitionSelect:Ct,createPermutations:St,createPhi:Nt,createPi:kt,createPickRandom:Tt,createPinv:Ft,createPlanckCharge:Mt,createPlanckConstant:wt,createPlanckLength:Rt,createPlanckMass:Et,createPlanckTemperature:jt,createPlanckTime:At,createPolynomialRoot:Pt,createPow:It,createPrint:Ot,createPrintTransform:qt,createProd:Lt,createProtonMass:zt,createQr:Ut,createQuantileSeq:Bt,createQuantileSeqTransform:Qt,createQuantumOfCirculation:Ht,createRandom:Wt,createRandomInt:Gt,createRange:Vt,createRangeClass:Yt,createRangeNode:Zt,createRangeTransform:Xt,createRationalize:Jt,createRe:Kt,createReducedPlanckConstant:$t,createRelationalNode:ei,createReplacer:ai,createReshape:si,createResize:ri,createResolve:ni,createResultSet:ti,createReviver:ii,createRightArithShift:ci,createRightLogShift:oi,createRotate:di,createRotationMatrix:pi,createRound:li,createRow:vi,createRowTransform:ui,createRydberg:mi,createSQRT1_2:fi,createSQRT2:Di,createSackurTetrode:hi,createSchur:gi,createSec:bi,createSech:xi,createSecondRadiation:yi,createSetCartesian:_i,createSetDifference:Ci,createSetDistinct:Si,createSetIntersect:Ni,createSetIsSubset:ki,createSetMultiplicity:Ti,createSetPowerset:Fi,createSetSize:Mi,createSetSymDifference:wi,createSetUnion:Ri,createSign:Ei,createSimplify:ji,createSimplifyConstant:Ai,createSimplifyCore:Pi,createSin:Ii,createSinh:Oi,createSize:qi,createSlu:Li,createSmaller:zi,createSmallerEq:Ui,createSolveODE:Bi,createSort:Qi,createSpaClass:Hi,createSparse:Wi,createSparseMatrixClass:Gi,createSpeedOfLight:Vi,createSplitUnit:Yi,createSqrt:Zi,createSqrtm:Xi,createSquare:Ji,createSqueeze:Ki,createStd:$i,createStdTransform:ec,createStefanBoltzmann:ac,createStirlingS2:sc,createString:rc,createSubset:nc,createSubsetTransform:tc,createSubtract:ic,createSubtractScalar:cc,createSum:oc,createSumTransform:dc,createSylvester:pc,createSymbolNode:lc,createSymbolicEqual:vc,createTan:uc,createTanh:mc,createTau:fc,createThomsonCrossSection:Dc,createTo:hc,createTrace:gc,createTranspose:bc,createTrue:xc,createTypeOf:yc,createTyped:_c,createUnaryMinus:Cc,createUnaryPlus:Sc,createUnequal:Nc,createUnitClass:kc,createUnitFunction:Tc,createUppercaseE:Fc,createUppercasePi:Mc,createUsolve:wc,createUsolveAll:Rc,createVacuumImpedance:Ec,createVariance:jc,createVarianceTransform:Ac,createVersion:Pc,createWeakMixingAngle:Ic,createWienDisplacement:Oc,createXgcd:qc,createXor:Lc,createZeros:zc,createZeta:Uc,createZpk2tf:Bc},Symbol.toStringTag,{value:"Module"}));var s={createBigNumberClass:Ra},h={createComplexClass:os},We={createMatrixClass:In},p={MatrixDependencies:We,createDenseMatrixClass:Es},ue={createFractionClass:Cr},e={BigNumberDependencies:s,ComplexDependencies:h,DenseMatrixDependencies:p,FractionDependencies:ue,createTyped:_c},A={typedDependencies:e,createAbs:na},R={createNode:nt},v={typedDependencies:e,createEqualScalar:$s},ae={MatrixDependencies:We,equalScalarDependencies:v,typedDependencies:e,createSparseMatrixClass:Gi},T={typedDependencies:e,createAddScalar:ua},O={typedDependencies:e,createIsInteger:$r},a={DenseMatrixDependencies:p,MatrixDependencies:We,SparseMatrixDependencies:ae,typedDependencies:e,createMatrix:Pn},f={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createConcat:ps},u={DenseMatrixDependencies:p,SparseMatrixDependencies:ae,addScalarDependencies:T,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createAdd:va},M={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createZeros:zc},q={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createSubset:nc},Ce={NodeDependencies:R,subsetDependencies:q,createAccessorNode:ta},PD={ComplexDependencies:h,typedDependencies:e,createAcos:ia},ID={ComplexDependencies:h,typedDependencies:e,createAcosh:ca},OD={BigNumberDependencies:s,typedDependencies:e,createAcot:oa},qD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAcoth:da},LD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAcsc:pa},zD={BigNumberDependencies:s,typedDependencies:e,createAcsch:la},Ge={typedDependencies:e,createNot:it},UD={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:Ge,typedDependencies:e,zerosDependencies:M,createAnd:ma},BD={addDependencies:u,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:Ge,typedDependencies:e,zerosDependencies:M,createAndTransform:fa},Zc={isIntegerDependencies:O,typedDependencies:e,createApply:Da},QD={isIntegerDependencies:O,typedDependencies:e,createApplyTransform:ha},HD={typedDependencies:e,createArg:ga},Se={NodeDependencies:R,createArrayNode:ba},WD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAsec:xa},GD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAsech:ya},VD={ComplexDependencies:h,typedDependencies:e,createAsin:_a},YD={typedDependencies:e,createAsinh:Ca},cd={matrixDependencies:a,NodeDependencies:R,subsetDependencies:q,createAssignmentNode:Sa},od={typedDependencies:e,createAtan:Na},ZD={BigNumberDependencies:s,DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createAtan2:ka},XD={ComplexDependencies:h,typedDependencies:e,createAtanh:Ta},L={BigNumberDependencies:s,typedDependencies:e,createBignumber:Ea},Ne={FractionDependencies:ue,typedDependencies:e,createFraction:_r},se={typedDependencies:e,createNumber:lt},Z={bignumberDependencies:L,fractionDependencies:Ne,numberDependencies:se,createNumeric:vt},y={numericDependencies:Z,typedDependencies:e,createDivideScalar:Us},B={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createEqual:Ks},ke={BigNumberDependencies:s,DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRound:li},Xc={DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createCeil:Va},dd={DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createFloor:gr},pd={ComplexDependencies:h,DenseMatrixDependencies:p,ceilDependencies:Xc,equalScalarDependencies:v,floorDependencies:dd,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createFix:Dr},je={typedDependencies:e,createFormat:yr},me={typedDependencies:e,createIsNumeric:sn},C={typedDependencies:e,createMultiplyScalar:at},ie={BigNumberDependencies:s,DenseMatrixDependencies:p,SparseMatrixDependencies:ae,matrixDependencies:a,typedDependencies:e,createIdentity:zr},X={typedDependencies:e,createIsZero:tn},fe={typedDependencies:e,createConj:ms},w={matrixDependencies:a,typedDependencies:e,createSize:qi},Ve={addScalarDependencies:T,conjDependencies:fe,multiplyScalarDependencies:C,sizeDependencies:w,typedDependencies:e,createDot:Bs},D={addScalarDependencies:T,dotDependencies:Ve,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createMultiply:et},Q={typedDependencies:e,createSubtractScalar:cc},K={typedDependencies:e,createUnaryMinus:Cc},ld={divideScalarDependencies:y,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createDet:As},De={absDependencies:A,addScalarDependencies:T,detDependencies:ld,divideScalarDependencies:y,identityDependencies:ie,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,unaryMinusDependencies:K,createInv:Xr},H={ComplexDependencies:h,fractionDependencies:Ne,identityDependencies:ie,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,numberDependencies:se,typedDependencies:e,createPow:It},c={BigNumberDependencies:s,ComplexDependencies:h,FractionDependencies:ue,absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,equalDependencies:B,fixDependencies:pd,formatDependencies:je,isNumericDependencies:me,multiplyScalarDependencies:C,numberDependencies:se,powDependencies:H,roundDependencies:ke,subtractScalarDependencies:Q,createUnitClass:kc},JD={BigNumberDependencies:s,UnitDependencies:c,createAtomicMass:Fa},KD={BigNumberDependencies:s,UnitDependencies:c,createAvogadro:Ma},ce={typedDependencies:e,createIsNegative:an},Ye={typedDependencies:e,createCombinations:es},Jc={BigNumberDependencies:s,ComplexDependencies:h,multiplyScalarDependencies:C,powDependencies:H,typedDependencies:e,createGamma:Tr},Ae={gammaDependencies:Jc,typedDependencies:e,createFactorial:ir},P={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createLarger:mn},vd={bignumberDependencies:L,addScalarDependencies:T,combinationsDependencies:Ye,divideScalarDependencies:y,factorialDependencies:Ae,isIntegerDependencies:O,isNegativeDependencies:ce,largerDependencies:P,multiplyScalarDependencies:C,numberDependencies:se,powDependencies:H,subtractScalarDependencies:Q,typedDependencies:e,createStirlingS2:sc},$D={addScalarDependencies:T,isIntegerDependencies:O,isNegativeDependencies:ce,stirlingS2Dependencies:vd,typedDependencies:e,createBellNumbers:wa},eh={formatDependencies:je,typedDependencies:e,createBin:ja},ah={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitAnd:Aa},sh={addDependencies:u,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:Ge,typedDependencies:e,zerosDependencies:M,createBitAndTransform:Pa},rh={typedDependencies:e,createBitNot:Ia},nh={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitOr:Oa},th={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitOrTransform:qa},ih={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createBitXor:La},ud={createResultSet:ti},md={NodeDependencies:R,ResultSetDependencies:ud,createBlockNode:za},ch={BigNumberDependencies:s,UnitDependencies:c,createBohrMagneton:Ua},oh={BigNumberDependencies:s,UnitDependencies:c,createBohrRadius:Ba},dh={BigNumberDependencies:s,UnitDependencies:c,createBoltzmann:Qa},ph={typedDependencies:e,createBoolean:Ha},lh={addScalarDependencies:T,combinationsDependencies:Ye,divideScalarDependencies:y,isIntegerDependencies:O,isNegativeDependencies:ce,multiplyScalarDependencies:C,typedDependencies:e,createCatalan:Wa},fd={BigNumberDependencies:s,ComplexDependencies:h,FractionDependencies:ue,isNegativeDependencies:ce,matrixDependencies:a,typedDependencies:e,unaryMinusDependencies:K,createCbrt:Ga},Dd={typedDependencies:e,createChainClass:Za},vh={ChainDependencies:Dd,typedDependencies:e,createChain:Ya},uh={BigNumberDependencies:s,UnitDependencies:c,createClassicalElectronRadius:Xa},mh={typedDependencies:e,createClone:Ja},I={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createSmaller:zi},hd={DenseMatrixDependencies:p,smallerDependencies:I,createImmutableDenseMatrixClass:Qr},Kc={typedDependencies:e,createGetMatrixDataType:wr},E={ImmutableDenseMatrixDependencies:hd,getMatrixDataTypeDependencies:Kc,createIndexClass:Wr},he={typedDependencies:e,createIsPositive:rn},Ze={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createLargerEq:fn},Te={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createSmallerEq:Ui},Fe={bignumberDependencies:L,matrixDependencies:a,addDependencies:u,isPositiveDependencies:he,largerDependencies:P,largerEqDependencies:Ze,smallerDependencies:I,smallerEqDependencies:Te,typedDependencies:e,createRange:Vt},gd={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createColumn:Ka},fh={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createColumnTransform:$a},Dh={typedDependencies:e,createCombinationsWithRep:as},ge={BigNumberDependencies:s,DenseMatrixDependencies:p,FractionDependencies:ue,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createCompare:ss},$={compareDependencies:ge,typedDependencies:e,createCompareNatural:rs},bd={concatDependencies:f,matrixDependencies:a,typedDependencies:e,createCompareText:ts},xd={NodeDependencies:R,createConditionalNode:vs},oe={NodeDependencies:R,createConstantNode:fs},yd={NodeDependencies:R,typedDependencies:e,createFunctionAssignmentNode:Nr},de={UnitDependencies:c,NodeDependencies:R,createSymbolNode:lc},pe={NodeDependencies:R,SymbolNodeDependencies:de,createFunctionNode:kr},Me={NodeDependencies:R,sizeDependencies:w,createIndexNode:Gr},we={NodeDependencies:R,createObjectNode:ut},re={NodeDependencies:R,createOperatorNode:Dt},be={NodeDependencies:R,createParenthesisNode:bt},_d={NodeDependencies:R,createRangeNode:Zt},Cd={NodeDependencies:R,createRelationalNode:ei},ee={AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,AssignmentNodeDependencies:cd,BlockNodeDependencies:md,ConditionalNodeDependencies:xd,ConstantNodeDependencies:oe,FunctionAssignmentNodeDependencies:yd,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,RangeNodeDependencies:_d,RelationalNodeDependencies:Cd,SymbolNodeDependencies:de,numericDependencies:Z,typedDependencies:e,createParse:xt},hh={parseDependencies:ee,typedDependencies:e,createCompile:is},Xe={ComplexDependencies:h,typedDependencies:e,createComplex:cs},gh={addScalarDependencies:T,combinationsDependencies:Ye,isIntegerDependencies:O,isNegativeDependencies:ce,isPositiveDependencies:he,largerDependencies:P,typedDependencies:e,createComposition:ds},bh={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createConcatTransform:ls},xh={BigNumberDependencies:s,UnitDependencies:c,createConductanceQuantum:us},F={divideScalarDependencies:y,equalScalarDependencies:v,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createDivide:zs},Sd={addDependencies:u,divideDependencies:F,typedDependencies:e,createMean:Bn},J={ComplexDependencies:h,typedDependencies:e,createSqrt:Zi},S={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createSubtract:ic},$c={addDependencies:u,numericDependencies:Z,typedDependencies:e,createSum:oc},yh={addDependencies:u,divideDependencies:F,matrixDependencies:a,meanDependencies:Sd,multiplyDependencies:D,powDependencies:H,sqrtDependencies:J,subtractDependencies:S,sumDependencies:$c,typedDependencies:e,createCorr:Ds},eo={typedDependencies:e,createCos:hs},_h={typedDependencies:e,createCosh:gs},Ch={BigNumberDependencies:s,typedDependencies:e,createCot:bs},Sh={BigNumberDependencies:s,typedDependencies:e,createCoth:xs},Nh={BigNumberDependencies:s,UnitDependencies:c,createCoulomb:ys},Nd={multiplyScalarDependencies:C,numericDependencies:Z,typedDependencies:e,createProd:Lt},kh={prodDependencies:Nd,sizeDependencies:w,typedDependencies:e,createCount:_s},Th={UnitDependencies:c,typedDependencies:e,createCreateUnit:Cs},Fh={matrixDependencies:a,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createCross:Ss},Mh={BigNumberDependencies:s,typedDependencies:e,createCsc:Ns},wh={BigNumberDependencies:s,typedDependencies:e,createCsch:ks},Pe={matrixDependencies:a,typedDependencies:e,createTranspose:bc},ao={conjDependencies:fe,transposeDependencies:Pe,typedDependencies:e,createCtranspose:Ts},Rh={typedDependencies:e,createCube:Fs},so={BigNumberDependencies:s,typedDependencies:e,createUnaryPlus:Sc},Eh={addDependencies:u,typedDependencies:e,unaryPlusDependencies:so,createCumSum:Ms},jh={addDependencies:u,typedDependencies:e,unaryPlusDependencies:so,createCumSumTransform:ws},ro={equalDependencies:B,typedDependencies:e,createDeepEqual:Rs},kd={ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,parseDependencies:ee,typedDependencies:e,createResolve:ni},no={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,SymbolNodeDependencies:de,matrixDependencies:a,typedDependencies:e,createSimplifyConstant:Ai},to={AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,subtractDependencies:S,typedDependencies:e,createSimplifyCore:Pi},Je={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,resolveDependencies:kd,simplifyConstantDependencies:no,simplifyCoreDependencies:to,subtractDependencies:S,typedDependencies:e,createSimplify:ji},Ah={ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,equalDependencies:B,isZeroDependencies:X,numericDependencies:Z,parseDependencies:ee,simplifyDependencies:Je,typedDependencies:e,createDerivative:js},Ph={BigNumberDependencies:s,UnitDependencies:c,createDeuteronMass:Ps},Td={DenseMatrixDependencies:p,SparseMatrixDependencies:ae,matrixDependencies:a,typedDependencies:e,createDiag:Is},Ih={matrixDependencies:a,numberDependencies:se,subtractDependencies:S,typedDependencies:e,createDiff:Os},Oh={bignumberDependencies:L,matrixDependencies:a,numberDependencies:se,subtractDependencies:S,typedDependencies:e,createDiffTransform:qs},qh={absDependencies:A,addScalarDependencies:T,deepEqualDependencies:ro,divideScalarDependencies:y,multiplyScalarDependencies:C,sqrtDependencies:J,subtractScalarDependencies:Q,typedDependencies:e,createDistance:Ls},Ie={DenseMatrixDependencies:p,concatDependencies:f,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createDotDivide:Qs},Lh={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createDotMultiply:Hs},zh={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,powDependencies:H,typedDependencies:e,createDotPow:Ws},Fd={BigNumberDependencies:s,createE:Gs},Uh={BigNumberDependencies:s,createEfimovFactor:Vs},Oe={matrixDependencies:a,typedDependencies:e,createFlatten:hr},io={typedDependencies:e,createIm:Br},co={flattenDependencies:Oe,matrixDependencies:a,sizeDependencies:w,typedDependencies:e,createMatrixFromColumns:On},Md={BigNumberDependencies:s,FractionDependencies:ue,complexDependencies:Xe,typedDependencies:e,createSign:Ei},oo={addScalarDependencies:T,complexDependencies:Xe,conjDependencies:fe,divideScalarDependencies:y,equalDependencies:B,identityDependencies:ie,isZeroDependencies:X,matrixDependencies:a,multiplyScalarDependencies:C,signDependencies:Md,sqrtDependencies:J,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,zerosDependencies:M,createQr:Ut},po={typedDependencies:e,createRe:Kt},wd={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createReshape:si},Ke={typedDependencies:e,createSin:Ii},lo={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createUsolve:wc},Rd={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createUsolveAll:Rc},Ed={absDependencies:A,addDependencies:u,addScalarDependencies:T,atanDependencies:od,bignumberDependencies:L,columnDependencies:gd,complexDependencies:Xe,cosDependencies:eo,diagDependencies:Td,divideScalarDependencies:y,dotDependencies:Ve,equalDependencies:B,flattenDependencies:Oe,imDependencies:io,invDependencies:De,largerDependencies:P,matrixDependencies:a,matrixFromColumnsDependencies:co,multiplyDependencies:D,multiplyScalarDependencies:C,numberDependencies:se,qrDependencies:oo,reDependencies:po,reshapeDependencies:wd,sinDependencies:Ke,sizeDependencies:w,smallerDependencies:I,sqrtDependencies:J,subtractDependencies:S,typedDependencies:e,usolveDependencies:lo,usolveAllDependencies:Rd,createEigs:Ys},Bh={BigNumberDependencies:s,UnitDependencies:c,createElectricConstant:Zs},Qh={BigNumberDependencies:s,UnitDependencies:c,createElectronMass:Xs},Hh={BigNumberDependencies:s,UnitDependencies:c,createElementaryCharge:Js},Wh={compareTextDependencies:bd,isZeroDependencies:X,typedDependencies:e,createEqualText:er},Gh={typedDependencies:e,createErf:ar},vo={parseDependencies:ee,typedDependencies:e,createEvaluate:sr},jd={typedDependencies:e,createExp:rr},Vh={absDependencies:A,addDependencies:u,identityDependencies:ie,invDependencies:De,multiplyDependencies:D,typedDependencies:e,createExpm:nr},Yh={ComplexDependencies:h,typedDependencies:e,createExpm1:tr},Zh={createFalse:cr},Xh={BigNumberDependencies:s,UnitDependencies:c,createFaraday:or},Jh={BigNumberDependencies:s,UnitDependencies:c,createFermiCoupling:dr},Ad={ComplexDependencies:h,createI:Lr},Pd={ComplexDependencies:h,typedDependencies:e,createLog2:Cn},Id={BigNumberDependencies:s,createTau:fc},Od={addScalarDependencies:T,ceilDependencies:Xc,conjDependencies:fe,divideScalarDependencies:y,dotDivideDependencies:Ie,expDependencies:jd,iDependencies:Ad,log2Dependencies:Pd,matrixDependencies:a,multiplyScalarDependencies:C,powDependencies:H,tauDependencies:Id,typedDependencies:e,createFft:pr},qd={largerDependencies:P,smallerDependencies:I,createFibonacciHeapClass:lr},Kh={typedDependencies:e,createFilter:vr},$h={typedDependencies:e,createFilterTransform:ur},eg={BigNumberDependencies:s,createFineStructure:mr},ag={BigNumberDependencies:s,UnitDependencies:c,createFirstRadiation:fr},sg={typedDependencies:e,createForEach:br},rg={typedDependencies:e,createForEachTransform:xr},ng={ComplexDependencies:h,addDependencies:u,divideDependencies:F,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createFreqz:Sr},tg={BigNumberDependencies:s,UnitDependencies:c,createGasConstant:Fr},ig={BigNumberDependencies:s,DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createGcd:Mr},cg={BigNumberDependencies:s,UnitDependencies:c,createGravitationConstant:Rr},og={BigNumberDependencies:s,UnitDependencies:c,createGravity:Er},dg={BigNumberDependencies:s,UnitDependencies:c,createHartreeEnergy:jr},pg={isNumericDependencies:me,typedDependencies:e,createHasNumericValue:Ar},Ld={evaluateDependencies:vo,createHelpClass:Ir},lg={HelpDependencies:Ld,typedDependencies:e,createHelp:Pr},vg={formatDependencies:je,typedDependencies:e,createHex:Or},ug={absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,isPositiveDependencies:he,multiplyScalarDependencies:C,smallerDependencies:I,sqrtDependencies:J,typedDependencies:e,createHypot:qr},mg={conjDependencies:fe,dotDivideDependencies:Ie,fftDependencies:Od,typedDependencies:e,createIfft:Ur},zd={IndexDependencies:E,typedDependencies:e,createIndex:Hr},fg={IndexDependencies:E,getMatrixDataTypeDependencies:Kc,createIndexTransform:Vr},Dg={BigNumberDependencies:s,createInfinity:Yr},hg={absDependencies:A,addDependencies:u,addScalarDependencies:T,divideScalarDependencies:y,equalScalarDependencies:v,flattenDependencies:Oe,isNumericDependencies:me,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,multiplyScalarDependencies:C,smallerDependencies:I,subtractDependencies:S,typedDependencies:e,createIntersect:Zr},gg={BigNumberDependencies:s,UnitDependencies:c,createInverseConductanceQuantum:Jr},Ud={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createMod:Vn},Bd={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createXgcd:qc},bg={BigNumberDependencies:s,addDependencies:u,equalDependencies:B,isIntegerDependencies:O,modDependencies:Ud,smallerDependencies:I,typedDependencies:e,xgcdDependencies:Bd,createInvmod:Kr},qe={typedDependencies:e,createIsNaN:en},xg={typedDependencies:e,createIsPrime:nn},uo={ComplexDependencies:h,divideScalarDependencies:y,typedDependencies:e,createLog:xn},xe={typedDependencies:e,createMap:jn},yg={divideDependencies:F,dotDivideDependencies:Ie,isNumericDependencies:me,logDependencies:uo,mapDependencies:xe,matrixDependencies:a,multiplyDependencies:D,sumDependencies:$c,typedDependencies:e,createKldivergence:cn},_g={BigNumberDependencies:s,UnitDependencies:c,createKlitzing:on},Cg={matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createKron:dn},Sg={BigNumberDependencies:s,createLN10:pn},Ng={BigNumberDependencies:s,createLN2:ln},kg={BigNumberDependencies:s,createLOG10E:vn},Tg={BigNumberDependencies:s,createLOG2E:un},Fg={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createLcm:Dn},Mg={parseDependencies:ee,typedDependencies:e,createLeafCount:hn},wg={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createLeftShift:gn},Rg={ComplexDependencies:h,typedDependencies:e,createLgamma:bn},Eg={ComplexDependencies:h,typedDependencies:e,createLog10:yn},jg={ComplexDependencies:h,divideScalarDependencies:y,logDependencies:uo,typedDependencies:e,createLog1p:_n},Ag={BigNumberDependencies:s,UnitDependencies:c,createLoschmidt:Sn},Qd={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createLsolve:Nn},Pg={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createLsolveAll:kn},Hd={FibonacciHeapDependencies:qd,addScalarDependencies:T,equalScalarDependencies:v,createSpaClass:Hi},Wd={DenseMatrixDependencies:p,SpaDependencies:Hd,SparseMatrixDependencies:ae,absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,equalScalarDependencies:v,largerDependencies:P,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createLup:Tn},Gd={SparseMatrixDependencies:ae,absDependencies:A,addDependencies:u,divideScalarDependencies:y,largerDependencies:P,largerEqDependencies:Ze,multiplyDependencies:D,subtractDependencies:S,transposeDependencies:Pe,typedDependencies:e,createSlu:Li},Vd={DenseMatrixDependencies:p,lsolveDependencies:Qd,lupDependencies:Wd,matrixDependencies:a,sluDependencies:Gd,typedDependencies:e,usolveDependencies:lo,createLusolve:Fn},mo={absDependencies:A,addDependencies:u,conjDependencies:fe,ctransposeDependencies:ao,eigsDependencies:Ed,equalScalarDependencies:v,largerDependencies:P,matrixDependencies:a,multiplyDependencies:D,powDependencies:H,smallerDependencies:I,sqrtDependencies:J,typedDependencies:e,createNorm:tt},Yd={identityDependencies:ie,matrixDependencies:a,multiplyDependencies:D,normDependencies:mo,qrDependencies:oo,subtractDependencies:S,typedDependencies:e,createSchur:gi},Zd={absDependencies:A,addDependencies:u,concatDependencies:f,identityDependencies:ie,indexDependencies:zd,lusolveDependencies:Vd,matrixDependencies:a,matrixFromColumnsDependencies:co,multiplyDependencies:D,rangeDependencies:Fe,schurDependencies:Yd,subsetDependencies:q,subtractDependencies:S,transposeDependencies:Pe,typedDependencies:e,createSylvester:pc},Ig={matrixDependencies:a,multiplyDependencies:D,sylvesterDependencies:Zd,transposeDependencies:Pe,typedDependencies:e,createLyap:Mn},$e={compareDependencies:ge,isNaNDependencies:qe,isNumericDependencies:me,typedDependencies:e,createPartitionSelect:Ct},Xd={addDependencies:u,compareDependencies:ge,divideDependencies:F,partitionSelectDependencies:$e,typedDependencies:e,createMedian:Hn},Og={absDependencies:A,mapDependencies:xe,medianDependencies:Xd,subtractDependencies:S,typedDependencies:e,createMad:wn},qg={BigNumberDependencies:s,UnitDependencies:c,createMagneticConstant:Rn},Lg={BigNumberDependencies:s,UnitDependencies:c,createMagneticFluxQuantum:En},zg={typedDependencies:e,createMapTransform:An},Ug={isZeroDependencies:X,matrixDependencies:a,typedDependencies:e,createMatrixFromFunction:qn},Bg={flattenDependencies:Oe,matrixDependencies:a,sizeDependencies:w,typedDependencies:e,createMatrixFromRows:Ln},fo={largerDependencies:P,numericDependencies:Z,typedDependencies:e,createMax:zn},Qg={largerDependencies:P,numericDependencies:Z,typedDependencies:e,createMaxTransform:Un},Hg={addDependencies:u,divideDependencies:F,typedDependencies:e,createMeanTransform:Qn},Wg={numericDependencies:Z,smallerDependencies:I,typedDependencies:e,createMin:Wn},Gg={numericDependencies:Z,smallerDependencies:I,typedDependencies:e,createMinTransform:Gn},Vg={isNaNDependencies:qe,isNumericDependencies:me,typedDependencies:e,createMode:Yn},Yg={BigNumberDependencies:s,UnitDependencies:c,createMolarMass:Zn},Zg={BigNumberDependencies:s,UnitDependencies:c,createMolarMassC12:Xn},Xg={BigNumberDependencies:s,UnitDependencies:c,createMolarPlanckConstant:Jn},Jg={BigNumberDependencies:s,UnitDependencies:c,createMolarVolume:Kn},Kg={addDependencies:u,divideDependencies:F,factorialDependencies:Ae,isIntegerDependencies:O,isPositiveDependencies:he,multiplyDependencies:D,typedDependencies:e,createMultinomial:$n},$g={BigNumberDependencies:s,createNaN:st},eb={BigNumberDependencies:s,UnitDependencies:c,createNeutronMass:rt},ab={BigNumberDependencies:s,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createNthRoot:ct},sb={ComplexDependencies:h,divideScalarDependencies:y,typedDependencies:e,createNthRoots:ot},rb={BigNumberDependencies:s,UnitDependencies:c,createNuclearMagneton:dt},nb={createNull:pt},tb={formatDependencies:je,typedDependencies:e,createOct:mt},ib={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createOnes:ft},cb={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createOr:ht},ob={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createOrTransform:gt},Jd={evaluateDependencies:vo,createParserClass:_t},db={ParserDependencies:Jd,typedDependencies:e,createParser:yt},pb={factorialDependencies:Ae,typedDependencies:e,createPermutations:St},lb={BigNumberDependencies:s,createPhi:Nt},Do={BigNumberDependencies:s,createPi:kt},vb={typedDependencies:e,createPickRandom:Tt},ub={ComplexDependencies:h,addDependencies:u,ctransposeDependencies:ao,deepEqualDependencies:ro,divideScalarDependencies:y,dotDependencies:Ve,dotDivideDependencies:Ie,equalDependencies:B,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createPinv:Ft},mb={BigNumberDependencies:s,UnitDependencies:c,createPlanckCharge:Mt},fb={BigNumberDependencies:s,UnitDependencies:c,createPlanckConstant:wt},Db={BigNumberDependencies:s,UnitDependencies:c,createPlanckLength:Rt},hb={BigNumberDependencies:s,UnitDependencies:c,createPlanckMass:Et},gb={BigNumberDependencies:s,UnitDependencies:c,createPlanckTemperature:jt},bb={BigNumberDependencies:s,UnitDependencies:c,createPlanckTime:At},Kd={typedDependencies:e,createTypeOf:yc},xb={addDependencies:u,cbrtDependencies:fd,divideDependencies:F,equalScalarDependencies:v,imDependencies:io,isZeroDependencies:X,multiplyDependencies:D,reDependencies:po,sqrtDependencies:J,subtractDependencies:S,typeOfDependencies:Kd,typedDependencies:e,unaryMinusDependencies:K,createPolynomialRoot:Pt},yb={typedDependencies:e,createPrint:Ot},_b={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createPrintTransform:qt},Cb={BigNumberDependencies:s,UnitDependencies:c,createProtonMass:zt},Sb={bignumberDependencies:L,addDependencies:u,compareDependencies:ge,divideDependencies:F,isIntegerDependencies:O,largerDependencies:P,multiplyDependencies:D,partitionSelectDependencies:$e,smallerDependencies:I,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createQuantileSeq:Bt},Nb={addDependencies:u,bignumberDependencies:L,compareDependencies:ge,divideDependencies:F,isIntegerDependencies:O,largerDependencies:P,multiplyDependencies:D,partitionSelectDependencies:$e,smallerDependencies:I,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createQuantileSeqTransform:Qt},kb={BigNumberDependencies:s,UnitDependencies:c,createQuantumOfCirculation:Ht},Tb={typedDependencies:e,createRandom:Wt},Fb={typedDependencies:e,createRandomInt:Gt},Mb={createRangeClass:Yt},wb={bignumberDependencies:L,matrixDependencies:a,addDependencies:u,isPositiveDependencies:he,largerDependencies:P,largerEqDependencies:Ze,smallerDependencies:I,smallerEqDependencies:Te,typedDependencies:e,createRangeTransform:Xt},Rb={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,simplifyDependencies:Je,simplifyConstantDependencies:no,simplifyCoreDependencies:to,subtractDependencies:S,typedDependencies:e,createRationalize:Jt},Eb={BigNumberDependencies:s,UnitDependencies:c,createReducedPlanckConstant:$t},jb={createReplacer:ai},Ab={matrixDependencies:a,createResize:ri},Pb={createReviver:ii},Ib={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRightArithShift:ci},Ob={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRightLogShift:oi},$d={BigNumberDependencies:s,DenseMatrixDependencies:p,SparseMatrixDependencies:ae,addScalarDependencies:T,cosDependencies:eo,matrixDependencies:a,multiplyScalarDependencies:C,normDependencies:mo,sinDependencies:Ke,typedDependencies:e,unaryMinusDependencies:K,createRotationMatrix:pi},qb={multiplyDependencies:D,rotationMatrixDependencies:$d,typedDependencies:e,createRotate:di},Lb={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createRow:vi},zb={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createRowTransform:ui},Ub={BigNumberDependencies:s,UnitDependencies:c,createRydberg:mi},Bb={BigNumberDependencies:s,createSQRT1_2:fi},Qb={BigNumberDependencies:s,createSQRT2:Di},Hb={BigNumberDependencies:s,createSackurTetrode:hi},Wb={BigNumberDependencies:s,typedDependencies:e,createSec:bi},Gb={BigNumberDependencies:s,typedDependencies:e,createSech:xi},Vb={BigNumberDependencies:s,UnitDependencies:c,createSecondRadiation:yi},Yb={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetCartesian:_i},ep={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetDifference:Ci},Zb={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetDistinct:Si},ap={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetIntersect:Ni},Xb={IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetIsSubset:ki},Jb={IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetMultiplicity:Ti},Kb={IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetPowerset:Fi},$b={compareNaturalDependencies:$,typedDependencies:e,createSetSize:Mi},sp={IndexDependencies:E,concatDependencies:f,setDifferenceDependencies:ep,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetSymDifference:wi},ex={IndexDependencies:E,concatDependencies:f,setIntersectDependencies:ap,setSymDifferenceDependencies:sp,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetUnion:Ri},ax={typedDependencies:e,createSinh:Oi},sx={absDependencies:A,addDependencies:u,bignumberDependencies:L,divideDependencies:F,isNegativeDependencies:ce,isPositiveDependencies:he,largerDependencies:P,mapDependencies:xe,matrixDependencies:a,maxDependencies:fo,multiplyDependencies:D,smallerDependencies:I,subtractDependencies:S,typedDependencies:e,unaryMinusDependencies:K,createSolveODE:Bi},rx={compareDependencies:ge,compareNaturalDependencies:$,matrixDependencies:a,typedDependencies:e,createSort:Qi},nx={SparseMatrixDependencies:ae,typedDependencies:e,createSparse:Wi},tx={BigNumberDependencies:s,UnitDependencies:c,createSpeedOfLight:Vi},ix={typedDependencies:e,createSplitUnit:Yi},cx={absDependencies:A,addDependencies:u,identityDependencies:ie,invDependencies:De,mapDependencies:xe,maxDependencies:fo,multiplyDependencies:D,sizeDependencies:w,sqrtDependencies:J,subtractDependencies:S,typedDependencies:e,createSqrtm:Xi},ox={typedDependencies:e,createSquare:Ji},dx={matrixDependencies:a,typedDependencies:e,createSqueeze:Ki},ho={addDependencies:u,applyDependencies:Zc,divideDependencies:F,isNaNDependencies:qe,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createVariance:jc},px={mapDependencies:xe,sqrtDependencies:J,typedDependencies:e,varianceDependencies:ho,createStd:$i},lx={mapDependencies:xe,sqrtDependencies:J,typedDependencies:e,varianceDependencies:ho,createStdTransform:ec},vx={BigNumberDependencies:s,UnitDependencies:c,createStefanBoltzmann:ac},ux={typedDependencies:e,createString:rc},mx={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createSubsetTransform:tc},fx={addDependencies:u,numericDependencies:Z,typedDependencies:e,createSumTransform:dc},Dx={OperatorNodeDependencies:re,parseDependencies:ee,simplifyDependencies:Je,typedDependencies:e,createSymbolicEqual:vc},hx={typedDependencies:e,createTan:uc},gx={typedDependencies:e,createTanh:mc},bx={BigNumberDependencies:s,UnitDependencies:c,createThomsonCrossSection:Dc},xx={concatDependencies:f,matrixDependencies:a,typedDependencies:e,createTo:hc},yx={addDependencies:u,matrixDependencies:a,typedDependencies:e,createTrace:gc},_x={createTrue:xc},Cx={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createUnequal:Nc},Sx={UnitDependencies:c,typedDependencies:e,createUnitFunction:Tc},Nx={eDependencies:Fd,createUppercaseE:Fc},kx={piDependencies:Do,createUppercasePi:Mc},Tx={BigNumberDependencies:s,UnitDependencies:c,createVacuumImpedance:Ec},Fx={addDependencies:u,applyDependencies:Zc,divideDependencies:F,isNaNDependencies:qe,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createVarianceTransform:Ac},Mx={createVersion:Pc},wx={BigNumberDependencies:s,createWeakMixingAngle:Ic},Rx={BigNumberDependencies:s,UnitDependencies:c,createWienDisplacement:Oc},Ex={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createXor:Lc},jx={BigNumberDependencies:s,ComplexDependencies:h,addDependencies:u,divideDependencies:F,equalDependencies:B,factorialDependencies:Ae,gammaDependencies:Jc,isNegativeDependencies:ce,multiplyDependencies:D,piDependencies:Do,powDependencies:H,sinDependencies:Ke,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createZeta:Uc},Ax={ComplexDependencies:h,addDependencies:u,multiplyDependencies:D,numberDependencies:se,typedDependencies:e,createZpk2tf:Bc},Px=AD,He={},Ix={get exports(){return He},set exports(n){He=n}};function go(){}go.prototype={on:function(n,l,i){var o=this.e||(this.e={});return(o[n]||(o[n]=[])).push({fn:l,ctx:i}),this},once:function(n,l,i){var o=this;function x(){o.off(n,x),l.apply(i,arguments)}return x._=l,this.on(n,x,i)},emit:function(n){var l=[].slice.call(arguments,1),i=((this.e||(this.e={}))[n]||[]).slice(),o=0,x=i.length;for(o;oj(ye,np));else if(typeof k=="object")for(var Y in k)_e(k,Y)&&j(ye,k[Y],Y);else if(Ee(k)||te!==void 0){var Be=Ee(k)?Ue(k)?k.fn+".transform":k.fn:te;if(_e(ye,Be)&&ye[Be]!==k&&!m.silent)throw new Error('Cannot import "'+Be+'" twice');ye[Be]=k}else if(!m.silent)throw new TypeError("Factory, Object, or Array expected")}var z={};j(z,r);for(var U in z)if(_e(z,U)){var V=z[U];if(Ee(V))ze(V,m);else if(N(V))d(U,V,m);else if(!m.silent)throw new TypeError("Factory, Object, or Array expected")}}function d(r,m,b){if(b.wrap&&typeof m=="function"&&(m=Le(m)),le(m)&&(m=n(r,{[m.signature]:m})),n.isTypedFunction(i[r])&&n.isTypedFunction(m)){b.override?m=n(r,m.signatures):m=n(i[r],m),i[r]=m,delete o[r],W(r,m),i.emit("import",r,function(){return m});return}if(i[r]===void 0||b.override){i[r]=m,delete o[r],W(r,m),i.emit("import",r,function(){return m});return}if(!b.silent)throw new Error('Cannot import "'+r+'": already exists')}function W(r,m){m&&typeof m.transform=="function"?(i.expression.transform[r]=m.transform,G(r)&&(i.expression.mathWithTransform[r]=m.transform)):(delete i.expression.transform[r],G(r)&&(i.expression.mathWithTransform[r]=m))}function _(r){delete i.expression.transform[r],G(r)?i.expression.mathWithTransform[r]=i[r]:delete i.expression.mathWithTransform[r]}function Le(r){var m=function(){for(var j=[],z=0,U=arguments.length;z2&&arguments[2]!==void 0?arguments[2]:r.fn;if(xo(b,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(b));var j=Ue(r)?i.expression.transform:i,z=b in i.expression.transform,U=_e(j,b)?j[b]:void 0,V=function(){var k={};r.dependencies.map(tp).forEach(Y=>{if(xo(Y,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(Y));Y==="math"?k.math=i:Y==="mathWithTransform"?k.mathWithTransform=i.expression.mathWithTransform:Y==="classes"?k.classes=i:k[Y]=i[Y]});var te=r(k);if(te&&typeof te.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(U===void 0||m.override)return te;if(n.isTypedFunction(U)&&n.isTypedFunction(te))return n(U,te);if(m.silent)return U;throw new Error('Cannot import "'+b+'": already exists')};!r.meta||r.meta.lazy!==!1?(ea(j,b,V),U&&z?_(b):(Ue(r)||ne(r))&&ea(i.expression.mathWithTransform,b,()=>j[b])):(j[b]=V(),U&&z?_(b):(Ue(r)||ne(r))&&ea(i.expression.mathWithTransform,b,()=>j[b])),o[b]=r,i.emit("import",b,V)}function N(r){return typeof r=="function"||typeof r=="number"||typeof r=="string"||typeof r=="boolean"||r===null||Hc(r)||Wc(r)||Gc(r)||Vc(r)||Yc(r)||Array.isArray(r)}function le(r){return typeof r=="function"&&typeof r.signature=="string"}function G(r){return!_e(bo,r)}function ne(r){return r.fn.indexOf(".")===-1&&!_e(bo,r.fn)&&(!r.meta||!r.meta.isClass)}function Ue(r){return r!==void 0&&r.meta!==void 0&&r.meta.isTransformFunction===!0||!1}var bo={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return x}function rp(n,l){var i=ip({},cp,l);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var o=Ox({isNumber:To,isComplex:Wc,isBigNumber:Gc,isFraction:Vc,isUnit:Hc,isString:Fo,isArray:Mo,isMatrix:Yc,isCollection:wo,isDenseMatrix:Ro,isSparseMatrix:Eo,isRange:jo,isIndex:Ao,isBoolean:Po,isResultSet:Io,isHelp:Oo,isFunction:qo,isDate:Lo,isRegExp:zo,isObject:Uo,isNull:Bo,isUndefined:Qo,isAccessorNode:Ho,isArrayNode:Wo,isAssignmentNode:Go,isBlockNode:Vo,isConditionalNode:Yo,isConstantNode:Zo,isFunctionAssignmentNode:Xo,isFunctionNode:Jo,isIndexNode:Ko,isNode:$o,isObjectNode:ed,isOperatorNode:ad,isParenthesisNode:sd,isRangeNode:rd,isRelationalNode:nd,isSymbolNode:td,isChain:id});o.config=op(i,o.emit),o.expression={transform:{},mathWithTransform:{config:o.config}};var x=[],d=[];function W(N){if(Ee(N))return N(o);var le=N[Object.keys(N)[0]];if(Ee(le))return le(o);if(!lp(N))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",N),new Error("Factory object with properties `type`, `name`, and `factory` expected");var G=x.indexOf(N),ne;return G===-1?(N.math===!0?ne=N.factory(o.type,i,W,o.typed,o):ne=N.factory(o.type,i,W,o.typed),x.push(N),d.push(ne)):ne=d[G],ne}var _={};function Le(){for(var N=arguments.length,le=new Array(N),G=0;G{yo(_).forEach(N=>{N&&N.meta&&N.meta.recreateOnConfigChange&&ze(N,{override:!0})})}),o.create=rp.bind(null,n),o.factory=So,o.import(yo(pp(n))),o.ArgumentsError=Qc,o.DimensionError=No,o.IndexError=ko,o}const Lx=Object.freeze(Object.defineProperty({__proto__:null,AccessorNode:vp,AccessorNodeDependencies:Ce,ArgumentsError:Qc,ArrayNode:up,ArrayNodeDependencies:Se,AssignmentNode:mp,AssignmentNodeDependencies:cd,BigNumber:fp,BigNumberDependencies:s,BlockNode:Dp,BlockNodeDependencies:md,Chain:hp,ChainDependencies:Dd,Complex:gp,ComplexDependencies:h,ConditionalNode:bp,ConditionalNodeDependencies:xd,ConstantNode:xp,ConstantNodeDependencies:oe,DenseMatrix:yp,DenseMatrixDependencies:p,DimensionError:No,EDependencies:Nx,FibonacciHeap:_p,FibonacciHeapDependencies:qd,Fraction:Cp,FractionDependencies:ue,FunctionAssignmentNode:Sp,FunctionAssignmentNodeDependencies:yd,FunctionNode:Np,FunctionNodeDependencies:pe,Help:kp,HelpDependencies:Ld,ImmutableDenseMatrix:Tp,ImmutableDenseMatrixDependencies:hd,Index:Fp,IndexDependencies:E,IndexError:ko,IndexNode:Mp,IndexNodeDependencies:Me,InfinityDependencies:Dg,LN10:wp,LN10Dependencies:Sg,LN2:Rp,LN2Dependencies:Ng,LOG10E:Ep,LOG10EDependencies:kg,LOG2E:jp,LOG2EDependencies:Tg,Matrix:Ap,MatrixDependencies:We,NaNDependencies:$g,Node:Pp,NodeDependencies:R,ObjectNode:Ip,ObjectNodeDependencies:we,OperatorNode:Op,OperatorNodeDependencies:re,PIDependencies:kx,ParenthesisNode:qp,ParenthesisNodeDependencies:be,Parser:Lp,ParserDependencies:Jd,Range:zp,RangeDependencies:Mb,RangeNode:Up,RangeNodeDependencies:_d,RelationalNode:Bp,RelationalNodeDependencies:Cd,ResultSet:Qp,ResultSetDependencies:ud,SQRT1_2:Hp,SQRT1_2Dependencies:Bb,SQRT2:Wp,SQRT2Dependencies:Qb,Spa:Gp,SpaDependencies:Hd,SparseMatrix:Vp,SparseMatrixDependencies:ae,SymbolNode:Yp,SymbolNodeDependencies:de,Unit:Zp,UnitDependencies:c,_Infinity:Xp,_NaN:Jp,_false:Kp,_null:$p,_true:el,abs:al,absDependencies:A,acos:sl,acosDependencies:PD,acosh:rl,acoshDependencies:ID,acot:nl,acotDependencies:OD,acoth:tl,acothDependencies:qD,acsc:il,acscDependencies:LD,acsch:cl,acschDependencies:zD,add:ol,addDependencies:u,addScalar:dl,addScalarDependencies:T,all:Px,and:pl,andDependencies:UD,andTransformDependencies:BD,apply:ll,applyDependencies:Zc,applyTransformDependencies:QD,arg:vl,argDependencies:HD,asec:ul,asecDependencies:WD,asech:ml,asechDependencies:GD,asin:fl,asinDependencies:VD,asinh:Dl,asinhDependencies:YD,atan:hl,atan2:gl,atan2Dependencies:ZD,atanDependencies:od,atanh:bl,atanhDependencies:XD,atomicMass:xl,atomicMassDependencies:JD,avogadro:yl,avogadroDependencies:KD,bellNumbers:_l,bellNumbersDependencies:$D,bignumber:Cl,bignumberDependencies:L,bin:Sl,binDependencies:eh,bitAnd:Nl,bitAndDependencies:ah,bitAndTransformDependencies:sh,bitNot:kl,bitNotDependencies:rh,bitOr:Tl,bitOrDependencies:nh,bitOrTransformDependencies:th,bitXor:Fl,bitXorDependencies:ih,bohrMagneton:Ml,bohrMagnetonDependencies:ch,bohrRadius:wl,bohrRadiusDependencies:oh,boltzmann:Rl,boltzmannDependencies:dh,boolean:El,booleanDependencies:ph,catalan:jl,catalanDependencies:lh,cbrt:Al,cbrtDependencies:fd,ceil:Pl,ceilDependencies:Xc,chain:ra,chainDependencies:vh,classicalElectronRadius:Il,classicalElectronRadiusDependencies:uh,clone:Ol,cloneDependencies:mh,column:ql,columnDependencies:gd,columnTransformDependencies:fh,combinations:Ll,combinationsDependencies:Ye,combinationsWithRep:zl,combinationsWithRepDependencies:Dh,compare:Ul,compareDependencies:ge,compareNatural:Bl,compareNaturalDependencies:$,compareText:Ql,compareTextDependencies:bd,compile:Hl,compileDependencies:hh,complex:Wl,complexDependencies:Xe,composition:Gl,compositionDependencies:gh,concat:Vl,concatDependencies:f,concatTransformDependencies:bh,conductanceQuantum:Yl,conductanceQuantumDependencies:xh,config:Zl,conj:Xl,conjDependencies:fe,corr:Jl,corrDependencies:yh,cos:Kl,cosDependencies:eo,cosh:$l,coshDependencies:_h,cot:ev,cotDependencies:Ch,coth:av,cothDependencies:Sh,coulomb:sv,coulombDependencies:Nh,count:rv,countDependencies:kh,create:rp,createAbs:na,createAccessorNode:ta,createAcos:ia,createAcosh:ca,createAcot:oa,createAcoth:da,createAcsc:pa,createAcsch:la,createAdd:va,createAddScalar:ua,createAnd:ma,createAndTransform:fa,createApply:Da,createApplyTransform:ha,createArg:ga,createArrayNode:ba,createAsec:xa,createAsech:ya,createAsin:_a,createAsinh:Ca,createAssignmentNode:Sa,createAtan:Na,createAtan2:ka,createAtanh:Ta,createAtomicMass:Fa,createAvogadro:Ma,createBellNumbers:wa,createBigNumberClass:Ra,createBignumber:Ea,createBin:ja,createBitAnd:Aa,createBitAndTransform:Pa,createBitNot:Ia,createBitOr:Oa,createBitOrTransform:qa,createBitXor:La,createBlockNode:za,createBohrMagneton:Ua,createBohrRadius:Ba,createBoltzmann:Qa,createBoolean:Ha,createCatalan:Wa,createCbrt:Ga,createCeil:Va,createChain:Ya,createChainClass:Za,createClassicalElectronRadius:Xa,createClone:Ja,createColumn:Ka,createColumnTransform:$a,createCombinations:es,createCombinationsWithRep:as,createCompare:ss,createCompareNatural:rs,createCompareText:ts,createCompile:is,createComplex:cs,createComplexClass:os,createComposition:ds,createConcat:ps,createConcatTransform:ls,createConditionalNode:vs,createConductanceQuantum:us,createConj:ms,createConstantNode:fs,createCorr:Ds,createCos:hs,createCosh:gs,createCot:bs,createCoth:xs,createCoulomb:ys,createCount:_s,createCreateUnit:Cs,createCross:Ss,createCsc:Ns,createCsch:ks,createCtranspose:Ts,createCube:Fs,createCumSum:Ms,createCumSumTransform:ws,createDeepEqual:Rs,createDenseMatrixClass:Es,createDerivative:js,createDet:As,createDeuteronMass:Ps,createDiag:Is,createDiff:Os,createDiffTransform:qs,createDistance:Ls,createDivide:zs,createDivideScalar:Us,createDot:Bs,createDotDivide:Qs,createDotMultiply:Hs,createDotPow:Ws,createE:Gs,createEfimovFactor:Vs,createEigs:Ys,createElectricConstant:Zs,createElectronMass:Xs,createElementaryCharge:Js,createEqual:Ks,createEqualScalar:$s,createEqualText:er,createErf:ar,createEvaluate:sr,createExp:rr,createExpm:nr,createExpm1:tr,createFactorial:ir,createFalse:cr,createFaraday:or,createFermiCoupling:dr,createFft:pr,createFibonacciHeapClass:lr,createFilter:vr,createFilterTransform:ur,createFineStructure:mr,createFirstRadiation:fr,createFix:Dr,createFlatten:hr,createFloor:gr,createForEach:br,createForEachTransform:xr,createFormat:yr,createFraction:_r,createFractionClass:Cr,createFreqz:Sr,createFunctionAssignmentNode:Nr,createFunctionNode:kr,createGamma:Tr,createGasConstant:Fr,createGcd:Mr,createGetMatrixDataType:wr,createGravitationConstant:Rr,createGravity:Er,createHartreeEnergy:jr,createHasNumericValue:Ar,createHelp:Pr,createHelpClass:Ir,createHex:Or,createHypot:qr,createI:Lr,createIdentity:zr,createIfft:Ur,createIm:Br,createImmutableDenseMatrixClass:Qr,createIndex:Hr,createIndexClass:Wr,createIndexNode:Gr,createIndexTransform:Vr,createInfinity:Yr,createIntersect:Zr,createInv:Xr,createInverseConductanceQuantum:Jr,createInvmod:Kr,createIsInteger:$r,createIsNaN:en,createIsNegative:an,createIsNumeric:sn,createIsPositive:rn,createIsPrime:nn,createIsZero:tn,createKldivergence:cn,createKlitzing:on,createKron:dn,createLN10:pn,createLN2:ln,createLOG10E:vn,createLOG2E:un,createLarger:mn,createLargerEq:fn,createLcm:Dn,createLeafCount:hn,createLeftShift:gn,createLgamma:bn,createLog:xn,createLog10:yn,createLog1p:_n,createLog2:Cn,createLoschmidt:Sn,createLsolve:Nn,createLsolveAll:kn,createLup:Tn,createLusolve:Fn,createLyap:Mn,createMad:wn,createMagneticConstant:Rn,createMagneticFluxQuantum:En,createMap:jn,createMapTransform:An,createMatrix:Pn,createMatrixClass:In,createMatrixFromColumns:On,createMatrixFromFunction:qn,createMatrixFromRows:Ln,createMax:zn,createMaxTransform:Un,createMean:Bn,createMeanTransform:Qn,createMedian:Hn,createMin:Wn,createMinTransform:Gn,createMod:Vn,createMode:Yn,createMolarMass:Zn,createMolarMassC12:Xn,createMolarPlanckConstant:Jn,createMolarVolume:Kn,createMultinomial:$n,createMultiply:et,createMultiplyScalar:at,createNaN:st,createNeutronMass:rt,createNode:nt,createNorm:tt,createNot:it,createNthRoot:ct,createNthRoots:ot,createNuclearMagneton:dt,createNull:pt,createNumber:lt,createNumeric:vt,createObjectNode:ut,createOct:mt,createOnes:ft,createOperatorNode:Dt,createOr:ht,createOrTransform:gt,createParenthesisNode:bt,createParse:xt,createParser:yt,createParserClass:_t,createPartitionSelect:Ct,createPermutations:St,createPhi:Nt,createPi:kt,createPickRandom:Tt,createPinv:Ft,createPlanckCharge:Mt,createPlanckConstant:wt,createPlanckLength:Rt,createPlanckMass:Et,createPlanckTemperature:jt,createPlanckTime:At,createPolynomialRoot:Pt,createPow:It,createPrint:Ot,createPrintTransform:qt,createProd:Lt,createProtonMass:zt,createQr:Ut,createQuantileSeq:Bt,createQuantileSeqTransform:Qt,createQuantumOfCirculation:Ht,createRandom:Wt,createRandomInt:Gt,createRange:Vt,createRangeClass:Yt,createRangeNode:Zt,createRangeTransform:Xt,createRationalize:Jt,createRe:Kt,createReducedPlanckConstant:$t,createRelationalNode:ei,createReplacer:ai,createReshape:si,createResize:ri,createResolve:ni,createResultSet:ti,createReviver:ii,createRightArithShift:ci,createRightLogShift:oi,createRotate:di,createRotationMatrix:pi,createRound:li,createRow:vi,createRowTransform:ui,createRydberg:mi,createSQRT1_2:fi,createSQRT2:Di,createSackurTetrode:hi,createSchur:gi,createSec:bi,createSech:xi,createSecondRadiation:yi,createSetCartesian:_i,createSetDifference:Ci,createSetDistinct:Si,createSetIntersect:Ni,createSetIsSubset:ki,createSetMultiplicity:Ti,createSetPowerset:Fi,createSetSize:Mi,createSetSymDifference:wi,createSetUnion:Ri,createSign:Ei,createSimplify:ji,createSimplifyConstant:Ai,createSimplifyCore:Pi,createSin:Ii,createSinh:Oi,createSize:qi,createSlu:Li,createSmaller:zi,createSmallerEq:Ui,createSolveODE:Bi,createSort:Qi,createSpaClass:Hi,createSparse:Wi,createSparseMatrixClass:Gi,createSpeedOfLight:Vi,createSplitUnit:Yi,createSqrt:Zi,createSqrtm:Xi,createSquare:Ji,createSqueeze:Ki,createStd:$i,createStdTransform:ec,createStefanBoltzmann:ac,createStirlingS2:sc,createString:rc,createSubset:nc,createSubsetTransform:tc,createSubtract:ic,createSubtractScalar:cc,createSum:oc,createSumTransform:dc,createSylvester:pc,createSymbolNode:lc,createSymbolicEqual:vc,createTan:uc,createTanh:mc,createTau:fc,createThomsonCrossSection:Dc,createTo:hc,createTrace:gc,createTranspose:bc,createTrue:xc,createTypeOf:yc,createTyped:_c,createUnaryMinus:Cc,createUnaryPlus:Sc,createUnequal:Nc,createUnit:nv,createUnitClass:kc,createUnitDependencies:Th,createUnitFunction:Tc,createUppercaseE:Fc,createUppercasePi:Mc,createUsolve:wc,createUsolveAll:Rc,createVacuumImpedance:Ec,createVariance:jc,createVarianceTransform:Ac,createVersion:Pc,createWeakMixingAngle:Ic,createWienDisplacement:Oc,createXgcd:qc,createXor:Lc,createZeros:zc,createZeta:Uc,createZpk2tf:Bc,cross:tv,crossDependencies:Fh,csc:iv,cscDependencies:Mh,csch:cv,cschDependencies:wh,ctranspose:ov,ctransposeDependencies:ao,cube:dv,cubeDependencies:Rh,cumsum:pv,cumsumDependencies:Eh,cumsumTransformDependencies:jh,deepEqual:lv,deepEqualDependencies:ro,derivative:vv,derivativeDependencies:Ah,det:uv,detDependencies:ld,deuteronMass:mv,deuteronMassDependencies:Ph,diag:fv,diagDependencies:Td,diff:Dv,diffDependencies:Ih,diffTransformDependencies:Oh,distance:hv,distanceDependencies:qh,divide:gv,divideDependencies:F,divideScalar:bv,divideScalarDependencies:y,docs:xv,dot:yv,dotDependencies:Ve,dotDivide:_v,dotDivideDependencies:Ie,dotMultiply:Cv,dotMultiplyDependencies:Lh,dotPow:Sv,dotPowDependencies:zh,e:Nv,eDependencies:Fd,efimovFactor:kv,efimovFactorDependencies:Uh,eigs:Tv,eigsDependencies:Ed,electricConstant:Fv,electricConstantDependencies:Bh,electronMass:Mv,electronMassDependencies:Qh,elementaryCharge:wv,elementaryChargeDependencies:Hh,equal:Rv,equalDependencies:B,equalScalar:Ev,equalScalarDependencies:v,equalText:jv,equalTextDependencies:Wh,erf:Av,erfDependencies:Gh,evaluate:Pv,evaluateDependencies:vo,exp:Iv,expDependencies:jd,expm:Ov,expm1:qv,expm1Dependencies:Yh,expmDependencies:Vh,factorial:Lv,factorialDependencies:Ae,factory:So,falseDependencies:Zh,faraday:zv,faradayDependencies:Xh,fermiCoupling:Uv,fermiCouplingDependencies:Jh,fft:Bv,fftDependencies:Od,filter:Qv,filterDependencies:Kh,filterTransformDependencies:$h,fineStructure:Hv,fineStructureDependencies:eg,firstRadiation:Wv,firstRadiationDependencies:ag,fix:Gv,fixDependencies:pd,flatten:Vv,flattenDependencies:Oe,floor:Yv,floorDependencies:dd,forEach:Zv,forEachDependencies:sg,forEachTransformDependencies:rg,format:Xv,formatDependencies:je,fraction:Jv,fractionDependencies:Ne,freqz:Kv,freqzDependencies:ng,gamma:$v,gammaDependencies:Jc,gasConstant:eu,gasConstantDependencies:tg,gcd:au,gcdDependencies:ig,getMatrixDataType:su,getMatrixDataTypeDependencies:Kc,gravitationConstant:ru,gravitationConstantDependencies:cg,gravity:nu,gravityDependencies:og,hartreeEnergy:tu,hartreeEnergyDependencies:dg,hasNumericValue:iu,hasNumericValueDependencies:pg,help:cu,helpDependencies:lg,hex:ou,hexDependencies:vg,hypot:du,hypotDependencies:ug,i:pu,iDependencies:Ad,identity:lu,identityDependencies:ie,ifft:vu,ifftDependencies:mg,im:uu,imDependencies:io,index:mu,indexDependencies:zd,indexTransformDependencies:fg,intersect:fu,intersectDependencies:hg,inv:Du,invDependencies:De,inverseConductanceQuantum:hu,inverseConductanceQuantumDependencies:gg,invmod:gu,invmodDependencies:bg,isAccessorNode:Ho,isArray:Mo,isArrayNode:Wo,isAssignmentNode:Go,isBigNumber:Gc,isBlockNode:Vo,isBoolean:Po,isChain:id,isCollection:wo,isComplex:Wc,isConditionalNode:Yo,isConstantNode:Zo,isDate:Lo,isDenseMatrix:Ro,isFraction:Vc,isFunction:qo,isFunctionAssignmentNode:Xo,isFunctionNode:Jo,isHelp:Oo,isIndex:Ao,isIndexNode:Ko,isInteger:bu,isIntegerDependencies:O,isMatrix:Yc,isNaN:xu,isNaNDependencies:qe,isNegative:yu,isNegativeDependencies:ce,isNode:$o,isNull:Bo,isNumber:To,isNumeric:_u,isNumericDependencies:me,isObject:Uo,isObjectNode:ed,isOperatorNode:ad,isParenthesisNode:sd,isPositive:Cu,isPositiveDependencies:he,isPrime:Su,isPrimeDependencies:xg,isRange:jo,isRangeNode:rd,isRegExp:zo,isRelationalNode:nd,isResultSet:Io,isSparseMatrix:Eo,isString:Fo,isSymbolNode:td,isUndefined:Qo,isUnit:Hc,isZero:Nu,isZeroDependencies:X,kldivergence:ku,kldivergenceDependencies:yg,klitzing:Tu,klitzingDependencies:_g,kron:Fu,kronDependencies:Cg,larger:Mu,largerDependencies:P,largerEq:wu,largerEqDependencies:Ze,lcm:Ru,lcmDependencies:Fg,leafCount:Eu,leafCountDependencies:Mg,leftShift:ju,leftShiftDependencies:wg,lgamma:Au,lgammaDependencies:Rg,log:Pu,log10:Iu,log10Dependencies:Eg,log1p:Ou,log1pDependencies:jg,log2:qu,log2Dependencies:Pd,logDependencies:uo,loschmidt:Lu,loschmidtDependencies:Ag,lsolve:zu,lsolveAll:Uu,lsolveAllDependencies:Pg,lsolveDependencies:Qd,lup:Bu,lupDependencies:Wd,lusolve:Qu,lusolveDependencies:Vd,lyap:Hu,lyapDependencies:Ig,mad:Wu,madDependencies:Og,magneticConstant:Gu,magneticConstantDependencies:qg,magneticFluxQuantum:Vu,magneticFluxQuantumDependencies:Lg,map:Yu,mapDependencies:xe,mapTransformDependencies:zg,matrix:Zu,matrixDependencies:a,matrixFromColumns:Xu,matrixFromColumnsDependencies:co,matrixFromFunction:Ju,matrixFromFunctionDependencies:Ug,matrixFromRows:Ku,matrixFromRowsDependencies:Bg,max:$u,maxDependencies:fo,maxTransformDependencies:Qg,mean:em,meanDependencies:Sd,meanTransformDependencies:Hg,median:am,medianDependencies:Xd,min:sm,minDependencies:Wg,minTransformDependencies:Gg,mod:rm,modDependencies:Ud,mode:nm,modeDependencies:Vg,molarMass:tm,molarMassC12:im,molarMassC12Dependencies:Zg,molarMassDependencies:Yg,molarPlanckConstant:cm,molarPlanckConstantDependencies:Xg,molarVolume:om,molarVolumeDependencies:Jg,multinomial:dm,multinomialDependencies:Kg,multiply:pm,multiplyDependencies:D,multiplyScalar:lm,multiplyScalarDependencies:C,neutronMass:vm,neutronMassDependencies:eb,norm:um,normDependencies:mo,not:mm,notDependencies:Ge,nthRoot:fm,nthRootDependencies:ab,nthRoots:Dm,nthRootsDependencies:sb,nuclearMagneton:hm,nuclearMagnetonDependencies:rb,nullDependencies:nb,number:gm,numberDependencies:se,numeric:bm,numericDependencies:Z,oct:xm,octDependencies:tb,ones:ym,onesDependencies:ib,or:_m,orDependencies:cb,orTransformDependencies:ob,parse:Cm,parseDependencies:ee,parser:Sm,parserDependencies:db,partitionSelect:Nm,partitionSelectDependencies:$e,permutations:km,permutationsDependencies:pb,phi:Tm,phiDependencies:lb,pi:Fm,piDependencies:Do,pickRandom:Mm,pickRandomDependencies:vb,pinv:wm,pinvDependencies:ub,planckCharge:Rm,planckChargeDependencies:mb,planckConstant:Em,planckConstantDependencies:fb,planckLength:jm,planckLengthDependencies:Db,planckMass:Am,planckMassDependencies:hb,planckTemperature:Pm,planckTemperatureDependencies:gb,planckTime:Im,planckTimeDependencies:bb,polynomialRoot:Om,polynomialRootDependencies:xb,pow:qm,powDependencies:H,print:Lm,printDependencies:yb,printTransformDependencies:_b,prod:zm,prodDependencies:Nd,protonMass:Um,protonMassDependencies:Cb,qr:Bm,qrDependencies:oo,quantileSeq:Qm,quantileSeqDependencies:Sb,quantileSeqTransformDependencies:Nb,quantumOfCirculation:Hm,quantumOfCirculationDependencies:kb,random:Wm,randomDependencies:Tb,randomInt:Gm,randomIntDependencies:Fb,range:Vm,rangeDependencies:Fe,rangeTransformDependencies:wb,rationalize:Ym,rationalizeDependencies:Rb,re:Zm,reDependencies:po,reducedPlanckConstant:Xm,reducedPlanckConstantDependencies:Eb,replacer:Jm,replacerDependencies:jb,reshape:Km,reshapeDependencies:wd,resize:$m,resizeDependencies:Ab,resolve:ef,resolveDependencies:kd,reviver:af,reviverDependencies:Pb,rightArithShift:sf,rightArithShiftDependencies:Ib,rightLogShift:rf,rightLogShiftDependencies:Ob,rotate:nf,rotateDependencies:qb,rotationMatrix:tf,rotationMatrixDependencies:$d,round:cf,roundDependencies:ke,row:of,rowDependencies:Lb,rowTransformDependencies:zb,rydberg:df,rydbergDependencies:Ub,sackurTetrode:pf,sackurTetrodeDependencies:Hb,schur:lf,schurDependencies:Yd,sec:vf,secDependencies:Wb,sech:uf,sechDependencies:Gb,secondRadiation:mf,secondRadiationDependencies:Vb,setCartesian:ff,setCartesianDependencies:Yb,setDifference:Df,setDifferenceDependencies:ep,setDistinct:hf,setDistinctDependencies:Zb,setIntersect:gf,setIntersectDependencies:ap,setIsSubset:bf,setIsSubsetDependencies:Xb,setMultiplicity:xf,setMultiplicityDependencies:Jb,setPowerset:yf,setPowersetDependencies:Kb,setSize:_f,setSizeDependencies:$b,setSymDifference:Cf,setSymDifferenceDependencies:sp,setUnion:Sf,setUnionDependencies:ex,sign:Nf,signDependencies:Md,simplify:kf,simplifyConstant:Tf,simplifyConstantDependencies:no,simplifyCore:Ff,simplifyCoreDependencies:to,simplifyDependencies:Je,sin:Mf,sinDependencies:Ke,sinh:wf,sinhDependencies:ax,size:Rf,sizeDependencies:w,slu:Ef,sluDependencies:Gd,smaller:jf,smallerDependencies:I,smallerEq:Af,smallerEqDependencies:Te,solveODE:Pf,solveODEDependencies:sx,sort:If,sortDependencies:rx,sparse:Of,sparseDependencies:nx,speedOfLight:qf,speedOfLightDependencies:tx,splitUnit:Lf,splitUnitDependencies:ix,sqrt:zf,sqrtDependencies:J,sqrtm:Uf,sqrtmDependencies:cx,square:Bf,squareDependencies:ox,squeeze:Qf,squeezeDependencies:dx,std:Hf,stdDependencies:px,stdTransformDependencies:lx,stefanBoltzmann:Wf,stefanBoltzmannDependencies:vx,stirlingS2:Gf,stirlingS2Dependencies:vd,string:Vf,stringDependencies:ux,subset:Yf,subsetDependencies:q,subsetTransformDependencies:mx,subtract:Zf,subtractDependencies:S,subtractScalar:Xf,subtractScalarDependencies:Q,sum:Jf,sumDependencies:$c,sumTransformDependencies:fx,sylvester:Kf,sylvesterDependencies:Zd,symbolicEqual:$f,symbolicEqualDependencies:Dx,tan:eD,tanDependencies:hx,tanh:aD,tanhDependencies:gx,tau:sD,tauDependencies:Id,thomsonCrossSection:rD,thomsonCrossSectionDependencies:bx,to:nD,toDependencies:xx,trace:tD,traceDependencies:yx,transpose:iD,transposeDependencies:Pe,trueDependencies:_x,typeOf:cD,typeOfDependencies:Kd,typed:oD,typedDependencies:e,unaryMinus:dD,unaryMinusDependencies:K,unaryPlus:pD,unaryPlusDependencies:so,unequal:lD,unequalDependencies:Cx,unit:vD,unitDependencies:Sx,usolve:uD,usolveAll:mD,usolveAllDependencies:Rd,usolveDependencies:lo,vacuumImpedance:fD,vacuumImpedanceDependencies:Tx,variance:DD,varianceDependencies:ho,varianceTransformDependencies:Fx,version:hD,versionDependencies:Mx,weakMixingAngle:gD,weakMixingAngleDependencies:wx,wienDisplacement:bD,wienDisplacementDependencies:Rx,xgcd:xD,xgcdDependencies:Bd,xor:yD,xorDependencies:Ex,zeros:_D,zerosDependencies:M,zeta:CD,zetaDependencies:jx,zpk2tf:SD,zpk2tfDependencies:Ax},Symbol.toStringTag,{value:"Module"})),zx={name:"ns-profit-report",props:["storeLogo","storeName"],data(){return{categoryNames:"",unitNames:"",startDateField:{type:"datetimepicker",value:Qe(ns.date.current).startOf("month").format("YYYY-MM-DD HH:mm:ss")},endDateField:{type:"datetimepicker",value:Qe(ns.date.current).endOf("month").format("YYYY-MM-DD HH:mm:ss")},categoryField:{value:[],label:ve("Filter by Category")},unitField:{value:[],label:ve("Filter by Units")},products:[],ns:window.ns,math:Lx}},components:{nsDatepicker:kD,nsDateTimePicker:TD},computed:{totalQuantities(){return this.products.length>0?this.products.map(n=>n.quantity).reduce((n,l)=>n+l):0},totalPurchasePrice(){return this.products.length>0?this.products.map(n=>n.total_purchase_price).reduce((n,l)=>n+l):0},totalSalePrice(){return this.products.length>0?this.products.map(n=>n.total_price).reduce((n,l)=>n+l):0},totalProfit(){return this.products.length>0?this.products.map(n=>ra(n.total_price).subtract(ra(n.total_purchase_price).add(n.tax_value).done())).reduce((n,l)=>n+l):0},totalTax(){return this.products.length>0?this.products.map(n=>n.tax_value).reduce((n,l)=>n+l):0}},methods:{__:ve,nsCurrency:FD,printSaleReport(){this.$htmlToPaper("profit-report")},setStartDate(n){this.startDate=n.format()},async selectCategories(){try{const n=await _o("/api/categories",this.categoryField.label,this.categoryField.value);this.categoryField.value=n.values,this.categoryNames=n.labels,this.loadReport()}catch(n){if(n!==!1)return Re.error(ve("An error has occured while loading the categories")).subscribe()}},async selectUnit(){try{const n=await _o("/api/units",this.unitField.label,this.unitField.value);this.unitField.value=n.values,this.unitNames=n.labels,this.loadReport()}catch(n){if(n!==!1)return Re.error(ve("An error has occured while loading the units")).subscribe()}},loadReport(){if(this.startDateField.value===null||this.endDateField.value===null)return Re.error(ve("Unable to proceed. Select a correct time range.")).subscribe();const n=Qe(this.startDateField.value);if(Qe(this.endDateField.value).isBefore(n))return Re.error(ve("Unable to proceed. The current time range is not valid.")).subscribe();ND.post("/api/reports/profit-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,categories:this.categoryField.value,units:this.unitField.value}).subscribe({next:i=>{this.products=i},error:i=>{Re.error(i.message).subscribe()}})},setEndDate(n){this.endDate=n.format()}}},Ux={id:"report-section",class:"px-4"},Bx={class:"flex -mx-2"},Qx={class:"px-2"},Hx={class:"px-2"},Wx={class:"px-2"},Gx=t("i",{class:"las la-sync-alt text-xl"},null,-1),Vx={class:"pl-2"},Yx={class:"px-2"},Zx=t("i",{class:"las la-print text-xl"},null,-1),Xx={class:"pl-2"},Jx={class:"px-2"},Kx=t("i",{class:"las la-filter text-xl"},null,-1),$x={class:"pl-2"},ey={class:"px-2"},ay=t("i",{class:"las la-filter text-xl"},null,-1),sy={class:"pl-2"},ry={id:"profit-report",class:"anim-duration-500 fade-in-entrance"},ny={class:"flex w-full"},ty={class:"my-4 flex justify-between w-full"},iy={class:"text-secondary"},cy={class:"pb-1 border-b border-dashed"},oy={class:"pb-1 border-b border-dashed"},dy={class:"pb-1 border-b border-dashed"},py=["src","alt"],ly={class:"shadow rounded my-4"},vy={class:"ns-box"},uy={class:"border-b ns-box-body"},my={class:"table ns-table w-full"},fy={class:"border p-2 text-left"},Dy={width:"110",class:"text-right border p-2"},hy={width:"110",class:"text-right border p-2"},gy={width:"110",class:"text-right border p-2"},by={width:"110",class:"text-right border p-2"},xy={width:"110",class:"text-right border p-2"},yy={width:"110",class:"text-right border p-2"},_y={class:"p-2 border border-box-edge"},Cy={class:"p-2 border text-right border-box-edge"},Sy={class:"p-2 border text-right border-box-edge"},Ny={class:"p-2 border text-right border-box-edge"},ky={class:"p-2 border text-right border-box-edge"},Ty={class:"p-2 border text-right border-box-edge"},Fy={class:"p-2 border text-right border-box-edge"},My={class:"font-semibold"},wy=t("td",{colspan:"2",class:"p-2 border"},null,-1),Ry={class:"p-2 border text-right"},Ey={class:"p-2 border text-right"},jy={class:"p-2 border text-right"},Ay={class:"p-2 border text-right"},Py={class:"p-2 border text-right"};function Iy(n,l,i,o,x,d){const W=wD("ns-field");return aa(),sa("div",Ux,[t("div",Bx,[t("div",Qx,[Co(W,{field:x.startDateField},null,8,["field"])]),t("div",Hx,[Co(W,{field:x.endDateField},null,8,["field"])]),t("div",Wx,[t("button",{onClick:l[0]||(l[0]=_=>d.loadReport()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[Gx,t("span",Vx,g(d.__("Load")),1)])]),t("div",Yx,[t("button",{onClick:l[1]||(l[1]=_=>d.printSaleReport()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[Zx,t("span",Xx,g(d.__("Print")),1)])]),t("div",Jx,[t("button",{onClick:l[2]||(l[2]=_=>d.selectCategories()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[Kx,t("span",$x,g(d.__("Category"))+": "+g(x.categoryNames||d.__("All Categories")),1)])]),t("div",ey,[t("button",{onClick:l[3]||(l[3]=_=>d.selectUnit()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[ay,t("span",sy,g(d.__("Unit"))+": "+g(x.unitNames||d.__("All Units")),1)])])]),t("div",ry,[t("div",ny,[t("div",ty,[t("div",iy,[t("ul",null,[t("li",cy,g(d.__("Range : {date1} — {date2}").replace("{date1}",x.startDateField.value).replace("{date2}",x.endDateField.value)),1),t("li",oy,g(d.__("Document : Profit Report")),1),t("li",dy,g(d.__("By : {user}").replace("{user}",x.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:i.storeLogo,alt:i.storeName},null,8,py)])])]),t("div",ly,[t("div",vy,[t("div",uy,[t("table",my,[t("thead",null,[t("tr",null,[t("th",fy,g(d.__("Product")),1),t("th",Dy,g(d.__("Unit")),1),t("th",hy,g(d.__("Quantity")),1),t("th",gy,g(d.__("COGS")),1),t("th",by,g(d.__("Sale Price")),1),t("th",xy,g(d.__("Taxes")),1),t("th",yy,g(d.__("Profit")),1)])]),t("tbody",null,[(aa(!0),sa(RD,null,ED(x.products,_=>(aa(),sa("tr",{key:_.id,class:jD(_.total_price-_.total_purchase_price<0?"bg-error-primary":"bg-box-background")},[t("td",_y,g(_.name),1),t("td",Cy,g(_.unit_name),1),t("td",Sy,g(_.quantity),1),t("td",Ny,g(d.nsCurrency(_.total_purchase_price)),1),t("td",ky,g(d.nsCurrency(_.total_price)),1),t("td",Ty,g(d.nsCurrency(_.tax_value)),1),t("td",Fy,g(d.nsCurrency(x.math.chain(_.total_price).subtract(x.math.chain(_.total_purchase_price).add(_.tax_value).done()).done())),1)],2))),128))]),t("tfoot",My,[t("tr",null,[wy,t("td",Ry,g(d.totalQuantities),1),t("td",Ey,g(d.nsCurrency(d.totalPurchasePrice)),1),t("td",jy,g(d.nsCurrency(d.totalSalePrice)),1),t("td",Ay,g(d.nsCurrency(d.totalTax)),1),t("td",Py,g(d.nsCurrency(d.totalProfit)),1)])])])])])])])])}const Yy=MD(zx,[["render",Iy]]);export{Yy as default}; +import{I as na,J as ta,K as ia,L as ca,M as oa,N as da,O as pa,Q as la,R as va,U as ua,W as ma,X as fa,Y as Da,Z as ha,_ as ga,$ as ba,a0 as xa,a1 as ya,a2 as _a,a3 as Ca,a4 as Sa,a5 as Na,a6 as ka,a7 as Ta,a8 as Fa,a9 as Ma,aa as wa,ab as Ra,ac as Ea,ad as ja,ae as Aa,af as Pa,ag as Ia,ah as Oa,ai as qa,aj as La,ak as za,al as Ua,am as Ba,an as Qa,ao as Ha,ap as Wa,aq as Ga,ar as Va,as as Ya,at as Za,au as Xa,av as Ja,aw as Ka,ax as $a,ay as es,az as as,aA as ss,aB as rs,aC as ts,aD as is,aE as cs,aF as os,aG as ds,aH as ps,aI as ls,aJ as vs,aK as us,aL as ms,aM as fs,aN as Ds,aO as hs,aP as gs,aQ as bs,aR as xs,aS as ys,aT as _s,aU as Cs,aV as Ss,aW as Ns,aX as ks,aY as Ts,aZ as Fs,a_ as Ms,a$ as ws,b0 as Rs,b1 as Es,b2 as js,b3 as As,b4 as Ps,b5 as Is,b6 as Os,b7 as qs,b8 as Ls,b9 as zs,ba as Us,bb as Bs,bc as Qs,bd as Hs,be as Ws,bf as Gs,bg as Vs,bh as Ys,bi as Zs,bj as Xs,bk as Js,bl as Ks,bm as $s,bn as er,bo as ar,bp as sr,bq as rr,br as nr,bs as tr,bt as ir,bu as cr,bv as or,bw as dr,bx as pr,by as lr,bz as vr,bA as ur,bB as mr,bC as fr,bD as Dr,bE as hr,bF as gr,bG as br,bH as xr,bI as yr,bJ as _r,bK as Cr,bL as Sr,bM as Nr,bN as kr,bO as Tr,bP as Fr,bQ as Mr,bR as wr,bS as Rr,bT as Er,bU as jr,bV as Ar,bW as Pr,bX as Ir,bY as Or,bZ as qr,b_ as Lr,b$ as zr,c0 as Ur,c1 as Br,c2 as Qr,c3 as Hr,c4 as Wr,c5 as Gr,c6 as Vr,c7 as Yr,c8 as Zr,c9 as Xr,ca as Jr,cb as Kr,cc as $r,cd as en,ce as an,cf as sn,cg as rn,ch as nn,ci as tn,cj as cn,ck as on,cl as dn,cm as pn,cn as ln,co as vn,cp as un,cq as mn,cr as fn,cs as Dn,ct as hn,cu as gn,cv as bn,cw as xn,cx as yn,cy as _n,cz as Cn,cA as Sn,cB as Nn,cC as kn,cD as Tn,cE as Fn,cF as Mn,cG as wn,cH as Rn,cI as En,cJ as jn,cK as An,cL as Pn,cM as In,cN as On,cO as qn,cP as Ln,cQ as zn,cR as Un,cS as Bn,cT as Qn,cU as Hn,cV as Wn,cW as Gn,cX as Vn,cY as Yn,cZ as Zn,c_ as Xn,c$ as Jn,d0 as Kn,d1 as $n,d2 as et,d3 as at,d4 as st,d5 as rt,d6 as nt,d7 as tt,d8 as it,d9 as ct,da as ot,db as dt,dc as pt,dd as lt,de as vt,df as ut,dg as mt,dh as ft,di as Dt,dj as ht,dk as gt,dl as bt,dm as xt,dn as yt,dp as _t,dq as Ct,dr as St,ds as Nt,dt as kt,du as Tt,dv as Ft,dw as Mt,dx as wt,dy as Rt,dz as Et,dA as jt,dB as At,dC as Pt,dD as It,dE as Ot,dF as qt,dG as Lt,dH as zt,dI as Ut,dJ as Bt,dK as Qt,dL as Ht,dM as Wt,dN as Gt,dO as Vt,dP as Yt,dQ as Zt,dR as Xt,dS as Jt,dT as Kt,dU as $t,dV as ei,dW as ai,dX as si,dY as ri,dZ as ni,d_ as ti,d$ as ii,e0 as ci,e1 as oi,e2 as di,e3 as pi,e4 as li,e5 as vi,e6 as ui,e7 as mi,e8 as fi,e9 as Di,ea as hi,eb as gi,ec as bi,ed as xi,ee as yi,ef as _i,eg as Ci,eh as Si,ei as Ni,ej as ki,ek as Ti,el as Fi,em as Mi,en as wi,eo as Ri,ep as Ei,eq as ji,er as Ai,es as Pi,et as Ii,eu as Oi,ev as qi,ew as Li,ex as zi,ey as Ui,ez as Bi,eA as Qi,eB as Hi,eC as Wi,eD as Gi,eE as Vi,eF as Yi,eG as Zi,eH as Xi,eI as Ji,eJ as Ki,eK as $i,eL as ec,eM as ac,eN as sc,eO as rc,eP as nc,eQ as tc,eR as ic,eS as cc,eT as oc,eU as dc,eV as pc,eW as lc,eX as vc,eY as uc,eZ as mc,e_ as fc,e$ as Dc,f0 as hc,f1 as gc,f2 as bc,f3 as xc,f4 as yc,f5 as _c,f6 as Cc,f7 as Sc,f8 as Nc,f9 as kc,fa as Tc,fb as Fc,fc as Mc,fd as wc,fe as Rc,ff as Ec,fg as jc,fh as Ac,fi as Pc,fj as Ic,fk as Oc,fl as qc,fm as Lc,fn as zc,fo as Uc,fp as Bc,fq as Qc,fr as _e,fs as Ee,ft as xo,fu as ea,fv as Hc,fw as Wc,fx as Gc,fy as Vc,fz as Yc,fA as tp,fB as ip,fC as cp,fD as op,fE as dp,fF as yo,fG as So,fH as pp,fI as No,fJ as ko,fK as To,fL as Fo,fM as Mo,fN as wo,fO as Ro,fP as Eo,fQ as jo,fR as Ao,fS as Po,fT as Io,fU as Oo,fV as qo,fW as Lo,fX as zo,fY as Uo,fZ as Bo,f_ as Qo,f$ as Ho,g0 as Wo,g1 as Go,g2 as Vo,g3 as Yo,g4 as Zo,g5 as Xo,g6 as Jo,g7 as Ko,g8 as $o,g9 as ed,ga as ad,gb as sd,gc as rd,gd as nd,ge as td,gf as id,gg as lp,gh as vp,gi as up,gj as mp,gk as fp,gl as Dp,gm as hp,gn as gp,go as bp,gp as xp,gq as yp,gr as _p,gs as Cp,gt as Sp,gu as Np,gv as kp,gw as Tp,gx as Fp,gy as Mp,gz as wp,gA as Rp,gB as Ep,gC as jp,gD as Ap,gE as Pp,gF as Ip,gG as Op,gH as qp,gI as Lp,gJ as zp,gK as Up,gL as Bp,gM as Qp,gN as Hp,gO as Wp,gP as Gp,gQ as Vp,gR as Yp,gS as Zp,gT as Xp,gU as Jp,gV as Kp,gW as $p,gX as el,gY as al,gZ as sl,g_ as rl,g$ as nl,h0 as tl,h1 as il,h2 as cl,h3 as ol,h4 as dl,h5 as pl,h6 as ll,h7 as vl,h8 as ul,h9 as ml,ha as fl,hb as Dl,hc as hl,hd as gl,he as bl,hf as xl,hg as yl,hh as _l,hi as Cl,hj as Sl,hk as Nl,hl as kl,hm as Tl,hn as Fl,ho as Ml,hp as wl,hq as Rl,hr as El,hs as jl,ht as Al,hu as Pl,f as ra,hv as Il,hw as Ol,hx as ql,hy as Ll,hz as zl,hA as Ul,hB as Bl,hC as Ql,hD as Hl,hE as Wl,hF as Gl,hG as Vl,hH as Yl,hI as Zl,hJ as Xl,hK as Jl,hL as Kl,hM as $l,hN as ev,hO as av,hP as sv,hQ as rv,hR as nv,hS as tv,hT as iv,hU as cv,hV as ov,hW as dv,hX as pv,hY as lv,hZ as vv,h_ as uv,h$ as mv,i0 as fv,i1 as Dv,i2 as hv,i3 as gv,i4 as bv,i5 as xv,i6 as yv,i7 as _v,i8 as Cv,i9 as Sv,ia as Nv,ib as kv,ic as Tv,id as Fv,ie as Mv,ig as wv,ih as Rv,ii as Ev,ij as jv,ik as Av,il as Pv,im as Iv,io as Ov,ip as qv,iq as Lv,ir as zv,is as Uv,it as Bv,iu as Qv,iv as Hv,iw as Wv,ix as Gv,iy as Vv,iz as Yv,iA as Zv,iB as Xv,iC as Jv,iD as Kv,iE as $v,iF as eu,iG as au,iH as su,iI as ru,iJ as nu,iK as tu,iL as iu,iM as cu,iN as ou,iO as du,iP as pu,iQ as lu,iR as vu,iS as uu,iT as mu,iU as fu,iV as Du,iW as hu,iX as gu,iY as bu,iZ as xu,i_ as yu,i$ as _u,j0 as Cu,j1 as Su,j2 as Nu,j3 as ku,j4 as Tu,j5 as Fu,j6 as Mu,j7 as wu,j8 as Ru,j9 as Eu,ja as ju,jb as Au,jc as Pu,jd as Iu,je as Ou,jf as qu,jg as Lu,jh as zu,ji as Uu,jj as Bu,jk as Qu,jl as Hu,jm as Wu,jn as Gu,jo as Vu,jp as Yu,jq as Zu,jr as Xu,js as Ju,jt as Ku,ju as $u,jv as em,jw as am,jx as sm,jy as rm,jz as nm,jA as tm,jB as im,jC as cm,jD as om,jE as dm,jF as pm,jG as lm,jH as vm,jI as um,jJ as mm,jK as fm,jL as Dm,jM as hm,jN as gm,jO as bm,jP as xm,jQ as ym,jR as _m,jS as Cm,jT as Sm,jU as Nm,jV as km,jW as Tm,jX as Fm,jY as Mm,jZ as wm,j_ as Rm,j$ as Em,k0 as jm,k1 as Am,k2 as Pm,k3 as Im,k4 as Om,k5 as qm,k6 as Lm,k7 as zm,k8 as Um,k9 as Bm,ka as Qm,kb as Hm,kc as Wm,kd as Gm,ke as Vm,kf as Ym,kg as Zm,kh as Xm,ki as Jm,kj as Km,kk as $m,kl as ef,km as af,kn as sf,ko as rf,kp as nf,kq as tf,kr as cf,ks as of,kt as df,ku as pf,kv as lf,kw as vf,kx as uf,ky as mf,kz as ff,kA as Df,kB as hf,kC as gf,kD as bf,kE as xf,kF as yf,kG as _f,kH as Cf,kI as Sf,kJ as Nf,kK as kf,kL as Tf,kM as Ff,kN as Mf,kO as wf,kP as Rf,kQ as Ef,kR as jf,kS as Af,kT as Pf,kU as If,kV as Of,kW as qf,kX as Lf,kY as zf,kZ as Uf,k_ as Bf,k$ as Qf,l0 as Hf,l1 as Wf,l2 as Gf,l3 as Vf,l4 as Yf,l5 as Zf,l6 as Xf,l7 as Jf,l8 as Kf,l9 as $f,la as eD,lb as aD,lc as sD,ld as rD,le as nD,lf as tD,lg as iD,lh as cD,li as oD,lj as dD,lk as pD,ll as lD,lm as vD,ln as uD,lo as mD,lp as fD,lq as DD,lr as hD,ls as gD,lt as bD,lu as xD,lv as yD,lw as _D,lx as CD,ly as SD,h as Qe,b as Re,a as ND}from"./bootstrap-8be442b1.js";import{c as kD,e as TD}from"./components-50630f18.js";import{_ as ve,n as FD}from"./currency-f8bd78d1.js";import{s as _o}from"./select-api-entities-c72f4497.js";import{_ as MD}from"./_plugin-vue_export-helper-c27b6911.js";import{r as wD,o as aa,c as sa,a as t,f as Co,t as g,F as RD,b as ED,n as jD}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";import"./join-array-4b30b096.js";const AD=Object.freeze(Object.defineProperty({__proto__:null,createAbs:na,createAccessorNode:ta,createAcos:ia,createAcosh:ca,createAcot:oa,createAcoth:da,createAcsc:pa,createAcsch:la,createAdd:va,createAddScalar:ua,createAnd:ma,createAndTransform:fa,createApply:Da,createApplyTransform:ha,createArg:ga,createArrayNode:ba,createAsec:xa,createAsech:ya,createAsin:_a,createAsinh:Ca,createAssignmentNode:Sa,createAtan:Na,createAtan2:ka,createAtanh:Ta,createAtomicMass:Fa,createAvogadro:Ma,createBellNumbers:wa,createBigNumberClass:Ra,createBignumber:Ea,createBin:ja,createBitAnd:Aa,createBitAndTransform:Pa,createBitNot:Ia,createBitOr:Oa,createBitOrTransform:qa,createBitXor:La,createBlockNode:za,createBohrMagneton:Ua,createBohrRadius:Ba,createBoltzmann:Qa,createBoolean:Ha,createCatalan:Wa,createCbrt:Ga,createCeil:Va,createChain:Ya,createChainClass:Za,createClassicalElectronRadius:Xa,createClone:Ja,createColumn:Ka,createColumnTransform:$a,createCombinations:es,createCombinationsWithRep:as,createCompare:ss,createCompareNatural:rs,createCompareText:ts,createCompile:is,createComplex:cs,createComplexClass:os,createComposition:ds,createConcat:ps,createConcatTransform:ls,createConditionalNode:vs,createConductanceQuantum:us,createConj:ms,createConstantNode:fs,createCorr:Ds,createCos:hs,createCosh:gs,createCot:bs,createCoth:xs,createCoulomb:ys,createCount:_s,createCreateUnit:Cs,createCross:Ss,createCsc:Ns,createCsch:ks,createCtranspose:Ts,createCube:Fs,createCumSum:Ms,createCumSumTransform:ws,createDeepEqual:Rs,createDenseMatrixClass:Es,createDerivative:js,createDet:As,createDeuteronMass:Ps,createDiag:Is,createDiff:Os,createDiffTransform:qs,createDistance:Ls,createDivide:zs,createDivideScalar:Us,createDot:Bs,createDotDivide:Qs,createDotMultiply:Hs,createDotPow:Ws,createE:Gs,createEfimovFactor:Vs,createEigs:Ys,createElectricConstant:Zs,createElectronMass:Xs,createElementaryCharge:Js,createEqual:Ks,createEqualScalar:$s,createEqualText:er,createErf:ar,createEvaluate:sr,createExp:rr,createExpm:nr,createExpm1:tr,createFactorial:ir,createFalse:cr,createFaraday:or,createFermiCoupling:dr,createFft:pr,createFibonacciHeapClass:lr,createFilter:vr,createFilterTransform:ur,createFineStructure:mr,createFirstRadiation:fr,createFix:Dr,createFlatten:hr,createFloor:gr,createForEach:br,createForEachTransform:xr,createFormat:yr,createFraction:_r,createFractionClass:Cr,createFreqz:Sr,createFunctionAssignmentNode:Nr,createFunctionNode:kr,createGamma:Tr,createGasConstant:Fr,createGcd:Mr,createGetMatrixDataType:wr,createGravitationConstant:Rr,createGravity:Er,createHartreeEnergy:jr,createHasNumericValue:Ar,createHelp:Pr,createHelpClass:Ir,createHex:Or,createHypot:qr,createI:Lr,createIdentity:zr,createIfft:Ur,createIm:Br,createImmutableDenseMatrixClass:Qr,createIndex:Hr,createIndexClass:Wr,createIndexNode:Gr,createIndexTransform:Vr,createInfinity:Yr,createIntersect:Zr,createInv:Xr,createInverseConductanceQuantum:Jr,createInvmod:Kr,createIsInteger:$r,createIsNaN:en,createIsNegative:an,createIsNumeric:sn,createIsPositive:rn,createIsPrime:nn,createIsZero:tn,createKldivergence:cn,createKlitzing:on,createKron:dn,createLN10:pn,createLN2:ln,createLOG10E:vn,createLOG2E:un,createLarger:mn,createLargerEq:fn,createLcm:Dn,createLeafCount:hn,createLeftShift:gn,createLgamma:bn,createLog:xn,createLog10:yn,createLog1p:_n,createLog2:Cn,createLoschmidt:Sn,createLsolve:Nn,createLsolveAll:kn,createLup:Tn,createLusolve:Fn,createLyap:Mn,createMad:wn,createMagneticConstant:Rn,createMagneticFluxQuantum:En,createMap:jn,createMapTransform:An,createMatrix:Pn,createMatrixClass:In,createMatrixFromColumns:On,createMatrixFromFunction:qn,createMatrixFromRows:Ln,createMax:zn,createMaxTransform:Un,createMean:Bn,createMeanTransform:Qn,createMedian:Hn,createMin:Wn,createMinTransform:Gn,createMod:Vn,createMode:Yn,createMolarMass:Zn,createMolarMassC12:Xn,createMolarPlanckConstant:Jn,createMolarVolume:Kn,createMultinomial:$n,createMultiply:et,createMultiplyScalar:at,createNaN:st,createNeutronMass:rt,createNode:nt,createNorm:tt,createNot:it,createNthRoot:ct,createNthRoots:ot,createNuclearMagneton:dt,createNull:pt,createNumber:lt,createNumeric:vt,createObjectNode:ut,createOct:mt,createOnes:ft,createOperatorNode:Dt,createOr:ht,createOrTransform:gt,createParenthesisNode:bt,createParse:xt,createParser:yt,createParserClass:_t,createPartitionSelect:Ct,createPermutations:St,createPhi:Nt,createPi:kt,createPickRandom:Tt,createPinv:Ft,createPlanckCharge:Mt,createPlanckConstant:wt,createPlanckLength:Rt,createPlanckMass:Et,createPlanckTemperature:jt,createPlanckTime:At,createPolynomialRoot:Pt,createPow:It,createPrint:Ot,createPrintTransform:qt,createProd:Lt,createProtonMass:zt,createQr:Ut,createQuantileSeq:Bt,createQuantileSeqTransform:Qt,createQuantumOfCirculation:Ht,createRandom:Wt,createRandomInt:Gt,createRange:Vt,createRangeClass:Yt,createRangeNode:Zt,createRangeTransform:Xt,createRationalize:Jt,createRe:Kt,createReducedPlanckConstant:$t,createRelationalNode:ei,createReplacer:ai,createReshape:si,createResize:ri,createResolve:ni,createResultSet:ti,createReviver:ii,createRightArithShift:ci,createRightLogShift:oi,createRotate:di,createRotationMatrix:pi,createRound:li,createRow:vi,createRowTransform:ui,createRydberg:mi,createSQRT1_2:fi,createSQRT2:Di,createSackurTetrode:hi,createSchur:gi,createSec:bi,createSech:xi,createSecondRadiation:yi,createSetCartesian:_i,createSetDifference:Ci,createSetDistinct:Si,createSetIntersect:Ni,createSetIsSubset:ki,createSetMultiplicity:Ti,createSetPowerset:Fi,createSetSize:Mi,createSetSymDifference:wi,createSetUnion:Ri,createSign:Ei,createSimplify:ji,createSimplifyConstant:Ai,createSimplifyCore:Pi,createSin:Ii,createSinh:Oi,createSize:qi,createSlu:Li,createSmaller:zi,createSmallerEq:Ui,createSolveODE:Bi,createSort:Qi,createSpaClass:Hi,createSparse:Wi,createSparseMatrixClass:Gi,createSpeedOfLight:Vi,createSplitUnit:Yi,createSqrt:Zi,createSqrtm:Xi,createSquare:Ji,createSqueeze:Ki,createStd:$i,createStdTransform:ec,createStefanBoltzmann:ac,createStirlingS2:sc,createString:rc,createSubset:nc,createSubsetTransform:tc,createSubtract:ic,createSubtractScalar:cc,createSum:oc,createSumTransform:dc,createSylvester:pc,createSymbolNode:lc,createSymbolicEqual:vc,createTan:uc,createTanh:mc,createTau:fc,createThomsonCrossSection:Dc,createTo:hc,createTrace:gc,createTranspose:bc,createTrue:xc,createTypeOf:yc,createTyped:_c,createUnaryMinus:Cc,createUnaryPlus:Sc,createUnequal:Nc,createUnitClass:kc,createUnitFunction:Tc,createUppercaseE:Fc,createUppercasePi:Mc,createUsolve:wc,createUsolveAll:Rc,createVacuumImpedance:Ec,createVariance:jc,createVarianceTransform:Ac,createVersion:Pc,createWeakMixingAngle:Ic,createWienDisplacement:Oc,createXgcd:qc,createXor:Lc,createZeros:zc,createZeta:Uc,createZpk2tf:Bc},Symbol.toStringTag,{value:"Module"}));var s={createBigNumberClass:Ra},h={createComplexClass:os},We={createMatrixClass:In},p={MatrixDependencies:We,createDenseMatrixClass:Es},ue={createFractionClass:Cr},e={BigNumberDependencies:s,ComplexDependencies:h,DenseMatrixDependencies:p,FractionDependencies:ue,createTyped:_c},A={typedDependencies:e,createAbs:na},R={createNode:nt},v={typedDependencies:e,createEqualScalar:$s},ae={MatrixDependencies:We,equalScalarDependencies:v,typedDependencies:e,createSparseMatrixClass:Gi},T={typedDependencies:e,createAddScalar:ua},O={typedDependencies:e,createIsInteger:$r},a={DenseMatrixDependencies:p,MatrixDependencies:We,SparseMatrixDependencies:ae,typedDependencies:e,createMatrix:Pn},f={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createConcat:ps},u={DenseMatrixDependencies:p,SparseMatrixDependencies:ae,addScalarDependencies:T,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createAdd:va},M={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createZeros:zc},q={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createSubset:nc},Ce={NodeDependencies:R,subsetDependencies:q,createAccessorNode:ta},PD={ComplexDependencies:h,typedDependencies:e,createAcos:ia},ID={ComplexDependencies:h,typedDependencies:e,createAcosh:ca},OD={BigNumberDependencies:s,typedDependencies:e,createAcot:oa},qD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAcoth:da},LD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAcsc:pa},zD={BigNumberDependencies:s,typedDependencies:e,createAcsch:la},Ge={typedDependencies:e,createNot:it},UD={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:Ge,typedDependencies:e,zerosDependencies:M,createAnd:ma},BD={addDependencies:u,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:Ge,typedDependencies:e,zerosDependencies:M,createAndTransform:fa},Zc={isIntegerDependencies:O,typedDependencies:e,createApply:Da},QD={isIntegerDependencies:O,typedDependencies:e,createApplyTransform:ha},HD={typedDependencies:e,createArg:ga},Se={NodeDependencies:R,createArrayNode:ba},WD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAsec:xa},GD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAsech:ya},VD={ComplexDependencies:h,typedDependencies:e,createAsin:_a},YD={typedDependencies:e,createAsinh:Ca},cd={matrixDependencies:a,NodeDependencies:R,subsetDependencies:q,createAssignmentNode:Sa},od={typedDependencies:e,createAtan:Na},ZD={BigNumberDependencies:s,DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createAtan2:ka},XD={ComplexDependencies:h,typedDependencies:e,createAtanh:Ta},L={BigNumberDependencies:s,typedDependencies:e,createBignumber:Ea},Ne={FractionDependencies:ue,typedDependencies:e,createFraction:_r},se={typedDependencies:e,createNumber:lt},Z={bignumberDependencies:L,fractionDependencies:Ne,numberDependencies:se,createNumeric:vt},y={numericDependencies:Z,typedDependencies:e,createDivideScalar:Us},B={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createEqual:Ks},ke={BigNumberDependencies:s,DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRound:li},Xc={DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createCeil:Va},dd={DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createFloor:gr},pd={ComplexDependencies:h,DenseMatrixDependencies:p,ceilDependencies:Xc,equalScalarDependencies:v,floorDependencies:dd,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createFix:Dr},je={typedDependencies:e,createFormat:yr},me={typedDependencies:e,createIsNumeric:sn},C={typedDependencies:e,createMultiplyScalar:at},ie={BigNumberDependencies:s,DenseMatrixDependencies:p,SparseMatrixDependencies:ae,matrixDependencies:a,typedDependencies:e,createIdentity:zr},X={typedDependencies:e,createIsZero:tn},fe={typedDependencies:e,createConj:ms},w={matrixDependencies:a,typedDependencies:e,createSize:qi},Ve={addScalarDependencies:T,conjDependencies:fe,multiplyScalarDependencies:C,sizeDependencies:w,typedDependencies:e,createDot:Bs},D={addScalarDependencies:T,dotDependencies:Ve,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createMultiply:et},Q={typedDependencies:e,createSubtractScalar:cc},K={typedDependencies:e,createUnaryMinus:Cc},ld={divideScalarDependencies:y,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createDet:As},De={absDependencies:A,addScalarDependencies:T,detDependencies:ld,divideScalarDependencies:y,identityDependencies:ie,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,unaryMinusDependencies:K,createInv:Xr},H={ComplexDependencies:h,fractionDependencies:Ne,identityDependencies:ie,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,numberDependencies:se,typedDependencies:e,createPow:It},c={BigNumberDependencies:s,ComplexDependencies:h,FractionDependencies:ue,absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,equalDependencies:B,fixDependencies:pd,formatDependencies:je,isNumericDependencies:me,multiplyScalarDependencies:C,numberDependencies:se,powDependencies:H,roundDependencies:ke,subtractScalarDependencies:Q,createUnitClass:kc},JD={BigNumberDependencies:s,UnitDependencies:c,createAtomicMass:Fa},KD={BigNumberDependencies:s,UnitDependencies:c,createAvogadro:Ma},ce={typedDependencies:e,createIsNegative:an},Ye={typedDependencies:e,createCombinations:es},Jc={BigNumberDependencies:s,ComplexDependencies:h,multiplyScalarDependencies:C,powDependencies:H,typedDependencies:e,createGamma:Tr},Ae={gammaDependencies:Jc,typedDependencies:e,createFactorial:ir},P={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createLarger:mn},vd={bignumberDependencies:L,addScalarDependencies:T,combinationsDependencies:Ye,divideScalarDependencies:y,factorialDependencies:Ae,isIntegerDependencies:O,isNegativeDependencies:ce,largerDependencies:P,multiplyScalarDependencies:C,numberDependencies:se,powDependencies:H,subtractScalarDependencies:Q,typedDependencies:e,createStirlingS2:sc},$D={addScalarDependencies:T,isIntegerDependencies:O,isNegativeDependencies:ce,stirlingS2Dependencies:vd,typedDependencies:e,createBellNumbers:wa},eh={formatDependencies:je,typedDependencies:e,createBin:ja},ah={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitAnd:Aa},sh={addDependencies:u,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:Ge,typedDependencies:e,zerosDependencies:M,createBitAndTransform:Pa},rh={typedDependencies:e,createBitNot:Ia},nh={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitOr:Oa},th={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitOrTransform:qa},ih={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createBitXor:La},ud={createResultSet:ti},md={NodeDependencies:R,ResultSetDependencies:ud,createBlockNode:za},ch={BigNumberDependencies:s,UnitDependencies:c,createBohrMagneton:Ua},oh={BigNumberDependencies:s,UnitDependencies:c,createBohrRadius:Ba},dh={BigNumberDependencies:s,UnitDependencies:c,createBoltzmann:Qa},ph={typedDependencies:e,createBoolean:Ha},lh={addScalarDependencies:T,combinationsDependencies:Ye,divideScalarDependencies:y,isIntegerDependencies:O,isNegativeDependencies:ce,multiplyScalarDependencies:C,typedDependencies:e,createCatalan:Wa},fd={BigNumberDependencies:s,ComplexDependencies:h,FractionDependencies:ue,isNegativeDependencies:ce,matrixDependencies:a,typedDependencies:e,unaryMinusDependencies:K,createCbrt:Ga},Dd={typedDependencies:e,createChainClass:Za},vh={ChainDependencies:Dd,typedDependencies:e,createChain:Ya},uh={BigNumberDependencies:s,UnitDependencies:c,createClassicalElectronRadius:Xa},mh={typedDependencies:e,createClone:Ja},I={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createSmaller:zi},hd={DenseMatrixDependencies:p,smallerDependencies:I,createImmutableDenseMatrixClass:Qr},Kc={typedDependencies:e,createGetMatrixDataType:wr},E={ImmutableDenseMatrixDependencies:hd,getMatrixDataTypeDependencies:Kc,createIndexClass:Wr},he={typedDependencies:e,createIsPositive:rn},Ze={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createLargerEq:fn},Te={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createSmallerEq:Ui},Fe={bignumberDependencies:L,matrixDependencies:a,addDependencies:u,isPositiveDependencies:he,largerDependencies:P,largerEqDependencies:Ze,smallerDependencies:I,smallerEqDependencies:Te,typedDependencies:e,createRange:Vt},gd={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createColumn:Ka},fh={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createColumnTransform:$a},Dh={typedDependencies:e,createCombinationsWithRep:as},ge={BigNumberDependencies:s,DenseMatrixDependencies:p,FractionDependencies:ue,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createCompare:ss},$={compareDependencies:ge,typedDependencies:e,createCompareNatural:rs},bd={concatDependencies:f,matrixDependencies:a,typedDependencies:e,createCompareText:ts},xd={NodeDependencies:R,createConditionalNode:vs},oe={NodeDependencies:R,createConstantNode:fs},yd={NodeDependencies:R,typedDependencies:e,createFunctionAssignmentNode:Nr},de={UnitDependencies:c,NodeDependencies:R,createSymbolNode:lc},pe={NodeDependencies:R,SymbolNodeDependencies:de,createFunctionNode:kr},Me={NodeDependencies:R,sizeDependencies:w,createIndexNode:Gr},we={NodeDependencies:R,createObjectNode:ut},re={NodeDependencies:R,createOperatorNode:Dt},be={NodeDependencies:R,createParenthesisNode:bt},_d={NodeDependencies:R,createRangeNode:Zt},Cd={NodeDependencies:R,createRelationalNode:ei},ee={AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,AssignmentNodeDependencies:cd,BlockNodeDependencies:md,ConditionalNodeDependencies:xd,ConstantNodeDependencies:oe,FunctionAssignmentNodeDependencies:yd,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,RangeNodeDependencies:_d,RelationalNodeDependencies:Cd,SymbolNodeDependencies:de,numericDependencies:Z,typedDependencies:e,createParse:xt},hh={parseDependencies:ee,typedDependencies:e,createCompile:is},Xe={ComplexDependencies:h,typedDependencies:e,createComplex:cs},gh={addScalarDependencies:T,combinationsDependencies:Ye,isIntegerDependencies:O,isNegativeDependencies:ce,isPositiveDependencies:he,largerDependencies:P,typedDependencies:e,createComposition:ds},bh={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createConcatTransform:ls},xh={BigNumberDependencies:s,UnitDependencies:c,createConductanceQuantum:us},F={divideScalarDependencies:y,equalScalarDependencies:v,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createDivide:zs},Sd={addDependencies:u,divideDependencies:F,typedDependencies:e,createMean:Bn},J={ComplexDependencies:h,typedDependencies:e,createSqrt:Zi},S={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createSubtract:ic},$c={addDependencies:u,numericDependencies:Z,typedDependencies:e,createSum:oc},yh={addDependencies:u,divideDependencies:F,matrixDependencies:a,meanDependencies:Sd,multiplyDependencies:D,powDependencies:H,sqrtDependencies:J,subtractDependencies:S,sumDependencies:$c,typedDependencies:e,createCorr:Ds},eo={typedDependencies:e,createCos:hs},_h={typedDependencies:e,createCosh:gs},Ch={BigNumberDependencies:s,typedDependencies:e,createCot:bs},Sh={BigNumberDependencies:s,typedDependencies:e,createCoth:xs},Nh={BigNumberDependencies:s,UnitDependencies:c,createCoulomb:ys},Nd={multiplyScalarDependencies:C,numericDependencies:Z,typedDependencies:e,createProd:Lt},kh={prodDependencies:Nd,sizeDependencies:w,typedDependencies:e,createCount:_s},Th={UnitDependencies:c,typedDependencies:e,createCreateUnit:Cs},Fh={matrixDependencies:a,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createCross:Ss},Mh={BigNumberDependencies:s,typedDependencies:e,createCsc:Ns},wh={BigNumberDependencies:s,typedDependencies:e,createCsch:ks},Pe={matrixDependencies:a,typedDependencies:e,createTranspose:bc},ao={conjDependencies:fe,transposeDependencies:Pe,typedDependencies:e,createCtranspose:Ts},Rh={typedDependencies:e,createCube:Fs},so={BigNumberDependencies:s,typedDependencies:e,createUnaryPlus:Sc},Eh={addDependencies:u,typedDependencies:e,unaryPlusDependencies:so,createCumSum:Ms},jh={addDependencies:u,typedDependencies:e,unaryPlusDependencies:so,createCumSumTransform:ws},ro={equalDependencies:B,typedDependencies:e,createDeepEqual:Rs},kd={ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,parseDependencies:ee,typedDependencies:e,createResolve:ni},no={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,SymbolNodeDependencies:de,matrixDependencies:a,typedDependencies:e,createSimplifyConstant:Ai},to={AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,subtractDependencies:S,typedDependencies:e,createSimplifyCore:Pi},Je={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,resolveDependencies:kd,simplifyConstantDependencies:no,simplifyCoreDependencies:to,subtractDependencies:S,typedDependencies:e,createSimplify:ji},Ah={ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,equalDependencies:B,isZeroDependencies:X,numericDependencies:Z,parseDependencies:ee,simplifyDependencies:Je,typedDependencies:e,createDerivative:js},Ph={BigNumberDependencies:s,UnitDependencies:c,createDeuteronMass:Ps},Td={DenseMatrixDependencies:p,SparseMatrixDependencies:ae,matrixDependencies:a,typedDependencies:e,createDiag:Is},Ih={matrixDependencies:a,numberDependencies:se,subtractDependencies:S,typedDependencies:e,createDiff:Os},Oh={bignumberDependencies:L,matrixDependencies:a,numberDependencies:se,subtractDependencies:S,typedDependencies:e,createDiffTransform:qs},qh={absDependencies:A,addScalarDependencies:T,deepEqualDependencies:ro,divideScalarDependencies:y,multiplyScalarDependencies:C,sqrtDependencies:J,subtractScalarDependencies:Q,typedDependencies:e,createDistance:Ls},Ie={DenseMatrixDependencies:p,concatDependencies:f,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createDotDivide:Qs},Lh={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createDotMultiply:Hs},zh={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,powDependencies:H,typedDependencies:e,createDotPow:Ws},Fd={BigNumberDependencies:s,createE:Gs},Uh={BigNumberDependencies:s,createEfimovFactor:Vs},Oe={matrixDependencies:a,typedDependencies:e,createFlatten:hr},io={typedDependencies:e,createIm:Br},co={flattenDependencies:Oe,matrixDependencies:a,sizeDependencies:w,typedDependencies:e,createMatrixFromColumns:On},Md={BigNumberDependencies:s,FractionDependencies:ue,complexDependencies:Xe,typedDependencies:e,createSign:Ei},oo={addScalarDependencies:T,complexDependencies:Xe,conjDependencies:fe,divideScalarDependencies:y,equalDependencies:B,identityDependencies:ie,isZeroDependencies:X,matrixDependencies:a,multiplyScalarDependencies:C,signDependencies:Md,sqrtDependencies:J,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,zerosDependencies:M,createQr:Ut},po={typedDependencies:e,createRe:Kt},wd={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createReshape:si},Ke={typedDependencies:e,createSin:Ii},lo={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createUsolve:wc},Rd={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createUsolveAll:Rc},Ed={absDependencies:A,addDependencies:u,addScalarDependencies:T,atanDependencies:od,bignumberDependencies:L,columnDependencies:gd,complexDependencies:Xe,cosDependencies:eo,diagDependencies:Td,divideScalarDependencies:y,dotDependencies:Ve,equalDependencies:B,flattenDependencies:Oe,imDependencies:io,invDependencies:De,largerDependencies:P,matrixDependencies:a,matrixFromColumnsDependencies:co,multiplyDependencies:D,multiplyScalarDependencies:C,numberDependencies:se,qrDependencies:oo,reDependencies:po,reshapeDependencies:wd,sinDependencies:Ke,sizeDependencies:w,smallerDependencies:I,sqrtDependencies:J,subtractDependencies:S,typedDependencies:e,usolveDependencies:lo,usolveAllDependencies:Rd,createEigs:Ys},Bh={BigNumberDependencies:s,UnitDependencies:c,createElectricConstant:Zs},Qh={BigNumberDependencies:s,UnitDependencies:c,createElectronMass:Xs},Hh={BigNumberDependencies:s,UnitDependencies:c,createElementaryCharge:Js},Wh={compareTextDependencies:bd,isZeroDependencies:X,typedDependencies:e,createEqualText:er},Gh={typedDependencies:e,createErf:ar},vo={parseDependencies:ee,typedDependencies:e,createEvaluate:sr},jd={typedDependencies:e,createExp:rr},Vh={absDependencies:A,addDependencies:u,identityDependencies:ie,invDependencies:De,multiplyDependencies:D,typedDependencies:e,createExpm:nr},Yh={ComplexDependencies:h,typedDependencies:e,createExpm1:tr},Zh={createFalse:cr},Xh={BigNumberDependencies:s,UnitDependencies:c,createFaraday:or},Jh={BigNumberDependencies:s,UnitDependencies:c,createFermiCoupling:dr},Ad={ComplexDependencies:h,createI:Lr},Pd={ComplexDependencies:h,typedDependencies:e,createLog2:Cn},Id={BigNumberDependencies:s,createTau:fc},Od={addScalarDependencies:T,ceilDependencies:Xc,conjDependencies:fe,divideScalarDependencies:y,dotDivideDependencies:Ie,expDependencies:jd,iDependencies:Ad,log2Dependencies:Pd,matrixDependencies:a,multiplyScalarDependencies:C,powDependencies:H,tauDependencies:Id,typedDependencies:e,createFft:pr},qd={largerDependencies:P,smallerDependencies:I,createFibonacciHeapClass:lr},Kh={typedDependencies:e,createFilter:vr},$h={typedDependencies:e,createFilterTransform:ur},eg={BigNumberDependencies:s,createFineStructure:mr},ag={BigNumberDependencies:s,UnitDependencies:c,createFirstRadiation:fr},sg={typedDependencies:e,createForEach:br},rg={typedDependencies:e,createForEachTransform:xr},ng={ComplexDependencies:h,addDependencies:u,divideDependencies:F,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createFreqz:Sr},tg={BigNumberDependencies:s,UnitDependencies:c,createGasConstant:Fr},ig={BigNumberDependencies:s,DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createGcd:Mr},cg={BigNumberDependencies:s,UnitDependencies:c,createGravitationConstant:Rr},og={BigNumberDependencies:s,UnitDependencies:c,createGravity:Er},dg={BigNumberDependencies:s,UnitDependencies:c,createHartreeEnergy:jr},pg={isNumericDependencies:me,typedDependencies:e,createHasNumericValue:Ar},Ld={evaluateDependencies:vo,createHelpClass:Ir},lg={HelpDependencies:Ld,typedDependencies:e,createHelp:Pr},vg={formatDependencies:je,typedDependencies:e,createHex:Or},ug={absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,isPositiveDependencies:he,multiplyScalarDependencies:C,smallerDependencies:I,sqrtDependencies:J,typedDependencies:e,createHypot:qr},mg={conjDependencies:fe,dotDivideDependencies:Ie,fftDependencies:Od,typedDependencies:e,createIfft:Ur},zd={IndexDependencies:E,typedDependencies:e,createIndex:Hr},fg={IndexDependencies:E,getMatrixDataTypeDependencies:Kc,createIndexTransform:Vr},Dg={BigNumberDependencies:s,createInfinity:Yr},hg={absDependencies:A,addDependencies:u,addScalarDependencies:T,divideScalarDependencies:y,equalScalarDependencies:v,flattenDependencies:Oe,isNumericDependencies:me,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,multiplyScalarDependencies:C,smallerDependencies:I,subtractDependencies:S,typedDependencies:e,createIntersect:Zr},gg={BigNumberDependencies:s,UnitDependencies:c,createInverseConductanceQuantum:Jr},Ud={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createMod:Vn},Bd={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createXgcd:qc},bg={BigNumberDependencies:s,addDependencies:u,equalDependencies:B,isIntegerDependencies:O,modDependencies:Ud,smallerDependencies:I,typedDependencies:e,xgcdDependencies:Bd,createInvmod:Kr},qe={typedDependencies:e,createIsNaN:en},xg={typedDependencies:e,createIsPrime:nn},uo={ComplexDependencies:h,divideScalarDependencies:y,typedDependencies:e,createLog:xn},xe={typedDependencies:e,createMap:jn},yg={divideDependencies:F,dotDivideDependencies:Ie,isNumericDependencies:me,logDependencies:uo,mapDependencies:xe,matrixDependencies:a,multiplyDependencies:D,sumDependencies:$c,typedDependencies:e,createKldivergence:cn},_g={BigNumberDependencies:s,UnitDependencies:c,createKlitzing:on},Cg={matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createKron:dn},Sg={BigNumberDependencies:s,createLN10:pn},Ng={BigNumberDependencies:s,createLN2:ln},kg={BigNumberDependencies:s,createLOG10E:vn},Tg={BigNumberDependencies:s,createLOG2E:un},Fg={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createLcm:Dn},Mg={parseDependencies:ee,typedDependencies:e,createLeafCount:hn},wg={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createLeftShift:gn},Rg={ComplexDependencies:h,typedDependencies:e,createLgamma:bn},Eg={ComplexDependencies:h,typedDependencies:e,createLog10:yn},jg={ComplexDependencies:h,divideScalarDependencies:y,logDependencies:uo,typedDependencies:e,createLog1p:_n},Ag={BigNumberDependencies:s,UnitDependencies:c,createLoschmidt:Sn},Qd={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createLsolve:Nn},Pg={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createLsolveAll:kn},Hd={FibonacciHeapDependencies:qd,addScalarDependencies:T,equalScalarDependencies:v,createSpaClass:Hi},Wd={DenseMatrixDependencies:p,SpaDependencies:Hd,SparseMatrixDependencies:ae,absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,equalScalarDependencies:v,largerDependencies:P,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createLup:Tn},Gd={SparseMatrixDependencies:ae,absDependencies:A,addDependencies:u,divideScalarDependencies:y,largerDependencies:P,largerEqDependencies:Ze,multiplyDependencies:D,subtractDependencies:S,transposeDependencies:Pe,typedDependencies:e,createSlu:Li},Vd={DenseMatrixDependencies:p,lsolveDependencies:Qd,lupDependencies:Wd,matrixDependencies:a,sluDependencies:Gd,typedDependencies:e,usolveDependencies:lo,createLusolve:Fn},mo={absDependencies:A,addDependencies:u,conjDependencies:fe,ctransposeDependencies:ao,eigsDependencies:Ed,equalScalarDependencies:v,largerDependencies:P,matrixDependencies:a,multiplyDependencies:D,powDependencies:H,smallerDependencies:I,sqrtDependencies:J,typedDependencies:e,createNorm:tt},Yd={identityDependencies:ie,matrixDependencies:a,multiplyDependencies:D,normDependencies:mo,qrDependencies:oo,subtractDependencies:S,typedDependencies:e,createSchur:gi},Zd={absDependencies:A,addDependencies:u,concatDependencies:f,identityDependencies:ie,indexDependencies:zd,lusolveDependencies:Vd,matrixDependencies:a,matrixFromColumnsDependencies:co,multiplyDependencies:D,rangeDependencies:Fe,schurDependencies:Yd,subsetDependencies:q,subtractDependencies:S,transposeDependencies:Pe,typedDependencies:e,createSylvester:pc},Ig={matrixDependencies:a,multiplyDependencies:D,sylvesterDependencies:Zd,transposeDependencies:Pe,typedDependencies:e,createLyap:Mn},$e={compareDependencies:ge,isNaNDependencies:qe,isNumericDependencies:me,typedDependencies:e,createPartitionSelect:Ct},Xd={addDependencies:u,compareDependencies:ge,divideDependencies:F,partitionSelectDependencies:$e,typedDependencies:e,createMedian:Hn},Og={absDependencies:A,mapDependencies:xe,medianDependencies:Xd,subtractDependencies:S,typedDependencies:e,createMad:wn},qg={BigNumberDependencies:s,UnitDependencies:c,createMagneticConstant:Rn},Lg={BigNumberDependencies:s,UnitDependencies:c,createMagneticFluxQuantum:En},zg={typedDependencies:e,createMapTransform:An},Ug={isZeroDependencies:X,matrixDependencies:a,typedDependencies:e,createMatrixFromFunction:qn},Bg={flattenDependencies:Oe,matrixDependencies:a,sizeDependencies:w,typedDependencies:e,createMatrixFromRows:Ln},fo={largerDependencies:P,numericDependencies:Z,typedDependencies:e,createMax:zn},Qg={largerDependencies:P,numericDependencies:Z,typedDependencies:e,createMaxTransform:Un},Hg={addDependencies:u,divideDependencies:F,typedDependencies:e,createMeanTransform:Qn},Wg={numericDependencies:Z,smallerDependencies:I,typedDependencies:e,createMin:Wn},Gg={numericDependencies:Z,smallerDependencies:I,typedDependencies:e,createMinTransform:Gn},Vg={isNaNDependencies:qe,isNumericDependencies:me,typedDependencies:e,createMode:Yn},Yg={BigNumberDependencies:s,UnitDependencies:c,createMolarMass:Zn},Zg={BigNumberDependencies:s,UnitDependencies:c,createMolarMassC12:Xn},Xg={BigNumberDependencies:s,UnitDependencies:c,createMolarPlanckConstant:Jn},Jg={BigNumberDependencies:s,UnitDependencies:c,createMolarVolume:Kn},Kg={addDependencies:u,divideDependencies:F,factorialDependencies:Ae,isIntegerDependencies:O,isPositiveDependencies:he,multiplyDependencies:D,typedDependencies:e,createMultinomial:$n},$g={BigNumberDependencies:s,createNaN:st},eb={BigNumberDependencies:s,UnitDependencies:c,createNeutronMass:rt},ab={BigNumberDependencies:s,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createNthRoot:ct},sb={ComplexDependencies:h,divideScalarDependencies:y,typedDependencies:e,createNthRoots:ot},rb={BigNumberDependencies:s,UnitDependencies:c,createNuclearMagneton:dt},nb={createNull:pt},tb={formatDependencies:je,typedDependencies:e,createOct:mt},ib={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createOnes:ft},cb={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createOr:ht},ob={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createOrTransform:gt},Jd={evaluateDependencies:vo,createParserClass:_t},db={ParserDependencies:Jd,typedDependencies:e,createParser:yt},pb={factorialDependencies:Ae,typedDependencies:e,createPermutations:St},lb={BigNumberDependencies:s,createPhi:Nt},Do={BigNumberDependencies:s,createPi:kt},vb={typedDependencies:e,createPickRandom:Tt},ub={ComplexDependencies:h,addDependencies:u,ctransposeDependencies:ao,deepEqualDependencies:ro,divideScalarDependencies:y,dotDependencies:Ve,dotDivideDependencies:Ie,equalDependencies:B,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createPinv:Ft},mb={BigNumberDependencies:s,UnitDependencies:c,createPlanckCharge:Mt},fb={BigNumberDependencies:s,UnitDependencies:c,createPlanckConstant:wt},Db={BigNumberDependencies:s,UnitDependencies:c,createPlanckLength:Rt},hb={BigNumberDependencies:s,UnitDependencies:c,createPlanckMass:Et},gb={BigNumberDependencies:s,UnitDependencies:c,createPlanckTemperature:jt},bb={BigNumberDependencies:s,UnitDependencies:c,createPlanckTime:At},Kd={typedDependencies:e,createTypeOf:yc},xb={addDependencies:u,cbrtDependencies:fd,divideDependencies:F,equalScalarDependencies:v,imDependencies:io,isZeroDependencies:X,multiplyDependencies:D,reDependencies:po,sqrtDependencies:J,subtractDependencies:S,typeOfDependencies:Kd,typedDependencies:e,unaryMinusDependencies:K,createPolynomialRoot:Pt},yb={typedDependencies:e,createPrint:Ot},_b={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createPrintTransform:qt},Cb={BigNumberDependencies:s,UnitDependencies:c,createProtonMass:zt},Sb={bignumberDependencies:L,addDependencies:u,compareDependencies:ge,divideDependencies:F,isIntegerDependencies:O,largerDependencies:P,multiplyDependencies:D,partitionSelectDependencies:$e,smallerDependencies:I,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createQuantileSeq:Bt},Nb={addDependencies:u,bignumberDependencies:L,compareDependencies:ge,divideDependencies:F,isIntegerDependencies:O,largerDependencies:P,multiplyDependencies:D,partitionSelectDependencies:$e,smallerDependencies:I,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createQuantileSeqTransform:Qt},kb={BigNumberDependencies:s,UnitDependencies:c,createQuantumOfCirculation:Ht},Tb={typedDependencies:e,createRandom:Wt},Fb={typedDependencies:e,createRandomInt:Gt},Mb={createRangeClass:Yt},wb={bignumberDependencies:L,matrixDependencies:a,addDependencies:u,isPositiveDependencies:he,largerDependencies:P,largerEqDependencies:Ze,smallerDependencies:I,smallerEqDependencies:Te,typedDependencies:e,createRangeTransform:Xt},Rb={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,simplifyDependencies:Je,simplifyConstantDependencies:no,simplifyCoreDependencies:to,subtractDependencies:S,typedDependencies:e,createRationalize:Jt},Eb={BigNumberDependencies:s,UnitDependencies:c,createReducedPlanckConstant:$t},jb={createReplacer:ai},Ab={matrixDependencies:a,createResize:ri},Pb={createReviver:ii},Ib={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRightArithShift:ci},Ob={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRightLogShift:oi},$d={BigNumberDependencies:s,DenseMatrixDependencies:p,SparseMatrixDependencies:ae,addScalarDependencies:T,cosDependencies:eo,matrixDependencies:a,multiplyScalarDependencies:C,normDependencies:mo,sinDependencies:Ke,typedDependencies:e,unaryMinusDependencies:K,createRotationMatrix:pi},qb={multiplyDependencies:D,rotationMatrixDependencies:$d,typedDependencies:e,createRotate:di},Lb={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createRow:vi},zb={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createRowTransform:ui},Ub={BigNumberDependencies:s,UnitDependencies:c,createRydberg:mi},Bb={BigNumberDependencies:s,createSQRT1_2:fi},Qb={BigNumberDependencies:s,createSQRT2:Di},Hb={BigNumberDependencies:s,createSackurTetrode:hi},Wb={BigNumberDependencies:s,typedDependencies:e,createSec:bi},Gb={BigNumberDependencies:s,typedDependencies:e,createSech:xi},Vb={BigNumberDependencies:s,UnitDependencies:c,createSecondRadiation:yi},Yb={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetCartesian:_i},ep={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetDifference:Ci},Zb={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetDistinct:Si},ap={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetIntersect:Ni},Xb={IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetIsSubset:ki},Jb={IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetMultiplicity:Ti},Kb={IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetPowerset:Fi},$b={compareNaturalDependencies:$,typedDependencies:e,createSetSize:Mi},sp={IndexDependencies:E,concatDependencies:f,setDifferenceDependencies:ep,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetSymDifference:wi},ex={IndexDependencies:E,concatDependencies:f,setIntersectDependencies:ap,setSymDifferenceDependencies:sp,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetUnion:Ri},ax={typedDependencies:e,createSinh:Oi},sx={absDependencies:A,addDependencies:u,bignumberDependencies:L,divideDependencies:F,isNegativeDependencies:ce,isPositiveDependencies:he,largerDependencies:P,mapDependencies:xe,matrixDependencies:a,maxDependencies:fo,multiplyDependencies:D,smallerDependencies:I,subtractDependencies:S,typedDependencies:e,unaryMinusDependencies:K,createSolveODE:Bi},rx={compareDependencies:ge,compareNaturalDependencies:$,matrixDependencies:a,typedDependencies:e,createSort:Qi},nx={SparseMatrixDependencies:ae,typedDependencies:e,createSparse:Wi},tx={BigNumberDependencies:s,UnitDependencies:c,createSpeedOfLight:Vi},ix={typedDependencies:e,createSplitUnit:Yi},cx={absDependencies:A,addDependencies:u,identityDependencies:ie,invDependencies:De,mapDependencies:xe,maxDependencies:fo,multiplyDependencies:D,sizeDependencies:w,sqrtDependencies:J,subtractDependencies:S,typedDependencies:e,createSqrtm:Xi},ox={typedDependencies:e,createSquare:Ji},dx={matrixDependencies:a,typedDependencies:e,createSqueeze:Ki},ho={addDependencies:u,applyDependencies:Zc,divideDependencies:F,isNaNDependencies:qe,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createVariance:jc},px={mapDependencies:xe,sqrtDependencies:J,typedDependencies:e,varianceDependencies:ho,createStd:$i},lx={mapDependencies:xe,sqrtDependencies:J,typedDependencies:e,varianceDependencies:ho,createStdTransform:ec},vx={BigNumberDependencies:s,UnitDependencies:c,createStefanBoltzmann:ac},ux={typedDependencies:e,createString:rc},mx={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createSubsetTransform:tc},fx={addDependencies:u,numericDependencies:Z,typedDependencies:e,createSumTransform:dc},Dx={OperatorNodeDependencies:re,parseDependencies:ee,simplifyDependencies:Je,typedDependencies:e,createSymbolicEqual:vc},hx={typedDependencies:e,createTan:uc},gx={typedDependencies:e,createTanh:mc},bx={BigNumberDependencies:s,UnitDependencies:c,createThomsonCrossSection:Dc},xx={concatDependencies:f,matrixDependencies:a,typedDependencies:e,createTo:hc},yx={addDependencies:u,matrixDependencies:a,typedDependencies:e,createTrace:gc},_x={createTrue:xc},Cx={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createUnequal:Nc},Sx={UnitDependencies:c,typedDependencies:e,createUnitFunction:Tc},Nx={eDependencies:Fd,createUppercaseE:Fc},kx={piDependencies:Do,createUppercasePi:Mc},Tx={BigNumberDependencies:s,UnitDependencies:c,createVacuumImpedance:Ec},Fx={addDependencies:u,applyDependencies:Zc,divideDependencies:F,isNaNDependencies:qe,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createVarianceTransform:Ac},Mx={createVersion:Pc},wx={BigNumberDependencies:s,createWeakMixingAngle:Ic},Rx={BigNumberDependencies:s,UnitDependencies:c,createWienDisplacement:Oc},Ex={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createXor:Lc},jx={BigNumberDependencies:s,ComplexDependencies:h,addDependencies:u,divideDependencies:F,equalDependencies:B,factorialDependencies:Ae,gammaDependencies:Jc,isNegativeDependencies:ce,multiplyDependencies:D,piDependencies:Do,powDependencies:H,sinDependencies:Ke,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createZeta:Uc},Ax={ComplexDependencies:h,addDependencies:u,multiplyDependencies:D,numberDependencies:se,typedDependencies:e,createZpk2tf:Bc},Px=AD,He={},Ix={get exports(){return He},set exports(n){He=n}};function go(){}go.prototype={on:function(n,l,i){var o=this.e||(this.e={});return(o[n]||(o[n]=[])).push({fn:l,ctx:i}),this},once:function(n,l,i){var o=this;function x(){o.off(n,x),l.apply(i,arguments)}return x._=l,this.on(n,x,i)},emit:function(n){var l=[].slice.call(arguments,1),i=((this.e||(this.e={}))[n]||[]).slice(),o=0,x=i.length;for(o;oj(ye,np));else if(typeof k=="object")for(var Y in k)_e(k,Y)&&j(ye,k[Y],Y);else if(Ee(k)||te!==void 0){var Be=Ee(k)?Ue(k)?k.fn+".transform":k.fn:te;if(_e(ye,Be)&&ye[Be]!==k&&!m.silent)throw new Error('Cannot import "'+Be+'" twice');ye[Be]=k}else if(!m.silent)throw new TypeError("Factory, Object, or Array expected")}var z={};j(z,r);for(var U in z)if(_e(z,U)){var V=z[U];if(Ee(V))ze(V,m);else if(N(V))d(U,V,m);else if(!m.silent)throw new TypeError("Factory, Object, or Array expected")}}function d(r,m,b){if(b.wrap&&typeof m=="function"&&(m=Le(m)),le(m)&&(m=n(r,{[m.signature]:m})),n.isTypedFunction(i[r])&&n.isTypedFunction(m)){b.override?m=n(r,m.signatures):m=n(i[r],m),i[r]=m,delete o[r],W(r,m),i.emit("import",r,function(){return m});return}if(i[r]===void 0||b.override){i[r]=m,delete o[r],W(r,m),i.emit("import",r,function(){return m});return}if(!b.silent)throw new Error('Cannot import "'+r+'": already exists')}function W(r,m){m&&typeof m.transform=="function"?(i.expression.transform[r]=m.transform,G(r)&&(i.expression.mathWithTransform[r]=m.transform)):(delete i.expression.transform[r],G(r)&&(i.expression.mathWithTransform[r]=m))}function _(r){delete i.expression.transform[r],G(r)?i.expression.mathWithTransform[r]=i[r]:delete i.expression.mathWithTransform[r]}function Le(r){var m=function(){for(var j=[],z=0,U=arguments.length;z2&&arguments[2]!==void 0?arguments[2]:r.fn;if(xo(b,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(b));var j=Ue(r)?i.expression.transform:i,z=b in i.expression.transform,U=_e(j,b)?j[b]:void 0,V=function(){var k={};r.dependencies.map(tp).forEach(Y=>{if(xo(Y,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(Y));Y==="math"?k.math=i:Y==="mathWithTransform"?k.mathWithTransform=i.expression.mathWithTransform:Y==="classes"?k.classes=i:k[Y]=i[Y]});var te=r(k);if(te&&typeof te.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(U===void 0||m.override)return te;if(n.isTypedFunction(U)&&n.isTypedFunction(te))return n(U,te);if(m.silent)return U;throw new Error('Cannot import "'+b+'": already exists')};!r.meta||r.meta.lazy!==!1?(ea(j,b,V),U&&z?_(b):(Ue(r)||ne(r))&&ea(i.expression.mathWithTransform,b,()=>j[b])):(j[b]=V(),U&&z?_(b):(Ue(r)||ne(r))&&ea(i.expression.mathWithTransform,b,()=>j[b])),o[b]=r,i.emit("import",b,V)}function N(r){return typeof r=="function"||typeof r=="number"||typeof r=="string"||typeof r=="boolean"||r===null||Hc(r)||Wc(r)||Gc(r)||Vc(r)||Yc(r)||Array.isArray(r)}function le(r){return typeof r=="function"&&typeof r.signature=="string"}function G(r){return!_e(bo,r)}function ne(r){return r.fn.indexOf(".")===-1&&!_e(bo,r.fn)&&(!r.meta||!r.meta.isClass)}function Ue(r){return r!==void 0&&r.meta!==void 0&&r.meta.isTransformFunction===!0||!1}var bo={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return x}function rp(n,l){var i=ip({},cp,l);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var o=Ox({isNumber:To,isComplex:Wc,isBigNumber:Gc,isFraction:Vc,isUnit:Hc,isString:Fo,isArray:Mo,isMatrix:Yc,isCollection:wo,isDenseMatrix:Ro,isSparseMatrix:Eo,isRange:jo,isIndex:Ao,isBoolean:Po,isResultSet:Io,isHelp:Oo,isFunction:qo,isDate:Lo,isRegExp:zo,isObject:Uo,isNull:Bo,isUndefined:Qo,isAccessorNode:Ho,isArrayNode:Wo,isAssignmentNode:Go,isBlockNode:Vo,isConditionalNode:Yo,isConstantNode:Zo,isFunctionAssignmentNode:Xo,isFunctionNode:Jo,isIndexNode:Ko,isNode:$o,isObjectNode:ed,isOperatorNode:ad,isParenthesisNode:sd,isRangeNode:rd,isRelationalNode:nd,isSymbolNode:td,isChain:id});o.config=op(i,o.emit),o.expression={transform:{},mathWithTransform:{config:o.config}};var x=[],d=[];function W(N){if(Ee(N))return N(o);var le=N[Object.keys(N)[0]];if(Ee(le))return le(o);if(!lp(N))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",N),new Error("Factory object with properties `type`, `name`, and `factory` expected");var G=x.indexOf(N),ne;return G===-1?(N.math===!0?ne=N.factory(o.type,i,W,o.typed,o):ne=N.factory(o.type,i,W,o.typed),x.push(N),d.push(ne)):ne=d[G],ne}var _={};function Le(){for(var N=arguments.length,le=new Array(N),G=0;G{yo(_).forEach(N=>{N&&N.meta&&N.meta.recreateOnConfigChange&&ze(N,{override:!0})})}),o.create=rp.bind(null,n),o.factory=So,o.import(yo(pp(n))),o.ArgumentsError=Qc,o.DimensionError=No,o.IndexError=ko,o}const Lx=Object.freeze(Object.defineProperty({__proto__:null,AccessorNode:vp,AccessorNodeDependencies:Ce,ArgumentsError:Qc,ArrayNode:up,ArrayNodeDependencies:Se,AssignmentNode:mp,AssignmentNodeDependencies:cd,BigNumber:fp,BigNumberDependencies:s,BlockNode:Dp,BlockNodeDependencies:md,Chain:hp,ChainDependencies:Dd,Complex:gp,ComplexDependencies:h,ConditionalNode:bp,ConditionalNodeDependencies:xd,ConstantNode:xp,ConstantNodeDependencies:oe,DenseMatrix:yp,DenseMatrixDependencies:p,DimensionError:No,EDependencies:Nx,FibonacciHeap:_p,FibonacciHeapDependencies:qd,Fraction:Cp,FractionDependencies:ue,FunctionAssignmentNode:Sp,FunctionAssignmentNodeDependencies:yd,FunctionNode:Np,FunctionNodeDependencies:pe,Help:kp,HelpDependencies:Ld,ImmutableDenseMatrix:Tp,ImmutableDenseMatrixDependencies:hd,Index:Fp,IndexDependencies:E,IndexError:ko,IndexNode:Mp,IndexNodeDependencies:Me,InfinityDependencies:Dg,LN10:wp,LN10Dependencies:Sg,LN2:Rp,LN2Dependencies:Ng,LOG10E:Ep,LOG10EDependencies:kg,LOG2E:jp,LOG2EDependencies:Tg,Matrix:Ap,MatrixDependencies:We,NaNDependencies:$g,Node:Pp,NodeDependencies:R,ObjectNode:Ip,ObjectNodeDependencies:we,OperatorNode:Op,OperatorNodeDependencies:re,PIDependencies:kx,ParenthesisNode:qp,ParenthesisNodeDependencies:be,Parser:Lp,ParserDependencies:Jd,Range:zp,RangeDependencies:Mb,RangeNode:Up,RangeNodeDependencies:_d,RelationalNode:Bp,RelationalNodeDependencies:Cd,ResultSet:Qp,ResultSetDependencies:ud,SQRT1_2:Hp,SQRT1_2Dependencies:Bb,SQRT2:Wp,SQRT2Dependencies:Qb,Spa:Gp,SpaDependencies:Hd,SparseMatrix:Vp,SparseMatrixDependencies:ae,SymbolNode:Yp,SymbolNodeDependencies:de,Unit:Zp,UnitDependencies:c,_Infinity:Xp,_NaN:Jp,_false:Kp,_null:$p,_true:el,abs:al,absDependencies:A,acos:sl,acosDependencies:PD,acosh:rl,acoshDependencies:ID,acot:nl,acotDependencies:OD,acoth:tl,acothDependencies:qD,acsc:il,acscDependencies:LD,acsch:cl,acschDependencies:zD,add:ol,addDependencies:u,addScalar:dl,addScalarDependencies:T,all:Px,and:pl,andDependencies:UD,andTransformDependencies:BD,apply:ll,applyDependencies:Zc,applyTransformDependencies:QD,arg:vl,argDependencies:HD,asec:ul,asecDependencies:WD,asech:ml,asechDependencies:GD,asin:fl,asinDependencies:VD,asinh:Dl,asinhDependencies:YD,atan:hl,atan2:gl,atan2Dependencies:ZD,atanDependencies:od,atanh:bl,atanhDependencies:XD,atomicMass:xl,atomicMassDependencies:JD,avogadro:yl,avogadroDependencies:KD,bellNumbers:_l,bellNumbersDependencies:$D,bignumber:Cl,bignumberDependencies:L,bin:Sl,binDependencies:eh,bitAnd:Nl,bitAndDependencies:ah,bitAndTransformDependencies:sh,bitNot:kl,bitNotDependencies:rh,bitOr:Tl,bitOrDependencies:nh,bitOrTransformDependencies:th,bitXor:Fl,bitXorDependencies:ih,bohrMagneton:Ml,bohrMagnetonDependencies:ch,bohrRadius:wl,bohrRadiusDependencies:oh,boltzmann:Rl,boltzmannDependencies:dh,boolean:El,booleanDependencies:ph,catalan:jl,catalanDependencies:lh,cbrt:Al,cbrtDependencies:fd,ceil:Pl,ceilDependencies:Xc,chain:ra,chainDependencies:vh,classicalElectronRadius:Il,classicalElectronRadiusDependencies:uh,clone:Ol,cloneDependencies:mh,column:ql,columnDependencies:gd,columnTransformDependencies:fh,combinations:Ll,combinationsDependencies:Ye,combinationsWithRep:zl,combinationsWithRepDependencies:Dh,compare:Ul,compareDependencies:ge,compareNatural:Bl,compareNaturalDependencies:$,compareText:Ql,compareTextDependencies:bd,compile:Hl,compileDependencies:hh,complex:Wl,complexDependencies:Xe,composition:Gl,compositionDependencies:gh,concat:Vl,concatDependencies:f,concatTransformDependencies:bh,conductanceQuantum:Yl,conductanceQuantumDependencies:xh,config:Zl,conj:Xl,conjDependencies:fe,corr:Jl,corrDependencies:yh,cos:Kl,cosDependencies:eo,cosh:$l,coshDependencies:_h,cot:ev,cotDependencies:Ch,coth:av,cothDependencies:Sh,coulomb:sv,coulombDependencies:Nh,count:rv,countDependencies:kh,create:rp,createAbs:na,createAccessorNode:ta,createAcos:ia,createAcosh:ca,createAcot:oa,createAcoth:da,createAcsc:pa,createAcsch:la,createAdd:va,createAddScalar:ua,createAnd:ma,createAndTransform:fa,createApply:Da,createApplyTransform:ha,createArg:ga,createArrayNode:ba,createAsec:xa,createAsech:ya,createAsin:_a,createAsinh:Ca,createAssignmentNode:Sa,createAtan:Na,createAtan2:ka,createAtanh:Ta,createAtomicMass:Fa,createAvogadro:Ma,createBellNumbers:wa,createBigNumberClass:Ra,createBignumber:Ea,createBin:ja,createBitAnd:Aa,createBitAndTransform:Pa,createBitNot:Ia,createBitOr:Oa,createBitOrTransform:qa,createBitXor:La,createBlockNode:za,createBohrMagneton:Ua,createBohrRadius:Ba,createBoltzmann:Qa,createBoolean:Ha,createCatalan:Wa,createCbrt:Ga,createCeil:Va,createChain:Ya,createChainClass:Za,createClassicalElectronRadius:Xa,createClone:Ja,createColumn:Ka,createColumnTransform:$a,createCombinations:es,createCombinationsWithRep:as,createCompare:ss,createCompareNatural:rs,createCompareText:ts,createCompile:is,createComplex:cs,createComplexClass:os,createComposition:ds,createConcat:ps,createConcatTransform:ls,createConditionalNode:vs,createConductanceQuantum:us,createConj:ms,createConstantNode:fs,createCorr:Ds,createCos:hs,createCosh:gs,createCot:bs,createCoth:xs,createCoulomb:ys,createCount:_s,createCreateUnit:Cs,createCross:Ss,createCsc:Ns,createCsch:ks,createCtranspose:Ts,createCube:Fs,createCumSum:Ms,createCumSumTransform:ws,createDeepEqual:Rs,createDenseMatrixClass:Es,createDerivative:js,createDet:As,createDeuteronMass:Ps,createDiag:Is,createDiff:Os,createDiffTransform:qs,createDistance:Ls,createDivide:zs,createDivideScalar:Us,createDot:Bs,createDotDivide:Qs,createDotMultiply:Hs,createDotPow:Ws,createE:Gs,createEfimovFactor:Vs,createEigs:Ys,createElectricConstant:Zs,createElectronMass:Xs,createElementaryCharge:Js,createEqual:Ks,createEqualScalar:$s,createEqualText:er,createErf:ar,createEvaluate:sr,createExp:rr,createExpm:nr,createExpm1:tr,createFactorial:ir,createFalse:cr,createFaraday:or,createFermiCoupling:dr,createFft:pr,createFibonacciHeapClass:lr,createFilter:vr,createFilterTransform:ur,createFineStructure:mr,createFirstRadiation:fr,createFix:Dr,createFlatten:hr,createFloor:gr,createForEach:br,createForEachTransform:xr,createFormat:yr,createFraction:_r,createFractionClass:Cr,createFreqz:Sr,createFunctionAssignmentNode:Nr,createFunctionNode:kr,createGamma:Tr,createGasConstant:Fr,createGcd:Mr,createGetMatrixDataType:wr,createGravitationConstant:Rr,createGravity:Er,createHartreeEnergy:jr,createHasNumericValue:Ar,createHelp:Pr,createHelpClass:Ir,createHex:Or,createHypot:qr,createI:Lr,createIdentity:zr,createIfft:Ur,createIm:Br,createImmutableDenseMatrixClass:Qr,createIndex:Hr,createIndexClass:Wr,createIndexNode:Gr,createIndexTransform:Vr,createInfinity:Yr,createIntersect:Zr,createInv:Xr,createInverseConductanceQuantum:Jr,createInvmod:Kr,createIsInteger:$r,createIsNaN:en,createIsNegative:an,createIsNumeric:sn,createIsPositive:rn,createIsPrime:nn,createIsZero:tn,createKldivergence:cn,createKlitzing:on,createKron:dn,createLN10:pn,createLN2:ln,createLOG10E:vn,createLOG2E:un,createLarger:mn,createLargerEq:fn,createLcm:Dn,createLeafCount:hn,createLeftShift:gn,createLgamma:bn,createLog:xn,createLog10:yn,createLog1p:_n,createLog2:Cn,createLoschmidt:Sn,createLsolve:Nn,createLsolveAll:kn,createLup:Tn,createLusolve:Fn,createLyap:Mn,createMad:wn,createMagneticConstant:Rn,createMagneticFluxQuantum:En,createMap:jn,createMapTransform:An,createMatrix:Pn,createMatrixClass:In,createMatrixFromColumns:On,createMatrixFromFunction:qn,createMatrixFromRows:Ln,createMax:zn,createMaxTransform:Un,createMean:Bn,createMeanTransform:Qn,createMedian:Hn,createMin:Wn,createMinTransform:Gn,createMod:Vn,createMode:Yn,createMolarMass:Zn,createMolarMassC12:Xn,createMolarPlanckConstant:Jn,createMolarVolume:Kn,createMultinomial:$n,createMultiply:et,createMultiplyScalar:at,createNaN:st,createNeutronMass:rt,createNode:nt,createNorm:tt,createNot:it,createNthRoot:ct,createNthRoots:ot,createNuclearMagneton:dt,createNull:pt,createNumber:lt,createNumeric:vt,createObjectNode:ut,createOct:mt,createOnes:ft,createOperatorNode:Dt,createOr:ht,createOrTransform:gt,createParenthesisNode:bt,createParse:xt,createParser:yt,createParserClass:_t,createPartitionSelect:Ct,createPermutations:St,createPhi:Nt,createPi:kt,createPickRandom:Tt,createPinv:Ft,createPlanckCharge:Mt,createPlanckConstant:wt,createPlanckLength:Rt,createPlanckMass:Et,createPlanckTemperature:jt,createPlanckTime:At,createPolynomialRoot:Pt,createPow:It,createPrint:Ot,createPrintTransform:qt,createProd:Lt,createProtonMass:zt,createQr:Ut,createQuantileSeq:Bt,createQuantileSeqTransform:Qt,createQuantumOfCirculation:Ht,createRandom:Wt,createRandomInt:Gt,createRange:Vt,createRangeClass:Yt,createRangeNode:Zt,createRangeTransform:Xt,createRationalize:Jt,createRe:Kt,createReducedPlanckConstant:$t,createRelationalNode:ei,createReplacer:ai,createReshape:si,createResize:ri,createResolve:ni,createResultSet:ti,createReviver:ii,createRightArithShift:ci,createRightLogShift:oi,createRotate:di,createRotationMatrix:pi,createRound:li,createRow:vi,createRowTransform:ui,createRydberg:mi,createSQRT1_2:fi,createSQRT2:Di,createSackurTetrode:hi,createSchur:gi,createSec:bi,createSech:xi,createSecondRadiation:yi,createSetCartesian:_i,createSetDifference:Ci,createSetDistinct:Si,createSetIntersect:Ni,createSetIsSubset:ki,createSetMultiplicity:Ti,createSetPowerset:Fi,createSetSize:Mi,createSetSymDifference:wi,createSetUnion:Ri,createSign:Ei,createSimplify:ji,createSimplifyConstant:Ai,createSimplifyCore:Pi,createSin:Ii,createSinh:Oi,createSize:qi,createSlu:Li,createSmaller:zi,createSmallerEq:Ui,createSolveODE:Bi,createSort:Qi,createSpaClass:Hi,createSparse:Wi,createSparseMatrixClass:Gi,createSpeedOfLight:Vi,createSplitUnit:Yi,createSqrt:Zi,createSqrtm:Xi,createSquare:Ji,createSqueeze:Ki,createStd:$i,createStdTransform:ec,createStefanBoltzmann:ac,createStirlingS2:sc,createString:rc,createSubset:nc,createSubsetTransform:tc,createSubtract:ic,createSubtractScalar:cc,createSum:oc,createSumTransform:dc,createSylvester:pc,createSymbolNode:lc,createSymbolicEqual:vc,createTan:uc,createTanh:mc,createTau:fc,createThomsonCrossSection:Dc,createTo:hc,createTrace:gc,createTranspose:bc,createTrue:xc,createTypeOf:yc,createTyped:_c,createUnaryMinus:Cc,createUnaryPlus:Sc,createUnequal:Nc,createUnit:nv,createUnitClass:kc,createUnitDependencies:Th,createUnitFunction:Tc,createUppercaseE:Fc,createUppercasePi:Mc,createUsolve:wc,createUsolveAll:Rc,createVacuumImpedance:Ec,createVariance:jc,createVarianceTransform:Ac,createVersion:Pc,createWeakMixingAngle:Ic,createWienDisplacement:Oc,createXgcd:qc,createXor:Lc,createZeros:zc,createZeta:Uc,createZpk2tf:Bc,cross:tv,crossDependencies:Fh,csc:iv,cscDependencies:Mh,csch:cv,cschDependencies:wh,ctranspose:ov,ctransposeDependencies:ao,cube:dv,cubeDependencies:Rh,cumsum:pv,cumsumDependencies:Eh,cumsumTransformDependencies:jh,deepEqual:lv,deepEqualDependencies:ro,derivative:vv,derivativeDependencies:Ah,det:uv,detDependencies:ld,deuteronMass:mv,deuteronMassDependencies:Ph,diag:fv,diagDependencies:Td,diff:Dv,diffDependencies:Ih,diffTransformDependencies:Oh,distance:hv,distanceDependencies:qh,divide:gv,divideDependencies:F,divideScalar:bv,divideScalarDependencies:y,docs:xv,dot:yv,dotDependencies:Ve,dotDivide:_v,dotDivideDependencies:Ie,dotMultiply:Cv,dotMultiplyDependencies:Lh,dotPow:Sv,dotPowDependencies:zh,e:Nv,eDependencies:Fd,efimovFactor:kv,efimovFactorDependencies:Uh,eigs:Tv,eigsDependencies:Ed,electricConstant:Fv,electricConstantDependencies:Bh,electronMass:Mv,electronMassDependencies:Qh,elementaryCharge:wv,elementaryChargeDependencies:Hh,equal:Rv,equalDependencies:B,equalScalar:Ev,equalScalarDependencies:v,equalText:jv,equalTextDependencies:Wh,erf:Av,erfDependencies:Gh,evaluate:Pv,evaluateDependencies:vo,exp:Iv,expDependencies:jd,expm:Ov,expm1:qv,expm1Dependencies:Yh,expmDependencies:Vh,factorial:Lv,factorialDependencies:Ae,factory:So,falseDependencies:Zh,faraday:zv,faradayDependencies:Xh,fermiCoupling:Uv,fermiCouplingDependencies:Jh,fft:Bv,fftDependencies:Od,filter:Qv,filterDependencies:Kh,filterTransformDependencies:$h,fineStructure:Hv,fineStructureDependencies:eg,firstRadiation:Wv,firstRadiationDependencies:ag,fix:Gv,fixDependencies:pd,flatten:Vv,flattenDependencies:Oe,floor:Yv,floorDependencies:dd,forEach:Zv,forEachDependencies:sg,forEachTransformDependencies:rg,format:Xv,formatDependencies:je,fraction:Jv,fractionDependencies:Ne,freqz:Kv,freqzDependencies:ng,gamma:$v,gammaDependencies:Jc,gasConstant:eu,gasConstantDependencies:tg,gcd:au,gcdDependencies:ig,getMatrixDataType:su,getMatrixDataTypeDependencies:Kc,gravitationConstant:ru,gravitationConstantDependencies:cg,gravity:nu,gravityDependencies:og,hartreeEnergy:tu,hartreeEnergyDependencies:dg,hasNumericValue:iu,hasNumericValueDependencies:pg,help:cu,helpDependencies:lg,hex:ou,hexDependencies:vg,hypot:du,hypotDependencies:ug,i:pu,iDependencies:Ad,identity:lu,identityDependencies:ie,ifft:vu,ifftDependencies:mg,im:uu,imDependencies:io,index:mu,indexDependencies:zd,indexTransformDependencies:fg,intersect:fu,intersectDependencies:hg,inv:Du,invDependencies:De,inverseConductanceQuantum:hu,inverseConductanceQuantumDependencies:gg,invmod:gu,invmodDependencies:bg,isAccessorNode:Ho,isArray:Mo,isArrayNode:Wo,isAssignmentNode:Go,isBigNumber:Gc,isBlockNode:Vo,isBoolean:Po,isChain:id,isCollection:wo,isComplex:Wc,isConditionalNode:Yo,isConstantNode:Zo,isDate:Lo,isDenseMatrix:Ro,isFraction:Vc,isFunction:qo,isFunctionAssignmentNode:Xo,isFunctionNode:Jo,isHelp:Oo,isIndex:Ao,isIndexNode:Ko,isInteger:bu,isIntegerDependencies:O,isMatrix:Yc,isNaN:xu,isNaNDependencies:qe,isNegative:yu,isNegativeDependencies:ce,isNode:$o,isNull:Bo,isNumber:To,isNumeric:_u,isNumericDependencies:me,isObject:Uo,isObjectNode:ed,isOperatorNode:ad,isParenthesisNode:sd,isPositive:Cu,isPositiveDependencies:he,isPrime:Su,isPrimeDependencies:xg,isRange:jo,isRangeNode:rd,isRegExp:zo,isRelationalNode:nd,isResultSet:Io,isSparseMatrix:Eo,isString:Fo,isSymbolNode:td,isUndefined:Qo,isUnit:Hc,isZero:Nu,isZeroDependencies:X,kldivergence:ku,kldivergenceDependencies:yg,klitzing:Tu,klitzingDependencies:_g,kron:Fu,kronDependencies:Cg,larger:Mu,largerDependencies:P,largerEq:wu,largerEqDependencies:Ze,lcm:Ru,lcmDependencies:Fg,leafCount:Eu,leafCountDependencies:Mg,leftShift:ju,leftShiftDependencies:wg,lgamma:Au,lgammaDependencies:Rg,log:Pu,log10:Iu,log10Dependencies:Eg,log1p:Ou,log1pDependencies:jg,log2:qu,log2Dependencies:Pd,logDependencies:uo,loschmidt:Lu,loschmidtDependencies:Ag,lsolve:zu,lsolveAll:Uu,lsolveAllDependencies:Pg,lsolveDependencies:Qd,lup:Bu,lupDependencies:Wd,lusolve:Qu,lusolveDependencies:Vd,lyap:Hu,lyapDependencies:Ig,mad:Wu,madDependencies:Og,magneticConstant:Gu,magneticConstantDependencies:qg,magneticFluxQuantum:Vu,magneticFluxQuantumDependencies:Lg,map:Yu,mapDependencies:xe,mapTransformDependencies:zg,matrix:Zu,matrixDependencies:a,matrixFromColumns:Xu,matrixFromColumnsDependencies:co,matrixFromFunction:Ju,matrixFromFunctionDependencies:Ug,matrixFromRows:Ku,matrixFromRowsDependencies:Bg,max:$u,maxDependencies:fo,maxTransformDependencies:Qg,mean:em,meanDependencies:Sd,meanTransformDependencies:Hg,median:am,medianDependencies:Xd,min:sm,minDependencies:Wg,minTransformDependencies:Gg,mod:rm,modDependencies:Ud,mode:nm,modeDependencies:Vg,molarMass:tm,molarMassC12:im,molarMassC12Dependencies:Zg,molarMassDependencies:Yg,molarPlanckConstant:cm,molarPlanckConstantDependencies:Xg,molarVolume:om,molarVolumeDependencies:Jg,multinomial:dm,multinomialDependencies:Kg,multiply:pm,multiplyDependencies:D,multiplyScalar:lm,multiplyScalarDependencies:C,neutronMass:vm,neutronMassDependencies:eb,norm:um,normDependencies:mo,not:mm,notDependencies:Ge,nthRoot:fm,nthRootDependencies:ab,nthRoots:Dm,nthRootsDependencies:sb,nuclearMagneton:hm,nuclearMagnetonDependencies:rb,nullDependencies:nb,number:gm,numberDependencies:se,numeric:bm,numericDependencies:Z,oct:xm,octDependencies:tb,ones:ym,onesDependencies:ib,or:_m,orDependencies:cb,orTransformDependencies:ob,parse:Cm,parseDependencies:ee,parser:Sm,parserDependencies:db,partitionSelect:Nm,partitionSelectDependencies:$e,permutations:km,permutationsDependencies:pb,phi:Tm,phiDependencies:lb,pi:Fm,piDependencies:Do,pickRandom:Mm,pickRandomDependencies:vb,pinv:wm,pinvDependencies:ub,planckCharge:Rm,planckChargeDependencies:mb,planckConstant:Em,planckConstantDependencies:fb,planckLength:jm,planckLengthDependencies:Db,planckMass:Am,planckMassDependencies:hb,planckTemperature:Pm,planckTemperatureDependencies:gb,planckTime:Im,planckTimeDependencies:bb,polynomialRoot:Om,polynomialRootDependencies:xb,pow:qm,powDependencies:H,print:Lm,printDependencies:yb,printTransformDependencies:_b,prod:zm,prodDependencies:Nd,protonMass:Um,protonMassDependencies:Cb,qr:Bm,qrDependencies:oo,quantileSeq:Qm,quantileSeqDependencies:Sb,quantileSeqTransformDependencies:Nb,quantumOfCirculation:Hm,quantumOfCirculationDependencies:kb,random:Wm,randomDependencies:Tb,randomInt:Gm,randomIntDependencies:Fb,range:Vm,rangeDependencies:Fe,rangeTransformDependencies:wb,rationalize:Ym,rationalizeDependencies:Rb,re:Zm,reDependencies:po,reducedPlanckConstant:Xm,reducedPlanckConstantDependencies:Eb,replacer:Jm,replacerDependencies:jb,reshape:Km,reshapeDependencies:wd,resize:$m,resizeDependencies:Ab,resolve:ef,resolveDependencies:kd,reviver:af,reviverDependencies:Pb,rightArithShift:sf,rightArithShiftDependencies:Ib,rightLogShift:rf,rightLogShiftDependencies:Ob,rotate:nf,rotateDependencies:qb,rotationMatrix:tf,rotationMatrixDependencies:$d,round:cf,roundDependencies:ke,row:of,rowDependencies:Lb,rowTransformDependencies:zb,rydberg:df,rydbergDependencies:Ub,sackurTetrode:pf,sackurTetrodeDependencies:Hb,schur:lf,schurDependencies:Yd,sec:vf,secDependencies:Wb,sech:uf,sechDependencies:Gb,secondRadiation:mf,secondRadiationDependencies:Vb,setCartesian:ff,setCartesianDependencies:Yb,setDifference:Df,setDifferenceDependencies:ep,setDistinct:hf,setDistinctDependencies:Zb,setIntersect:gf,setIntersectDependencies:ap,setIsSubset:bf,setIsSubsetDependencies:Xb,setMultiplicity:xf,setMultiplicityDependencies:Jb,setPowerset:yf,setPowersetDependencies:Kb,setSize:_f,setSizeDependencies:$b,setSymDifference:Cf,setSymDifferenceDependencies:sp,setUnion:Sf,setUnionDependencies:ex,sign:Nf,signDependencies:Md,simplify:kf,simplifyConstant:Tf,simplifyConstantDependencies:no,simplifyCore:Ff,simplifyCoreDependencies:to,simplifyDependencies:Je,sin:Mf,sinDependencies:Ke,sinh:wf,sinhDependencies:ax,size:Rf,sizeDependencies:w,slu:Ef,sluDependencies:Gd,smaller:jf,smallerDependencies:I,smallerEq:Af,smallerEqDependencies:Te,solveODE:Pf,solveODEDependencies:sx,sort:If,sortDependencies:rx,sparse:Of,sparseDependencies:nx,speedOfLight:qf,speedOfLightDependencies:tx,splitUnit:Lf,splitUnitDependencies:ix,sqrt:zf,sqrtDependencies:J,sqrtm:Uf,sqrtmDependencies:cx,square:Bf,squareDependencies:ox,squeeze:Qf,squeezeDependencies:dx,std:Hf,stdDependencies:px,stdTransformDependencies:lx,stefanBoltzmann:Wf,stefanBoltzmannDependencies:vx,stirlingS2:Gf,stirlingS2Dependencies:vd,string:Vf,stringDependencies:ux,subset:Yf,subsetDependencies:q,subsetTransformDependencies:mx,subtract:Zf,subtractDependencies:S,subtractScalar:Xf,subtractScalarDependencies:Q,sum:Jf,sumDependencies:$c,sumTransformDependencies:fx,sylvester:Kf,sylvesterDependencies:Zd,symbolicEqual:$f,symbolicEqualDependencies:Dx,tan:eD,tanDependencies:hx,tanh:aD,tanhDependencies:gx,tau:sD,tauDependencies:Id,thomsonCrossSection:rD,thomsonCrossSectionDependencies:bx,to:nD,toDependencies:xx,trace:tD,traceDependencies:yx,transpose:iD,transposeDependencies:Pe,trueDependencies:_x,typeOf:cD,typeOfDependencies:Kd,typed:oD,typedDependencies:e,unaryMinus:dD,unaryMinusDependencies:K,unaryPlus:pD,unaryPlusDependencies:so,unequal:lD,unequalDependencies:Cx,unit:vD,unitDependencies:Sx,usolve:uD,usolveAll:mD,usolveAllDependencies:Rd,usolveDependencies:lo,vacuumImpedance:fD,vacuumImpedanceDependencies:Tx,variance:DD,varianceDependencies:ho,varianceTransformDependencies:Fx,version:hD,versionDependencies:Mx,weakMixingAngle:gD,weakMixingAngleDependencies:wx,wienDisplacement:bD,wienDisplacementDependencies:Rx,xgcd:xD,xgcdDependencies:Bd,xor:yD,xorDependencies:Ex,zeros:_D,zerosDependencies:M,zeta:CD,zetaDependencies:jx,zpk2tf:SD,zpk2tfDependencies:Ax},Symbol.toStringTag,{value:"Module"})),zx={name:"ns-profit-report",props:["storeLogo","storeName"],data(){return{categoryNames:"",unitNames:"",startDateField:{type:"datetimepicker",value:Qe(ns.date.current).startOf("month").format("YYYY-MM-DD HH:mm:ss")},endDateField:{type:"datetimepicker",value:Qe(ns.date.current).endOf("month").format("YYYY-MM-DD HH:mm:ss")},categoryField:{value:[],label:ve("Filter by Category")},unitField:{value:[],label:ve("Filter by Units")},products:[],ns:window.ns,math:Lx}},components:{nsDatepicker:kD,nsDateTimePicker:TD},computed:{totalQuantities(){return this.products.length>0?this.products.map(n=>n.quantity).reduce((n,l)=>n+l):0},totalPurchasePrice(){return this.products.length>0?this.products.map(n=>n.total_purchase_price).reduce((n,l)=>n+l):0},totalSalePrice(){return this.products.length>0?this.products.map(n=>n.total_price).reduce((n,l)=>n+l):0},totalProfit(){return this.products.length>0?this.products.map(n=>ra(n.total_price).subtract(ra(n.total_purchase_price).add(n.tax_value).done())).reduce((n,l)=>n+l):0},totalTax(){return this.products.length>0?this.products.map(n=>n.tax_value).reduce((n,l)=>n+l):0}},methods:{__:ve,nsCurrency:FD,printSaleReport(){this.$htmlToPaper("profit-report")},setStartDate(n){this.startDate=n.format()},async selectCategories(){try{const n=await _o("/api/categories",this.categoryField.label,this.categoryField.value);this.categoryField.value=n.values,this.categoryNames=n.labels,this.loadReport()}catch(n){if(n!==!1)return Re.error(ve("An error has occured while loading the categories")).subscribe()}},async selectUnit(){try{const n=await _o("/api/units",this.unitField.label,this.unitField.value);this.unitField.value=n.values,this.unitNames=n.labels,this.loadReport()}catch(n){if(n!==!1)return Re.error(ve("An error has occured while loading the units")).subscribe()}},loadReport(){if(this.startDateField.value===null||this.endDateField.value===null)return Re.error(ve("Unable to proceed. Select a correct time range.")).subscribe();const n=Qe(this.startDateField.value);if(Qe(this.endDateField.value).isBefore(n))return Re.error(ve("Unable to proceed. The current time range is not valid.")).subscribe();ND.post("/api/reports/profit-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,categories:this.categoryField.value,units:this.unitField.value}).subscribe({next:i=>{this.products=i},error:i=>{Re.error(i.message).subscribe()}})},setEndDate(n){this.endDate=n.format()}}},Ux={id:"report-section",class:"px-4"},Bx={class:"flex -mx-2"},Qx={class:"px-2"},Hx={class:"px-2"},Wx={class:"px-2"},Gx=t("i",{class:"las la-sync-alt text-xl"},null,-1),Vx={class:"pl-2"},Yx={class:"px-2"},Zx=t("i",{class:"las la-print text-xl"},null,-1),Xx={class:"pl-2"},Jx={class:"px-2"},Kx=t("i",{class:"las la-filter text-xl"},null,-1),$x={class:"pl-2"},ey={class:"px-2"},ay=t("i",{class:"las la-filter text-xl"},null,-1),sy={class:"pl-2"},ry={id:"profit-report",class:"anim-duration-500 fade-in-entrance"},ny={class:"flex w-full"},ty={class:"my-4 flex justify-between w-full"},iy={class:"text-secondary"},cy={class:"pb-1 border-b border-dashed"},oy={class:"pb-1 border-b border-dashed"},dy={class:"pb-1 border-b border-dashed"},py=["src","alt"],ly={class:"shadow rounded my-4"},vy={class:"ns-box"},uy={class:"border-b ns-box-body"},my={class:"table ns-table w-full"},fy={class:"border p-2 text-left"},Dy={width:"110",class:"text-right border p-2"},hy={width:"110",class:"text-right border p-2"},gy={width:"110",class:"text-right border p-2"},by={width:"110",class:"text-right border p-2"},xy={width:"110",class:"text-right border p-2"},yy={width:"110",class:"text-right border p-2"},_y={class:"p-2 border border-box-edge"},Cy={class:"p-2 border text-right border-box-edge"},Sy={class:"p-2 border text-right border-box-edge"},Ny={class:"p-2 border text-right border-box-edge"},ky={class:"p-2 border text-right border-box-edge"},Ty={class:"p-2 border text-right border-box-edge"},Fy={class:"p-2 border text-right border-box-edge"},My={class:"font-semibold"},wy=t("td",{colspan:"2",class:"p-2 border"},null,-1),Ry={class:"p-2 border text-right"},Ey={class:"p-2 border text-right"},jy={class:"p-2 border text-right"},Ay={class:"p-2 border text-right"},Py={class:"p-2 border text-right"};function Iy(n,l,i,o,x,d){const W=wD("ns-field");return aa(),sa("div",Ux,[t("div",Bx,[t("div",Qx,[Co(W,{field:x.startDateField},null,8,["field"])]),t("div",Hx,[Co(W,{field:x.endDateField},null,8,["field"])]),t("div",Wx,[t("button",{onClick:l[0]||(l[0]=_=>d.loadReport()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[Gx,t("span",Vx,g(d.__("Load")),1)])]),t("div",Yx,[t("button",{onClick:l[1]||(l[1]=_=>d.printSaleReport()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[Zx,t("span",Xx,g(d.__("Print")),1)])]),t("div",Jx,[t("button",{onClick:l[2]||(l[2]=_=>d.selectCategories()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[Kx,t("span",$x,g(d.__("Category"))+": "+g(x.categoryNames||d.__("All Categories")),1)])]),t("div",ey,[t("button",{onClick:l[3]||(l[3]=_=>d.selectUnit()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[ay,t("span",sy,g(d.__("Unit"))+": "+g(x.unitNames||d.__("All Units")),1)])])]),t("div",ry,[t("div",ny,[t("div",ty,[t("div",iy,[t("ul",null,[t("li",cy,g(d.__("Range : {date1} — {date2}").replace("{date1}",x.startDateField.value).replace("{date2}",x.endDateField.value)),1),t("li",oy,g(d.__("Document : Profit Report")),1),t("li",dy,g(d.__("By : {user}").replace("{user}",x.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:i.storeLogo,alt:i.storeName},null,8,py)])])]),t("div",ly,[t("div",vy,[t("div",uy,[t("table",my,[t("thead",null,[t("tr",null,[t("th",fy,g(d.__("Product")),1),t("th",Dy,g(d.__("Unit")),1),t("th",hy,g(d.__("Quantity")),1),t("th",gy,g(d.__("COGS")),1),t("th",by,g(d.__("Sale Price")),1),t("th",xy,g(d.__("Taxes")),1),t("th",yy,g(d.__("Profit")),1)])]),t("tbody",null,[(aa(!0),sa(RD,null,ED(x.products,_=>(aa(),sa("tr",{key:_.id,class:jD(_.total_price-_.total_purchase_price<0?"bg-error-primary":"bg-box-background")},[t("td",_y,g(_.name),1),t("td",Cy,g(_.unit_name),1),t("td",Sy,g(_.quantity),1),t("td",Ny,g(d.nsCurrency(_.total_purchase_price)),1),t("td",ky,g(d.nsCurrency(_.total_price)),1),t("td",Ty,g(d.nsCurrency(_.tax_value)),1),t("td",Fy,g(d.nsCurrency(x.math.chain(_.total_price).subtract(x.math.chain(_.total_purchase_price).add(_.tax_value).done()).done())),1)],2))),128))]),t("tfoot",My,[t("tr",null,[wy,t("td",Ry,g(d.totalQuantities),1),t("td",Ey,g(d.nsCurrency(d.totalPurchasePrice)),1),t("td",jy,g(d.nsCurrency(d.totalSalePrice)),1),t("td",Ay,g(d.nsCurrency(d.totalTax)),1),t("td",Py,g(d.nsCurrency(d.totalProfit)),1)])])])])])])])])}const Yy=MD(zx,[["render",Iy]]);export{Yy as default}; diff --git a/public/build/assets/ns-sale-report-41e30de6.js b/public/build/assets/ns-sale-report-5b586d47.js similarity index 99% rename from public/build/assets/ns-sale-report-41e30de6.js rename to public/build/assets/ns-sale-report-5b586d47.js index a9db68d16..d54fceb9a 100644 --- a/public/build/assets/ns-sale-report-41e30de6.js +++ b/public/build/assets/ns-sale-report-5b586d47.js @@ -1 +1 @@ -import{a as x,b as h,h as w}from"./bootstrap-8be442b1.js";import{c as C,e as T}from"./components-ef1ba55f.js";import{_ as d,n as k}from"./currency-f8bd78d1.js";import{b as f}from"./ns-prompt-popup-100414c5.js";import{j as D}from"./join-array-4b30b096.js";import{_ as P}from"./_plugin-vue_export-helper-c27b6911.js";import{r as U,o as i,c as n,a as t,f as v,n as F,t as s,e as p,F as b,b as m}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";const L={name:"ns-sale-report",data(){return{saleReport:"",startDateField:{name:"start_date",type:"datetime",value:ns.date.moment.startOf("day").format()},endDateField:{name:"end_date",type:"datetime",value:ns.date.moment.endOf("day").format()},result:[],isLoading:!1,users:[],ns:window.ns,summary:{},selectedUser:"",selectedCategory:"",reportType:{label:d("Report Type"),name:"reportType",type:"select",value:"categories_report",options:[{label:d("Categories Detailed"),value:"categories_report"},{label:d("Categories Summary"),value:"categories_summary"},{label:d("Products"),value:"products_report"}],description:d("Allow you to choose the report type.")},filterUser:{label:d("Filter User"),name:"filterUser",type:"select",value:"",options:[],description:d("Allow you to choose the report type.")},filterCategory:{label:d("Filter By Category"),name:"filterCategory",type:"multiselect",value:"",options:[],description:d("Allow you to choose the category.")},field:{type:"datetimepicker",value:"2021-02-07",name:"date"}}},components:{nsDatepicker:C,nsDateTimePicker:T},computed:{},methods:{__:d,nsCurrency:k,joinArray:D,printSaleReport(){this.$htmlToPaper("sale-report")},async openSettings(){try{const c=await new Promise((a,l)=>{Popup.show(f,{...this.reportType,resolve:a,reject:l})});this.reportType.value=c,this.result=[],this.loadReport()}catch(c){console.log({exception:c})}},async openUserFiltering(){try{this.isLoading=!0;const c=await new Promise((l,_)=>{x.get("/api/users").subscribe({next:r=>{this.users=r,this.isLoading=!1,this.filterUser.options=[{label:d("All Users"),value:""},...this.users.map(e=>({label:e.username,value:e.id}))],Popup.show(f,{...this.filterUser,resolve:l,reject:_})},error:r=>{this.isLoading=!1,h.error(d("No user was found for proceeding the filtering.")),_(r)}})}),a=this.users.filter(l=>l.id===c);if(a.length>0){let l=a[0];this.selectedUser=`${l.username} ${l.first_name||l.last_name?l.first_name+" "+l.last_name:""}`,this.filterUser.value=c,this.result=[],this.loadReport()}}catch(c){console.log({exception:c})}},async openCategoryFiltering(){try{let c=[];this.isLoading=!0;const a=await new Promise((l,_)=>{x.get("/api/categories").subscribe({next:r=>{this.isLoading=!1,c=r,this.filterCategory.options=[...r.map(e=>({label:e.name,value:e.id}))],Popup.show(f,{...this.filterCategory,resolve:l,reject:_})},error:r=>{this.isLoading=!1,h.error(d("No category was found for proceeding the filtering.")),_(r)}})});if(a.length>0){let l=c.filter(_=>a.includes(_.id)).map(_=>_.name);this.selectedCategory=this.joinArray(l),this.filterCategory.value=a}else this.selectedCategory="",this.filterCategory.value=[];this.result=[],this.loadReport()}catch(c){console.log(c)}},getType(c){const a=this.reportType.options.filter(l=>l.value===c);return a.length>0?a[0].label:d("Unknown")},loadReport(){if(this.startDate===null||this.endDate===null)return h.error(d("Unable to proceed. Select a correct time range.")).subscribe();const c=w(this.startDate);if(w(this.endDate).isBefore(c))return h.error(d("Unable to proceed. The current time range is not valid.")).subscribe();this.isLoading=!0,x.post("/api/reports/sale-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,type:this.reportType.value,user_id:this.filterUser.value,categories_id:this.filterCategory.value}).subscribe({next:l=>{this.isLoading=!1,this.result=l.result,this.summary=l.summary},error:l=>{this.isLoading=!1,h.error(l.message).subscribe()}})},computeTotal(c,a){return c.length>0?c.map(l=>parseFloat(l[a])).reduce((l,_)=>l+_):0}},props:["storeLogo","storeName"],mounted(){}},S={id:"report-section",class:"px-4"},R={class:"flex -mx-2"},B={class:"px-2"},A={class:"px-2"},N={class:"px-2"},j={class:"pl-2"},M={class:"flex -mx-2"},q={class:"px-2"},V=t("i",{class:"las la-print text-xl"},null,-1),H={class:"pl-2"},O={class:"px-2"},Q=t("i",{class:"las la-filter text-xl"},null,-1),z={class:"pl-2"},E={class:"px-2"},G=t("i",{class:"las la-filter text-xl"},null,-1),I={class:"pl-2"},J={class:"px-2"},K=t("i",{class:"las la-filter text-xl"},null,-1),W={class:"pl-2"},X={id:"sale-report",class:"anim-duration-500 fade-in-entrance"},Y={class:"flex w-full"},Z={class:"my-4 flex justify-between w-full"},$={class:"text-secondary"},tt=["innerHTML"],et={class:"pb-1 border-b border-dashed"},st={class:"pb-1 border-b border-dashed"},rt=["src","alt"],ot={class:"-mx-4 flex md:flex-row flex-col"},lt={class:"w-full md:w-1/2 px-4"},at={class:"shadow rounded my-4 ns-box"},ct={class:"border-b ns-box-body"},dt={class:"table ns-table w-full"},it={class:"text-primary"},nt={class:""},_t={width:"200",class:"font-semibold p-2 border text-left bg-info-secondary border-info-primary text-white"},ut={class:"p-2 border text-right border-info-primary"},ht={class:""},pt={width:"200",class:"font-semibold p-2 border text-left bg-error-secondary border-error-primary text-white"},bt={class:"p-2 border text-right border-error-primary"},mt={class:""},yt={width:"200",class:"font-semibold p-2 border text-left bg-error-secondary border-error-primary text-white"},xt={class:"p-2 border text-right border-error-primary"},ft={key:0,class:""},gt={width:"200",class:"font-semibold p-2 border text-left bg-error-secondary border-error-primary text-white"},wt={class:"p-2 border text-right border-error-primary"},vt={class:""},Ct={width:"200",class:"font-semibold p-2 border text-left bg-info-secondary border-info-primary text-white"},Tt={class:"p-2 border text-right border-success-primary"},kt={class:""},Dt={width:"200",class:"font-semibold p-2 border text-left bg-success-secondary border-success-secondary text-white"},Pt={class:"p-2 border text-right border-success-primary"},Ut={class:""},Ft={width:"200",class:"font-semibold p-2 border text-left bg-info-secondary border-success-secondary text-white"},Lt={class:"p-2 border text-right border-success-primary"},St={class:""},Rt={width:"200",class:"font-semibold p-2 border text-left bg-success-secondary border-success-secondary text-white"},Bt={class:"p-2 border text-right border-success-primary"},At=t("div",{class:"w-full md:w-1/2 px-4"},null,-1),Nt={key:0,class:"bg-box-background shadow rounded my-4"},jt={class:"border-b border-box-edge"},Mt={class:"table ns-table w-full"},qt={class:"text-primary"},Vt={class:"border p-2 text-left"},Ht={width:"150",class:"border p-2"},Ot={width:"150",class:"border p-2"},Qt={width:"150",class:"border p-2"},zt={width:"150",class:"border p-2"},Et={width:"150",class:"border p-2"},Gt={width:"150",class:"border p-2"},It={class:"text-primary"},Jt={class:"p-2 border"},Kt={class:"p-2 border text-right"},Wt={class:"p-2 border text-right"},Xt={class:"p-2 border text-right"},Yt={class:"p-2 border text-right"},Zt={class:"p-2 border text-right"},$t={class:"p-2 border text-right"},te={class:"text-primary font-semibold"},ee=t("td",{class:"p-2 border text-primary"},null,-1),se={class:"p-2 border text-right text-primary"},re={class:"p-2 border text-right text-primary"},oe={class:"p-2 border text-right text-primary"},le={class:"p-2 border text-right text-primary"},ae={class:"p-2 border text-right text-primary"},ce={class:"p-2 border text-right text-primary"},de={key:1,class:"bg-box-background shadow rounded my-4"},ie={class:"border-b border-box-edge"},ne={class:"table ns-table w-full"},_e={class:"text-primary"},ue={class:"border p-2 text-left"},he={class:"border p-2 text-left"},pe={width:"100",class:"border p-2"},be={width:"150",class:"border p-2"},me={width:"150",class:"border p-2"},ye={width:"150",class:"border p-2"},xe={width:"150",class:"border p-2"},fe={width:"150",class:"border p-2"},ge={class:"text-primary"},we={class:"p-2 border"},ve={class:"p-2 border"},Ce={class:"p-2 border text-right"},Te={class:"p-2 border text-right"},ke={class:"p-2 border text-right"},De={class:"p-2 border text-right"},Pe={class:"p-2 border text-right"},Ue={class:"p-2 border text-right"},Fe={class:"bg-info-primary"},Le={colspan:"2",class:"p-2 border border-info-secondary"},Se={class:"p-2 border text-right border-info-secondary"},Re={class:"p-2 border text-right border-info-secondary"},Be={class:"p-2 border text-right border-info-secondary"},Ae={class:"p-2 border text-right border-info-secondary"},Ne={class:"p-2 border text-right border-info-secondary"},je={class:"p-2 border text-right border-info-secondary"},Me={class:"text-primary font-semibold"},qe=t("td",{colspan:"2",class:"p-2 border text-primary"},null,-1),Ve={class:"p-2 border text-right text-primary"},He={class:"p-2 border text-right text-primary"},Oe={class:"p-2 border text-right text-primary"},Qe={class:"p-2 border text-right text-primary"},ze={class:"p-2 border text-right text-primary"},Ee={class:"p-2 border text-right text-primary"},Ge={key:2,class:"bg-box-background shadow rounded my-4"},Ie={class:"border-b border-box-edge"},Je={class:"table ns-table w-full"},Ke={class:"text-primary"},We={class:"border p-2 text-left"},Xe={width:"100",class:"border p-2"},Ye={width:"150",class:"border p-2"},Ze={width:"150",class:"border p-2"},$e={width:"150",class:"border p-2"},ts={width:"150",class:"border p-2"},es={class:"text-primary"},ss={class:"p-2 border text-left border-info-primary"},rs={class:"p-2 border text-right border-info-primary"},os={class:"p-2 border text-right border-info-primary"},ls={class:"p-2 border text-right border-info-primary"},as={class:"p-2 border text-right border-info-primary"},cs={class:"p-2 border text-right border-info-primary"},ds={class:"text-primary font-semibold"},is=t("td",{class:"p-2 border text-primary"},null,-1),_s={class:"p-2 border text-right text-primary"},us={class:"p-2 border text-right text-primary"},hs={class:"p-2 border text-right text-primary"},ps={class:"p-2 border text-right text-primary"},bs={class:"p-2 border text-right text-primary"};function ms(c,a,l,_,r,e){const g=U("ns-date-time-picker");return i(),n("div",S,[t("div",R,[t("div",B,[v(g,{field:r.startDateField},null,8,["field"])]),t("div",A,[v(g,{field:r.endDateField},null,8,["field"])]),t("div",N,[t("button",{onClick:a[0]||(a[0]=o=>e.loadReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[t("i",{class:F([r.isLoading?"animate-spin":"","las la-sync-alt text-xl"])},null,2),t("span",j,s(e.__("Load")),1)])])]),t("div",M,[t("div",q,[t("button",{onClick:a[1]||(a[1]=o=>e.printSaleReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[V,t("span",H,s(e.__("Print")),1)])]),t("div",O,[t("button",{onClick:a[2]||(a[2]=o=>e.openSettings()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[Q,t("span",z,s(e.__("By Type"))+" : "+s(e.getType(r.reportType.value)),1)])]),t("div",E,[t("button",{onClick:a[3]||(a[3]=o=>e.openUserFiltering()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[G,t("span",I,s(e.__("By User"))+" : "+s(r.selectedUser||e.__("All Users")),1)])]),t("div",J,[t("button",{onClick:a[4]||(a[4]=o=>e.openCategoryFiltering()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[K,t("span",W,s(e.__("By Category"))+" : "+s(r.selectedCategory||e.__("All Category")),1)])])]),t("div",X,[t("div",Y,[t("div",Z,[t("div",$,[t("ul",null,[t("li",{class:"pb-1 border-b border-dashed",innerHTML:e.__("Range : {date1} — {date2}").replace("{date1}",r.startDateField.value).replace("{date2}",r.endDateField.value)},null,8,tt),t("li",et,s(e.__("Document : Sale Report")),1),t("li",st,s(e.__("By : {user}").replace("{user}",r.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:l.storeLogo,alt:l.storeName},null,8,rt)])])]),t("div",null,[t("div",ot,[t("div",lt,[t("div",at,[t("div",ct,[t("table",dt,[t("tbody",it,[t("tr",nt,[t("td",_t,s(e.__("Sub Total")),1),t("td",ut,s(e.nsCurrency(r.summary.subtotal)),1)]),t("tr",ht,[t("td",pt,s(e.__("Sales Discounts")),1),t("td",bt,s(e.nsCurrency(r.summary.sales_discounts)),1)]),t("tr",mt,[t("td",yt,s(e.__("Sales Taxes")),1),t("td",xt,s(e.nsCurrency(r.summary.sales_taxes)),1)]),r.summary.product_taxes>0?(i(),n("tr",ft,[t("td",gt,s(e.__("Product Taxes")),1),t("td",wt,s(e.nsCurrency(r.summary.product_taxes)),1)])):p("",!0),t("tr",vt,[t("td",Ct,s(e.__("Shipping")),1),t("td",Tt,s(e.nsCurrency(r.summary.shipping)),1)]),t("tr",kt,[t("td",Dt,s(e.__("Total")),1),t("td",Pt,s(e.nsCurrency(r.summary.total)),1)]),t("tr",Ut,[t("td",Ft,s(e.__("Cost Of Goods")),1),t("td",Lt,s(e.nsCurrency(r.summary.total_purchase_price)),1)]),t("tr",St,[t("td",Rt,s(e.__("Profit")),1),t("td",Bt,s(e.nsCurrency(r.summary.profit)),1)])])])])])]),At])]),r.reportType.value==="products_report"?(i(),n("div",Nt,[t("div",jt,[t("table",Mt,[t("thead",qt,[t("tr",null,[t("th",Vt,s(e.__("Products")),1),t("th",Ht,s(e.__("Quantity")),1),t("th",Ot,s(e.__("Discounts")),1),t("th",Qt,s(e.__("Cost")),1),t("th",zt,s(e.__("Taxes")),1),t("th",Et,s(e.__("Total")),1),t("th",Gt,s(e.__("Profit")),1)])]),t("tbody",It,[(i(!0),n(b,null,m(r.result,o=>(i(),n("tr",{key:o.id},[t("td",Jt,s(o.name),1),t("td",Kt,s(o.quantity),1),t("td",Wt,s(e.nsCurrency(o.discount)),1),t("td",Xt,s(e.nsCurrency(o.total_purchase_price)),1),t("td",Yt,s(e.nsCurrency(o.tax_value)),1),t("td",Zt,s(e.nsCurrency(o.total_price)),1),t("td",$t,s(e.nsCurrency(Math.chain(o.total_price).subtract(Math.chain(o.total_purchase_price).add(o.tax_value).done()).done())),1)]))),128))]),t("tfoot",te,[t("tr",null,[ee,t("td",se,s(e.computeTotal(r.result,"quantity")),1),t("td",re,s(e.nsCurrency(e.computeTotal(r.result,"discount"))),1),t("td",oe,s(e.nsCurrency(e.computeTotal(r.result,"total_purchase_price"))),1),t("td",le,s(e.nsCurrency(e.computeTotal(r.result,"tax_value"))),1),t("td",ae,s(e.nsCurrency(e.computeTotal(r.result,"total_price"))),1),t("td",ce,s(e.nsCurrency(e.computeTotal(r.result,"total_price")-e.computeTotal(r.result,"total_purchase_price")-e.computeTotal(r.result,"tax_value"))),1)])])])])])):p("",!0),r.reportType.value==="categories_report"?(i(),n("div",de,[t("div",ie,[t("table",ne,[t("thead",_e,[t("tr",null,[t("th",ue,s(e.__("Category")),1),t("th",he,s(e.__("Product")),1),t("th",pe,s(e.__("Quantity")),1),t("th",be,s(e.__("Discounts")),1),t("th",me,s(e.__("Taxes")),1),t("th",ye,s(e.__("Total")),1),t("th",xe,s(e.__("Purchase Price")),1),t("th",fe,s(e.__("Profit")),1)])]),t("tbody",ge,[(i(!0),n(b,null,m(r.result,(o,y)=>(i(),n(b,{key:y},[o.products.length>0?(i(!0),n(b,{key:0},m(o.products,u=>(i(),n("tr",{key:parseInt(o.id+""+u.id)},[t("td",we,s(o.name),1),t("td",ve,s(u.name),1),t("td",Ce,s(u.quantity),1),t("td",Te,s(e.nsCurrency(u.discount)),1),t("td",ke,s(e.nsCurrency(u.tax_value)),1),t("td",De,s(e.nsCurrency(u.total_price)),1),t("td",Pe,s(e.nsCurrency(u.total_purchase_price)),1),t("td",Ue,s(e.nsCurrency(u.total_price-(u.total_purchase_price+u.tax_value+u.discount))),1)]))),128)):p("",!0),t("tr",Fe,[t("td",Le,s(o.name),1),t("td",Se,s(e.computeTotal(o.products,"quantity")),1),t("td",Re,s(e.nsCurrency(e.computeTotal(o.products,"discount"))),1),t("td",Be,s(e.nsCurrency(e.computeTotal(o.products,"tax_value"))),1),t("td",Ae,s(e.nsCurrency(e.computeTotal(o.products,"total_price"))),1),t("td",Ne,s(e.nsCurrency(e.computeTotal(o.products,"total_purchase_price"))),1),t("td",je,s(e.nsCurrency(e.computeTotal(o.products,"total_price")-(e.computeTotal(o.products,"total_purchase_price")+e.computeTotal(o.products,"tax_value")+e.computeTotal(o.products,"discount")))),1)])],64))),128))]),t("tfoot",Me,[t("tr",null,[qe,t("td",Ve,s(e.computeTotal(r.result,"total_sold_items")),1),t("td",He,s(e.nsCurrency(e.computeTotal(r.result,"total_discount"))),1),t("td",Oe,s(e.nsCurrency(e.computeTotal(r.result,"total_tax_value"))),1),t("td",Qe,s(e.nsCurrency(e.computeTotal(r.result,"total_price"))),1),t("td",ze,s(e.nsCurrency(e.computeTotal(r.result,"total_purchase_price"))),1),t("td",Ee,s(e.nsCurrency(e.computeTotal(r.result,"total_price")-(e.computeTotal(r.result,"total_purchase_price")+e.computeTotal(r.result,"total_discount")+e.computeTotal(r.result,"total_tax_value")))),1)])])])])])):p("",!0),r.reportType.value==="categories_summary"?(i(),n("div",Ge,[t("div",Ie,[t("table",Je,[t("thead",Ke,[t("tr",null,[t("th",We,s(e.__("Category")),1),t("th",Xe,s(e.__("Quantity")),1),t("th",Ye,s(e.__("Discounts")),1),t("th",Ze,s(e.__("Cost")),1),t("th",$e,s(e.__("Taxes")),1),t("th",ts,s(e.__("Total")),1)])]),t("tbody",es,[(i(!0),n(b,null,m(r.result,(o,y)=>(i(),n("tr",{key:y,class:""},[t("td",ss,s(o.name),1),t("td",rs,s(e.computeTotal(o.products,"quantity")),1),t("td",os,s(e.nsCurrency(e.computeTotal(o.products,"discount"))),1),t("td",ls,s(e.nsCurrency(e.computeTotal(o.products,"total_purchase_price"))),1),t("td",as,s(e.nsCurrency(e.computeTotal(o.products,"tax_value"))),1),t("td",cs,s(e.nsCurrency(e.computeTotal(o.products,"total_price"))),1)]))),128))]),t("tfoot",ds,[t("tr",null,[is,t("td",_s,s(e.computeTotal(r.result,"total_sold_items")),1),t("td",us,s(e.nsCurrency(e.computeTotal(r.result,"total_discount"))),1),t("td",hs,s(e.nsCurrency(e.computeTotal(r.result,"total_purchase_price"))),1),t("td",ps,s(e.nsCurrency(e.computeTotal(r.result,"total_tax_value"))),1),t("td",bs,s(e.nsCurrency(e.computeTotal(r.result,"total_price"))),1)])])])])])):p("",!0)])])}const Ps=P(L,[["render",ms]]);export{Ps as default}; +import{a as x,b as h,h as w}from"./bootstrap-8be442b1.js";import{c as C,e as T}from"./components-50630f18.js";import{_ as d,n as k}from"./currency-f8bd78d1.js";import{b as f}from"./ns-prompt-popup-100414c5.js";import{j as D}from"./join-array-4b30b096.js";import{_ as P}from"./_plugin-vue_export-helper-c27b6911.js";import{r as U,o as i,c as n,a as t,f as v,n as F,t as s,e as p,F as b,b as m}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";const L={name:"ns-sale-report",data(){return{saleReport:"",startDateField:{name:"start_date",type:"datetime",value:ns.date.moment.startOf("day").format()},endDateField:{name:"end_date",type:"datetime",value:ns.date.moment.endOf("day").format()},result:[],isLoading:!1,users:[],ns:window.ns,summary:{},selectedUser:"",selectedCategory:"",reportType:{label:d("Report Type"),name:"reportType",type:"select",value:"categories_report",options:[{label:d("Categories Detailed"),value:"categories_report"},{label:d("Categories Summary"),value:"categories_summary"},{label:d("Products"),value:"products_report"}],description:d("Allow you to choose the report type.")},filterUser:{label:d("Filter User"),name:"filterUser",type:"select",value:"",options:[],description:d("Allow you to choose the report type.")},filterCategory:{label:d("Filter By Category"),name:"filterCategory",type:"multiselect",value:"",options:[],description:d("Allow you to choose the category.")},field:{type:"datetimepicker",value:"2021-02-07",name:"date"}}},components:{nsDatepicker:C,nsDateTimePicker:T},computed:{},methods:{__:d,nsCurrency:k,joinArray:D,printSaleReport(){this.$htmlToPaper("sale-report")},async openSettings(){try{const c=await new Promise((a,l)=>{Popup.show(f,{...this.reportType,resolve:a,reject:l})});this.reportType.value=c,this.result=[],this.loadReport()}catch(c){console.log({exception:c})}},async openUserFiltering(){try{this.isLoading=!0;const c=await new Promise((l,_)=>{x.get("/api/users").subscribe({next:r=>{this.users=r,this.isLoading=!1,this.filterUser.options=[{label:d("All Users"),value:""},...this.users.map(e=>({label:e.username,value:e.id}))],Popup.show(f,{...this.filterUser,resolve:l,reject:_})},error:r=>{this.isLoading=!1,h.error(d("No user was found for proceeding the filtering.")),_(r)}})}),a=this.users.filter(l=>l.id===c);if(a.length>0){let l=a[0];this.selectedUser=`${l.username} ${l.first_name||l.last_name?l.first_name+" "+l.last_name:""}`,this.filterUser.value=c,this.result=[],this.loadReport()}}catch(c){console.log({exception:c})}},async openCategoryFiltering(){try{let c=[];this.isLoading=!0;const a=await new Promise((l,_)=>{x.get("/api/categories").subscribe({next:r=>{this.isLoading=!1,c=r,this.filterCategory.options=[...r.map(e=>({label:e.name,value:e.id}))],Popup.show(f,{...this.filterCategory,resolve:l,reject:_})},error:r=>{this.isLoading=!1,h.error(d("No category was found for proceeding the filtering.")),_(r)}})});if(a.length>0){let l=c.filter(_=>a.includes(_.id)).map(_=>_.name);this.selectedCategory=this.joinArray(l),this.filterCategory.value=a}else this.selectedCategory="",this.filterCategory.value=[];this.result=[],this.loadReport()}catch(c){console.log(c)}},getType(c){const a=this.reportType.options.filter(l=>l.value===c);return a.length>0?a[0].label:d("Unknown")},loadReport(){if(this.startDate===null||this.endDate===null)return h.error(d("Unable to proceed. Select a correct time range.")).subscribe();const c=w(this.startDate);if(w(this.endDate).isBefore(c))return h.error(d("Unable to proceed. The current time range is not valid.")).subscribe();this.isLoading=!0,x.post("/api/reports/sale-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,type:this.reportType.value,user_id:this.filterUser.value,categories_id:this.filterCategory.value}).subscribe({next:l=>{this.isLoading=!1,this.result=l.result,this.summary=l.summary},error:l=>{this.isLoading=!1,h.error(l.message).subscribe()}})},computeTotal(c,a){return c.length>0?c.map(l=>parseFloat(l[a])).reduce((l,_)=>l+_):0}},props:["storeLogo","storeName"],mounted(){}},S={id:"report-section",class:"px-4"},R={class:"flex -mx-2"},B={class:"px-2"},A={class:"px-2"},N={class:"px-2"},j={class:"pl-2"},M={class:"flex -mx-2"},q={class:"px-2"},V=t("i",{class:"las la-print text-xl"},null,-1),H={class:"pl-2"},O={class:"px-2"},Q=t("i",{class:"las la-filter text-xl"},null,-1),z={class:"pl-2"},E={class:"px-2"},G=t("i",{class:"las la-filter text-xl"},null,-1),I={class:"pl-2"},J={class:"px-2"},K=t("i",{class:"las la-filter text-xl"},null,-1),W={class:"pl-2"},X={id:"sale-report",class:"anim-duration-500 fade-in-entrance"},Y={class:"flex w-full"},Z={class:"my-4 flex justify-between w-full"},$={class:"text-secondary"},tt=["innerHTML"],et={class:"pb-1 border-b border-dashed"},st={class:"pb-1 border-b border-dashed"},rt=["src","alt"],ot={class:"-mx-4 flex md:flex-row flex-col"},lt={class:"w-full md:w-1/2 px-4"},at={class:"shadow rounded my-4 ns-box"},ct={class:"border-b ns-box-body"},dt={class:"table ns-table w-full"},it={class:"text-primary"},nt={class:""},_t={width:"200",class:"font-semibold p-2 border text-left bg-info-secondary border-info-primary text-white"},ut={class:"p-2 border text-right border-info-primary"},ht={class:""},pt={width:"200",class:"font-semibold p-2 border text-left bg-error-secondary border-error-primary text-white"},bt={class:"p-2 border text-right border-error-primary"},mt={class:""},yt={width:"200",class:"font-semibold p-2 border text-left bg-error-secondary border-error-primary text-white"},xt={class:"p-2 border text-right border-error-primary"},ft={key:0,class:""},gt={width:"200",class:"font-semibold p-2 border text-left bg-error-secondary border-error-primary text-white"},wt={class:"p-2 border text-right border-error-primary"},vt={class:""},Ct={width:"200",class:"font-semibold p-2 border text-left bg-info-secondary border-info-primary text-white"},Tt={class:"p-2 border text-right border-success-primary"},kt={class:""},Dt={width:"200",class:"font-semibold p-2 border text-left bg-success-secondary border-success-secondary text-white"},Pt={class:"p-2 border text-right border-success-primary"},Ut={class:""},Ft={width:"200",class:"font-semibold p-2 border text-left bg-info-secondary border-success-secondary text-white"},Lt={class:"p-2 border text-right border-success-primary"},St={class:""},Rt={width:"200",class:"font-semibold p-2 border text-left bg-success-secondary border-success-secondary text-white"},Bt={class:"p-2 border text-right border-success-primary"},At=t("div",{class:"w-full md:w-1/2 px-4"},null,-1),Nt={key:0,class:"bg-box-background shadow rounded my-4"},jt={class:"border-b border-box-edge"},Mt={class:"table ns-table w-full"},qt={class:"text-primary"},Vt={class:"border p-2 text-left"},Ht={width:"150",class:"border p-2"},Ot={width:"150",class:"border p-2"},Qt={width:"150",class:"border p-2"},zt={width:"150",class:"border p-2"},Et={width:"150",class:"border p-2"},Gt={width:"150",class:"border p-2"},It={class:"text-primary"},Jt={class:"p-2 border"},Kt={class:"p-2 border text-right"},Wt={class:"p-2 border text-right"},Xt={class:"p-2 border text-right"},Yt={class:"p-2 border text-right"},Zt={class:"p-2 border text-right"},$t={class:"p-2 border text-right"},te={class:"text-primary font-semibold"},ee=t("td",{class:"p-2 border text-primary"},null,-1),se={class:"p-2 border text-right text-primary"},re={class:"p-2 border text-right text-primary"},oe={class:"p-2 border text-right text-primary"},le={class:"p-2 border text-right text-primary"},ae={class:"p-2 border text-right text-primary"},ce={class:"p-2 border text-right text-primary"},de={key:1,class:"bg-box-background shadow rounded my-4"},ie={class:"border-b border-box-edge"},ne={class:"table ns-table w-full"},_e={class:"text-primary"},ue={class:"border p-2 text-left"},he={class:"border p-2 text-left"},pe={width:"100",class:"border p-2"},be={width:"150",class:"border p-2"},me={width:"150",class:"border p-2"},ye={width:"150",class:"border p-2"},xe={width:"150",class:"border p-2"},fe={width:"150",class:"border p-2"},ge={class:"text-primary"},we={class:"p-2 border"},ve={class:"p-2 border"},Ce={class:"p-2 border text-right"},Te={class:"p-2 border text-right"},ke={class:"p-2 border text-right"},De={class:"p-2 border text-right"},Pe={class:"p-2 border text-right"},Ue={class:"p-2 border text-right"},Fe={class:"bg-info-primary"},Le={colspan:"2",class:"p-2 border border-info-secondary"},Se={class:"p-2 border text-right border-info-secondary"},Re={class:"p-2 border text-right border-info-secondary"},Be={class:"p-2 border text-right border-info-secondary"},Ae={class:"p-2 border text-right border-info-secondary"},Ne={class:"p-2 border text-right border-info-secondary"},je={class:"p-2 border text-right border-info-secondary"},Me={class:"text-primary font-semibold"},qe=t("td",{colspan:"2",class:"p-2 border text-primary"},null,-1),Ve={class:"p-2 border text-right text-primary"},He={class:"p-2 border text-right text-primary"},Oe={class:"p-2 border text-right text-primary"},Qe={class:"p-2 border text-right text-primary"},ze={class:"p-2 border text-right text-primary"},Ee={class:"p-2 border text-right text-primary"},Ge={key:2,class:"bg-box-background shadow rounded my-4"},Ie={class:"border-b border-box-edge"},Je={class:"table ns-table w-full"},Ke={class:"text-primary"},We={class:"border p-2 text-left"},Xe={width:"100",class:"border p-2"},Ye={width:"150",class:"border p-2"},Ze={width:"150",class:"border p-2"},$e={width:"150",class:"border p-2"},ts={width:"150",class:"border p-2"},es={class:"text-primary"},ss={class:"p-2 border text-left border-info-primary"},rs={class:"p-2 border text-right border-info-primary"},os={class:"p-2 border text-right border-info-primary"},ls={class:"p-2 border text-right border-info-primary"},as={class:"p-2 border text-right border-info-primary"},cs={class:"p-2 border text-right border-info-primary"},ds={class:"text-primary font-semibold"},is=t("td",{class:"p-2 border text-primary"},null,-1),_s={class:"p-2 border text-right text-primary"},us={class:"p-2 border text-right text-primary"},hs={class:"p-2 border text-right text-primary"},ps={class:"p-2 border text-right text-primary"},bs={class:"p-2 border text-right text-primary"};function ms(c,a,l,_,r,e){const g=U("ns-date-time-picker");return i(),n("div",S,[t("div",R,[t("div",B,[v(g,{field:r.startDateField},null,8,["field"])]),t("div",A,[v(g,{field:r.endDateField},null,8,["field"])]),t("div",N,[t("button",{onClick:a[0]||(a[0]=o=>e.loadReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[t("i",{class:F([r.isLoading?"animate-spin":"","las la-sync-alt text-xl"])},null,2),t("span",j,s(e.__("Load")),1)])])]),t("div",M,[t("div",q,[t("button",{onClick:a[1]||(a[1]=o=>e.printSaleReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[V,t("span",H,s(e.__("Print")),1)])]),t("div",O,[t("button",{onClick:a[2]||(a[2]=o=>e.openSettings()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[Q,t("span",z,s(e.__("By Type"))+" : "+s(e.getType(r.reportType.value)),1)])]),t("div",E,[t("button",{onClick:a[3]||(a[3]=o=>e.openUserFiltering()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[G,t("span",I,s(e.__("By User"))+" : "+s(r.selectedUser||e.__("All Users")),1)])]),t("div",J,[t("button",{onClick:a[4]||(a[4]=o=>e.openCategoryFiltering()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[K,t("span",W,s(e.__("By Category"))+" : "+s(r.selectedCategory||e.__("All Category")),1)])])]),t("div",X,[t("div",Y,[t("div",Z,[t("div",$,[t("ul",null,[t("li",{class:"pb-1 border-b border-dashed",innerHTML:e.__("Range : {date1} — {date2}").replace("{date1}",r.startDateField.value).replace("{date2}",r.endDateField.value)},null,8,tt),t("li",et,s(e.__("Document : Sale Report")),1),t("li",st,s(e.__("By : {user}").replace("{user}",r.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:l.storeLogo,alt:l.storeName},null,8,rt)])])]),t("div",null,[t("div",ot,[t("div",lt,[t("div",at,[t("div",ct,[t("table",dt,[t("tbody",it,[t("tr",nt,[t("td",_t,s(e.__("Sub Total")),1),t("td",ut,s(e.nsCurrency(r.summary.subtotal)),1)]),t("tr",ht,[t("td",pt,s(e.__("Sales Discounts")),1),t("td",bt,s(e.nsCurrency(r.summary.sales_discounts)),1)]),t("tr",mt,[t("td",yt,s(e.__("Sales Taxes")),1),t("td",xt,s(e.nsCurrency(r.summary.sales_taxes)),1)]),r.summary.product_taxes>0?(i(),n("tr",ft,[t("td",gt,s(e.__("Product Taxes")),1),t("td",wt,s(e.nsCurrency(r.summary.product_taxes)),1)])):p("",!0),t("tr",vt,[t("td",Ct,s(e.__("Shipping")),1),t("td",Tt,s(e.nsCurrency(r.summary.shipping)),1)]),t("tr",kt,[t("td",Dt,s(e.__("Total")),1),t("td",Pt,s(e.nsCurrency(r.summary.total)),1)]),t("tr",Ut,[t("td",Ft,s(e.__("Cost Of Goods")),1),t("td",Lt,s(e.nsCurrency(r.summary.total_purchase_price)),1)]),t("tr",St,[t("td",Rt,s(e.__("Profit")),1),t("td",Bt,s(e.nsCurrency(r.summary.profit)),1)])])])])])]),At])]),r.reportType.value==="products_report"?(i(),n("div",Nt,[t("div",jt,[t("table",Mt,[t("thead",qt,[t("tr",null,[t("th",Vt,s(e.__("Products")),1),t("th",Ht,s(e.__("Quantity")),1),t("th",Ot,s(e.__("Discounts")),1),t("th",Qt,s(e.__("Cost")),1),t("th",zt,s(e.__("Taxes")),1),t("th",Et,s(e.__("Total")),1),t("th",Gt,s(e.__("Profit")),1)])]),t("tbody",It,[(i(!0),n(b,null,m(r.result,o=>(i(),n("tr",{key:o.id},[t("td",Jt,s(o.name),1),t("td",Kt,s(o.quantity),1),t("td",Wt,s(e.nsCurrency(o.discount)),1),t("td",Xt,s(e.nsCurrency(o.total_purchase_price)),1),t("td",Yt,s(e.nsCurrency(o.tax_value)),1),t("td",Zt,s(e.nsCurrency(o.total_price)),1),t("td",$t,s(e.nsCurrency(Math.chain(o.total_price).subtract(Math.chain(o.total_purchase_price).add(o.tax_value).done()).done())),1)]))),128))]),t("tfoot",te,[t("tr",null,[ee,t("td",se,s(e.computeTotal(r.result,"quantity")),1),t("td",re,s(e.nsCurrency(e.computeTotal(r.result,"discount"))),1),t("td",oe,s(e.nsCurrency(e.computeTotal(r.result,"total_purchase_price"))),1),t("td",le,s(e.nsCurrency(e.computeTotal(r.result,"tax_value"))),1),t("td",ae,s(e.nsCurrency(e.computeTotal(r.result,"total_price"))),1),t("td",ce,s(e.nsCurrency(e.computeTotal(r.result,"total_price")-e.computeTotal(r.result,"total_purchase_price")-e.computeTotal(r.result,"tax_value"))),1)])])])])])):p("",!0),r.reportType.value==="categories_report"?(i(),n("div",de,[t("div",ie,[t("table",ne,[t("thead",_e,[t("tr",null,[t("th",ue,s(e.__("Category")),1),t("th",he,s(e.__("Product")),1),t("th",pe,s(e.__("Quantity")),1),t("th",be,s(e.__("Discounts")),1),t("th",me,s(e.__("Taxes")),1),t("th",ye,s(e.__("Total")),1),t("th",xe,s(e.__("Purchase Price")),1),t("th",fe,s(e.__("Profit")),1)])]),t("tbody",ge,[(i(!0),n(b,null,m(r.result,(o,y)=>(i(),n(b,{key:y},[o.products.length>0?(i(!0),n(b,{key:0},m(o.products,u=>(i(),n("tr",{key:parseInt(o.id+""+u.id)},[t("td",we,s(o.name),1),t("td",ve,s(u.name),1),t("td",Ce,s(u.quantity),1),t("td",Te,s(e.nsCurrency(u.discount)),1),t("td",ke,s(e.nsCurrency(u.tax_value)),1),t("td",De,s(e.nsCurrency(u.total_price)),1),t("td",Pe,s(e.nsCurrency(u.total_purchase_price)),1),t("td",Ue,s(e.nsCurrency(u.total_price-(u.total_purchase_price+u.tax_value+u.discount))),1)]))),128)):p("",!0),t("tr",Fe,[t("td",Le,s(o.name),1),t("td",Se,s(e.computeTotal(o.products,"quantity")),1),t("td",Re,s(e.nsCurrency(e.computeTotal(o.products,"discount"))),1),t("td",Be,s(e.nsCurrency(e.computeTotal(o.products,"tax_value"))),1),t("td",Ae,s(e.nsCurrency(e.computeTotal(o.products,"total_price"))),1),t("td",Ne,s(e.nsCurrency(e.computeTotal(o.products,"total_purchase_price"))),1),t("td",je,s(e.nsCurrency(e.computeTotal(o.products,"total_price")-(e.computeTotal(o.products,"total_purchase_price")+e.computeTotal(o.products,"tax_value")+e.computeTotal(o.products,"discount")))),1)])],64))),128))]),t("tfoot",Me,[t("tr",null,[qe,t("td",Ve,s(e.computeTotal(r.result,"total_sold_items")),1),t("td",He,s(e.nsCurrency(e.computeTotal(r.result,"total_discount"))),1),t("td",Oe,s(e.nsCurrency(e.computeTotal(r.result,"total_tax_value"))),1),t("td",Qe,s(e.nsCurrency(e.computeTotal(r.result,"total_price"))),1),t("td",ze,s(e.nsCurrency(e.computeTotal(r.result,"total_purchase_price"))),1),t("td",Ee,s(e.nsCurrency(e.computeTotal(r.result,"total_price")-(e.computeTotal(r.result,"total_purchase_price")+e.computeTotal(r.result,"total_discount")+e.computeTotal(r.result,"total_tax_value")))),1)])])])])])):p("",!0),r.reportType.value==="categories_summary"?(i(),n("div",Ge,[t("div",Ie,[t("table",Je,[t("thead",Ke,[t("tr",null,[t("th",We,s(e.__("Category")),1),t("th",Xe,s(e.__("Quantity")),1),t("th",Ye,s(e.__("Discounts")),1),t("th",Ze,s(e.__("Cost")),1),t("th",$e,s(e.__("Taxes")),1),t("th",ts,s(e.__("Total")),1)])]),t("tbody",es,[(i(!0),n(b,null,m(r.result,(o,y)=>(i(),n("tr",{key:y,class:""},[t("td",ss,s(o.name),1),t("td",rs,s(e.computeTotal(o.products,"quantity")),1),t("td",os,s(e.nsCurrency(e.computeTotal(o.products,"discount"))),1),t("td",ls,s(e.nsCurrency(e.computeTotal(o.products,"total_purchase_price"))),1),t("td",as,s(e.nsCurrency(e.computeTotal(o.products,"tax_value"))),1),t("td",cs,s(e.nsCurrency(e.computeTotal(o.products,"total_price"))),1)]))),128))]),t("tfoot",ds,[t("tr",null,[is,t("td",_s,s(e.computeTotal(r.result,"total_sold_items")),1),t("td",us,s(e.nsCurrency(e.computeTotal(r.result,"total_discount"))),1),t("td",hs,s(e.nsCurrency(e.computeTotal(r.result,"total_purchase_price"))),1),t("td",ps,s(e.nsCurrency(e.computeTotal(r.result,"total_tax_value"))),1),t("td",bs,s(e.nsCurrency(e.computeTotal(r.result,"total_price"))),1)])])])])])):p("",!0)])])}const Ps=P(L,[["render",ms]]);export{Ps as default}; diff --git a/public/build/assets/ns-settings-a4c45132.js b/public/build/assets/ns-settings-f7f35eda.js similarity index 98% rename from public/build/assets/ns-settings-a4c45132.js rename to public/build/assets/ns-settings-f7f35eda.js index 2ede52554..e7eeb668f 100644 --- a/public/build/assets/ns-settings-a4c45132.js +++ b/public/build/assets/ns-settings-f7f35eda.js @@ -1 +1 @@ -import{_ as b}from"./currency-f8bd78d1.js";import{F as S}from"./bootstrap-8be442b1.js";import{g as x}from"./components-ef1ba55f.js";import{s as y,r as v,o as l,c,a as d,F as g,b as _,n as w,t as u,e as m,f as p,g as F,j as C,w as B,A as T,i as H}from"./runtime-core.esm-bundler-b48de70a.js";import{_ as j}from"./_plugin-vue_export-helper-c27b6911.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const A={name:"ns-settings",props:["url"],components:{nsField:x},data(){return{validation:new S,form:{},isSubmitting:!1,test:""}},computed:{formDefined(){return Object.values(this.form).length>0},activeTab(){for(let t in this.form.tabs)if(this.form.tabs[t].active===!0)return this.form.tabs[t]},activeTabIdentifier(){const t=Object.values(this.form.tabs);return Object.keys(this.form.tabs)[t.indexOf(this.activeTab)]}},mounted(){const t=window.location.href,a=new URL(t);this.loadSettingsForm(a.searchParams.get("tab")||null)},methods:{__:b,async handleSaved(t,a){(await this.loadSettingsForm(this.activeTab)).tabs[this.activeTabIdentifier].fields.filter(e=>{e.name===a.name&&t.data.entry&&(e.value=t.data.entry.id)})},loadComponent(t){return y(nsExtraComponents[t])},async submitForm(){if(this.validation.validateForm(this.form).length>0)return nsSnackBar.error(b("Unable to proceed the form is not valid.")).subscribe();this.validation.disableForm(this.form);const t=this.validation.extractForm(this.form),a=nsHooks.applyFilters("ns-before-saved",()=>new Promise((i,e)=>(this.isSubmitting=!0,nsHttpClient.post(this.url,t).subscribe({next:r=>{this.isSubmitting=!1,i(r)},error:r=>{this.isSubmitting=!1,e(r)}}))));try{const i=await a(t);this.validation.enableForm(this.form);const e=Object.values(this.form.tabs),r=Object.keys(this.form.tabs)[e.indexOf(this.activeTab)];this.loadSettingsForm(r),i.data&&i.data.results&&i.data.results.forEach(s=>{s.status==="error"?nsSnackBar.error(s.message).subscribe():nsSnackBar.success(s.message).subscribe()}),nsHooks.doAction("ns-settings-saved",{result:i,instance:this}),nsSnackBar.success(i.message).subscribe()}catch(i){this.validation.enableForm(this.form),this.validation.triggerFieldsErrors(this.form,i),nsHooks.doAction("ns-settings-failed",{error:i,instance:this}),i.message&&nsSnackBar.error(i.message||b("Unable to proceed the form is not valid.")).subscribe()}},setActive(t,a){for(let i in this.form.tabs)this.form.tabs[i].active=!1;t.active=!0,nsHooks.doAction("ns-settings-change-tab",{tab:t,instance:this,identifier:a})},loadSettingsForm(t=null){return new Promise((a,i)=>{nsHttpClient.get(this.url).subscribe({next:e=>{a(e);let r=0,s=null;this.form={},t=e.tabs[t]!==void 0?t:null;for(let n in e.tabs)this.formDefined?e.tabs[n].active=this.form.tabs[n].active:(e.tabs[n].active=!1,(t===null&&r===0||t!==null&&n===t)&&(e.tabs[n].active=!0,s=n)),r++,e.tabs[n].fields===void 0&&(e.tabs[n].fields=[]);this.form=this.validation.createForm(e),nsHooks.doAction("ns-settings-loaded",this),nsHooks.doAction("ns-settings-change-tab",{tab:this.activeTab,instance:this,identifier:s})},error:e=>{nsSnackBar.error(e.message).subscribe(),i(e)}})})}}},O={key:0,id:"tabbed-card",class:"ns-tab"},I={id:"card-header",class:"flex flex-wrap ml-4"},D=["onClick"],V={key:0,class:"ml-2 rounded-full ns-inset-button error active text-sm h-6 w-6 flex items-center justify-center"},E={class:"card-body ns-tab-item"},N={class:"shadow rounded"},P={class:"-mx-4 flex flex-wrap p-2"},U={class:"flex flex-col my-2"},L={key:1,class:"w-full px-4"},R={key:0,class:"ns-tab-item-footer border-t p-2 flex justify-end"};function z(t,a,i,e,r,s){const n=v("ns-field"),k=v("ns-button");return s.formDefined?(l(),c("div",O,[d("div",I,[(l(!0),c(g,null,_(r.form.tabs,(o,f)=>(l(),c("div",{class:w([o.active?"active":"inactive","tab cursor-pointer flex items-center px-4 py-2 rounded-tl-lg rounded-tr-lg"]),onClick:h=>s.setActive(o,f),key:f},[d("span",null,u(o.label),1),o.errors&&o.errors.length>0?(l(),c("span",V,u(o.errors.length),1)):m("",!0)],10,D))),128))]),d("div",E,[d("div",N,[d("div",P,[s.activeTab.fields?(l(!0),c(g,{key:0},_(s.activeTab.fields,(o,f)=>(l(),c("div",{class:"w-full px-4 md:w-1/2 lg:w-1/3",key:f},[d("div",U,[p(n,{onSaved:h=>s.handleSaved(h,o),field:o},null,8,["onSaved","field"])])]))),128)):m("",!0),s.activeTab.component?(l(),c("div",L,[(l(),F(C(s.loadComponent(s.activeTab.component).value)))])):m("",!0)]),s.activeTab.fields&&s.activeTab.fields.length>0?(l(),c("div",R,[p(k,{disabled:r.isSubmitting,onClick:a[0]||(a[0]=o=>s.submitForm()),type:"info"},{default:B(()=>[T(t.$slots,"submit-button",{},()=>[H(u(s.__("Save Settings")),1)])]),_:3},8,["disabled"])])):m("",!0)])])])):m("",!0)}const Z=j(A,[["render",z]]);export{Z as default}; +import{_ as b}from"./currency-f8bd78d1.js";import{F as S}from"./bootstrap-8be442b1.js";import{g as x}from"./components-50630f18.js";import{s as y,r as v,o as l,c,a as d,F as g,b as _,n as w,t as u,e as m,f as p,g as F,j as C,w as B,A as T,i as H}from"./runtime-core.esm-bundler-b48de70a.js";import{_ as j}from"./_plugin-vue_export-helper-c27b6911.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const A={name:"ns-settings",props:["url"],components:{nsField:x},data(){return{validation:new S,form:{},isSubmitting:!1,test:""}},computed:{formDefined(){return Object.values(this.form).length>0},activeTab(){for(let t in this.form.tabs)if(this.form.tabs[t].active===!0)return this.form.tabs[t]},activeTabIdentifier(){const t=Object.values(this.form.tabs);return Object.keys(this.form.tabs)[t.indexOf(this.activeTab)]}},mounted(){const t=window.location.href,a=new URL(t);this.loadSettingsForm(a.searchParams.get("tab")||null)},methods:{__:b,async handleSaved(t,a){(await this.loadSettingsForm(this.activeTab)).tabs[this.activeTabIdentifier].fields.filter(e=>{e.name===a.name&&t.data.entry&&(e.value=t.data.entry.id)})},loadComponent(t){return y(nsExtraComponents[t])},async submitForm(){if(this.validation.validateForm(this.form).length>0)return nsSnackBar.error(b("Unable to proceed the form is not valid.")).subscribe();this.validation.disableForm(this.form);const t=this.validation.extractForm(this.form),a=nsHooks.applyFilters("ns-before-saved",()=>new Promise((i,e)=>(this.isSubmitting=!0,nsHttpClient.post(this.url,t).subscribe({next:r=>{this.isSubmitting=!1,i(r)},error:r=>{this.isSubmitting=!1,e(r)}}))));try{const i=await a(t);this.validation.enableForm(this.form);const e=Object.values(this.form.tabs),r=Object.keys(this.form.tabs)[e.indexOf(this.activeTab)];this.loadSettingsForm(r),i.data&&i.data.results&&i.data.results.forEach(s=>{s.status==="error"?nsSnackBar.error(s.message).subscribe():nsSnackBar.success(s.message).subscribe()}),nsHooks.doAction("ns-settings-saved",{result:i,instance:this}),nsSnackBar.success(i.message).subscribe()}catch(i){this.validation.enableForm(this.form),this.validation.triggerFieldsErrors(this.form,i),nsHooks.doAction("ns-settings-failed",{error:i,instance:this}),i.message&&nsSnackBar.error(i.message||b("Unable to proceed the form is not valid.")).subscribe()}},setActive(t,a){for(let i in this.form.tabs)this.form.tabs[i].active=!1;t.active=!0,nsHooks.doAction("ns-settings-change-tab",{tab:t,instance:this,identifier:a})},loadSettingsForm(t=null){return new Promise((a,i)=>{nsHttpClient.get(this.url).subscribe({next:e=>{a(e);let r=0,s=null;this.form={},t=e.tabs[t]!==void 0?t:null;for(let n in e.tabs)this.formDefined?e.tabs[n].active=this.form.tabs[n].active:(e.tabs[n].active=!1,(t===null&&r===0||t!==null&&n===t)&&(e.tabs[n].active=!0,s=n)),r++,e.tabs[n].fields===void 0&&(e.tabs[n].fields=[]);this.form=this.validation.createForm(e),nsHooks.doAction("ns-settings-loaded",this),nsHooks.doAction("ns-settings-change-tab",{tab:this.activeTab,instance:this,identifier:s})},error:e=>{nsSnackBar.error(e.message).subscribe(),i(e)}})})}}},O={key:0,id:"tabbed-card",class:"ns-tab"},I={id:"card-header",class:"flex flex-wrap ml-4"},D=["onClick"],V={key:0,class:"ml-2 rounded-full ns-inset-button error active text-sm h-6 w-6 flex items-center justify-center"},E={class:"card-body ns-tab-item"},N={class:"shadow rounded"},P={class:"-mx-4 flex flex-wrap p-2"},U={class:"flex flex-col my-2"},L={key:1,class:"w-full px-4"},R={key:0,class:"ns-tab-item-footer border-t p-2 flex justify-end"};function z(t,a,i,e,r,s){const n=v("ns-field"),k=v("ns-button");return s.formDefined?(l(),c("div",O,[d("div",I,[(l(!0),c(g,null,_(r.form.tabs,(o,f)=>(l(),c("div",{class:w([o.active?"active":"inactive","tab cursor-pointer flex items-center px-4 py-2 rounded-tl-lg rounded-tr-lg"]),onClick:h=>s.setActive(o,f),key:f},[d("span",null,u(o.label),1),o.errors&&o.errors.length>0?(l(),c("span",V,u(o.errors.length),1)):m("",!0)],10,D))),128))]),d("div",E,[d("div",N,[d("div",P,[s.activeTab.fields?(l(!0),c(g,{key:0},_(s.activeTab.fields,(o,f)=>(l(),c("div",{class:"w-full px-4 md:w-1/2 lg:w-1/3",key:f},[d("div",U,[p(n,{onSaved:h=>s.handleSaved(h,o),field:o},null,8,["onSaved","field"])])]))),128)):m("",!0),s.activeTab.component?(l(),c("div",L,[(l(),F(C(s.loadComponent(s.activeTab.component).value)))])):m("",!0)]),s.activeTab.fields&&s.activeTab.fields.length>0?(l(),c("div",R,[p(k,{disabled:r.isSubmitting,onClick:a[0]||(a[0]=o=>s.submitForm()),type:"info"},{default:B(()=>[T(t.$slots,"submit-button",{},()=>[H(u(s.__("Save Settings")),1)])]),_:3},8,["disabled"])])):m("",!0)])])])):m("",!0)}const Z=j(A,[["render",z]]);export{Z as default}; diff --git a/public/build/assets/ns-sold-stock-report-f37081a1.js b/public/build/assets/ns-sold-stock-report-177054bb.js similarity index 98% rename from public/build/assets/ns-sold-stock-report-f37081a1.js rename to public/build/assets/ns-sold-stock-report-177054bb.js index 1341e6ea2..e627163ee 100644 --- a/public/build/assets/ns-sold-stock-report-f37081a1.js +++ b/public/build/assets/ns-sold-stock-report-177054bb.js @@ -1 +1 @@ -import{h as c,b as d,a as b}from"./bootstrap-8be442b1.js";import{c as x,e as f}from"./components-ef1ba55f.js";import{_ as o,n as y}from"./currency-f8bd78d1.js";import{s as p}from"./select-api-entities-c72f4497.js";import{_ as v}from"./_plugin-vue_export-helper-c27b6911.js";import{r as g,o as _,c as u,a as t,f as m,t as r,F as w,b as F}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";import"./join-array-4b30b096.js";const D={name:"ns-sold-stock-report",props:["storeLogo","storeName"],data(){return{categoriesNames:"",unitsNames:"",startDateField:{type:"datetimepicker",value:c(ns.date.current).startOf("month").format("YYYY-MM-DD HH:mm:ss")},endDateField:{type:"datetimepicker",value:c(ns.date.current).endOf("month").format("YYYY-MM-DD HH:mm:ss")},categoryField:{label:o("Filter by Category"),value:[],name:"filter_by_category"},unitField:{label:o("Filter by Unit"),value:[],name:"filter_by_unit"},products:[],ns:window.ns}},components:{nsDatepicker:x,nsDateTimePicker:f},computed:{totalQuantity(){return this.products.length>0?this.products.map(s=>s.quantity).reduce((s,i)=>s+i):0},totalTaxes(){return this.products.length>0?this.products.map(s=>s.tax_value).reduce((s,i)=>s+i):0},totalPrice(){return this.products.length>0?this.products.map(s=>s.total_price).reduce((s,i)=>s+i):0}},methods:{__:o,nsCurrency:y,async selectCategories(){try{const s=await p("/api/categories",o("Limit Results By Categories"),this.categoryField.value);this.categoriesNames=s.labels,this.categoryField.value=s.values,this.loadReport()}catch{d.error(o("An error has occured while loading the categories")).subscribe()}},async selectUnits(){try{const s=await p("/api/units",o("Limit Results By Units"),this.unitField.value);this.unitsNames=s.labels,this.unitField.value=s.values,this.loadReport()}catch{d.error(o("An error has occured while loading the units")).subscribe()}},printSaleReport(){this.$htmlToPaper("report-printable")},loadReport(){if(this.startDateField.value===null||this.endDateField.value===null)return d.error(o("Unable to proceed. Select a correct time range.")).subscribe();const s=c(this.startDateField.value);if(c(this.endDateField.value).isBefore(s))return d.error(o("Unable to proceed. The current time range is not valid.")).subscribe();b.post("/api/reports/sold-stock-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,categories:this.categoryField.value,units:this.unitField.value}).subscribe({next:n=>{this.products=n},error:n=>{d.error(n.message).subscribe()}})}}},k={id:"report-section",class:"px-4"},C={class:"flex -mx-2"},R={class:"px-2"},N={class:"px-2"},S={class:"px-2"},U={class:"ns-button"},B=t("i",{class:"las la-sync-alt text-xl"},null,-1),Y={class:"pl-2"},M={class:"px-2"},T={class:"ns-button"},L=t("i",{class:"las la-print text-xl"},null,-1),P={class:"pl-2"},j={class:"px-2"},A={class:"ns-button"},H=t("i",{class:"las la-filter text-xl"},null,-1),Q={class:"pl-2"},V={class:"px-2"},q={class:"ns-button"},E=t("i",{class:"las la-filter text-xl"},null,-1),O={class:"pl-2"},z={id:"report-printable",class:"anim-duration-500 fade-in-entrance"},G={class:"flex w-full"},I={class:"my-4 flex justify-between w-full"},J={class:"text-secondary"},K={class:"pb-1 border-b border-dashed"},W={class:"pb-1 border-b border-dashed"},X={class:"pb-1 border-b border-dashed"},Z=["src","alt"],$={class:"rounded my-4"},tt={class:"ns-box shadow"},et={class:"border-b ns-box-body"},st={class:"table ns-table w-full"},rt={class:""},it={class:"border p-2 text-left"},at={width:"150",class:"text-right border p-2"},ot={width:"150",class:"text-right border p-2"},lt={width:"150",class:"text-right border p-2"},nt={width:"150",class:"text-right border p-2"},dt={class:""},ct={class:"p-2 border"},_t={class:"p-2 border text-right"},ut={class:"p-2 border text-right"},ht={class:"p-2 border text-right"},pt={class:"p-2 border text-right"},mt={class:"font-semibold"},bt=t("td",{colspan:"2",class:"p-2 border"},null,-1),xt={class:"p-2 border text-right"},ft={class:"p-2 border text-right"},yt={class:"p-2 border text-right"};function vt(s,i,n,gt,l,e){const h=g("ns-field");return _(),u("div",k,[t("div",C,[t("div",R,[m(h,{field:l.startDateField},null,8,["field"])]),t("div",N,[m(h,{field:l.endDateField},null,8,["field"])]),t("div",S,[t("div",U,[t("button",{onClick:i[0]||(i[0]=a=>e.loadReport()),class:"rounded flex justify-between shadow py-1 items-center text-primary px-2"},[B,t("span",Y,r(e.__("Load")),1)])])]),t("div",M,[t("div",T,[t("button",{onClick:i[1]||(i[1]=a=>e.printSaleReport()),class:"rounded flex justify-between shadow py-1 items-center text-primary px-2"},[L,t("span",P,r(e.__("Print")),1)])])]),t("div",j,[t("div",A,[t("button",{onClick:i[2]||(i[2]=a=>e.selectCategories()),class:"rounded flex justify-between shadow py-1 items-center text-primary px-2"},[H,t("span",Q,r(e.__("Categories"))+": "+r(l.categoriesNames||e.__("All Categories")),1)])])]),t("div",V,[t("div",q,[t("button",{onClick:i[3]||(i[3]=a=>e.selectUnits()),class:"rounded flex justify-between shadow py-1 items-center text-primary px-2"},[E,t("span",O,r(e.__("Units"))+": "+r(l.unitsNames||e.__("All Units")),1)])])])]),t("div",z,[t("div",G,[t("div",I,[t("div",J,[t("ul",null,[t("li",K,r(e.__("Range : {date1} — {date2}").replace("{date1}",l.startDateField.value).replace("{date2}",l.endDateField.value)),1),t("li",W,r(e.__("Document : Sold Stock Report")),1),t("li",X,r(e.__("By : {user}").replace("{user}",l.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:n.storeLogo,alt:n.storeName},null,8,Z)])])]),t("div",$,[t("div",tt,[t("div",et,[t("table",st,[t("thead",rt,[t("tr",null,[t("th",it,r(e.__("Product")),1),t("th",at,r(e.__("Unit")),1),t("th",ot,r(e.__("Quantity")),1),t("th",lt,r(e.__("Tax Value")),1),t("th",nt,r(e.__("Total")),1)])]),t("tbody",dt,[(_(!0),u(w,null,F(l.products,a=>(_(),u("tr",{key:a.id},[t("td",ct,r(a.name),1),t("td",_t,r(a.unit_name),1),t("td",ut,r(a.quantity),1),t("td",ht,r(e.nsCurrency(a.tax_value)),1),t("td",pt,r(e.nsCurrency(a.total_price)),1)]))),128))]),t("tfoot",mt,[t("tr",null,[bt,t("td",xt,r(e.totalQuantity),1),t("td",ft,r(e.nsCurrency(e.totalTaxes)),1),t("td",yt,r(e.nsCurrency(e.totalPrice)),1)])])])])])])])])}const Mt=v(D,[["render",vt]]);export{Mt as default}; +import{h as c,b as d,a as b}from"./bootstrap-8be442b1.js";import{c as x,e as f}from"./components-50630f18.js";import{_ as o,n as y}from"./currency-f8bd78d1.js";import{s as p}from"./select-api-entities-c72f4497.js";import{_ as v}from"./_plugin-vue_export-helper-c27b6911.js";import{r as g,o as _,c as u,a as t,f as m,t as r,F as w,b as F}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";import"./join-array-4b30b096.js";const D={name:"ns-sold-stock-report",props:["storeLogo","storeName"],data(){return{categoriesNames:"",unitsNames:"",startDateField:{type:"datetimepicker",value:c(ns.date.current).startOf("month").format("YYYY-MM-DD HH:mm:ss")},endDateField:{type:"datetimepicker",value:c(ns.date.current).endOf("month").format("YYYY-MM-DD HH:mm:ss")},categoryField:{label:o("Filter by Category"),value:[],name:"filter_by_category"},unitField:{label:o("Filter by Unit"),value:[],name:"filter_by_unit"},products:[],ns:window.ns}},components:{nsDatepicker:x,nsDateTimePicker:f},computed:{totalQuantity(){return this.products.length>0?this.products.map(s=>s.quantity).reduce((s,i)=>s+i):0},totalTaxes(){return this.products.length>0?this.products.map(s=>s.tax_value).reduce((s,i)=>s+i):0},totalPrice(){return this.products.length>0?this.products.map(s=>s.total_price).reduce((s,i)=>s+i):0}},methods:{__:o,nsCurrency:y,async selectCategories(){try{const s=await p("/api/categories",o("Limit Results By Categories"),this.categoryField.value);this.categoriesNames=s.labels,this.categoryField.value=s.values,this.loadReport()}catch{d.error(o("An error has occured while loading the categories")).subscribe()}},async selectUnits(){try{const s=await p("/api/units",o("Limit Results By Units"),this.unitField.value);this.unitsNames=s.labels,this.unitField.value=s.values,this.loadReport()}catch{d.error(o("An error has occured while loading the units")).subscribe()}},printSaleReport(){this.$htmlToPaper("report-printable")},loadReport(){if(this.startDateField.value===null||this.endDateField.value===null)return d.error(o("Unable to proceed. Select a correct time range.")).subscribe();const s=c(this.startDateField.value);if(c(this.endDateField.value).isBefore(s))return d.error(o("Unable to proceed. The current time range is not valid.")).subscribe();b.post("/api/reports/sold-stock-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,categories:this.categoryField.value,units:this.unitField.value}).subscribe({next:n=>{this.products=n},error:n=>{d.error(n.message).subscribe()}})}}},k={id:"report-section",class:"px-4"},C={class:"flex -mx-2"},R={class:"px-2"},N={class:"px-2"},S={class:"px-2"},U={class:"ns-button"},B=t("i",{class:"las la-sync-alt text-xl"},null,-1),Y={class:"pl-2"},M={class:"px-2"},T={class:"ns-button"},L=t("i",{class:"las la-print text-xl"},null,-1),P={class:"pl-2"},j={class:"px-2"},A={class:"ns-button"},H=t("i",{class:"las la-filter text-xl"},null,-1),Q={class:"pl-2"},V={class:"px-2"},q={class:"ns-button"},E=t("i",{class:"las la-filter text-xl"},null,-1),O={class:"pl-2"},z={id:"report-printable",class:"anim-duration-500 fade-in-entrance"},G={class:"flex w-full"},I={class:"my-4 flex justify-between w-full"},J={class:"text-secondary"},K={class:"pb-1 border-b border-dashed"},W={class:"pb-1 border-b border-dashed"},X={class:"pb-1 border-b border-dashed"},Z=["src","alt"],$={class:"rounded my-4"},tt={class:"ns-box shadow"},et={class:"border-b ns-box-body"},st={class:"table ns-table w-full"},rt={class:""},it={class:"border p-2 text-left"},at={width:"150",class:"text-right border p-2"},ot={width:"150",class:"text-right border p-2"},lt={width:"150",class:"text-right border p-2"},nt={width:"150",class:"text-right border p-2"},dt={class:""},ct={class:"p-2 border"},_t={class:"p-2 border text-right"},ut={class:"p-2 border text-right"},ht={class:"p-2 border text-right"},pt={class:"p-2 border text-right"},mt={class:"font-semibold"},bt=t("td",{colspan:"2",class:"p-2 border"},null,-1),xt={class:"p-2 border text-right"},ft={class:"p-2 border text-right"},yt={class:"p-2 border text-right"};function vt(s,i,n,gt,l,e){const h=g("ns-field");return _(),u("div",k,[t("div",C,[t("div",R,[m(h,{field:l.startDateField},null,8,["field"])]),t("div",N,[m(h,{field:l.endDateField},null,8,["field"])]),t("div",S,[t("div",U,[t("button",{onClick:i[0]||(i[0]=a=>e.loadReport()),class:"rounded flex justify-between shadow py-1 items-center text-primary px-2"},[B,t("span",Y,r(e.__("Load")),1)])])]),t("div",M,[t("div",T,[t("button",{onClick:i[1]||(i[1]=a=>e.printSaleReport()),class:"rounded flex justify-between shadow py-1 items-center text-primary px-2"},[L,t("span",P,r(e.__("Print")),1)])])]),t("div",j,[t("div",A,[t("button",{onClick:i[2]||(i[2]=a=>e.selectCategories()),class:"rounded flex justify-between shadow py-1 items-center text-primary px-2"},[H,t("span",Q,r(e.__("Categories"))+": "+r(l.categoriesNames||e.__("All Categories")),1)])])]),t("div",V,[t("div",q,[t("button",{onClick:i[3]||(i[3]=a=>e.selectUnits()),class:"rounded flex justify-between shadow py-1 items-center text-primary px-2"},[E,t("span",O,r(e.__("Units"))+": "+r(l.unitsNames||e.__("All Units")),1)])])])]),t("div",z,[t("div",G,[t("div",I,[t("div",J,[t("ul",null,[t("li",K,r(e.__("Range : {date1} — {date2}").replace("{date1}",l.startDateField.value).replace("{date2}",l.endDateField.value)),1),t("li",W,r(e.__("Document : Sold Stock Report")),1),t("li",X,r(e.__("By : {user}").replace("{user}",l.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:n.storeLogo,alt:n.storeName},null,8,Z)])])]),t("div",$,[t("div",tt,[t("div",et,[t("table",st,[t("thead",rt,[t("tr",null,[t("th",it,r(e.__("Product")),1),t("th",at,r(e.__("Unit")),1),t("th",ot,r(e.__("Quantity")),1),t("th",lt,r(e.__("Tax Value")),1),t("th",nt,r(e.__("Total")),1)])]),t("tbody",dt,[(_(!0),u(w,null,F(l.products,a=>(_(),u("tr",{key:a.id},[t("td",ct,r(a.name),1),t("td",_t,r(a.unit_name),1),t("td",ut,r(a.quantity),1),t("td",ht,r(e.nsCurrency(a.tax_value)),1),t("td",pt,r(e.nsCurrency(a.total_price)),1)]))),128))]),t("tfoot",mt,[t("tr",null,[bt,t("td",xt,r(e.totalQuantity),1),t("td",ft,r(e.nsCurrency(e.totalTaxes)),1),t("td",yt,r(e.nsCurrency(e.totalPrice)),1)])])])])])])])])}const Mt=v(D,[["render",vt]]);export{Mt as default}; diff --git a/public/build/assets/ns-yearly-report-14b5e6ca.js b/public/build/assets/ns-yearly-report-e9f907c8.js similarity index 99% rename from public/build/assets/ns-yearly-report-14b5e6ca.js rename to public/build/assets/ns-yearly-report-e9f907c8.js index b3dc93080..d5fc0c7ec 100644 --- a/public/build/assets/ns-yearly-report-14b5e6ca.js +++ b/public/build/assets/ns-yearly-report-e9f907c8.js @@ -1 +1 @@ -import{h as m,a as x,b as h,v as w}from"./bootstrap-8be442b1.js";import{c as k,e as v}from"./components-ef1ba55f.js";import{i as C,n as D}from"./ns-prompt-popup-100414c5.js";import{_ as p,n as R}from"./currency-f8bd78d1.js";import{_ as S}from"./_plugin-vue_export-helper-c27b6911.js";import{r as j,o,c as n,g as B,w as y,i as f,t as s,e as b,a as e,B as F,F as u,b as _}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";const N={name:"ns-yearly-report",props:["storeLogo","storeName"],mounted(){this.timezone!==""&&(this.year=ns.date.getMoment().format("Y"),this.loadReport())},components:{nsDatepicker:k,nsNotice:C,nsDateTimePicker:v},data(){return{startDate:m(),endDate:m(),report:{},timezone:ns.date.timeZone,year:"",ns:window.ns,labels:["month_paid_orders","month_taxes","month_expenses","month_income"]}},computed:{totalDebit(){return 0},totalCredit(){return 0}},methods:{__:p,nsCurrency:R,setStartDate(i){this.startDate=i.format()},setEndDate(i){this.endDate=i.format()},printSaleReport(){this.$htmlToPaper("annual-report")},sumOf(i){return Object.values(this.report).length>0?Object.values(this.report).map(d=>parseFloat(d[i])||0).reduce((d,a)=>d+a):0},recomputeForSpecificYear(){Popup.show(D,{title:p("Would you like to proceed ?"),message:p("The report will be computed for the current year, a job will be dispatched and you'll be informed once it's completed."),onAction:i=>{i&&x.post("/api/reports/compute/yearly",{year:this.year}).subscribe(d=>{h.success(d.message).subscribe()},d=>{h.success(d.message||p("An unexpected error has occurred.")).subscribe()})}})},getReportForMonth(i){return this.report[i]},loadReport(){const i=this.year;x.post("/api/reports/annual-report",{year:i}).subscribe(d=>{this.report=d},d=>{h.error(d.message).subscribe()})}}},T={class:"px-4"},z={key:1,class:"flex -mx-2"},O={class:"px-2"},P={class:"px-2 flex"},Y=e("i",{class:"las la-sync-alt text-xl"},null,-1),A={class:"pl-2"},M={class:"px-2 flex"},V=e("i",{class:"las la-print text-xl"},null,-1),E={class:"pl-2"},L={class:"px-2 flex"},J=e("i",{class:"las la-sync-alt text-xl"},null,-1),H={class:"pl-2"},U={key:2,id:"annual-report",class:"anim-duration-500 fade-in-entrance"},I={class:"flex w-full"},W={class:"my-4 flex justify-between w-full"},Z={class:"text-secondary"},q={class:"pb-1 border-b border-dashed"},G={class:"pb-1 border-b border-dashed"},K={class:"pb-1 border-b border-dashed"},Q=["src","alt"],X={class:"bg-box-background shadow rounded my-4 overflow-hidden"},$={class:"border-b border-box-edge overflow-auto"},ee={class:"table ns-table w-full"},te={class:""},re=e("th",{width:"100",class:"border p-2 text-left"},null,-1),se={width:"150",class:"border p-2 text-right"},le={width:"150",class:"border p-2 text-right"},oe={width:"150",class:"border p-2 text-right"},ne={width:"150",class:"border p-2 text-right"},ce={class:"border p-2 text-left"},de={class:"border p-2 text-left"},ue={class:"text-left border p-2"},_e={class:"text-left border p-2"},ie={class:"text-left border p-2"},ae={class:"text-left border p-2"},pe={class:"text-left border p-2"},he={class:"text-left border p-2"},be={class:"text-left border p-2"},me={class:"text-left border p-2"},xe={class:"text-left border p-2"},ye={class:"text-left border p-2"},fe={class:"text-left border p-2"};function ge(i,d,a,we,t,r){const g=j("ns-notice");return o(),n("div",T,[t.timezone===""?(o(),B(g,{key:0,color:"error"},{title:y(()=>[f(s(r.__("An Error Has Occured")),1)]),description:y(()=>[f(s(r.__("Unable to load the report as the timezone is not set on the settings.")),1)]),_:1})):b("",!0),t.timezone!==""?(o(),n("div",z,[e("div",O,[F(e("input",{type:"text","onUpdate:modelValue":d[0]||(d[0]=l=>t.year=l),placeholder:"{{ __( 'Year' ) }}",class:"outline-none rounded border-gray-400 border-2 focus:border-blue-400 p-2"},null,512),[[w,t.year]])]),e("div",P,[e("button",{onClick:d[1]||(d[1]=l=>r.loadReport()),class:"rounded flex justify-between bg-white shadow py-1 items-center text-gray-700 px-2"},[Y,e("span",A,s(r.__("Load")),1)])]),e("div",M,[e("button",{onClick:d[2]||(d[2]=l=>r.printSaleReport()),class:"rounded flex justify-between bg-white shadow py-1 items-center text-gray-700 px-2"},[V,e("span",E,s(r.__("Print")),1)])]),e("div",L,[e("button",{onClick:d[3]||(d[3]=l=>r.recomputeForSpecificYear()),class:"rounded flex justify-between bg-white shadow py-1 items-center text-gray-700 px-2"},[J,e("span",H,s(r.__("Recompute")),1)])])])):b("",!0),t.timezone!==""?(o(),n("div",U,[e("div",I,[e("div",W,[e("div",Z,[e("ul",null,[e("li",q,s(r.__("Date : {date}").replace("{date}",t.ns.date.current)),1),e("li",G,s(r.__("Document : Yearly Report")),1),e("li",K,s(r.__("By : {user}").replace("{user}",t.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:a.storeLogo,alt:a.storeName},null,8,Q)])])]),e("div",X,[e("div",$,[e("table",ee,[e("thead",te,[e("tr",null,[re,e("th",se,s(r.__("Sales")),1),e("th",le,s(r.__("Taxes")),1),e("th",oe,s(r.__("Expenses")),1),e("th",ne,s(r.__("Income")),1)])]),e("tbody",null,[e("tr",null,[e("td",ce,s(r.__("January")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[1]?t.report[1][l]:0)),1))),128))]),e("tr",null,[e("td",de,s(r.__("Febuary")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[2]?t.report[2][l]:0)),1))),128))]),e("tr",null,[e("td",ue,s(r.__("March")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[3]?t.report[3][l]:0)),1))),128))]),e("tr",null,[e("td",_e,s(r.__("April")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[4]?t.report[4][l]:0)),1))),128))]),e("tr",null,[e("td",ie,s(r.__("May")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[5]?t.report[5][l]:0)),1))),128))]),e("tr",null,[e("td",ae,s(r.__("June")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[6]?t.report[6][l]:0)),1))),128))]),e("tr",null,[e("td",pe,s(r.__("July")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[7]?t.report[7][l]:0)),1))),128))]),e("tr",null,[e("td",he,s(r.__("August")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[8]?t.report[8][l]:0)),1))),128))]),e("tr",null,[e("td",be,s(r.__("September")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[9]?t.report[9][l]:0)),1))),128))]),e("tr",null,[e("td",me,s(r.__("October")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[10]?t.report[10][l]:0)),1))),128))]),e("tr",null,[e("td",xe,s(r.__("November")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[11]?t.report[11][l]:0)),1))),128))]),e("tr",null,[e("td",ye,s(r.__("December")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[12]?t.report[12][l]:0)),1))),128))])]),e("tfoot",null,[e("tr",null,[e("td",fe,s(r.__("Total")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(r.sumOf(l))),1))),128))])])])])])])):b("",!0)])}const Ne=S(N,[["render",ge]]);export{Ne as default}; +import{h as m,a as x,b as h,v as w}from"./bootstrap-8be442b1.js";import{c as k,e as v}from"./components-50630f18.js";import{i as C,n as D}from"./ns-prompt-popup-100414c5.js";import{_ as p,n as R}from"./currency-f8bd78d1.js";import{_ as S}from"./_plugin-vue_export-helper-c27b6911.js";import{r as j,o,c as n,g as B,w as y,i as f,t as s,e as b,a as e,B as F,F as u,b as _}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";const N={name:"ns-yearly-report",props:["storeLogo","storeName"],mounted(){this.timezone!==""&&(this.year=ns.date.getMoment().format("Y"),this.loadReport())},components:{nsDatepicker:k,nsNotice:C,nsDateTimePicker:v},data(){return{startDate:m(),endDate:m(),report:{},timezone:ns.date.timeZone,year:"",ns:window.ns,labels:["month_paid_orders","month_taxes","month_expenses","month_income"]}},computed:{totalDebit(){return 0},totalCredit(){return 0}},methods:{__:p,nsCurrency:R,setStartDate(i){this.startDate=i.format()},setEndDate(i){this.endDate=i.format()},printSaleReport(){this.$htmlToPaper("annual-report")},sumOf(i){return Object.values(this.report).length>0?Object.values(this.report).map(d=>parseFloat(d[i])||0).reduce((d,a)=>d+a):0},recomputeForSpecificYear(){Popup.show(D,{title:p("Would you like to proceed ?"),message:p("The report will be computed for the current year, a job will be dispatched and you'll be informed once it's completed."),onAction:i=>{i&&x.post("/api/reports/compute/yearly",{year:this.year}).subscribe(d=>{h.success(d.message).subscribe()},d=>{h.success(d.message||p("An unexpected error has occurred.")).subscribe()})}})},getReportForMonth(i){return this.report[i]},loadReport(){const i=this.year;x.post("/api/reports/annual-report",{year:i}).subscribe(d=>{this.report=d},d=>{h.error(d.message).subscribe()})}}},T={class:"px-4"},z={key:1,class:"flex -mx-2"},O={class:"px-2"},P={class:"px-2 flex"},Y=e("i",{class:"las la-sync-alt text-xl"},null,-1),A={class:"pl-2"},M={class:"px-2 flex"},V=e("i",{class:"las la-print text-xl"},null,-1),E={class:"pl-2"},L={class:"px-2 flex"},J=e("i",{class:"las la-sync-alt text-xl"},null,-1),H={class:"pl-2"},U={key:2,id:"annual-report",class:"anim-duration-500 fade-in-entrance"},I={class:"flex w-full"},W={class:"my-4 flex justify-between w-full"},Z={class:"text-secondary"},q={class:"pb-1 border-b border-dashed"},G={class:"pb-1 border-b border-dashed"},K={class:"pb-1 border-b border-dashed"},Q=["src","alt"],X={class:"bg-box-background shadow rounded my-4 overflow-hidden"},$={class:"border-b border-box-edge overflow-auto"},ee={class:"table ns-table w-full"},te={class:""},re=e("th",{width:"100",class:"border p-2 text-left"},null,-1),se={width:"150",class:"border p-2 text-right"},le={width:"150",class:"border p-2 text-right"},oe={width:"150",class:"border p-2 text-right"},ne={width:"150",class:"border p-2 text-right"},ce={class:"border p-2 text-left"},de={class:"border p-2 text-left"},ue={class:"text-left border p-2"},_e={class:"text-left border p-2"},ie={class:"text-left border p-2"},ae={class:"text-left border p-2"},pe={class:"text-left border p-2"},he={class:"text-left border p-2"},be={class:"text-left border p-2"},me={class:"text-left border p-2"},xe={class:"text-left border p-2"},ye={class:"text-left border p-2"},fe={class:"text-left border p-2"};function ge(i,d,a,we,t,r){const g=j("ns-notice");return o(),n("div",T,[t.timezone===""?(o(),B(g,{key:0,color:"error"},{title:y(()=>[f(s(r.__("An Error Has Occured")),1)]),description:y(()=>[f(s(r.__("Unable to load the report as the timezone is not set on the settings.")),1)]),_:1})):b("",!0),t.timezone!==""?(o(),n("div",z,[e("div",O,[F(e("input",{type:"text","onUpdate:modelValue":d[0]||(d[0]=l=>t.year=l),placeholder:"{{ __( 'Year' ) }}",class:"outline-none rounded border-gray-400 border-2 focus:border-blue-400 p-2"},null,512),[[w,t.year]])]),e("div",P,[e("button",{onClick:d[1]||(d[1]=l=>r.loadReport()),class:"rounded flex justify-between bg-white shadow py-1 items-center text-gray-700 px-2"},[Y,e("span",A,s(r.__("Load")),1)])]),e("div",M,[e("button",{onClick:d[2]||(d[2]=l=>r.printSaleReport()),class:"rounded flex justify-between bg-white shadow py-1 items-center text-gray-700 px-2"},[V,e("span",E,s(r.__("Print")),1)])]),e("div",L,[e("button",{onClick:d[3]||(d[3]=l=>r.recomputeForSpecificYear()),class:"rounded flex justify-between bg-white shadow py-1 items-center text-gray-700 px-2"},[J,e("span",H,s(r.__("Recompute")),1)])])])):b("",!0),t.timezone!==""?(o(),n("div",U,[e("div",I,[e("div",W,[e("div",Z,[e("ul",null,[e("li",q,s(r.__("Date : {date}").replace("{date}",t.ns.date.current)),1),e("li",G,s(r.__("Document : Yearly Report")),1),e("li",K,s(r.__("By : {user}").replace("{user}",t.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:a.storeLogo,alt:a.storeName},null,8,Q)])])]),e("div",X,[e("div",$,[e("table",ee,[e("thead",te,[e("tr",null,[re,e("th",se,s(r.__("Sales")),1),e("th",le,s(r.__("Taxes")),1),e("th",oe,s(r.__("Expenses")),1),e("th",ne,s(r.__("Income")),1)])]),e("tbody",null,[e("tr",null,[e("td",ce,s(r.__("January")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[1]?t.report[1][l]:0)),1))),128))]),e("tr",null,[e("td",de,s(r.__("Febuary")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[2]?t.report[2][l]:0)),1))),128))]),e("tr",null,[e("td",ue,s(r.__("March")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[3]?t.report[3][l]:0)),1))),128))]),e("tr",null,[e("td",_e,s(r.__("April")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[4]?t.report[4][l]:0)),1))),128))]),e("tr",null,[e("td",ie,s(r.__("May")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[5]?t.report[5][l]:0)),1))),128))]),e("tr",null,[e("td",ae,s(r.__("June")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[6]?t.report[6][l]:0)),1))),128))]),e("tr",null,[e("td",pe,s(r.__("July")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[7]?t.report[7][l]:0)),1))),128))]),e("tr",null,[e("td",he,s(r.__("August")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[8]?t.report[8][l]:0)),1))),128))]),e("tr",null,[e("td",be,s(r.__("September")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[9]?t.report[9][l]:0)),1))),128))]),e("tr",null,[e("td",me,s(r.__("October")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[10]?t.report[10][l]:0)),1))),128))]),e("tr",null,[e("td",xe,s(r.__("November")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[11]?t.report[11][l]:0)),1))),128))]),e("tr",null,[e("td",ye,s(r.__("December")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(t.report[12]?t.report[12][l]:0)),1))),128))])]),e("tfoot",null,[e("tr",null,[e("td",fe,s(r.__("Total")),1),(o(!0),n(u,null,_(t.labels,(l,c)=>(o(),n("td",{key:c,class:"border p-2 text-right"},s(r.nsCurrency(r.sumOf(l))),1))),128))])])])])])])):b("",!0)])}const Ne=S(N,[["render",ge]]);export{Ne as default}; diff --git a/public/build/assets/popups-486ddd78.js b/public/build/assets/popups-6c3933d8.js similarity index 99% rename from public/build/assets/popups-486ddd78.js rename to public/build/assets/popups-6c3933d8.js index f41ff9ed3..1861b56a1 100644 --- a/public/build/assets/popups-486ddd78.js +++ b/public/build/assets/popups-6c3933d8.js @@ -1 +1 @@ -import{b as q,f as M}from"./components-ef1ba55f.js";import{b as v,P as U,d as g,a as T,c as F}from"./bootstrap-8be442b1.js";import O from"./ns-alert-popup-5493aad8.js";import{n as x,d as N,b as B,c as z}from"./ns-prompt-popup-100414c5.js";import{n as W,a as H}from"./ns-orders-preview-popup-5ba94079.js";import{n as D}from"./ns-procurement-quantity-ecf5ad70.js";import{_ as u,n as E}from"./currency-f8bd78d1.js";import"./index.es-25aa42ee.js";import{_ as j}from"./_plugin-vue_export-helper-c27b6911.js";import{r as p,o as d,c,F as P,a as e,t as a,f as h,n as k,b as A,g as S,w,e as f,i as L,s as R}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-avatar-image-35303576.js";const I={name:"ns-products-convertion",props:["popup","unitQuantity","product"],data(){return{unitQuantities:[],isLoading:!1,unitPair:{from:{unit:{},unitQuantity:{},selected:!0,quantity:0,realQuantity:0,fields:[{label:u("Assigned Unit"),name:"assigned_unit",value:"",type:"select",options:[]}]},to:{unit:{},unitQuantity:{},selected:!1,quantity:0,fields:[{label:u("Assigned Unit"),name:"assigned_unit",value:"",type:"select",options:[]}]}},selected:""}},mounted(){this.loadProductQuantities(),console.log(this)},methods:{__:u,async submitConvertion(){if(this.unitPair.from.quantity===0)return v.error(u("The quantity should be greater than 0")).subscribe();if(Math.floor(this.unitPair.to.quantity)===0)return v.error(u(`The provided quantity can't result in any convertion for unit "{destination}"`).replace("{destination}",this.unitPair.to.unit.name)).subscribe();if(this.unitPair.from.quantity!==this.unitPair.from.realQuantity)try{const i=await new Promise((t,s)=>{U.show(x,{title:u("Conversion Warning"),message:u("Only {quantity}({source}) can be converted to {destinationCount}({destination}). Would you like to proceed ?").replace("{quantity}",this.unitPair.from.realQuantity).replace("{destinationCount}",Math.floor(this.unitPair.to.quantity)).replace("{source}",this.unitPair.from.unit.name).replace("{destination}",this.unitPair.to.unit.name),onAction:l=>{l?t(!0):s(!1)}})});return this.proceedConversionSubmissions()}catch{return}try{const i=await new Promise((t,s)=>{U.show(x,{title:u("Confirm Conversion"),message:u("You're about to convert {quantity}({source}) to {destinationCount}({destination}). Would you like to proceed?").replace("{quantity}",this.unitPair.from.quantity).replace("{destinationCount}",Math.floor(this.unitPair.to.quantity)).replace("{source}",this.unitPair.from.unit.name).replace("{destination}",this.unitPair.to.unit.name),onAction:l=>{l?t(!0):s(!1)}})});return this.proceedConversionSubmissions()}catch{return}},proceedConversionSubmissions(){this.isLoading=!0,nsHttpClient.post(`/api/products/${this.unitQuantity.product_id}/units/conversion`,{from:this.unitPair.from.unit.id,to:this.unitPair.to.unit.id,quantity:this.unitPair.from.realQuantity}).subscribe({next:i=>(this.isLoading=!1,this.popup.close(),this.popup.params.resolve(i),g.success(u("Conversion Successful"),u("The product {product} has been converted successfully.").replace("{product}",this.product.name))),error:i=>(this.isLoading=!1,this.popup.params.reject(i),g.error(u("An error occured"),i.message||u("An error occured while converting the product {product}").replace("{product}",this.product.name)))})},handlePairUnitUpdated(i){const t=this.selectedUnitPair();t.unitQuantity=this.unitQuantities.filter(l=>l.unit.id===i.value)[0],t.unit=t.unitQuantity.unit,t.fields[0].value=i.value;const s=t===this.unitPair.from?this.unitPair.to:this.unitPair.from;s.unit.id===t.unit.id&&(s.unitQuantity=this.unitQuantities.filter(l=>l.unit.id!==t.unit.id)[0],s.unit=s.unitQuantity.unit,s.fields[0].value=s.unit.id),this.updateFromPairQuantity(this.unitPair.from.quantity)},updateFromPairQuantity(i){i.length===0&&(i=0),i>this.unitPair.from.unitQuantity.quantity&&(i=this.unitPair.from.unitQuantity.quantity,v.info(u("The quantity has been set to the maximum available")).subscribe()),this.unitPair.from.quantity=parseFloat(i);const t=this.unitQuantities.filter(o=>o.unit.base_unit)[0];if(t.length===0)return g.error(u("An error occured"),u("The product {product} has no base unit").replace("{product}",this.product.name));const l=this.unitPair.from.quantity*this.unitPair.from.unit.value*t.unit.value/this.unitPair.to.unit.value;this.unitPair.from.unit.values.unit.id===t.id)[0],this.unitPair.from.quantity=Math.floor(this.unitPair.to.quantity),this.unitPair.to.unit=i,this.unitPair.to.unitQuantity=this.unitQuantities.filter(s=>s.unit.id===i.id)[0],this.updateFromPairQuantity(this.unitPair.from.quantity)},selectedUnitPair(){return this.unitPair[this.unitPair.from.selected?"from":"to"]},setVisible(i,t){const s=t==="from"?"to":"from";i[t].selected=!0,i[s].selected=!1},loadProductQuantities(){nsHttpClient.get("/api/products/"+this.unitQuantity.product_id+"/units/quantities").subscribe({next:i=>{this.unitQuantities=i,this.unitPair.from.unit=this.unitQuantity.unit,this.unitPair.from.unitQuantity=this.unitQuantity,this.unitPair.from.fields[0].value=this.unitQuantity.unit.id,this.unitPair.from.fields[0].options=i.map(t=>({label:t.unit.name,value:t.unit.id})),this.unitPair.to.unit=i.filter(t=>t.unit.id!==this.unitQuantity.unit.id)[0].unit,this.unitPair.to.unitQuantity=i.filter(t=>t.unit.id!==this.unitQuantity.unit.id)[0],this.unitPair.to.fields[0].value=this.unitPair.to.unit.id,this.unitPair.to.fields[0].options=i.map(t=>({label:t.unit.name,value:t.unit.id}))}})}}},Y={class:"shadow-lg w-6/7-screen lg:w-3/5-screen ns-box overflow-hidden flex flex-col"},G={class:"p-2 border-b ns-box-header text-primary text-center font-medium flex justify-between items-center"},J={class:"relative"},K={class:"border-b border-box-edge"},X={class:"flex"},Z={class:"font-bold text-3xl"},$={class:"border-r border-box-edge relative"},tt=e("i",{class:"las la-exchange-alt text-3xl"},null,-1),it=[tt],et={class:"font-bold text-3xl"},nt={class:"p-2 border-b border-box-edge"},st={class:""},ot={key:0,class:"top-0 left-0 absolute h-full w-full flex items-center justify-center",style:{background:"rgb(121 121 121 / 20%)"}},rt={key:1,class:"flex items-center h-full justify-center"};function ut(i,t,s,l,o,n){const b=p("ns-close-button"),_=p("ns-field"),y=p("ns-numpad"),m=p("ns-spinner");return d(),c("div",Y,[o.unitQuantities.length>0?(d(),c(P,{key:0},[e("div",G,[e("div",null,a(n.__("Unit Conversion : {product}").replace("{product}",s.product.name)),1),e("div",null,[h(b,{onClick:t[0]||(t[0]=r=>s.popup.close())})])]),e("div",J,[e("div",K,[e("div",X,[e("div",{class:k(["p-2 w-full md:w-1/2 flex flex-col items-center justify-center",o.unitPair.from.selected?"bg-info-primary text-white":""]),onClick:t[1]||(t[1]=r=>n.setVisible(o.unitPair,"from"))},[e("span",null,a(o.unitPair.from.unit.name),1),e("h3",Z,a(o.unitPair.from.quantity),1)],2),e("div",$,[e("div",{class:"rounded-full h-12 w-12 flex items-center justify-center absolute shadow bg-input-button p-2",onClick:t[2]||(t[2]=r=>n.switchPair()),style:{position:"absolute",left:"-22px",top:"14px"}},it)]),e("div",{class:k(["p-2 w-full md:w-1/2 flex flex-col items-center justify-center",o.unitPair.to.selected?"bg-info-primary text-white":""]),onClick:t[3]||(t[3]=r=>n.setVisible(o.unitPair,"to"))},[e("span",null,a(o.unitPair.to.unit.name),1),e("h3",et,a(Math.floor(o.unitPair.to.quantity)),1)],2)])]),e("div",nt,[(d(!0),c(P,null,A(n.selectedUnitPair().fields,r=>(d(),S(_,{onChange:t[4]||(t[4]=C=>n.handlePairUnitUpdated(C)),field:r},null,8,["field"]))),256))]),e("div",st,[h(y,{onNext:t[6]||(t[6]=r=>n.submitConvertion()),value:o.unitPair.from.quantity,onChanged:t[7]||(t[7]=r=>n.updateFromPairQuantity(r))},{"numpad-footer":w(()=>[e("div",{onClick:t[5]||(t[5]=r=>n.updateFromPairQuantity(o.unitPair.from.unitQuantity.quantity)),class:"w-full ns-numpad-key h-24 font-bold flex items-center justify-center cursor-pointer col-span-3"},a(n.__("Convert {quantity} available").replace("{quantity}",o.unitPair.from.unitQuantity.quantity)),1)]),_:1},8,["value"])]),o.isLoading?(d(),c("div",ot,[h(m,{size:"24"})])):f("",!0)])],64)):f("",!0),o.unitQuantities.length===0?(d(),c("div",rt,[h(m)])):f("",!0)])}const at=j(I,[["render",ut]]),lt={name:"ns-products-preview",props:["popup","product"],computed:{product(){return this.popup.params.product}},methods:{__:u,nsCurrency:E,changeActiveTab(i){this.active=i,this.active==="units-quantities"&&this.loadProductQuantities()},loadProductQuantities(){console.log("is loadinfg"),this.hasLoadedUnitQuantities=!1,T.get(`/api/products/${this.product.id}/units/quantities`).subscribe({next:i=>{this.unitQuantities=i,this.hasLoadedUnitQuantities=!0}})},async convert(i,t){try{const s=await new Promise((l,o)=>{Popup.show(at,{unitQuantity:i,product:t,resolve:l,reject:o})});this.loadProductQuantities()}catch(s){console.log({exception:s})}}},data(){return{active:"units-quantities",unitQuantities:[],hasLoadedUnitQuantities:!1}},mounted(){this.loadProductQuantities()}},dt={class:"shadow-lg w-6/7-screen lg:w-3/5-screen h-6/7-screen lg:h-4/5-screen ns-box overflow-hidden flex flex-col"},ct={class:"p-2 border-b ns-box-header text-primary text-center font-medium flex justify-between items-center"},pt={class:"flex-auto overflow-y-auto ns-box-body"},ht={class:"p-2"},ft={key:0,class:"table ns-table w-full"},mt={class:"p-1 border"},Pt={width:"150",class:"text-right p-1 border"},bt={width:"150",class:"text-right p-1 border"},_t={width:"150",class:"text-right p-1 border"},yt={class:"p-1 border text-left"},vt=["onClick"],gt={class:"p-1 border text-right"},xt={class:"p-1 border text-right"},wt={class:"p-1 border text-right"};function Qt(i,t,s,l,o,n){const b=p("ns-close-button"),_=p("ns-spinner"),y=p("ns-tabs-item"),m=p("ns-tabs");return d(),c("div",dt,[e("div",ct,[e("div",null,a(n.__("Previewing :"))+" "+a(n.product.name),1),e("div",null,[h(b,{onClick:t[0]||(t[0]=r=>s.popup.close())})])]),e("div",pt,[e("div",ht,[h(m,{active:o.active,onActive:t[1]||(t[1]=r=>n.changeActiveTab(r))},{default:w(()=>[h(y,{label:n.__("Units & Quantities"),identifier:"units-quantities"},{default:w(()=>[o.hasLoadedUnitQuantities?(d(),c("table",ft,[e("thead",null,[e("tr",null,[e("th",mt,a(n.__("Unit")),1),e("th",Pt,a(n.__("Sale Price")),1),e("th",bt,a(n.__("Wholesale Price")),1),e("th",_t,a(n.__("Quantity")),1)])]),e("tbody",null,[(d(!0),c(P,null,A(o.unitQuantities,r=>(d(),c("tr",{key:r.id},[e("td",yt,[L(a(r.unit.name)+" ",1),n.product.rawType==="materialized"&&n.product.rawStockManagement==="enabled"?(d(),c(P,{key:0},[L(" — "),e("a",{onClick:C=>n.convert(r,n.product),class:"text-sm text-info-secondary hover:underline border-dashed",href:"javascript:void(0)"},a(n.__("Convert")),9,vt)],64)):f("",!0)]),e("td",gt,a(n.nsCurrency(r.sale_price)),1),e("td",xt,a(n.nsCurrency(r.wholesale_price)),1),e("td",wt,a(r.quantity),1)]))),128))])])):f("",!0),o.hasLoadedUnitQuantities?f("",!0):(d(),S(_,{key:1,size:"16",border:"4"}))]),_:1},8,["label"])]),_:1},8,["active"])])])])}const Ct=j(lt,[["render",Qt]]),V={nsOrderPreview:W,nsProductPreview:Ct,nsAlertPopup:O,nsConfirmPopup:x,nsPromptPopup:N,nsMediaPopup:M,nsProcurementQuantity:D,nsOrdersRefund:H,nsSelectPopup:B,nsPOSLoadingPopup:z};for(let i in V)window[i]=V[i];const Q=F({data(){return{popups:[],defaultClass:"absolute top-0 left-0 w-full h-full items-center flex overflow-y-auto justify-center is-popup"}},mounted(){nsState.subscribe(i=>{i.popups!==void 0&&(document.body.focus(),this.popups=R(i.popups),this.$forceUpdate())})},methods:{closePopup(i,t){console.log({popup:i,event:t}),Object.values(t.target.classList).includes("is-popup")&&i.config!==void 0&&[void 0,!0].includes(i.config.closeOnOverlayClick)&&(i.params&&i.params.reject?(i.params.reject(!1),t.stopPropagation()):(console.log("here"),i.close()))},preventPropagation(i){i.stopImmediatePropagation()}}});for(let i in q)Q.component(i,q[i]);document.addEventListener("DOMContentLoaded",()=>{Q.mount("#dashboard-popups"),window.nsPopups=Q}); +import{b as q,f as M}from"./components-50630f18.js";import{b as v,P as U,d as g,a as T,c as F}from"./bootstrap-8be442b1.js";import O from"./ns-alert-popup-5493aad8.js";import{n as x,d as N,b as B,c as z}from"./ns-prompt-popup-100414c5.js";import{n as W,a as H}from"./ns-orders-preview-popup-5ba94079.js";import{n as D}from"./ns-procurement-quantity-ecf5ad70.js";import{_ as u,n as E}from"./currency-f8bd78d1.js";import"./index.es-25aa42ee.js";import{_ as j}from"./_plugin-vue_export-helper-c27b6911.js";import{r as p,o as d,c,F as P,a as e,t as a,f as h,n as k,b as A,g as S,w,e as f,i as L,s as R}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-avatar-image-35303576.js";const I={name:"ns-products-convertion",props:["popup","unitQuantity","product"],data(){return{unitQuantities:[],isLoading:!1,unitPair:{from:{unit:{},unitQuantity:{},selected:!0,quantity:0,realQuantity:0,fields:[{label:u("Assigned Unit"),name:"assigned_unit",value:"",type:"select",options:[]}]},to:{unit:{},unitQuantity:{},selected:!1,quantity:0,fields:[{label:u("Assigned Unit"),name:"assigned_unit",value:"",type:"select",options:[]}]}},selected:""}},mounted(){this.loadProductQuantities(),console.log(this)},methods:{__:u,async submitConvertion(){if(this.unitPair.from.quantity===0)return v.error(u("The quantity should be greater than 0")).subscribe();if(Math.floor(this.unitPair.to.quantity)===0)return v.error(u(`The provided quantity can't result in any convertion for unit "{destination}"`).replace("{destination}",this.unitPair.to.unit.name)).subscribe();if(this.unitPair.from.quantity!==this.unitPair.from.realQuantity)try{const i=await new Promise((t,s)=>{U.show(x,{title:u("Conversion Warning"),message:u("Only {quantity}({source}) can be converted to {destinationCount}({destination}). Would you like to proceed ?").replace("{quantity}",this.unitPair.from.realQuantity).replace("{destinationCount}",Math.floor(this.unitPair.to.quantity)).replace("{source}",this.unitPair.from.unit.name).replace("{destination}",this.unitPair.to.unit.name),onAction:l=>{l?t(!0):s(!1)}})});return this.proceedConversionSubmissions()}catch{return}try{const i=await new Promise((t,s)=>{U.show(x,{title:u("Confirm Conversion"),message:u("You're about to convert {quantity}({source}) to {destinationCount}({destination}). Would you like to proceed?").replace("{quantity}",this.unitPair.from.quantity).replace("{destinationCount}",Math.floor(this.unitPair.to.quantity)).replace("{source}",this.unitPair.from.unit.name).replace("{destination}",this.unitPair.to.unit.name),onAction:l=>{l?t(!0):s(!1)}})});return this.proceedConversionSubmissions()}catch{return}},proceedConversionSubmissions(){this.isLoading=!0,nsHttpClient.post(`/api/products/${this.unitQuantity.product_id}/units/conversion`,{from:this.unitPair.from.unit.id,to:this.unitPair.to.unit.id,quantity:this.unitPair.from.realQuantity}).subscribe({next:i=>(this.isLoading=!1,this.popup.close(),this.popup.params.resolve(i),g.success(u("Conversion Successful"),u("The product {product} has been converted successfully.").replace("{product}",this.product.name))),error:i=>(this.isLoading=!1,this.popup.params.reject(i),g.error(u("An error occured"),i.message||u("An error occured while converting the product {product}").replace("{product}",this.product.name)))})},handlePairUnitUpdated(i){const t=this.selectedUnitPair();t.unitQuantity=this.unitQuantities.filter(l=>l.unit.id===i.value)[0],t.unit=t.unitQuantity.unit,t.fields[0].value=i.value;const s=t===this.unitPair.from?this.unitPair.to:this.unitPair.from;s.unit.id===t.unit.id&&(s.unitQuantity=this.unitQuantities.filter(l=>l.unit.id!==t.unit.id)[0],s.unit=s.unitQuantity.unit,s.fields[0].value=s.unit.id),this.updateFromPairQuantity(this.unitPair.from.quantity)},updateFromPairQuantity(i){i.length===0&&(i=0),i>this.unitPair.from.unitQuantity.quantity&&(i=this.unitPair.from.unitQuantity.quantity,v.info(u("The quantity has been set to the maximum available")).subscribe()),this.unitPair.from.quantity=parseFloat(i);const t=this.unitQuantities.filter(o=>o.unit.base_unit)[0];if(t.length===0)return g.error(u("An error occured"),u("The product {product} has no base unit").replace("{product}",this.product.name));const l=this.unitPair.from.quantity*this.unitPair.from.unit.value*t.unit.value/this.unitPair.to.unit.value;this.unitPair.from.unit.values.unit.id===t.id)[0],this.unitPair.from.quantity=Math.floor(this.unitPair.to.quantity),this.unitPair.to.unit=i,this.unitPair.to.unitQuantity=this.unitQuantities.filter(s=>s.unit.id===i.id)[0],this.updateFromPairQuantity(this.unitPair.from.quantity)},selectedUnitPair(){return this.unitPair[this.unitPair.from.selected?"from":"to"]},setVisible(i,t){const s=t==="from"?"to":"from";i[t].selected=!0,i[s].selected=!1},loadProductQuantities(){nsHttpClient.get("/api/products/"+this.unitQuantity.product_id+"/units/quantities").subscribe({next:i=>{this.unitQuantities=i,this.unitPair.from.unit=this.unitQuantity.unit,this.unitPair.from.unitQuantity=this.unitQuantity,this.unitPair.from.fields[0].value=this.unitQuantity.unit.id,this.unitPair.from.fields[0].options=i.map(t=>({label:t.unit.name,value:t.unit.id})),this.unitPair.to.unit=i.filter(t=>t.unit.id!==this.unitQuantity.unit.id)[0].unit,this.unitPair.to.unitQuantity=i.filter(t=>t.unit.id!==this.unitQuantity.unit.id)[0],this.unitPair.to.fields[0].value=this.unitPair.to.unit.id,this.unitPair.to.fields[0].options=i.map(t=>({label:t.unit.name,value:t.unit.id}))}})}}},Y={class:"shadow-lg w-6/7-screen lg:w-3/5-screen ns-box overflow-hidden flex flex-col"},G={class:"p-2 border-b ns-box-header text-primary text-center font-medium flex justify-between items-center"},J={class:"relative"},K={class:"border-b border-box-edge"},X={class:"flex"},Z={class:"font-bold text-3xl"},$={class:"border-r border-box-edge relative"},tt=e("i",{class:"las la-exchange-alt text-3xl"},null,-1),it=[tt],et={class:"font-bold text-3xl"},nt={class:"p-2 border-b border-box-edge"},st={class:""},ot={key:0,class:"top-0 left-0 absolute h-full w-full flex items-center justify-center",style:{background:"rgb(121 121 121 / 20%)"}},rt={key:1,class:"flex items-center h-full justify-center"};function ut(i,t,s,l,o,n){const b=p("ns-close-button"),_=p("ns-field"),y=p("ns-numpad"),m=p("ns-spinner");return d(),c("div",Y,[o.unitQuantities.length>0?(d(),c(P,{key:0},[e("div",G,[e("div",null,a(n.__("Unit Conversion : {product}").replace("{product}",s.product.name)),1),e("div",null,[h(b,{onClick:t[0]||(t[0]=r=>s.popup.close())})])]),e("div",J,[e("div",K,[e("div",X,[e("div",{class:k(["p-2 w-full md:w-1/2 flex flex-col items-center justify-center",o.unitPair.from.selected?"bg-info-primary text-white":""]),onClick:t[1]||(t[1]=r=>n.setVisible(o.unitPair,"from"))},[e("span",null,a(o.unitPair.from.unit.name),1),e("h3",Z,a(o.unitPair.from.quantity),1)],2),e("div",$,[e("div",{class:"rounded-full h-12 w-12 flex items-center justify-center absolute shadow bg-input-button p-2",onClick:t[2]||(t[2]=r=>n.switchPair()),style:{position:"absolute",left:"-22px",top:"14px"}},it)]),e("div",{class:k(["p-2 w-full md:w-1/2 flex flex-col items-center justify-center",o.unitPair.to.selected?"bg-info-primary text-white":""]),onClick:t[3]||(t[3]=r=>n.setVisible(o.unitPair,"to"))},[e("span",null,a(o.unitPair.to.unit.name),1),e("h3",et,a(Math.floor(o.unitPair.to.quantity)),1)],2)])]),e("div",nt,[(d(!0),c(P,null,A(n.selectedUnitPair().fields,r=>(d(),S(_,{onChange:t[4]||(t[4]=C=>n.handlePairUnitUpdated(C)),field:r},null,8,["field"]))),256))]),e("div",st,[h(y,{onNext:t[6]||(t[6]=r=>n.submitConvertion()),value:o.unitPair.from.quantity,onChanged:t[7]||(t[7]=r=>n.updateFromPairQuantity(r))},{"numpad-footer":w(()=>[e("div",{onClick:t[5]||(t[5]=r=>n.updateFromPairQuantity(o.unitPair.from.unitQuantity.quantity)),class:"w-full ns-numpad-key h-24 font-bold flex items-center justify-center cursor-pointer col-span-3"},a(n.__("Convert {quantity} available").replace("{quantity}",o.unitPair.from.unitQuantity.quantity)),1)]),_:1},8,["value"])]),o.isLoading?(d(),c("div",ot,[h(m,{size:"24"})])):f("",!0)])],64)):f("",!0),o.unitQuantities.length===0?(d(),c("div",rt,[h(m)])):f("",!0)])}const at=j(I,[["render",ut]]),lt={name:"ns-products-preview",props:["popup","product"],computed:{product(){return this.popup.params.product}},methods:{__:u,nsCurrency:E,changeActiveTab(i){this.active=i,this.active==="units-quantities"&&this.loadProductQuantities()},loadProductQuantities(){console.log("is loadinfg"),this.hasLoadedUnitQuantities=!1,T.get(`/api/products/${this.product.id}/units/quantities`).subscribe({next:i=>{this.unitQuantities=i,this.hasLoadedUnitQuantities=!0}})},async convert(i,t){try{const s=await new Promise((l,o)=>{Popup.show(at,{unitQuantity:i,product:t,resolve:l,reject:o})});this.loadProductQuantities()}catch(s){console.log({exception:s})}}},data(){return{active:"units-quantities",unitQuantities:[],hasLoadedUnitQuantities:!1}},mounted(){this.loadProductQuantities()}},dt={class:"shadow-lg w-6/7-screen lg:w-3/5-screen h-6/7-screen lg:h-4/5-screen ns-box overflow-hidden flex flex-col"},ct={class:"p-2 border-b ns-box-header text-primary text-center font-medium flex justify-between items-center"},pt={class:"flex-auto overflow-y-auto ns-box-body"},ht={class:"p-2"},ft={key:0,class:"table ns-table w-full"},mt={class:"p-1 border"},Pt={width:"150",class:"text-right p-1 border"},bt={width:"150",class:"text-right p-1 border"},_t={width:"150",class:"text-right p-1 border"},yt={class:"p-1 border text-left"},vt=["onClick"],gt={class:"p-1 border text-right"},xt={class:"p-1 border text-right"},wt={class:"p-1 border text-right"};function Qt(i,t,s,l,o,n){const b=p("ns-close-button"),_=p("ns-spinner"),y=p("ns-tabs-item"),m=p("ns-tabs");return d(),c("div",dt,[e("div",ct,[e("div",null,a(n.__("Previewing :"))+" "+a(n.product.name),1),e("div",null,[h(b,{onClick:t[0]||(t[0]=r=>s.popup.close())})])]),e("div",pt,[e("div",ht,[h(m,{active:o.active,onActive:t[1]||(t[1]=r=>n.changeActiveTab(r))},{default:w(()=>[h(y,{label:n.__("Units & Quantities"),identifier:"units-quantities"},{default:w(()=>[o.hasLoadedUnitQuantities?(d(),c("table",ft,[e("thead",null,[e("tr",null,[e("th",mt,a(n.__("Unit")),1),e("th",Pt,a(n.__("Sale Price")),1),e("th",bt,a(n.__("Wholesale Price")),1),e("th",_t,a(n.__("Quantity")),1)])]),e("tbody",null,[(d(!0),c(P,null,A(o.unitQuantities,r=>(d(),c("tr",{key:r.id},[e("td",yt,[L(a(r.unit.name)+" ",1),n.product.rawType==="materialized"&&n.product.rawStockManagement==="enabled"?(d(),c(P,{key:0},[L(" — "),e("a",{onClick:C=>n.convert(r,n.product),class:"text-sm text-info-secondary hover:underline border-dashed",href:"javascript:void(0)"},a(n.__("Convert")),9,vt)],64)):f("",!0)]),e("td",gt,a(n.nsCurrency(r.sale_price)),1),e("td",xt,a(n.nsCurrency(r.wholesale_price)),1),e("td",wt,a(r.quantity),1)]))),128))])])):f("",!0),o.hasLoadedUnitQuantities?f("",!0):(d(),S(_,{key:1,size:"16",border:"4"}))]),_:1},8,["label"])]),_:1},8,["active"])])])])}const Ct=j(lt,[["render",Qt]]),V={nsOrderPreview:W,nsProductPreview:Ct,nsAlertPopup:O,nsConfirmPopup:x,nsPromptPopup:N,nsMediaPopup:M,nsProcurementQuantity:D,nsOrdersRefund:H,nsSelectPopup:B,nsPOSLoadingPopup:z};for(let i in V)window[i]=V[i];const Q=F({data(){return{popups:[],defaultClass:"absolute top-0 left-0 w-full h-full items-center flex overflow-y-auto justify-center is-popup"}},mounted(){nsState.subscribe(i=>{i.popups!==void 0&&(document.body.focus(),this.popups=R(i.popups),this.$forceUpdate())})},methods:{closePopup(i,t){console.log({popup:i,event:t}),Object.values(t.target.classList).includes("is-popup")&&i.config!==void 0&&[void 0,!0].includes(i.config.closeOnOverlayClick)&&(i.params&&i.params.reject?(i.params.reject(!1),t.stopPropagation()):(console.log("here"),i.close()))},preventPropagation(i){i.stopImmediatePropagation()}}});for(let i in q)Q.component(i,q[i]);document.addEventListener("DOMContentLoaded",()=>{Q.mount("#dashboard-popups"),window.nsPopups=Q}); diff --git a/public/build/assets/pos-5aad06e1.js b/public/build/assets/pos-3058282d.js similarity index 96% rename from public/build/assets/pos-5aad06e1.js rename to public/build/assets/pos-3058282d.js index 28d017759..8fcbc4a78 100644 --- a/public/build/assets/pos-5aad06e1.js +++ b/public/build/assets/pos-3058282d.js @@ -1 +1 @@ -import{_ as m}from"./preload-helper-41c905a7.js";import"./time-ccbcc647.js";import{b as t}from"./components-ef1ba55f.js";import{c as n}from"./bootstrap-8be442b1.js";import{N as i}from"./ns-hotpress-fbaed768.js";import{d as p}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";window.nsComponents={...t};window.nsHotPress=new i;const o=n({mounted(){}});o.component("nsPos",p(()=>m(()=>import("./ns-pos-982621e4.js"),["./ns-pos-982621e4.js","./ns-pos-cart-64fbf2af.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./pos-section-switch-0869c4e1.js","./ns-pos-order-type-popup-5204386b.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./ns-orders-preview-popup-5ba94079.js","./index.es-25aa42ee.js","./ns-pos-shipping-popup-acf8319e.js","./ns-pos-grid-0d26a576.js"],import.meta.url)));o.component("nsPosCart",p(()=>m(()=>import("./ns-pos-cart-64fbf2af.js"),["./ns-pos-cart-64fbf2af.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./pos-section-switch-0869c4e1.js","./ns-pos-order-type-popup-5204386b.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./ns-orders-preview-popup-5ba94079.js","./index.es-25aa42ee.js","./ns-pos-shipping-popup-acf8319e.js"],import.meta.url)));o.component("nsPosGrid",p(()=>m(()=>import("./ns-pos-grid-0d26a576.js"),["./ns-pos-grid-0d26a576.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./pos-section-switch-0869c4e1.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css"],import.meta.url)));for(let r in t)o.component(r,t[r]);o.mount("#pos-app");window.posApp=o; +import{_ as m}from"./preload-helper-41c905a7.js";import"./time-ccbcc647.js";import{b as t}from"./components-50630f18.js";import{c as n}from"./bootstrap-8be442b1.js";import{N as i}from"./ns-hotpress-fbaed768.js";import{d as p}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";window.nsComponents={...t};window.nsHotPress=new i;const o=n({mounted(){}});o.component("nsPos",p(()=>m(()=>import("./ns-pos-982621e4.js"),["./ns-pos-982621e4.js","./ns-pos-cart-64fbf2af.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./pos-section-switch-0869c4e1.js","./ns-pos-order-type-popup-5204386b.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./ns-orders-preview-popup-5ba94079.js","./index.es-25aa42ee.js","./ns-pos-shipping-popup-acf8319e.js","./ns-pos-grid-0d26a576.js"],import.meta.url)));o.component("nsPosCart",p(()=>m(()=>import("./ns-pos-cart-64fbf2af.js"),["./ns-pos-cart-64fbf2af.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./pos-section-switch-0869c4e1.js","./ns-pos-order-type-popup-5204386b.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./ns-orders-preview-popup-5ba94079.js","./index.es-25aa42ee.js","./ns-pos-shipping-popup-acf8319e.js"],import.meta.url)));o.component("nsPosGrid",p(()=>m(()=>import("./ns-pos-grid-0d26a576.js"),["./ns-pos-grid-0d26a576.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./pos-section-switch-0869c4e1.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css"],import.meta.url)));for(let r in t)o.component(r,t[r]);o.mount("#pos-app");window.posApp=o; diff --git a/public/build/assets/setup-11814a54.js b/public/build/assets/setup-8d3f4e27.js similarity index 95% rename from public/build/assets/setup-11814a54.js rename to public/build/assets/setup-8d3f4e27.js index 5be8559dc..9365b300b 100644 --- a/public/build/assets/setup-11814a54.js +++ b/public/build/assets/setup-8d3f4e27.js @@ -1 +1 @@ -import{_ as o}from"./preload-helper-41c905a7.js";import{b as e}from"./components-ef1ba55f.js";import{c as p,a as n}from"./vue-router-fe7700e6.js";import{c as i}from"./bootstrap-8be442b1.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./runtime-core.esm-bundler-b48de70a.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const a=()=>o(()=>import("./welcome-892dd819.js"),["./welcome-892dd819.js","./currency-f8bd78d1.js","./_plugin-vue_export-helper-c27b6911.js","./runtime-core.esm-bundler-b48de70a.js"],import.meta.url),s=()=>o(()=>import("./database-7955ce82.js"),["./database-7955ce82.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url),_=()=>o(()=>import("./setup-configuration-4eddae61.js"),["./setup-configuration-4eddae61.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url),c=[{path:"/",component:a},{path:"/database",component:s},{path:"/configuration",component:_}],m=p({routes:c,history:n()}),t=i({});t.use(m);for(let r in e)t.component(r,e[r]);t.mount("#nexopos-setup");window.nsRouter=m; +import{_ as o}from"./preload-helper-41c905a7.js";import{b as e}from"./components-50630f18.js";import{c as p,a as n}from"./vue-router-fe7700e6.js";import{c as i}from"./bootstrap-8be442b1.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./runtime-core.esm-bundler-b48de70a.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const a=()=>o(()=>import("./welcome-892dd819.js"),["./welcome-892dd819.js","./currency-f8bd78d1.js","./_plugin-vue_export-helper-c27b6911.js","./runtime-core.esm-bundler-b48de70a.js"],import.meta.url),s=()=>o(()=>import("./database-7955ce82.js"),["./database-7955ce82.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url),_=()=>o(()=>import("./setup-configuration-4eddae61.js"),["./setup-configuration-4eddae61.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url),c=[{path:"/",component:a},{path:"/database",component:s},{path:"/configuration",component:_}],m=p({routes:c,history:n()}),t=i({});t.use(m);for(let r in e)t.component(r,e[r]);t.mount("#nexopos-setup");window.nsRouter=m; diff --git a/public/build/assets/update-e4fa2b1a.js b/public/build/assets/update-fba879ad.js similarity index 98% rename from public/build/assets/update-e4fa2b1a.js rename to public/build/assets/update-fba879ad.js index 0c2040b04..9b5d85d63 100644 --- a/public/build/assets/update-e4fa2b1a.js +++ b/public/build/assets/update-fba879ad.js @@ -1 +1 @@ -import{b as g}from"./components-ef1ba55f.js";import{a as u,b as h,c as x}from"./bootstrap-8be442b1.js";import{_}from"./currency-f8bd78d1.js";import{_ as b}from"./_plugin-vue_export-helper-c27b6911.js";import{r as y,o as a,c,a as e,t,e as i,g as m,w as f}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const w={name:"ns-database-update",data(){return{files:Update.files,returnLink:Update.returnLink,modules:Update.modules,updating:!1,xXsrfToken:null,updatingModule:!1,error:!1,lastErrorMessage:"",index:0}},computed:{totalModules(){return Object.values(this.modules).length}},mounted(){u.get("/sanctum/csrf-cookie").subscribe(r=>{try{this.xXsrfToken=u.response.config.headers["X-XSRF-TOKEN"],this.proceedUpdate()}catch(o){h.error(o.message).subscribe()}})},methods:{__:_,async proceedUpdate(){this.updating=!0;for(let r in this.files)try{this.index=parseInt(r)+1;const o=await new Promise((d,l)=>{u.post("/api/update",{file:this.files[r]},{headers:{"X-XSRF-TOKEN":this.xXsrfToken}}).subscribe({next:d,error:l})})}catch(o){return this.updating=!1,this.error=!0,this.lastErrorMessage=o.message||_("An unexpected error occurred"),h.error(o.message).subscribe()}if(this.index=0,Object.values(this.modules).length>0){this.updatingModule=!0;let r=0;for(let o in this.modules)try{r+=1,this.index=r;const d=await new Promise((l,s)=>{u.post("/api/update",{module:this.modules[o]},{headers:{"X-XSRF-TOKEN":this.xXsrfToken}}).subscribe({next:l,error:s})})}catch(d){return this.updating=!1,this.error=!0,this.lastErrorMessage=d.message||_("An unexpected error occurred"),h.error(d.message).subscribe()}}this.error=!1,this.updating=!1,document.location=this.returnLink}}},k={class:"container mx-auto flex-auto items-center justify-center flex"},v={id:"database-update",class:"w-full md:w-2/3 lg:w-1/3"},U=e("div",{class:"flex justify-center items-center py-6"},[e("img",{class:"w-32",src:"/svg/nexopos-variant-1.svg",alt:"NexoPOS"})],-1),M={class:"my-3 rounded shadow ns-box"},X={class:"border-b ns-box-header py-4 flex items-center justify-center"},E={class:"text-xl font-bold"},T={class:"p-2 ns-box-body"},j={class:"text-center text-sm py-4"},N={key:0,class:"border-l-4 text-sm ns-notice error p-4"},O={class:"rounded whitespace-pre-wrap my-2 p-2"},S={class:"border-t ns-box-footer p-2 flex justify-between"},C=e("i",{class:"las la-sync"},null,-1),B={class:"ml-1"},L={class:"flex"},P=e("i",{class:"las la-sync animate-spin"},null,-1),A={key:0},R={key:1,class:"mr-1"},D={key:2},F={key:3,class:"mr-1"},I=e("i",{class:"las la-undo"},null,-1),K={class:"ml-1"};function H(r,o,d,l,s,n){const p=y("ns-button");return a(),c("div",k,[e("div",v,[U,e("div",M,[e("div",X,[e("h3",E,t(n.__("Database Update")),1)]),e("div",T,[e("p",j,t(n.__("In order to keep NexoPOS running smoothly with updates, we need to proceed to the database migration. In fact you don't need to do any action, just wait until the process is done and you'll be redirected.")),1),s.error?(a(),c("div",N,[e("p",null,t(n.__("Looks like an error has occurred during the update. Usually, giving another shot should fix that. However, if you still don't get any chance."))+" "+t(n.__("Please report this message to the support : ")),1),e("pre",O,t(s.lastErrorMessage),1)])):i("",!0)]),e("div",S,[e("div",null,[s.error?(a(),m(p,{key:0,onClick:o[0]||(o[0]=q=>n.proceedUpdate()),type:"error",class:"rounded shadow-inner"},{default:f(()=>[C,e("span",B,t(n.__("Try Again")),1)]),_:1})):i("",!0)]),e("div",L,[s.updating?(a(),m(p,{key:0,type:"info",class:"rounded shadow-inner"},{default:f(()=>[P,s.updatingModule?i("",!0):(a(),c("span",A,t(n.__("Updating"))+"...",1)),s.updatingModule?i("",!0):(a(),c("span",R,t(s.index)+"/"+t(s.files.length),1)),s.updatingModule?(a(),c("span",D,t(n.__("Updating Modules"))+"...",1)):i("",!0),s.updatingModule?(a(),c("span",F,t(s.index)+"/"+t(n.totalModules),1)):i("",!0)]),_:1})):i("",!0),s.updating?i("",!0):(a(),m(p,{key:1,type:"info",href:s.returnLink,class:"rounded shadow-inner"},{default:f(()=>[I,e("span",K,t(n.__("Return")),1)]),_:1},8,["href"]))])])])])])}const V=b(w,[["render",H]]);window.nsUpdate=x({components:{nsDatabaseUpdate:V}});for(let r in g)window.nsUpdate.component(r,g[r]);window.nsUpdate.mount("#main-container"); +import{b as g}from"./components-50630f18.js";import{a as u,b as h,c as x}from"./bootstrap-8be442b1.js";import{_}from"./currency-f8bd78d1.js";import{_ as b}from"./_plugin-vue_export-helper-c27b6911.js";import{r as y,o as a,c,a as e,t,e as i,g as m,w as f}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const w={name:"ns-database-update",data(){return{files:Update.files,returnLink:Update.returnLink,modules:Update.modules,updating:!1,xXsrfToken:null,updatingModule:!1,error:!1,lastErrorMessage:"",index:0}},computed:{totalModules(){return Object.values(this.modules).length}},mounted(){u.get("/sanctum/csrf-cookie").subscribe(r=>{try{this.xXsrfToken=u.response.config.headers["X-XSRF-TOKEN"],this.proceedUpdate()}catch(o){h.error(o.message).subscribe()}})},methods:{__:_,async proceedUpdate(){this.updating=!0;for(let r in this.files)try{this.index=parseInt(r)+1;const o=await new Promise((d,l)=>{u.post("/api/update",{file:this.files[r]},{headers:{"X-XSRF-TOKEN":this.xXsrfToken}}).subscribe({next:d,error:l})})}catch(o){return this.updating=!1,this.error=!0,this.lastErrorMessage=o.message||_("An unexpected error occurred"),h.error(o.message).subscribe()}if(this.index=0,Object.values(this.modules).length>0){this.updatingModule=!0;let r=0;for(let o in this.modules)try{r+=1,this.index=r;const d=await new Promise((l,s)=>{u.post("/api/update",{module:this.modules[o]},{headers:{"X-XSRF-TOKEN":this.xXsrfToken}}).subscribe({next:l,error:s})})}catch(d){return this.updating=!1,this.error=!0,this.lastErrorMessage=d.message||_("An unexpected error occurred"),h.error(d.message).subscribe()}}this.error=!1,this.updating=!1,document.location=this.returnLink}}},k={class:"container mx-auto flex-auto items-center justify-center flex"},v={id:"database-update",class:"w-full md:w-2/3 lg:w-1/3"},U=e("div",{class:"flex justify-center items-center py-6"},[e("img",{class:"w-32",src:"/svg/nexopos-variant-1.svg",alt:"NexoPOS"})],-1),M={class:"my-3 rounded shadow ns-box"},X={class:"border-b ns-box-header py-4 flex items-center justify-center"},E={class:"text-xl font-bold"},T={class:"p-2 ns-box-body"},j={class:"text-center text-sm py-4"},N={key:0,class:"border-l-4 text-sm ns-notice error p-4"},O={class:"rounded whitespace-pre-wrap my-2 p-2"},S={class:"border-t ns-box-footer p-2 flex justify-between"},C=e("i",{class:"las la-sync"},null,-1),B={class:"ml-1"},L={class:"flex"},P=e("i",{class:"las la-sync animate-spin"},null,-1),A={key:0},R={key:1,class:"mr-1"},D={key:2},F={key:3,class:"mr-1"},I=e("i",{class:"las la-undo"},null,-1),K={class:"ml-1"};function H(r,o,d,l,s,n){const p=y("ns-button");return a(),c("div",k,[e("div",v,[U,e("div",M,[e("div",X,[e("h3",E,t(n.__("Database Update")),1)]),e("div",T,[e("p",j,t(n.__("In order to keep NexoPOS running smoothly with updates, we need to proceed to the database migration. In fact you don't need to do any action, just wait until the process is done and you'll be redirected.")),1),s.error?(a(),c("div",N,[e("p",null,t(n.__("Looks like an error has occurred during the update. Usually, giving another shot should fix that. However, if you still don't get any chance."))+" "+t(n.__("Please report this message to the support : ")),1),e("pre",O,t(s.lastErrorMessage),1)])):i("",!0)]),e("div",S,[e("div",null,[s.error?(a(),m(p,{key:0,onClick:o[0]||(o[0]=q=>n.proceedUpdate()),type:"error",class:"rounded shadow-inner"},{default:f(()=>[C,e("span",B,t(n.__("Try Again")),1)]),_:1})):i("",!0)]),e("div",L,[s.updating?(a(),m(p,{key:0,type:"info",class:"rounded shadow-inner"},{default:f(()=>[P,s.updatingModule?i("",!0):(a(),c("span",A,t(n.__("Updating"))+"...",1)),s.updatingModule?i("",!0):(a(),c("span",R,t(s.index)+"/"+t(s.files.length),1)),s.updatingModule?(a(),c("span",D,t(n.__("Updating Modules"))+"...",1)):i("",!0),s.updatingModule?(a(),c("span",F,t(s.index)+"/"+t(n.totalModules),1)):i("",!0)]),_:1})):i("",!0),s.updating?i("",!0):(a(),m(p,{key:1,type:"info",href:s.returnLink,class:"rounded shadow-inner"},{default:f(()=>[I,e("span",K,t(n.__("Return")),1)]),_:1},8,["href"]))])])])])])}const V=b(w,[["render",H]]);window.nsUpdate=x({components:{nsDatabaseUpdate:V}});for(let r in g)window.nsUpdate.component(r,g[r]);window.nsUpdate.mount("#main-container"); diff --git a/public/build/manifest.json b/public/build/manifest.json index df01f1b50..b2e265ccf 100644 --- a/public/build/manifest.json +++ b/public/build/manifest.json @@ -2,8 +2,8 @@ "__plugin-vue_export-helper-c27b6911.js": { "file": "assets/_plugin-vue_export-helper-c27b6911.js" }, - "_components-ef1ba55f.js": { - "file": "assets/components-ef1ba55f.js", + "_components-50630f18.js": { + "file": "assets/components-50630f18.js", "imports": [ "resources/ts/popups/ns-alert-popup.vue", "_currency-f8bd78d1.js", @@ -253,7 +253,7 @@ "resources/ts/pages/dashboard/procurements/manage-products.vue", "resources/ts/pages/dashboard/procurements/ns-procurement-invoice.vue", "resources/ts/pages/dashboard/ns-notifications.vue", - "_components-ef1ba55f.js", + "_components-50630f18.js", "resources/ts/pages/dashboard/transactions/ns-transaction.vue", "resources/ts/pages/dashboard/home/ns-dashboard.vue", "resources/ts/pages/dashboard/reports/ns-low-stock-report.vue", @@ -271,11 +271,11 @@ "resources/ts/pages/dashboard/products/ns-print-label.vue", "resources/ts/pages/dashboard/profile/ns-token.vue" ], - "file": "assets/app-2f0e443c.js", + "file": "assets/app-7b31b481.js", "imports": [ "_preload-helper-41c905a7.js", "_time-ccbcc647.js", - "_components-ef1ba55f.js", + "_components-50630f18.js", "resources/ts/bootstrap.ts", "_ns-hotpress-fbaed768.js", "_runtime-core.esm-bundler-b48de70a.js", @@ -296,10 +296,10 @@ "resources/ts/pages/auth/ns-password-lost.vue", "resources/ts/pages/auth/ns-new-password.vue" ], - "file": "assets/auth-415a13f9.js", + "file": "assets/auth-85852227.js", "imports": [ "_preload-helper-41c905a7.js", - "_components-ef1ba55f.js", + "_components-50630f18.js", "_ns-hotpress-fbaed768.js", "resources/ts/bootstrap.ts", "_runtime-core.esm-bundler-b48de70a.js", @@ -343,9 +343,9 @@ "src": "resources/ts/dashboard.ts" }, "resources/ts/dev.ts": { - "file": "assets/dev-0f5ad8b1.js", + "file": "assets/dev-c3d47426.js", "imports": [ - "_components-ef1ba55f.js", + "_components-50630f18.js", "resources/ts/bootstrap.ts", "_vue-router-fe7700e6.js", "__plugin-vue_export-helper-c27b6911.js", @@ -445,12 +445,12 @@ "src": "resources/ts/pages/dashboard/modules.vue" }, "resources/ts/pages/dashboard/ns-notifications.vue": { - "file": "assets/ns-notifications-39f1777d.js", + "file": "assets/ns-notifications-ce6033c8.js", "imports": [ "resources/ts/bootstrap.ts", "_currency-f8bd78d1.js", "_ns-prompt-popup-100414c5.js", - "_components-ef1ba55f.js", + "_components-50630f18.js", "__plugin-vue_export-helper-c27b6911.js", "_runtime-core.esm-bundler-b48de70a.js", "resources/ts/popups/ns-alert-popup.vue", @@ -472,11 +472,11 @@ "src": "resources/ts/pages/dashboard/ns-permissions.vue" }, "resources/ts/pages/dashboard/ns-settings.vue": { - "file": "assets/ns-settings-a4c45132.js", + "file": "assets/ns-settings-f7f35eda.js", "imports": [ "_currency-f8bd78d1.js", "resources/ts/bootstrap.ts", - "_components-ef1ba55f.js", + "_components-50630f18.js", "_runtime-core.esm-bundler-b48de70a.js", "__plugin-vue_export-helper-c27b6911.js", "resources/ts/popups/ns-alert-popup.vue", @@ -694,10 +694,10 @@ "src": "resources/ts/pages/dashboard/profile/ns-token.vue" }, "resources/ts/pages/dashboard/reports/ns-best-products-report.vue": { - "file": "assets/ns-best-products-report-9979457f.js", + "file": "assets/ns-best-products-report-a3c9ec80.js", "imports": [ "resources/ts/bootstrap.ts", - "_components-ef1ba55f.js", + "_components-50630f18.js", "_currency-f8bd78d1.js", "__plugin-vue_export-helper-c27b6911.js", "_runtime-core.esm-bundler-b48de70a.js", @@ -710,10 +710,10 @@ "src": "resources/ts/pages/dashboard/reports/ns-best-products-report.vue" }, "resources/ts/pages/dashboard/reports/ns-cash-flow-report.vue": { - "file": "assets/ns-cash-flow-report-d8680316.js", + "file": "assets/ns-cash-flow-report-7c9dff88.js", "imports": [ "resources/ts/bootstrap.ts", - "_components-ef1ba55f.js", + "_components-50630f18.js", "_currency-f8bd78d1.js", "__plugin-vue_export-helper-c27b6911.js", "_runtime-core.esm-bundler-b48de70a.js", @@ -736,10 +736,10 @@ "src": "resources/ts/pages/dashboard/reports/ns-customers-statement-report.vue" }, "resources/ts/pages/dashboard/reports/ns-low-stock-report.vue": { - "file": "assets/ns-low-stock-report-585a8342.js", + "file": "assets/ns-low-stock-report-2d8101fa.js", "imports": [ "resources/ts/bootstrap.ts", - "_components-ef1ba55f.js", + "_components-50630f18.js", "_currency-f8bd78d1.js", "_ns-prompt-popup-100414c5.js", "_join-array-4b30b096.js", @@ -753,10 +753,10 @@ "src": "resources/ts/pages/dashboard/reports/ns-low-stock-report.vue" }, "resources/ts/pages/dashboard/reports/ns-payment-types-report.vue": { - "file": "assets/ns-payment-types-report-3fa90e99.js", + "file": "assets/ns-payment-types-report-9807dea4.js", "imports": [ "resources/ts/bootstrap.ts", - "_components-ef1ba55f.js", + "_components-50630f18.js", "_currency-f8bd78d1.js", "__plugin-vue_export-helper-c27b6911.js", "_runtime-core.esm-bundler-b48de70a.js", @@ -769,10 +769,10 @@ "src": "resources/ts/pages/dashboard/reports/ns-payment-types-report.vue" }, "resources/ts/pages/dashboard/reports/ns-profit-report.vue": { - "file": "assets/ns-profit-report-a9e68261.js", + "file": "assets/ns-profit-report-f2ead29c.js", "imports": [ "resources/ts/bootstrap.ts", - "_components-ef1ba55f.js", + "_components-50630f18.js", "_currency-f8bd78d1.js", "_select-api-entities-c72f4497.js", "__plugin-vue_export-helper-c27b6911.js", @@ -787,10 +787,10 @@ "src": "resources/ts/pages/dashboard/reports/ns-profit-report.vue" }, "resources/ts/pages/dashboard/reports/ns-sale-report.vue": { - "file": "assets/ns-sale-report-41e30de6.js", + "file": "assets/ns-sale-report-5b586d47.js", "imports": [ "resources/ts/bootstrap.ts", - "_components-ef1ba55f.js", + "_components-50630f18.js", "_currency-f8bd78d1.js", "_ns-prompt-popup-100414c5.js", "_join-array-4b30b096.js", @@ -804,10 +804,10 @@ "src": "resources/ts/pages/dashboard/reports/ns-sale-report.vue" }, "resources/ts/pages/dashboard/reports/ns-sold-stock-report.vue": { - "file": "assets/ns-sold-stock-report-f37081a1.js", + "file": "assets/ns-sold-stock-report-177054bb.js", "imports": [ "resources/ts/bootstrap.ts", - "_components-ef1ba55f.js", + "_components-50630f18.js", "_currency-f8bd78d1.js", "_select-api-entities-c72f4497.js", "__plugin-vue_export-helper-c27b6911.js", @@ -836,10 +836,10 @@ "src": "resources/ts/pages/dashboard/reports/ns-stock-combined-report.vue" }, "resources/ts/pages/dashboard/reports/ns-yearly-report.vue": { - "file": "assets/ns-yearly-report-14b5e6ca.js", + "file": "assets/ns-yearly-report-e9f907c8.js", "imports": [ "resources/ts/bootstrap.ts", - "_components-ef1ba55f.js", + "_components-50630f18.js", "_ns-prompt-popup-100414c5.js", "_currency-f8bd78d1.js", "__plugin-vue_export-helper-c27b6911.js", @@ -920,9 +920,9 @@ "src": "resources/ts/pages/setup/welcome.vue" }, "resources/ts/popups.ts": { - "file": "assets/popups-486ddd78.js", + "file": "assets/popups-6c3933d8.js", "imports": [ - "_components-ef1ba55f.js", + "_components-50630f18.js", "resources/ts/bootstrap.ts", "resources/ts/popups/ns-alert-popup.vue", "_ns-prompt-popup-100414c5.js", @@ -1005,11 +1005,11 @@ "resources/ts/pages/dashboard/pos/ns-pos-cart.vue", "resources/ts/pages/dashboard/pos/ns-pos-grid.vue" ], - "file": "assets/pos-5aad06e1.js", + "file": "assets/pos-3058282d.js", "imports": [ "_preload-helper-41c905a7.js", "_time-ccbcc647.js", - "_components-ef1ba55f.js", + "_components-50630f18.js", "resources/ts/bootstrap.ts", "_ns-hotpress-fbaed768.js", "_runtime-core.esm-bundler-b48de70a.js", @@ -1029,10 +1029,10 @@ "resources/ts/pages/setup/database.vue", "resources/ts/pages/setup/setup-configuration.vue" ], - "file": "assets/setup-11814a54.js", + "file": "assets/setup-8d3f4e27.js", "imports": [ "_preload-helper-41c905a7.js", - "_components-ef1ba55f.js", + "_components-50630f18.js", "_vue-router-fe7700e6.js", "resources/ts/bootstrap.ts", "resources/ts/popups/ns-alert-popup.vue", @@ -1047,9 +1047,9 @@ "src": "resources/ts/setup.ts" }, "resources/ts/update.ts": { - "file": "assets/update-e4fa2b1a.js", + "file": "assets/update-fba879ad.js", "imports": [ - "_components-ef1ba55f.js", + "_components-50630f18.js", "resources/ts/bootstrap.ts", "_currency-f8bd78d1.js", "__plugin-vue_export-helper-c27b6911.js", diff --git a/resources/ts/components/ns-table-row.vue b/resources/ts/components/ns-table-row.vue index 78f2ba5bc..e3c7a72d1 100644 --- a/resources/ts/components/ns-table-row.vue +++ b/resources/ts/components/ns-table-row.vue @@ -14,7 +14,7 @@ @@ -56,7 +56,7 @@