diff --git a/app/Services/Setup.php b/app/Services/Setup.php index 7f685f393..fc9ec6397 100644 --- a/app/Services/Setup.php +++ b/app/Services/Setup.php @@ -125,7 +125,9 @@ public function runMigration( $fields ) * default tables are created. Those table are located at the * root of the database folder. */ - Artisan::call( 'migrate' ); + Artisan::call( 'migrate', [ + '--force' => true + ]); /** * NexoPOS uses Sanctum, we're making sure to publish the package. diff --git a/config/nexopos.php b/config/nexopos.php index a5ea30a51..563c48bd3 100644 --- a/config/nexopos.php +++ b/config/nexopos.php @@ -1,7 +1,7 @@ '4.8.18', + 'version' => '4.8.19', 'languages' => [ 'en' => 'English', 'de' => 'Deutsch', diff --git a/public/css/app.css b/public/css/app.css new file mode 100644 index 000000000..bbd5accb4 --- /dev/null +++ b/public/css/app.css @@ -0,0 +1,3400 @@ +/* +! tailwindcss v3.0.23 | MIT License | https://tailwindcss.com +*//* +1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) +2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) +*/ + +*, +::before, +::after { + box-sizing: border-box; /* 1 */ + border-width: 0; /* 2 */ + border-style: solid; /* 2 */ + border-color: #e5e7eb; /* 2 */ +} + +::before, +::after { + --tw-content: ''; +} + +/* +1. Use a consistent sensible line-height in all browsers. +2. Prevent adjustments of font size after orientation changes in iOS. +3. Use a more readable tab size. +4. Use the user's configured `sans` font-family by default. +*/ + +html { + line-height: 1.5; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + -moz-tab-size: 4; /* 3 */ + -o-tab-size: 4; + tab-size: 4; /* 3 */ + font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */ +} + +/* +1. Remove the margin in all browsers. +2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. +*/ + +body { + margin: 0; /* 1 */ + line-height: inherit; /* 2 */ +} + +/* +1. Add the correct height in Firefox. +2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) +3. Ensure horizontal rules are visible by default. +*/ + +hr { + height: 0; /* 1 */ + color: inherit; /* 2 */ + border-top-width: 1px; /* 3 */ +} + +/* +Add the correct text decoration in Chrome, Edge, and Safari. +*/ + +abbr:where([title]) { + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; +} + +/* +Remove the default font size and weight for headings. +*/ + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: inherit; + font-weight: inherit; +} + +/* +Reset links to optimize for opt-in styling instead of opt-out. +*/ + +a { + color: inherit; + text-decoration: inherit; +} + +/* +Add the correct font weight in Edge and Safari. +*/ + +b, +strong { + font-weight: bolder; +} + +/* +1. Use the user's configured `mono` font family by default. +2. Correct the odd `em` font sizing in all browsers. +*/ + +code, +kbd, +samp, +pre { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/* +Add the correct font size in all browsers. +*/ + +small { + font-size: 80%; +} + +/* +Prevent `sub` and `sup` elements from affecting the line height in all browsers. +*/ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* +1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) +2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) +3. Remove gaps between table borders by default. +*/ + +table { + text-indent: 0; /* 1 */ + border-color: inherit; /* 2 */ + border-collapse: collapse; /* 3 */ +} + +/* +1. Change the font styles in all browsers. +2. Remove the margin in Firefox and Safari. +3. Remove default padding in all browsers. +*/ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: inherit; /* 1 */ + color: inherit; /* 1 */ + margin: 0; /* 2 */ + padding: 0; /* 3 */ +} + +/* +Remove the inheritance of text transform in Edge and Firefox. +*/ + +button, +select { + text-transform: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Remove default button styles. +*/ + +button, +[type='button'], +[type='reset'], +[type='submit'] { + -webkit-appearance: button; /* 1 */ + background-color: transparent; /* 2 */ + background-image: none; /* 2 */ +} + +/* +Use the modern Firefox focus style for all focusable elements. +*/ + +:-moz-focusring { + outline: auto; +} + +/* +Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) +*/ + +:-moz-ui-invalid { + box-shadow: none; +} + +/* +Add the correct vertical alignment in Chrome and Firefox. +*/ + +progress { + vertical-align: baseline; +} + +/* +Correct the cursor style of increment and decrement buttons in Safari. +*/ + +::-webkit-inner-spin-button, +::-webkit-outer-spin-button { + height: auto; +} + +/* +1. Correct the odd appearance in Chrome and Safari. +2. Correct the outline style in Safari. +*/ + +[type='search'] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/* +Remove the inner padding in Chrome and Safari on macOS. +*/ + +::-webkit-search-decoration { + -webkit-appearance: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Change font properties to `inherit` in Safari. +*/ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* +Add the correct display in Chrome and Safari. +*/ + +summary { + display: list-item; +} + +/* +Removes the default spacing and border for appropriate elements. +*/ + +blockquote, +dl, +dd, +h1, +h2, +h3, +h4, +h5, +h6, +hr, +figure, +p, +pre { + margin: 0; +} + +fieldset { + margin: 0; + padding: 0; +} + +legend { + padding: 0; +} + +ol, +ul, +menu { + list-style: none; + margin: 0; + padding: 0; +} + +/* +Prevent resizing textareas horizontally by default. +*/ + +textarea { + resize: vertical; +} + +/* +1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) +2. Set the default placeholder color to the user's configured gray 400 color. +*/ + +input::-moz-placeholder, textarea::-moz-placeholder { + opacity: 1; /* 1 */ + color: #9ca3af; /* 2 */ +} + +input:-ms-input-placeholder, textarea:-ms-input-placeholder { + opacity: 1; /* 1 */ + color: #9ca3af; /* 2 */ +} + +input::placeholder, +textarea::placeholder { + opacity: 1; /* 1 */ + color: #9ca3af; /* 2 */ +} + +/* +Set the default cursor for buttons. +*/ + +button, +[role="button"] { + cursor: pointer; +} + +/* +Make sure disabled buttons don't get the pointer cursor. +*/ +:disabled { + cursor: default; +} + +/* +1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) +2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) + This can trigger a poorly considered lint error in some tools but is included by design. +*/ + +img, +svg, +video, +canvas, +audio, +iframe, +embed, +object { + display: block; /* 1 */ + vertical-align: middle; /* 2 */ +} + +/* +Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) +*/ + +img, +video { + max-width: 100%; + height: auto; +} + +/* +Ensure the default browser behavior of the `hidden` attribute. +*/ + +[hidden] { + display: none; +} + +*, ::before, ::after { + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; +} +.container { + width: 100%; +} +@media (min-width: 640px) { + + .container { + max-width: 640px; + } +} +@media (min-width: 768px) { + + .container { + max-width: 768px; + } +} +@media (min-width: 1024px) { + + .container { + max-width: 1024px; + } +} +@media (min-width: 1280px) { + + .container { + max-width: 1280px; + } +} +@media (min-width: 1536px) { + + .container { + max-width: 1536px; + } +} +.pointer-events-none { + pointer-events: none !important; +} +.visible { + visibility: visible !important; +} +.\!visible { + visibility: visible !important; +} +.static { + position: static !important; +} +.absolute { + position: absolute !important; +} +.relative { + position: relative !important; +} +.inset-y-0 { + top: 0em !important; + bottom: 0em !important; +} +.left-0 { + left: 0em !important; +} +.top-0 { + top: 0em !important; +} +.bottom-0 { + bottom: 0em !important; +} +.-top-10 { + top: -5em !important; +} +.z-10 { + z-index: 10 !important; +} +.z-50 { + z-index: 50 !important; +} +.z-40 { + z-index: 40 !important; +} +.z-30 { + z-index: 30 !important; +} +.col-span-2 { + grid-column: span 2 / span 2 !important; +} +.col-span-3 { + grid-column: span 3 / span 3 !important; +} +.m-4 { + margin: 1rem !important; +} +.m-1 { + margin: 0.25rem !important; +} +.m-2 { + margin: 0.5rem !important; +} +.-m-3 { + margin: -0.75rem !important; +} +.-m-4 { + margin: -1rem !important; +} +.-m-2 { + margin: -0.5rem !important; +} +.mx-2 { + margin-left: 0.5rem !important; + margin-right: 0.5rem !important; +} +.my-2 { + margin-top: 0.5rem !important; + margin-bottom: 0.5rem !important; +} +.my-5 { + margin-top: 1.25rem !important; + margin-bottom: 1.25rem !important; +} +.-mx-4 { + margin-left: -1rem !important; + margin-right: -1rem !important; +} +.-mx-2 { + margin-left: -0.5rem !important; + margin-right: -0.5rem !important; +} +.-mx-1 { + margin-left: -0.25rem !important; + margin-right: -0.25rem !important; +} +.mx-4 { + margin-left: 1rem !important; + margin-right: 1rem !important; +} +.mx-1 { + margin-left: 0.25rem !important; + margin-right: 0.25rem !important; +} +.-my-1 { + margin-top: -0.25rem !important; + margin-bottom: -0.25rem !important; +} +.my-1 { + margin-top: 0.25rem !important; + margin-bottom: 0.25rem !important; +} +.my-4 { + margin-top: 1rem !important; + margin-bottom: 1rem !important; +} +.mx-auto { + margin-left: auto !important; + margin-right: auto !important; +} +.-my-2 { + margin-top: -0.5rem !important; + margin-bottom: -0.5rem !important; +} +.my-3 { + margin-top: 0.75rem !important; + margin-bottom: 0.75rem !important; +} +.-mx-3 { + margin-left: -0.75rem !important; + margin-right: -0.75rem !important; +} +.mr-2 { + margin-right: 0.5rem !important; +} +.mb-2 { + margin-bottom: 0.5rem !important; +} +.mt-1 { + margin-top: 0.25rem !important; +} +.mb-8 { + margin-bottom: 2rem !important; +} +.ml-1 { + margin-left: 0.25rem !important; +} +.-mt-4 { + margin-top: -1rem !important; +} +.mt-2 { + margin-top: 0.5rem !important; +} +.-mb-2 { + margin-bottom: -0.5rem !important; +} +.mb-1 { + margin-bottom: 0.25rem !important; +} +.-ml-28 { + margin-left: -7rem !important; +} +.mr-1 { + margin-right: 0.25rem !important; +} +.mb-4 { + margin-bottom: 1rem !important; +} +.mt-4 { + margin-top: 1rem !important; +} +.ml-2 { + margin-left: 0.5rem !important; +} +.mb-3 { + margin-bottom: 0.75rem !important; +} +.-ml-6 { + margin-left: -1.5rem !important; +} +.-mt-8 { + margin-top: -2rem !important; +} +.mb-6 { + margin-bottom: 1.5rem !important; +} +.block { + display: block !important; +} +.inline-block { + display: inline-block !important; +} +.flex { + display: flex !important; +} +.table { + display: table !important; +} +.grid { + display: grid !important; +} +.hidden { + display: none !important; +} +.aspect-square { + aspect-ratio: 1 / 1 !important; +} +.h-full { + height: 100% !important; +} +.h-8 { + height: 2rem !important; +} +.h-6 { + height: 1.5rem !important; +} +.h-10 { + height: 2.5rem !important; +} +.h-0 { + height: 0px !important; +} +.h-32 { + height: 8rem !important; +} +.h-40 { + height: 10rem !important; +} +.h-16 { + height: 4rem !important; +} +.h-half { + height: 50vh !important; +} +.h-6\/7-screen { + height: 85.71vh !important; +} +.h-95vh { + height: 95vh !important; +} +.h-120 { + height: 30rem !important; +} +.h-64 { + height: 16rem !important; +} +.h-3\/5-screen { + height: 60vh !important; +} +.h-24 { + height: 6rem !important; +} +.h-56 { + height: 14rem !important; +} +.h-screen { + height: 100vh !important; +} +.h-12 { + height: 3rem !important; +} +.h-20 { + height: 5rem !important; +} +.h-5\/7-screen { + height: 71.42vh !important; +} +.h-2\/5-screen { + height: 40vh !important; +} +.h-96 { + height: 24rem !important; +} +.h-28 { + height: 7rem !important; +} +.min-h-2\/5-screen { + min-height: 40vh !important; +} +.w-full { + width: 100% !important; +} +.w-32 { + width: 8rem !important; +} +.w-1\/3 { + width: 33.333333% !important; +} +.w-8 { + width: 2rem !important; +} +.w-6 { + width: 1.5rem !important; +} +.w-36 { + width: 9rem !important; +} +.w-16 { + width: 4rem !important; +} +.w-0 { + width: 0px !important; +} +.w-72 { + width: 18rem !important; +} +.w-2\/3 { + width: 66.666667% !important; +} +.w-24 { + width: 6rem !important; +} +.w-12 { + width: 3rem !important; +} +.w-10 { + width: 2.5rem !important; +} +.w-40 { + width: 10rem !important; +} +.w-56 { + width: 14rem !important; +} +.w-1\/2 { + width: 50% !important; +} +.w-6\/7-screen { + width: 85.71vw !important; +} +.w-95vw { + width: 95vw !important; +} +.w-5\/7-screen { + width: 71.42vw !important; +} +.w-4\/5-screen { + width: 80vw !important; +} +.w-screen { + width: 100vw !important; +} +.w-3\/4-screen { + width: 75vw !important; +} +.w-2\/3-screen { + width: 66.66vw !important; +} +.w-64 { + width: 16rem !important; +} +.w-11\/12 { + width: 91.666667% !important; +} +.w-48 { + width: 12rem !important; +} +.w-1\/6 { + width: 16.666667% !important; +} +.w-1\/4 { + width: 25% !important; +} +.w-3 { + width: 0.75rem !important; +} +.w-3\/5 { + width: 60% !important; +} +.w-3\/4 { + width: 75% !important; +} +.flex-auto { + flex: 1 1 auto !important; +} +.flex-shrink-0 { + flex-shrink: 0 !important; +} +.origin-bottom-right { + transform-origin: bottom right !important; +} +@-webkit-keyframes spin { + + to { + transform: rotate(360deg); + } +} +@keyframes spin { + + to { + transform: rotate(360deg); + } +} +.animate-spin { + -webkit-animation: spin 1s linear infinite !important; + animation: spin 1s linear infinite !important; +} +.cursor-pointer { + cursor: pointer !important; +} +.cursor-not-allowed { + cursor: not-allowed !important; +} +.select-none { + -webkit-user-select: none !important; + -moz-user-select: none !important; + -ms-user-select: none !important; + user-select: none !important; +} +.resize { + resize: both !important; +} +.appearance-none { + -webkit-appearance: none !important; + -moz-appearance: none !important; + appearance: none !important; +} +.grid-flow-row { + grid-auto-flow: row !important; +} +.grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)) !important; +} +.grid-cols-7 { + grid-template-columns: repeat(7, minmax(0, 1fr)) !important; +} +.grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)) !important; +} +.grid-cols-1 { + grid-template-columns: repeat(1, minmax(0, 1fr)) !important; +} +.grid-rows-1 { + grid-template-rows: repeat(1, minmax(0, 1fr)) !important; +} +.grid-rows-3 { + grid-template-rows: repeat(3, minmax(0, 1fr)) !important; +} +.grid-rows-2 { + grid-template-rows: repeat(2, minmax(0, 1fr)) !important; +} +.flex-row { + flex-direction: row !important; +} +.flex-row-reverse { + flex-direction: row-reverse !important; +} +.flex-col { + flex-direction: column !important; +} +.flex-wrap { + flex-wrap: wrap !important; +} +.items-start { + align-items: flex-start !important; +} +.items-end { + align-items: flex-end !important; +} +.items-center { + align-items: center !important; +} +.justify-start { + justify-content: flex-start !important; +} +.justify-end { + justify-content: flex-end !important; +} +.justify-center { + justify-content: center !important; +} +.justify-between { + justify-content: space-between !important; +} +.gap-0 { + gap: 0px !important; +} +.gap-2 { + gap: 0.5rem !important; +} +.divide-y-4 > :not([hidden]) ~ :not([hidden]) { + --tw-divide-y-reverse: 0 !important; + border-top-width: calc(4px * calc(1 - var(--tw-divide-y-reverse))) !important; + border-bottom-width: calc(4px * var(--tw-divide-y-reverse)) !important; +} +.overflow-auto { + overflow: auto !important; +} +.overflow-hidden { + overflow: hidden !important; +} +.overflow-scroll { + overflow: scroll !important; +} +.overflow-x-auto { + overflow-x: auto !important; +} +.overflow-y-auto { + overflow-y: auto !important; +} +.overflow-y-hidden { + overflow-y: hidden !important; +} +.overflow-y-scroll { + overflow-y: scroll !important; +} +.truncate { + overflow: hidden !important; + text-overflow: ellipsis !important; + white-space: nowrap !important; +} +.whitespace-pre-wrap { + white-space: pre-wrap !important; +} +.rounded-full { + border-radius: 9999px !important; +} +.rounded { + border-radius: 0.25rem !important; +} +.rounded-md { + border-radius: 0.375rem !important; +} +.rounded-lg { + border-radius: 0.5rem !important; +} +.rounded-none { + border-radius: 0px !important; +} +.rounded-t-lg { + border-top-left-radius: 0.5rem !important; + border-top-right-radius: 0.5rem !important; +} +.rounded-tl { + border-top-left-radius: 0.25rem !important; +} +.rounded-tr { + border-top-right-radius: 0.25rem !important; +} +.rounded-br-lg { + border-bottom-right-radius: 0.5rem !important; +} +.rounded-bl-lg { + border-bottom-left-radius: 0.5rem !important; +} +.rounded-tl-lg { + border-top-left-radius: 0.5rem !important; +} +.rounded-tr-lg { + border-top-right-radius: 0.5rem !important; +} +.border { + border-width: 1px !important; +} +.border-2 { + border-width: 2px !important; +} +.border-4 { + border-width: 4px !important; +} +.border-0 { + border-width: 0px !important; +} +.border-b { + border-bottom-width: 1px !important; +} +.border-t { + border-top-width: 1px !important; +} +.border-l { + border-left-width: 1px !important; +} +.border-b-0 { + border-bottom-width: 0px !important; +} +.border-l-2 { + border-left-width: 2px !important; +} +.border-l-8 { + border-left-width: 8px !important; +} +.border-l-4 { + border-left-width: 4px !important; +} +.border-r-2 { + border-right-width: 2px !important; +} +.border-t-4 { + border-top-width: 4px !important; +} +.border-r { + border-right-width: 1px !important; +} +.border-b-2 { + border-bottom-width: 2px !important; +} +.border-l-0 { + border-left-width: 0px !important; +} +.border-t-0 { + border-top-width: 0px !important; +} +.border-r-0 { + border-right-width: 0px !important; +} +.border-dashed { + border-style: dashed !important; +} +.border-red-200 { + --tw-border-opacity: 1 !important; + border-color: rgb(254 202 202 / var(--tw-border-opacity)) !important; +} +.border-green-200 { + --tw-border-opacity: 1 !important; + border-color: rgb(187 247 208 / var(--tw-border-opacity)) !important; +} +.border-blue-200 { + --tw-border-opacity: 1 !important; + border-color: rgb(191 219 254 / var(--tw-border-opacity)) !important; +} +.border-yellow-200 { + --tw-border-opacity: 1 !important; + border-color: rgb(254 240 138 / var(--tw-border-opacity)) !important; +} +.border-orange-200 { + --tw-border-opacity: 1 !important; + border-color: rgb(254 215 170 / var(--tw-border-opacity)) !important; +} +.border-input-edge { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--input-edge) / var(--tw-border-opacity)) !important; +} +.border-gray-400 { + --tw-border-opacity: 1 !important; + border-color: rgb(156 163 175 / var(--tw-border-opacity)) !important; +} +.border-gray-500 { + --tw-border-opacity: 1 !important; + border-color: rgb(107 114 128 / var(--tw-border-opacity)) !important; +} +.border-red-600 { + --tw-border-opacity: 1 !important; + border-color: rgb(220 38 38 / var(--tw-border-opacity)) !important; +} +.border-blue-500 { + --tw-border-opacity: 1 !important; + border-color: rgb(59 130 246 / var(--tw-border-opacity)) !important; +} +.border-popup-surface { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--popup-surface) / var(--tw-border-opacity)) !important; +} +.border-transparent { + border-color: transparent !important; +} +.border-red-400 { + --tw-border-opacity: 1 !important; + border-color: rgb(248 113 113 / var(--tw-border-opacity)) !important; +} +.border-gray-200 { + --tw-border-opacity: 1 !important; + border-color: rgb(229 231 235 / var(--tw-border-opacity)) !important; +} +.border-numpad-edge { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--numpad-edge) / var(--tw-border-opacity)) !important; +} +.border-info-secondary { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--info-secondary) / var(--tw-border-opacity)) !important; +} +.border-error-primary { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--error-primary) / var(--tw-border-opacity)) !important; +} +.border-blue-800 { + --tw-border-opacity: 1 !important; + border-color: rgb(30 64 175 / var(--tw-border-opacity)) !important; +} +.border-input-option-hover { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--input-option-hover) / var(--tw-border-opacity)) !important; +} +.border-box-edge { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--box-edge) / var(--tw-border-opacity)) !important; +} +.border-info-primary { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--info-primary) / var(--tw-border-opacity)) !important; +} +.border-green-400 { + --tw-border-opacity: 1 !important; + border-color: rgb(74 222 128 / var(--tw-border-opacity)) !important; +} +.border-tertiary { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--tertiary) / var(--tw-border-opacity)) !important; +} +.border-input-disabled { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--input-disabled) / var(--tw-border-opacity)) !important; +} +.border-input-button { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--input-button) / var(--tw-border-opacity)) !important; +} +.border-error-secondary { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--error-secondary) / var(--tw-border-opacity)) !important; +} +.border-gray-700 { + --tw-border-opacity: 1 !important; + border-color: rgb(55 65 81 / var(--tw-border-opacity)) !important; +} +.border-table-th-edge { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--table-th-edge) / var(--tw-border-opacity)) !important; +} +.border-gray-300 { + --tw-border-opacity: 1 !important; + border-color: rgb(209 213 219 / var(--tw-border-opacity)) !important; +} +.border-white { + --tw-border-opacity: 1 !important; + border-color: rgb(255 255 255 / var(--tw-border-opacity)) !important; +} +.border-gray-100 { + --tw-border-opacity: 1 !important; + border-color: rgb(243 244 246 / var(--tw-border-opacity)) !important; +} +.border-blue-400 { + --tw-border-opacity: 1 !important; + border-color: rgb(96 165 250 / var(--tw-border-opacity)) !important; +} +.border-success-secondary { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--success-secondary) / var(--tw-border-opacity)) !important; +} +.border-green-600 { + --tw-border-opacity: 1 !important; + border-color: rgb(22 163 74 / var(--tw-border-opacity)) !important; +} +.border-blue-600 { + --tw-border-opacity: 1 !important; + border-color: rgb(37 99 235 / var(--tw-border-opacity)) !important; +} +.border-box-elevation-edge { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--box-elevation-edge) / var(--tw-border-opacity)) !important; +} +.border-floating-menu-edge { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--floating-menu-edge) / var(--tw-border-opacity)) !important; +} +.border-black { + --tw-border-opacity: 1 !important; + border-color: rgb(0 0 0 / var(--tw-border-opacity)) !important; +} +.border-box-background { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--box-background) / var(--tw-border-opacity)) !important; +} +.border-success-primary { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--success-primary) / var(--tw-border-opacity)) !important; +} +.border-success-tertiary { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--success-tertiary) / var(--tw-border-opacity)) !important; +} +.border-gray-800 { + --tw-border-opacity: 1 !important; + border-color: rgb(31 41 55 / var(--tw-border-opacity)) !important; +} +.bg-green-400 { + --tw-bg-opacity: 1 !important; + background-color: rgb(74 222 128 / var(--tw-bg-opacity)) !important; +} +.bg-red-400 { + --tw-bg-opacity: 1 !important; + background-color: rgb(248 113 113 / var(--tw-bg-opacity)) !important; +} +.bg-red-100 { + --tw-bg-opacity: 1 !important; + background-color: rgb(254 226 226 / var(--tw-bg-opacity)) !important; +} +.bg-green-100 { + --tw-bg-opacity: 1 !important; + background-color: rgb(220 252 231 / var(--tw-bg-opacity)) !important; +} +.bg-blue-100 { + --tw-bg-opacity: 1 !important; + background-color: rgb(219 234 254 / var(--tw-bg-opacity)) !important; +} +.bg-yellow-100 { + --tw-bg-opacity: 1 !important; + background-color: rgb(254 249 195 / var(--tw-bg-opacity)) !important; +} +.bg-orange-100 { + --tw-bg-opacity: 1 !important; + background-color: rgb(255 237 213 / var(--tw-bg-opacity)) !important; +} +.bg-gray-600 { + --tw-bg-opacity: 1 !important; + background-color: rgb(75 85 99 / var(--tw-bg-opacity)) !important; +} +.bg-input-background { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--input-background) / var(--tw-bg-opacity)) !important; +} +.bg-gray-200 { + --tw-bg-opacity: 1 !important; + background-color: rgb(229 231 235 / var(--tw-bg-opacity)) !important; +} +.bg-transparent { + background-color: transparent !important; +} +.bg-white { + --tw-bg-opacity: 1 !important; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important; +} +.bg-gray-400 { + --tw-bg-opacity: 1 !important; + background-color: rgb(156 163 175 / var(--tw-bg-opacity)) !important; +} +.bg-gray-500 { + --tw-bg-opacity: 1 !important; + background-color: rgb(107 114 128 / var(--tw-bg-opacity)) !important; +} +.bg-red-500 { + --tw-bg-opacity: 1 !important; + background-color: rgb(239 68 68 / var(--tw-bg-opacity)) !important; +} +.bg-blue-500 { + --tw-bg-opacity: 1 !important; + background-color: rgb(59 130 246 / var(--tw-bg-opacity)) !important; +} +.bg-error-primary { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--error-primary) / var(--tw-bg-opacity)) !important; +} +.bg-input-disabled { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--input-disabled) / var(--tw-bg-opacity)) !important; +} +.bg-info-tertiary { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--info-tertiary) / var(--tw-bg-opacity)) !important; +} +.bg-info-secondary { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--info-secondary) / var(--tw-bg-opacity)) !important; +} +.bg-input-edge { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--input-edge) / var(--tw-bg-opacity)) !important; +} +.bg-blue-400 { + --tw-bg-opacity: 1 !important; + background-color: rgb(96 165 250 / var(--tw-bg-opacity)) !important; +} +.bg-orange-400 { + --tw-bg-opacity: 1 !important; + background-color: rgb(251 146 60 / var(--tw-bg-opacity)) !important; +} +.bg-gray-800 { + --tw-bg-opacity: 1 !important; + background-color: rgb(31 41 55 / var(--tw-bg-opacity)) !important; +} +.bg-gray-900 { + --tw-bg-opacity: 1 !important; + background-color: rgb(17 24 39 / var(--tw-bg-opacity)) !important; +} +.bg-red-600 { + --tw-bg-opacity: 1 !important; + background-color: rgb(220 38 38 / var(--tw-bg-opacity)) !important; +} +.bg-success-primary { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--success-primary) / var(--tw-bg-opacity)) !important; +} +.bg-info-primary { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--info-primary) / var(--tw-bg-opacity)) !important; +} +.bg-tab-active { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--tab-active) / var(--tw-bg-opacity)) !important; +} +.bg-tab-inactive { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--tab-inactive) / var(--tw-bg-opacity)) !important; +} +.bg-green-500 { + --tw-bg-opacity: 1 !important; + background-color: rgb(34 197 94 / var(--tw-bg-opacity)) !important; +} +.bg-error-secondary { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--error-secondary) / var(--tw-bg-opacity)) !important; +} +.bg-green-200 { + --tw-bg-opacity: 1 !important; + background-color: rgb(187 247 208 / var(--tw-bg-opacity)) !important; +} +.bg-gray-300 { + --tw-bg-opacity: 1 !important; + background-color: rgb(209 213 219 / var(--tw-bg-opacity)) !important; +} +.bg-surface { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--surface) / var(--tw-bg-opacity)) !important; +} +.bg-gray-100 { + --tw-bg-opacity: 1 !important; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)) !important; +} +.bg-gray-700 { + --tw-bg-opacity: 1 !important; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)) !important; +} +.bg-box-elevation-background { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--box-elevation-background) / var(--tw-bg-opacity)) !important; +} +.bg-floating-menu { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--floating-menu) / var(--tw-bg-opacity)) !important; +} +.bg-box-background { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--box-background) / var(--tw-bg-opacity)) !important; +} +.bg-gray-50 { + --tw-bg-opacity: 1 !important; + background-color: rgb(249 250 251 / var(--tw-bg-opacity)) !important; +} +.bg-input-button { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--input-button) / var(--tw-bg-opacity)) !important; +} +.bg-success-secondary { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--success-secondary) / var(--tw-bg-opacity)) !important; +} +.bg-warning-primary { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--warning-primary) / var(--tw-bg-opacity)) !important; +} +.bg-gradient-to-br { + background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)) !important; +} +.bg-gradient-to-b { + background-image: linear-gradient(to bottom, var(--tw-gradient-stops)) !important; +} +.bg-gradient-to-bl { + background-image: linear-gradient(to bottom left, var(--tw-gradient-stops)) !important; +} +.from-success-primary { + --tw-gradient-from: rgb(var(--success-primary)) !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(var(--success-primary) / 0)) !important; +} +.from-error-secondary { + --tw-gradient-from: rgb(var(--error-secondary)) !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(var(--error-secondary) / 0)) !important; +} +.from-blue-500 { + --tw-gradient-from: #3b82f6 !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(59 130 246 / 0)) !important; +} +.from-teal-500 { + --tw-gradient-from: #14b8a6 !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(20 184 166 / 0)) !important; +} +.from-blue-200 { + --tw-gradient-from: #bfdbfe !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(191 219 254 / 0)) !important; +} +.from-red-500 { + --tw-gradient-from: #ef4444 !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(239 68 68 / 0)) !important; +} +.from-pink-400 { + --tw-gradient-from: #f472b6 !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(244 114 182 / 0)) !important; +} +.from-purple-500 { + --tw-gradient-from: #a855f7 !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(168 85 247 / 0)) !important; +} +.from-purple-400 { + --tw-gradient-from: #c084fc !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(192 132 252 / 0)) !important; +} +.from-red-400 { + --tw-gradient-from: #f87171 !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(248 113 113 / 0)) !important; +} +.from-blue-400 { + --tw-gradient-from: #60a5fa !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(96 165 250 / 0)) !important; +} +.from-green-400 { + --tw-gradient-from: #4ade80 !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(74 222 128 / 0)) !important; +} +.from-info-secondary { + --tw-gradient-from: rgb(var(--info-secondary)) !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(var(--info-secondary) / 0)) !important; +} +.from-red-300 { + --tw-gradient-from: #fca5a5 !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(252 165 165 / 0)) !important; +} +.from-indigo-400 { + --tw-gradient-from: #818cf8 !important; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(129 140 248 / 0)) !important; +} +.via-red-400 { + --tw-gradient-stops: var(--tw-gradient-from), #f87171, var(--tw-gradient-to, rgb(248 113 113 / 0)) !important; +} +.to-green-700 { + --tw-gradient-to: #15803d !important; +} +.to-red-700 { + --tw-gradient-to: #b91c1c !important; +} +.to-blue-700 { + --tw-gradient-to: #1d4ed8 !important; +} +.to-teal-700 { + --tw-gradient-to: #0f766e !important; +} +.to-indigo-400 { + --tw-gradient-to: #818cf8 !important; +} +.to-pink-500 { + --tw-gradient-to: #ec4899 !important; +} +.to-blue-500 { + --tw-gradient-to: #3b82f6 !important; +} +.to-blue-400 { + --tw-gradient-to: #60a5fa !important; +} +.to-teal-500 { + --tw-gradient-to: #14b8a6 !important; +} +.to-purple-600 { + --tw-gradient-to: #9333ea !important; +} +.to-red-600 { + --tw-gradient-to: #dc2626 !important; +} +.to-blue-600 { + --tw-gradient-to: #2563eb !important; +} +.to-green-600 { + --tw-gradient-to: #16a34a !important; +} +.to-info-tertiary { + --tw-gradient-to: rgb(var(--info-tertiary)) !important; +} +.to-red-500 { + --tw-gradient-to: #ef4444 !important; +} +.to-indigo-600 { + --tw-gradient-to: #4f46e5 !important; +} +.bg-clip-text { + -webkit-background-clip: text !important; + background-clip: text !important; +} +.object-cover { + -o-object-fit: cover !important; + object-fit: cover !important; +} +.p-4 { + padding: 1rem !important; +} +.p-8 { + padding: 2rem !important; +} +.p-2 { + padding: 0.5rem !important; +} +.p-1 { + padding: 0.25rem !important; +} +.p-3 { + padding: 0.75rem !important; +} +.p-0 { + padding: 0px !important; +} +.p-10 { + padding: 2.5rem !important; +} +.px-2 { + padding-left: 0.5rem !important; + padding-right: 0.5rem !important; +} +.py-1 { + padding-top: 0.25rem !important; + padding-bottom: 0.25rem !important; +} +.py-6 { + padding-top: 1.5rem !important; + padding-bottom: 1.5rem !important; +} +.py-2 { + padding-top: 0.5rem !important; + padding-bottom: 0.5rem !important; +} +.px-3 { + padding-left: 0.75rem !important; + padding-right: 0.75rem !important; +} +.px-4 { + padding-left: 1rem !important; + padding-right: 1rem !important; +} +.px-1 { + padding-left: 0.25rem !important; + padding-right: 0.25rem !important; +} +.py-3 { + padding-top: 0.75rem !important; + padding-bottom: 0.75rem !important; +} +.py-4 { + padding-top: 1rem !important; + padding-bottom: 1rem !important; +} +.py-10 { + padding-top: 2.5rem !important; + padding-bottom: 2.5rem !important; +} +.py-5 { + padding-top: 1.25rem !important; + padding-bottom: 1.25rem !important; +} +.pl-3 { + padding-left: 0.75rem !important; +} +.pl-8 { + padding-left: 2rem !important; +} +.pr-8 { + padding-right: 2rem !important; +} +.pl-7 { + padding-left: 1.75rem !important; +} +.pr-12 { + padding-right: 3rem !important; +} +.pt-2 { + padding-top: 0.5rem !important; +} +.pb-10 { + padding-bottom: 2.5rem !important; +} +.pb-4 { + padding-bottom: 1rem !important; +} +.pb-2 { + padding-bottom: 0.5rem !important; +} +.pl-2 { + padding-left: 0.5rem !important; +} +.pb-1 { + padding-bottom: 0.25rem !important; +} +.pr-1 { + padding-right: 0.25rem !important; +} +.pr-2 { + padding-right: 0.5rem !important; +} +.pl-1 { + padding-left: 0.25rem !important; +} +.pt-6 { + padding-top: 1.5rem !important; +} +.text-left { + text-align: left !important; +} +.text-center { + text-align: center !important; +} +.text-right { + text-align: right !important; +} +.font-body { + font-family: Graphik, sans-serif !important; +} +.text-sm { + font-size: 0.875rem !important; + line-height: 1.25rem !important; +} +.text-xs { + font-size: 0.75rem !important; + line-height: 1rem !important; +} +.text-2xl { + font-size: 1.5rem !important; + line-height: 2rem !important; +} +.text-lg { + font-size: 1.125rem !important; + line-height: 1.75rem !important; +} +.text-3xl { + font-size: 1.875rem !important; + line-height: 2.25rem !important; +} +.text-6xl { + font-size: 3.75rem !important; + line-height: 1 !important; +} +.text-xl { + font-size: 1.25rem !important; + line-height: 1.75rem !important; +} +.text-5xl { + font-size: 3rem !important; + line-height: 1 !important; +} +.text-7xl { + font-size: 4.5rem !important; + line-height: 1 !important; +} +.font-semibold { + font-weight: 600 !important; +} +.font-medium { + font-weight: 500 !important; +} +.font-bold { + font-weight: 700 !important; +} +.font-black { + font-weight: 900 !important; +} +.uppercase { + text-transform: uppercase !important; +} +.leading-5 { + line-height: 1.25rem !important; +} +.text-white { + --tw-text-opacity: 1 !important; + color: rgb(255 255 255 / var(--tw-text-opacity)) !important; +} +.text-error-primary { + --tw-text-opacity: 1 !important; + color: rgb(var(--error-primary) / var(--tw-text-opacity)) !important; +} +.text-primary { + --tw-text-opacity: 1 !important; + color: rgb(var(--primary) / var(--tw-text-opacity)) !important; +} +.text-secondary { + --tw-text-opacity: 1 !important; + color: rgb(var(--secondary) / var(--tw-text-opacity)) !important; +} +.text-gray-700 { + --tw-text-opacity: 1 !important; + color: rgb(55 65 81 / var(--tw-text-opacity)) !important; +} +.text-gray-600 { + --tw-text-opacity: 1 !important; + color: rgb(75 85 99 / var(--tw-text-opacity)) !important; +} +.text-red-500 { + --tw-text-opacity: 1 !important; + color: rgb(239 68 68 / var(--tw-text-opacity)) !important; +} +.text-red-700 { + --tw-text-opacity: 1 !important; + color: rgb(185 28 28 / var(--tw-text-opacity)) !important; +} +.text-gray-500 { + --tw-text-opacity: 1 !important; + color: rgb(107 114 128 / var(--tw-text-opacity)) !important; +} +.text-red-400 { + --tw-text-opacity: 1 !important; + color: rgb(248 113 113 / var(--tw-text-opacity)) !important; +} +.text-gray-800 { + --tw-text-opacity: 1 !important; + color: rgb(31 41 55 / var(--tw-text-opacity)) !important; +} +.text-gray-200 { + --tw-text-opacity: 1 !important; + color: rgb(229 231 235 / var(--tw-text-opacity)) !important; +} +.text-gray-100 { + --tw-text-opacity: 1 !important; + color: rgb(243 244 246 / var(--tw-text-opacity)) !important; +} +.text-tertiary { + --tw-text-opacity: 1 !important; + color: rgb(var(--tertiary) / var(--tw-text-opacity)) !important; +} +.text-green-700 { + --tw-text-opacity: 1 !important; + color: rgb(21 128 61 / var(--tw-text-opacity)) !important; +} +.text-transparent { + color: transparent !important; +} +.text-blue-600 { + --tw-text-opacity: 1 !important; + color: rgb(37 99 235 / var(--tw-text-opacity)) !important; +} +.text-blue-500 { + --tw-text-opacity: 1 !important; + color: rgb(59 130 246 / var(--tw-text-opacity)) !important; +} +.text-success-secondary { + --tw-text-opacity: 1 !important; + color: rgb(var(--success-secondary) / var(--tw-text-opacity)) !important; +} +.text-black { + --tw-text-opacity: 1 !important; + color: rgb(0 0 0 / var(--tw-text-opacity)) !important; +} +.text-success-light-secondary { + --tw-text-opacity: 1 !important; + color: rgb(var(--success-light-secondary) / var(--tw-text-opacity)) !important; +} +.underline { + -webkit-text-decoration-line: underline !important; + text-decoration-line: underline !important; +} +.shadow { + --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important; + --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important; + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important; +} +.shadow-xl { + --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important; + --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color) !important; + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important; +} +.shadow-sm { + --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important; + --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important; + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important; +} +.shadow-lg { + --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) !important; + --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important; + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important; +} +.shadow-inner { + --tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05) !important; + --tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color) !important; + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important; +} +.outline-none { + outline: 2px solid transparent !important; + outline-offset: 2px !important; +} +.ring-4 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important; + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important; + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000) !important; +} +.blur { + --tw-blur: blur(8px) !important; + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important; +} +.filter { + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important; +} +.transition-all { + transition-property: all !important; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important; + transition-duration: 150ms !important; +} +.duration-100 { + transition-duration: 100ms !important; +} +.ease-linear { + transition-timing-function: linear !important; +} +.\[key\:string\] { + key: string; +} +@-webkit-keyframes ZoomOutEntrance { + 0% { + transform: scale(1.1,1.1); + opacity: 0; + } + 100% { + transform: scale(1,1); + opacity: 1; + } +} +@keyframes ZoomOutEntrance { + 0% { + transform: scale(1.1,1.1); + opacity: 0; + } + 100% { + transform: scale(1,1); + opacity: 1; + } +} +@-webkit-keyframes ZoomInEntrance { + 0% { + transform: scale(0.9,0.9); + opacity: 0; + } + 100% { + transform: scale(1,1); + opacity: 1; + } +} +@keyframes ZoomInEntrance { + 0% { + transform: scale(0.9,0.9); + opacity: 0; + } + 100% { + transform: scale(1,1); + opacity: 1; + } +} +@-webkit-keyframes ZoomOutExit { + 0% { + transform: scale(1,1); + opacity: 0; + } + 100% { + transform: scale(0.9,0.9); + opacity: 1; + } +} +@keyframes ZoomOutExit { + 0% { + transform: scale(1,1); + opacity: 0; + } + 100% { + transform: scale(0.9,0.9); + opacity: 1; + } +} +@-webkit-keyframes ZoomInExit { + 0% { + transform: scale(1,1); + opacity: 1; + } + 100% { + transform: scale(1.1,1.1); + opacity: 0; + } +} +@keyframes ZoomInExit { + 0% { + transform: scale(1,1); + opacity: 1; + } + 100% { + transform: scale(1.1,1.1); + opacity: 0; + } +} +@-webkit-keyframes FadeInEntrance { + 0% { + opacity: 0; + } + 70% { + opacity: 0.5; + } + 100% { + opacity: 1; + } +} +@keyframes FadeInEntrance { + 0% { + opacity: 0; + } + 70% { + opacity: 0.5; + } + 100% { + opacity: 1; + } +} +@-webkit-keyframes FadeOutExit { + 0% { + opacity: 1; + } + 70% { + opacity: 0.5; + } + 100% { + opacity: 0; + } +} +@keyframes FadeOutExit { + 0% { + opacity: 1; + } + 70% { + opacity: 0.5; + } + 100% { + opacity: 0; + } +} +.zoom-out-entrance { + -webkit-animation: ZoomOutEntrance 500ms; + animation: ZoomOutEntrance 500ms; +} +.zoom-in-entrance { + -webkit-animation: ZoomInEntrance; + animation: ZoomInEntrance; +} +.zoom-in-exit { + -webkit-animation: ZoomInExit 300ms; + animation: ZoomInExit 300ms; +} +.zoom-out-exit { + -webkit-animation: ZoomOutExit; + animation: ZoomOutExit; +} +.fade-in-entrance { + -webkit-animation: FadeInEntrance; + animation: FadeInEntrance; +} +.fade-out-exit { + -webkit-animation: FadeOutExit; + animation: FadeOutExit; +} +@for $i from 100 through 1000 { + .anim-duration-#{$i} { + -webkit-animation-duration: #{$i}ms; + animation-duration: #{$i}ms; + } + $i : $i + 200; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 100; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt5D4hTxM.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 100; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt7j4hTxM.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 100; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt4D4h.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 200; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt5D4hTxM.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 200; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt7j4hTxM.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 200; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt4D4h.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 300; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt5D4hTxM.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 300; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt7j4hTxM.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 300; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt4D4h.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt5D4hTxM.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt7j4hTxM.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt4D4h.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 500; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt5D4hTxM.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 500; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt7j4hTxM.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 500; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt4D4h.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 600; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt5D4hTxM.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 600; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt7j4hTxM.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 600; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt4D4h.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt5D4hTxM.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt7j4hTxM.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt4D4h.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 800; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt5D4hTxM.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 800; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt7j4hTxM.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 800; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt4D4h.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 900; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt5D4hTxM.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 900; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt7j4hTxM.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: italic; + font-weight: 900; + font-display: swap; + src: url(/fonts/92zUtBhPNqw73oHt4D4h.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 100; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oDd4iYl.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 100; + font-display: swap; + src: url(/fonts/92zatBhPNqw73ord4iYl.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 100; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oTd4g.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 200; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oDd4iYl.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 200; + font-display: swap; + src: url(/fonts/92zatBhPNqw73ord4iYl.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 200; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oTd4g.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 300; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oDd4iYl.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 300; + font-display: swap; + src: url(/fonts/92zatBhPNqw73ord4iYl.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 300; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oTd4g.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oDd4iYl.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(/fonts/92zatBhPNqw73ord4iYl.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oTd4g.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oDd4iYl.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url(/fonts/92zatBhPNqw73ord4iYl.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oTd4g.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oDd4iYl.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url(/fonts/92zatBhPNqw73ord4iYl.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oTd4g.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oDd4iYl.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url(/fonts/92zatBhPNqw73ord4iYl.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oTd4g.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 800; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oDd4iYl.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 800; + font-display: swap; + src: url(/fonts/92zatBhPNqw73ord4iYl.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 800; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oTd4g.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 900; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oDd4iYl.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 900; + font-display: swap; + src: url(/fonts/92zatBhPNqw73ord4iYl.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Jost'; + font-style: normal; + font-weight: 900; + font-display: swap; + src: url(/fonts/92zatBhPNqw73oTd4g.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +.ns-heading-1 { + margin-bottom: 1rem; + font-size: 3rem; + line-height: 1; +} +.ns-heading-2 { + margin-bottom: 0.75rem; + font-size: 2.25rem; + line-height: 2.5rem; +} +.ns-heading-3 { + margin-bottom: 0.5rem; + font-size: 1.875rem; + line-height: 2.25rem; +} +.ns-heading-4 { + margin-bottom: 0.5rem; + font-size: 1.5rem; + line-height: 2rem; +} +.ns-paragraph { + margin-bottom: 0.5rem; +} +.ns-grid { + display: flex; + flex-direction: column; +} +@media (min-width: 768px) { + + .ns-grid { + flex-direction: row; + } + + .ns-grid.ns-grid-gap-2 { + margin-left: -0.5rem; + margin-right: -0.5rem; + } + + .ns-grid.ns-grid-gap-2 > .ns-grid-item { + padding-left: 0.5rem; + padding-right: 0.5rem; + } + + .ns-grid.ns-grid-gap-4 { + margin-left: -1rem; + margin-right: -1rem; + } + + .ns-grid.ns-grid-gap-4 > .ns-grid-item { + padding-left: 1rem; + padding-right: 1rem; + } + + .ns-grid.ns-grid-gap-6 { + margin-left: -1.5rem; + margin-right: -1.5rem; + } + + .ns-grid.ns-grid-gap-6 > .ns-grid-item { + padding-left: 1.5rem; + padding-right: 1.5rem; + } + + .ns-grid.ns-grid-gap-8 { + margin-left: -2rem; + margin-right: -2rem; + } + + .ns-grid.ns-grid-gap-8 > .ns-grid-item { + padding-left: 2rem; + padding-right: 2rem; + } +} +html, +body { + height: 100%; + font-family: 'Jost'; + width: 100%; +} +.bg-overlay { + background:rgb(51 51 51 / 26%); +} +[v-cloak] > * { display:none } +.loader { + border-top-color: #3498db !important; +} +.loader.slow { + -webkit-animation: spinner 1.5s linear infinite; + animation: spinner 1.5s linear infinite; + } +.loader.fast { + -webkit-animation: spinner 0.7s linear infinite; + animation: spinner 0.7s linear infinite; + } +@-webkit-keyframes spinner { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(360deg); } +} +@keyframes spinner { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} +button { + border-radius: 0px; +} +#editor h1 { + font-size: 3rem; + line-height: 1; + font-weight: 700; +} +#editor h2 { + font-size: 2.25rem; + line-height: 2.5rem; + font-weight: 700; +} +#editor h3 { + font-size: 1.875rem; + line-height: 2.25rem; + font-weight: 700; +} +#editor h4 { + font-size: 1.5rem; + line-height: 2rem; + font-weight: 700; +} +#editor h5 { + font-size: 1.25rem; + line-height: 1.75rem; + font-weight: 700; +} +#grid-items .vue-recycle-scroller__item-wrapper { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 0px; + overflow-y: auto; +} +@media (min-width: 768px) { + + #grid-items .vue-recycle-scroller__item-wrapper { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } +} +@media (min-width: 1024px) { + + #grid-items .vue-recycle-scroller__item-wrapper { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } +} +@media (min-width: 1280px) { + + #grid-items .vue-recycle-scroller__item-wrapper { + grid-template-columns: repeat(5, minmax(0, 1fr)); + } +} +#grid-items .vue-recycle-scroller__item-view { + display: flex; + height: 8rem; + cursor: pointer; + flex-direction: column; + align-items: center; + justify-content: center; + overflow: hidden; + border-width: 1px; + --tw-border-opacity: 1; + border-color: rgb(229 231 235 / var(--tw-border-opacity)); +} +@media (min-width: 1024px) { + + #grid-items .vue-recycle-scroller__item-view { + height: 10rem; + } +} +#grid-items .vue-recycle-scroller__item-view:hover { + --tw-bg-opacity: 1; + background-color: rgb(229 231 235 / var(--tw-bg-opacity)); +} +/** + * Components +**/ +.popup-heading { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0.5rem; +} +.popup-heading h3 { + font-weight: 600; +} +.hover\:border-red-600:hover { + --tw-border-opacity: 1 !important; + border-color: rgb(220 38 38 / var(--tw-border-opacity)) !important; +} +.hover\:border-info-primary:hover { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--info-primary) / var(--tw-border-opacity)) !important; +} +.hover\:border-transparent:hover { + border-color: transparent !important; +} +.hover\:border-opacity-0:hover { + --tw-border-opacity: 0 !important; +} +.hover\:bg-red-600:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(220 38 38 / var(--tw-bg-opacity)) !important; +} +.hover\:bg-error-secondary:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--error-secondary) / var(--tw-bg-opacity)) !important; +} +.hover\:bg-numpad-hover:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--numpad-hover) / var(--tw-bg-opacity)) !important; +} +.hover\:bg-gray-100:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)) !important; +} +.hover\:bg-gray-700:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)) !important; +} +.hover\:bg-info-tertiary:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--info-tertiary) / var(--tw-bg-opacity)) !important; +} +.hover\:bg-info-secondary:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--info-secondary) / var(--tw-bg-opacity)) !important; +} +.hover\:bg-blue-400:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(96 165 250 / var(--tw-bg-opacity)) !important; +} +.hover\:bg-info-primary:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--info-primary) / var(--tw-bg-opacity)) !important; +} +.hover\:bg-error-primary:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--error-primary) / var(--tw-bg-opacity)) !important; +} +.hover\:bg-white:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important; +} +.hover\:bg-green-600:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(22 163 74 / var(--tw-bg-opacity)) !important; +} +.hover\:bg-blue-600:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(37 99 235 / var(--tw-bg-opacity)) !important; +} +.hover\:bg-indigo-100:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(224 231 255 / var(--tw-bg-opacity)) !important; +} +.hover\:bg-floating-menu-hover:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--floating-menu-hover) / var(--tw-bg-opacity)) !important; +} +.hover\:bg-success-tertiary:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(var(--success-tertiary) / var(--tw-bg-opacity)) !important; +} +.hover\:bg-green-500:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(34 197 94 / var(--tw-bg-opacity)) !important; +} +.hover\:text-white:hover { + --tw-text-opacity: 1 !important; + color: rgb(255 255 255 / var(--tw-text-opacity)) !important; +} +.hover\:text-blue-400:hover { + --tw-text-opacity: 1 !important; + color: rgb(96 165 250 / var(--tw-text-opacity)) !important; +} +.hover\:text-info-primary:hover { + --tw-text-opacity: 1 !important; + color: rgb(var(--info-primary) / var(--tw-text-opacity)) !important; +} +.hover\:text-gray-700:hover { + --tw-text-opacity: 1 !important; + color: rgb(55 65 81 / var(--tw-text-opacity)) !important; +} +.hover\:text-error-secondary:hover { + --tw-text-opacity: 1 !important; + color: rgb(var(--error-secondary) / var(--tw-text-opacity)) !important; +} +.hover\:text-success-secondary:hover { + --tw-text-opacity: 1 !important; + color: rgb(var(--success-secondary) / var(--tw-text-opacity)) !important; +} +.hover\:underline:hover { + -webkit-text-decoration-line: underline !important; + text-decoration-line: underline !important; +} +.hover\:shadow-lg:hover { + --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) !important; + --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important; + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important; +} +.focus\:border-blue-400:focus { + --tw-border-opacity: 1 !important; + border-color: rgb(96 165 250 / var(--tw-border-opacity)) !important; +} +.focus\:shadow-sm:focus { + --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important; + --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important; + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important; +} +.active\:border-numpad-edge:active { + --tw-border-opacity: 1 !important; + border-color: rgb(var(--numpad-edge) / var(--tw-border-opacity)) !important; +} +.dark .dark\:border-red-700 { + --tw-border-opacity: 1 !important; + border-color: rgb(185 28 28 / var(--tw-border-opacity)) !important; +} +.dark .dark\:border-green-800 { + --tw-border-opacity: 1 !important; + border-color: rgb(22 101 52 / var(--tw-border-opacity)) !important; +} +.dark .dark\:border-blue-700 { + --tw-border-opacity: 1 !important; + border-color: rgb(29 78 216 / var(--tw-border-opacity)) !important; +} +.dark .dark\:border-yellow-700 { + --tw-border-opacity: 1 !important; + border-color: rgb(161 98 7 / var(--tw-border-opacity)) !important; +} +.dark .dark\:border-slate-600 { + --tw-border-opacity: 1 !important; + border-color: rgb(71 85 105 / var(--tw-border-opacity)) !important; +} +.dark .dark\:border-slate-800 { + --tw-border-opacity: 1 !important; + border-color: rgb(30 41 59 / var(--tw-border-opacity)) !important; +} +.dark .dark\:border-slate-700 { + --tw-border-opacity: 1 !important; + border-color: rgb(51 65 85 / var(--tw-border-opacity)) !important; +} +.dark .dark\:bg-red-600 { + --tw-bg-opacity: 1 !important; + background-color: rgb(220 38 38 / var(--tw-bg-opacity)) !important; +} +.dark .dark\:bg-green-700 { + --tw-bg-opacity: 1 !important; + background-color: rgb(21 128 61 / var(--tw-bg-opacity)) !important; +} +.dark .dark\:bg-blue-600 { + --tw-bg-opacity: 1 !important; + background-color: rgb(37 99 235 / var(--tw-bg-opacity)) !important; +} +.dark .dark\:bg-yellow-600 { + --tw-bg-opacity: 1 !important; + background-color: rgb(202 138 4 / var(--tw-bg-opacity)) !important; +} +.dark .dark\:bg-transparent { + background-color: transparent !important; +} +.dark .dark\:bg-slate-600 { + --tw-bg-opacity: 1 !important; + background-color: rgb(71 85 105 / var(--tw-bg-opacity)) !important; +} +.dark .dark\:bg-slate-800 { + --tw-bg-opacity: 1 !important; + background-color: rgb(30 41 59 / var(--tw-bg-opacity)) !important; +} +.dark .dark\:bg-slate-700 { + --tw-bg-opacity: 1 !important; + background-color: rgb(51 65 85 / var(--tw-bg-opacity)) !important; +} +.dark .dark\:bg-slate-900 { + --tw-bg-opacity: 1 !important; + background-color: rgb(15 23 42 / var(--tw-bg-opacity)) !important; +} +.dark .dark\:text-slate-300 { + --tw-text-opacity: 1 !important; + color: rgb(203 213 225 / var(--tw-text-opacity)) !important; +} +.dark .dark\:text-slate-200 { + --tw-text-opacity: 1 !important; + color: rgb(226 232 240 / var(--tw-text-opacity)) !important; +} +.dark .dark\:hover\:bg-slate-600:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(71 85 105 / var(--tw-bg-opacity)) !important; +} +.dark .dark\:hover\:bg-slate-700:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(51 65 85 / var(--tw-bg-opacity)) !important; +} +@media (min-width: 640px) { + + .sm\:relative { + position: relative !important; + } + + .sm\:mx-auto { + margin-left: auto !important; + margin-right: auto !important; + } + + .sm\:hidden { + display: none !important; + } + + .sm\:h-108 { + height: 27rem !important; + } + + .sm\:w-64 { + width: 16rem !important; + } + + .sm\:flex-row { + flex-direction: row !important; + } + + .sm\:rounded-lg { + border-radius: 0.5rem !important; + } + + .sm\:text-sm { + font-size: 0.875rem !important; + line-height: 1.25rem !important; + } + + .sm\:leading-5 { + line-height: 1.25rem !important; + } +} +@media (min-width: 768px) { + + .md\:visible { + visibility: visible !important; + } + + .md\:static { + position: static !important; + } + + .md\:my-2 { + margin-top: 0.5rem !important; + margin-bottom: 0.5rem !important; + } + + .md\:mx-auto { + margin-left: auto !important; + margin-right: auto !important; + } + + .md\:-mx-2 { + margin-left: -0.5rem !important; + margin-right: -0.5rem !important; + } + + .md\:mb-0 { + margin-bottom: 0px !important; + } + + .md\:mt-2 { + margin-top: 0.5rem !important; + } + + .md\:mt-0 { + margin-top: 0px !important; + } + + .md\:block { + display: block !important; + } + + .md\:inline-block { + display: inline-block !important; + } + + .md\:inline { + display: inline !important; + } + + .md\:hidden { + display: none !important; + } + + .md\:h-5\/7-screen { + height: 71.42vh !important; + } + + .md\:h-5\/6-screen { + height: 83.33vh !important; + } + + .md\:h-6\/7-screen { + height: 85.71vh !important; + } + + .md\:h-3\/5-screen { + height: 60vh !important; + } + + .md\:h-4\/5-screen { + height: 80vh !important; + } + + .md\:h-full { + height: 100% !important; + } + + .md\:w-1\/2 { + width: 50% !important; + } + + .md\:w-auto { + width: auto !important; + } + + .md\:w-2\/5 { + width: 40% !important; + } + + .md\:w-4\/7-screen { + width: 57.14vw !important; + } + + .md\:w-5\/7-screen { + width: 71.42vw !important; + } + + .md\:w-2\/5-screen { + width: 40vw !important; + } + + .md\:w-6\/7-screen { + width: 85.71vw !important; + } + + .md\:w-4\/6-screen { + width: 66.66vw !important; + } + + .md\:w-3\/5-screen { + width: 60vw !important; + } + + .md\:w-16 { + width: 4rem !important; + } + + .md\:w-3\/6-screen { + width: 50vw !important; + } + + .md\:w-1\/4 { + width: 25% !important; + } + + .md\:w-3\/7-screen { + width: 42.85vw !important; + } + + .md\:w-2\/3 { + width: 66.666667% !important; + } + + .md\:w-24 { + width: 6rem !important; + } + + .md\:w-2\/4-screen { + width: 50vw !important; + } + + .md\:w-4\/5-screen { + width: 80vw !important; + } + + .md\:w-56 { + width: 14rem !important; + } + + .md\:w-3\/5 { + width: 60% !important; + } + + .md\:w-1\/3 { + width: 33.333333% !important; + } + + .md\:w-3\/4 { + width: 75% !important; + } + + .md\:w-full { + width: 100% !important; + } + + .md\:w-1\/3-screen { + width: 33.33vw !important; + } + + .md\:w-72 { + width: 18rem !important; + } + + .md\:flex-auto { + flex: 1 1 auto !important; + } + + .md\:grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)) !important; + } + + .md\:grid-cols-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)) !important; + } + + .md\:flex-row { + flex-direction: row !important; + } + + .md\:flex-col { + flex-direction: column !important; + } + + .md\:items-start { + align-items: flex-start !important; + } + + .md\:rounded { + border-radius: 0.25rem !important; + } + + .md\:border-l { + border-left-width: 1px !important; + } + + .md\:p-0 { + padding: 0px !important; + } + + .md\:text-3xl { + font-size: 1.875rem !important; + line-height: 2.25rem !important; + } + + .md\:text-base { + font-size: 1rem !important; + line-height: 1.5rem !important; + } + + .md\:text-xl { + font-size: 1.25rem !important; + line-height: 1.75rem !important; + } +} +@media (min-width: 1024px) { + + .lg\:my-8 { + margin-top: 2rem !important; + margin-bottom: 2rem !important; + } + + .lg\:my-1 { + margin-top: 0.25rem !important; + margin-bottom: 0.25rem !important; + } + + .lg\:block { + display: block !important; + } + + .lg\:flex { + display: flex !important; + } + + .lg\:hidden { + display: none !important; + } + + .lg\:h-5\/7-screen { + height: 71.42vh !important; + } + + .lg\:h-3\/7-screen { + height: 42.85vh !important; + } + + .lg\:h-5\/6-screen { + height: 83.33vh !important; + } + + .lg\:h-full { + height: 100% !important; + } + + .lg\:h-4\/5-screen { + height: 80vh !important; + } + + .lg\:w-1\/3 { + width: 33.333333% !important; + } + + .lg\:w-3\/7-screen { + width: 42.85vw !important; + } + + .lg\:w-4\/7-screen { + width: 57.14vw !important; + } + + .lg\:w-half { + width: 50vw !important; + } + + .lg\:w-2\/4-screen { + width: 50vw !important; + } + + .lg\:w-3\/5-screen { + width: 60vw !important; + } + + .lg\:w-2\/7-screen { + width: 28.57vw !important; + } + + .lg\:w-2\/6-screen { + width: 33.33vw !important; + } + + .lg\:w-2\/5-screen { + width: 40vw !important; + } + + .lg\:w-3\/6-screen { + width: 50vw !important; + } + + .lg\:w-56 { + width: 14rem !important; + } + + .lg\:w-1\/3-screen { + width: 33.33vw !important; + } + + .lg\:w-2\/5 { + width: 40% !important; + } + + .lg\:w-1\/2 { + width: 50% !important; + } + + .lg\:w-auto { + width: auto !important; + } + + .lg\:w-3\/5 { + width: 60% !important; + } + + .lg\:w-2\/3 { + width: 66.666667% !important; + } + + .lg\:w-1\/4 { + width: 25% !important; + } + + .lg\:w-full { + width: 100% !important; + } + + .lg\:w-2\/4 { + width: 50% !important; + } + + .lg\:w-4\/6 { + width: 66.666667% !important; + } + + .lg\:w-1\/6 { + width: 16.666667% !important; + } + + .lg\:grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)) !important; + } + + .lg\:grid-cols-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)) !important; + } + + .lg\:flex-row { + flex-direction: row !important; + } + + .lg\:items-start { + align-items: flex-start !important; + } + + .lg\:border-b { + border-bottom-width: 1px !important; + } + + .lg\:border-t { + border-top-width: 1px !important; + } + + .lg\:px-0 { + padding-left: 0px !important; + padding-right: 0px !important; + } + + .lg\:py-1 { + padding-top: 0.25rem !important; + padding-bottom: 0.25rem !important; + } + + .lg\:text-5xl { + font-size: 3rem !important; + line-height: 1 !important; + } + + .lg\:text-lg { + font-size: 1.125rem !important; + line-height: 1.75rem !important; + } + + .lg\:text-xl { + font-size: 1.25rem !important; + line-height: 1.75rem !important; + } + + .lg\:text-2xl { + font-size: 1.5rem !important; + line-height: 2rem !important; + } +} +@media (min-width: 1280px) { + + .xl\:h-2\/5-screen { + height: 40vh !important; + } + + .xl\:w-2\/5-screen { + width: 40vw !important; + } + + .xl\:w-108 { + width: 27rem !important; + } + + .xl\:w-2\/6-screen { + width: 33.33vw !important; + } + + .xl\:w-84 { + width: 21rem !important; + } + + .xl\:w-1\/4 { + width: 25% !important; + } + + .xl\:w-1\/2 { + width: 50% !important; + } + + .xl\:w-2\/4 { + width: 50% !important; + } + + .xl\:grid-cols-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)) !important; + } + + .xl\:grid-cols-6 { + grid-template-columns: repeat(6, minmax(0, 1fr)) !important; + } + + .xl\:border-none { + border-style: none !important; + } + + .xl\:text-xl { + font-size: 1.25rem !important; + line-height: 1.75rem !important; + } +} +@media print { + + .print\:w-1\/3 { + width: 33.333333% !important; + } + + .print\:w-1\/2 { + width: 50% !important; + } +} diff --git a/public/js/app.min.js b/public/js/app.min.js index 3251cd67a..8235aa9b1 100644 --- a/public/js/app.min.js +++ b/public/js/app.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[219,198],{6178:(e,t,n)=>{"use strict";var s=n(538),i=n(876),r=(n(131),n(7166)),a=n.n(r),o=n(5675),l=n(1625),c=window.nsState,d=window.nsScreen,u=window.ns.cssFiles,f=window.nsExtraComponents,p={name:"_blank",specs:["fullscreen=yes","titlebar=yes","scrollbars=yes"],styles:["/css/".concat(u["app.css"]),"/css/".concat(u["light.css"]),"/css/".concat(u["grid.css"]),"/css/".concat(u["typography.css"])]};window.nsHotPress=new l.e,s.default.use(o.Z,p);var h=s.default.component("vue-apex-charts",a()),m=Object.assign(Object.assign({nsModules:function(){return n.e(333).then(n.bind(n,2333))},nsRewardsSystem:function(){return n.e(694).then(n.bind(n,1694))},nsCreateCoupons:function(){return n.e(298).then(n.bind(n,298))},nsManageProducts:function(){return n.e(413).then(n.bind(n,4413))},nsSettings:function(){return n.e(914).then(n.bind(n,7353))},nsReset:function(){return n.e(517).then(n.bind(n,5517))},nsPermissions:function(){return n.e(496).then(n.bind(n,2496))},nsProcurement:function(){return n.e(934).then(n.bind(n,5934))},nsProcurementInvoice:function(){return n.e(716).then(n.bind(n,7716))},nsMedia:function(){return Promise.resolve().then(n.bind(n,9542))},nsDashboardCards:function(){return n.e(270).then(n.bind(n,4270))},nsCashierDashboard:function(){return n.e(987).then(n.bind(n,7987))},nsBestCustomers:function(){return n.e(352).then(n.bind(n,5352))},nsBestCashiers:function(){return n.e(458).then(n.bind(n,8458))},nsOrdersSummary:function(){return n.e(901).then(n.bind(n,7901))},nsOrdersChart:function(){return n.e(522).then(n.bind(n,5522))},nsNotifications:function(){return n.e(665).then(n.bind(n,1665))},nsSaleReport:function(){return n.e(939).then(n.bind(n,9939))},nsSoldStockReport:function(){return n.e(967).then(n.bind(n,1967))},nsProfitReport:function(){return n.e(730).then(n.bind(n,9730))},nsCashFlowReport:function(){return n.e(537).then(n.bind(n,7537))},nsYearlyReport:function(){return n.e(59).then(n.bind(n,5059))},nsPaymentTypesReport:function(){return n.e(945).then(n.bind(n,4948))},nsBestProductsReport:function(){return n.e(521).then(n.bind(n,5521))},nsLowStockReport:function(){return n.e(399).then(n.bind(n,399))},nsStockAdjustment:function(){return n.e(114).then(n.bind(n,2114))},nsPromptPopup:function(){return n.e(33).then(n.bind(n,3033))},nsAlertPopup:function(){return n.e(634).then(n.bind(n,7634))},nsConfirmPopup:function(){return Promise.resolve().then(n.bind(n,914))},nsPOSLoadingPopup:function(){return n.e(409).then(n.bind(n,409))},nsOrderInvoice:function(){return n.e(588).then(n.bind(n,9631))},VueApexCharts:h},i),f);for(var v in m)void 0!==m[v].name&&"VueComponent"!==m[v].name&&s.default.component(m[v].name,m[v]);var b=new s.default({el:"#dashboard-aside",data:{sidebar:"visible"},components:m,mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))}});window.nsDashboardAside=b,window.nsDashboardOverlay=new s.default({el:"#dashboard-overlay",data:{sidebar:null},components:m,mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))},methods:{closeMenu:function(){c.setState({sidebar:"hidden"===this.sidebar?"visible":"hidden"})}}}),window.nsDashboardHeader=new s.default({el:"#dashboard-header",data:{menuToggled:!1,sidebar:"visible"},components:m,methods:{toggleMenu:function(){this.menuToggled=!this.menuToggled},toggleSideMenu:function(){["lg","xl"].includes(d.breakpoint),c.setState({sidebar:"hidden"===this.sidebar?"visible":"hidden"})}},mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))}}),window.nsComponents=Object.assign(m,i),window.nsDashboardContent=new s.default({el:"#dashboard-content",components:m})},7700:(e,t,n)=>{"use strict";n.d(t,{l:()=>z,kq:()=>I,ih:()=>H,kX:()=>L});var s=n(6486),i=n(8945),r=n(6300),a=n(8345),o=n(9093),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=I.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),$=n(9020),E=n(7794);function P(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&V(t.prototype,n),s&&V(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),U=new b({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});H.defineClient(i.Z),window.nsEvent=z,window.nsHttpClient=H,window.nsSnackBar=L,window.nsCurrency=$.W,window.nsTruncate=E.b,window.nsRawCurrency=$.f,window.nsAbbreviate=S,window.nsState=U,window.nsUrl=R,window.nsScreen=N,window.ChartJS=r,window.EventEmitter=h,window.Popup=_.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=Z,window.nsTax=q.Z},876:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>x.P,nsIconButton:()=>S,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>_,nsNotice:()=>J.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(7700),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n
\n \n \n \n {{ label }}\n \n {{ notification }}\n \n \n
\n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
\n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

    \n
    \n '}),T=n.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=n.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),A=s(3164),V=s(5318),q=s(4687),M=s.n(q),Z=s(914),Y=s(665),R=s(2830);const z={data:function(){return{fields:[],validation:new b.Z}},methods:{__:u.__,popupCloser:Y.Z,popupResolver:R.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var I=s(1900);const U=(0,I.Z)(z,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[s("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[s("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[s("div",[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var L=function(e,t,s,n){return new(s||(s=Promise))((function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function o(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(a,o)}l((n=n.apply(e,t||[])).next())}))};const H={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,u.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:u.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,u.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,u.__)("Unexpected error occurred.")).subscribe()}))},clearSelectedEntries:function(){var e=this;m.G.show(Z.default,{title:(0,u.__)("Clear Selected Entries ?"),message:(0,u.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(console.log({row:e}),!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var s=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(s,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(s){s.$checked=e,t.refreshRow(s)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,u.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,u.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,u.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return L(this,void 0,void 0,M().mark((function e(){var t,s=this;return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(U),e.next=4,new Promise((function(e,t){m.G.show(U,{resolve:e,reject:t,queryFilters:s.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const N=(0,I.Z)(H,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?s("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[s("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?s("div",{staticClass:"px-2 flex items-center justify-center"},[s("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[s("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),s("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[s("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?s("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[s("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 flex items-center justify-center"},[s("button",{staticClass:"rounded-full text-sm h-10 px-3 outline-none border ns-crud-button",on:{click:function(t){return e.refresh()}}},[s("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?s("div",{staticClass:"px-2 flex items-center"},[s("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():s("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?s("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():s("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?s("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),s("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[s("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[s("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",[s("th",{staticClass:"text-center px-2 border w-16 py-2"},[s("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,n){return s("th",{key:n,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(n)}}},[s("div",{staticClass:"w-full flex justify-between items-center"},[s("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),s("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?s("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?s("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),s("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,n){return s("ns-table-row",{key:n,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():s("tr",[s("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?s("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?s:s[0]}}},[s("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,n){return s("option",{key:n,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),s("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),s("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var X=s(7751),Q=s(1726),W=s(7259);const G=n.default.extend({methods:{__:u.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,Q.createAvatar)(W,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const B=(0,I.Z)(G,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[s("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),s("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?s("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?s("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=s(328),J=s(2404),ee=s(9045),te=s(3502);const se={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:u.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,s,n;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},s=e.searchArgument||"search",n=e.searchText,s in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,u.__)("An unexpected error occurred.")).subscribe()}})}),1e3)}},mounted:function(){}};const ne=(0,I.Z)(se,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-search"},[s("div",{staticClass:"input-group info border-2"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),s("div",{staticClass:"relative"},[s("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?s("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,n){return s("li",{key:n,staticClass:"border-b p-2 cursor-pointer",on:{click:function(s){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},4110:(e,t,s)=>{"use strict";s.d(t,{P:()=>o});var n=s(538),i=s(328),r=s(5318),a=s(3164),o=n.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n '})},9020:(e,t,s)=>{"use strict";s.d(t,{W:()=>c,f:()=>u});var n=s(2077),i=s.n(n),r=s(538),a=s(6740),o=s.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,s,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===n){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};s=o()(e,r).format()}else s=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(s).concat("after"===ns.currency.ns_currency_position?t:"")})),u=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},7794:(e,t,s)=>{"use strict";s.d(t,{b:()=>n});var n=s(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},4679:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;si});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,s,i;return t=e,s=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var s in e.tabs)if(e.tabs[s].fields){var n=[],i=this.validateFieldsErrors(e.tabs[s].fields);i.length>0&&n.push(i),e.tabs[s].errors=n.flat(),t.push(n.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var s in e)0===t&&(e[s].active=!0),e[s].active=void 0!==e[s].active&&e[s].active,e[s].fields=this.createFields(e[s].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var s=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(s,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(s){t.fieldPassCheck(e,s)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var s in e.tabs)void 0===t[s]&&(t[s]={}),t[s]=this.extractFields(e.tabs[s].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var s=function(s){var n=s.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===n.length&&e.tabs[n[0]].fields.forEach((function(e){e.name===n[1]&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))})),s===e.main.name&&t.errors[s].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var n in t.errors)s(n)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var s=function(s){e.forEach((function(e){e.name===s&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))}))};for(var n in t.errors)s(n)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){s.identifier===t.identifier&&!0===s.invalid&&e.errors.splice(n,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){!0===s[t.identifier]&&e.errors.splice(n,1)}))}return e}}],s&&n(t.prototype,s),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3632:(e,t,s)=>{"use strict";s.d(t,{__:()=>n,c:()=>i});var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},665:(e,t,s)=>{"use strict";function n(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var s=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(s+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}s.d(t,{Z:()=>n})},2830:(e,t,s)=>{"use strict";function n(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}s.d(t,{Z:()=>n})},6979:(e,t,s)=>{"use strict";s.d(t,{G:()=>c});var n=s(4687),i=s.n(n),r=s(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var s=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[s-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,s,n;return t=e,s=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=0;s<10;s++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,s,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,u=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){u.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var s="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(s),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],n=[{key:"show",value:function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(n);return i.open(t,s),i}}],s&&o(t.prototype,s),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},282:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;si});var i=function(){function e(t){var s=t.urls,n=t.options;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.printingURL={refund:"refund_printing_url",sale:"sale_printing_url",payment:"payment_printing_url"},this.urls=s,this.options=n}var t,s,i;return t=e,s=[{key:"processRegularPrinting",value:function(e,t){var s=document.querySelector("#printing-section");s&&s.remove();var n=this.urls[this.printingURL[t]].replace("{reference_id}",e),i=document.createElement("iframe");i.id="printing-section",i.className="hidden",i.src=n,document.body.appendChild(i),setTimeout((function(){document.querySelector("#printing-section").remove()}),5e3)}},{key:"process",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"aloud";"default"===this.options.ns_pos_printing_gateway?this.processRegularPrinting(e,t):this.processCustomPrinting(e,this.options.ns_pos_printing_gateway,t,s)}},{key:"processCustomPrinting",value:function(e,t,s){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"aloud",i={printed:!1,reference_id:e,gateway:t,document:s,mode:n},r=nsHooks.applyFilters("ns-custom-print",{params:i,promise:function(){return new Promise((function(e,t){t({status:"failed",message:__("The selected print gateway doesn't support this type of printing.","NsPrintAdapter")})}))}});r.promise().then((function(e){nsSnackBar.success(e.message).subscribe()})).catch((function(e){nsSnackBar.error(e.message||__("An error unexpected occured while printing.")).subscribe()}))}}],s&&n(t.prototype,s),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9093:(e,t,s)=>{"use strict";s.d(t,{S:()=>r});var n=s(3260);function i(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return n.Observable.create((function(n){var r=s.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){n.onNext(a),n.onCompleted(),o.remove()})),s.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var s,n=function(){e>0&&!1!==e&&(s=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(s)})),t.addEventListener("mouseleave",(function(){n()})),n()}},{key:"__createSnack",value:function(e){var t=e.message,s=e.label,n=e.type,i=void 0===n?"info":n,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),u="",d="";switch(i){case"info":u="",d="info";break;case"error":u="",d="error";break;case"success":u="",d="success"}return o.textContent=t,o.setAttribute("class","pr-2"),s&&(l.setAttribute("class","ns-button default"),c.textContent=s,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(u)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],s&&i(t.prototype,s),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7995:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});var n=s(2376);function i(e,t){for(var s=0;s{"use strict";var n=s(800),i=s(7700);const r={name:"ns-products-preview",computed:{product:function(){return this.$popupParams.product}},methods:{__:s(3632).__,changeActiveTab:function(e){this.active=e,"units-quantities"===this.active&&this.loadProductQuantities()},loadProductQuantities:function(){var e=this;this.hasLoadedUnitQuantities=!1,i.ih.get("/api/nexopos/v4/products/".concat(this.product.id,"/units/quantities")).subscribe((function(t){e.unitQuantities=t,e.hasLoadedUnitQuantities=!0}))}},data:function(){return{active:"units-quantities",unitQuantities:[],hasLoadedUnitQuantities:!1}},mounted:function(){var e=this;this.loadProductQuantities(),this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.$popup.close()}))}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"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"},[s("div",{staticClass:"p-2 border-b ns-box-header text-primary text-center font-medium flex justify-between items-center"},[s("div",[e._v("\n "+e._s(e.__("Previewing :"))+" "+e._s(e.product.name)+"\n ")]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.$popup.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex-auto overflow-y-auto ns-box-body"},[s("div",{staticClass:"p-2"},[s("ns-tabs",{attrs:{active:e.active},on:{active:function(t){return e.changeActiveTab(t)}}},[s("ns-tabs-item",{attrs:{label:e.__("Units & Quantities"),identifier:"units-quantities"}},[e.hasLoadedUnitQuantities?s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",[s("th",{staticClass:"p-1 border"},[e._v(e._s(e.__("Unit")))]),e._v(" "),s("th",{staticClass:"text-right p-1 border",attrs:{width:"150"}},[e._v(e._s(e.__("Sale Price")))]),e._v(" "),s("th",{staticClass:"text-right p-1 border",attrs:{width:"150"}},[e._v(e._s(e.__("Wholesale Price")))]),e._v(" "),s("th",{staticClass:"text-right p-1 border",attrs:{width:"150"}},[e._v(e._s(e.__("Quantity")))])])]),e._v(" "),s("tbody",e._l(e.unitQuantities,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"p-1 border text-left"},[e._v(e._s(t.unit.name))]),e._v(" "),s("td",{staticClass:"p-1 border text-right"},[e._v(e._s(e._f("currency")(t.sale_price)))]),e._v(" "),s("td",{staticClass:"p-1 border text-right"},[e._v(e._s(e._f("currency")(t.wholesale_price)))]),e._v(" "),s("td",{staticClass:"p-1 border text-right"},[e._v(e._s(t.quantity))])])})),0)]):e._e(),e._v(" "),e.hasLoadedUnitQuantities?e._e():s("ns-spinner",{attrs:{size:"16",border:"4"}})],1)],1)],1)])])}),[],!1,null,null,null).exports;var o=s(7634),l=s(914),c=s(3033),u=s(9542),d=s(7962),f=s(1765),p=s(2614),m=s(409),v={nsOrderPreview:n.Z,nsProductPreview:a,nsAlertPopup:o.default,nsConfirmPopup:l.default,nsPromptPopup:c.default,nsMediaPopup:u.default,nsProcurementQuantity:d.Z,nsOrdersRefund:f.Z,nsSelectPopup:p.Z,nsPOSLoadingPopup:m.default};for(var h in v)window[h]=v[h]},6700:(e,t,s)=>{var n={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":1793,"./ru.js":1793,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return s(t)}function r(e){if(!s.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=r,e.exports=i,i.id=6700},328:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(538),i=s(381),r=s.n(i),a=s(7144),o=s.n(a),l=(s(9095),s(3632));const c=n.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?s("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[s("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),s("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[s("i",{staticClass:"las la-times"})]),e._v(" "),s("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[s("div",{staticClass:"flex justify-between items-center w-full py-2"},[s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},5318:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(381),i=s.n(n);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:s(3632).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker mb-2"},[e.field?s("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),s("div",{staticClass:"ns-button"},[s("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?s("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?s("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?s("span",{staticClass:"mx-1 text-sm"},[null!==e.date?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?s("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?s("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?s("div",{staticClass:"relative z-10 h-0 w-0"},[s("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[s("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[s("i",{staticClass:"las la-minus"})]),e._v(" "),s("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[s("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,n){return s("div",{key:n,staticClass:"h-8 flex justify-center items-center text-sm"},[[s("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thu")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(n,i){return s("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===n?s("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),s("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[s("div",{staticClass:"-mx-1 flex justify-between"},[s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-1 flex"},[e.field?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[s("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[s("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),s("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},9045:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(381),i=s.n(n);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:s(3632).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker"},[s("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),s("span",{staticClass:"mx-1 text-sm"},[s("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?s("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?s("div",{staticClass:"relative h-0 w-0 -mb-2"},[s("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thu")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(n,i){return s("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===n?s("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),s("div")])]):e._e()])}),[],!1,null,null,null).exports},2404:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});const n={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[s("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),s("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},7751:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(3632);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var s=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",s)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,s(1900).Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,n){return s("div",{key:n,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(s){return e.inputValue(t)}}},[void 0!==t.value?s("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?s("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3502:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});const n={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},3164:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});const n={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"mb-2 ns-switch"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,n){return s("button",{key:n,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(s){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},9542:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var n=s(4687),i=s.n(n),r=s(7700),a=s(665),o=s(3632),l=s(914);function c(e,t,s,n,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void s(e)}o.done?t(l):Promise.resolve(l).then(n,i)}const u={name:"ns-media",props:["popup"],components:{VueUpload:s(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var s,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),n=i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s[t],e.prev=1,n.progress=1,e.next=5,new Promise((function(e,t){var s=new FormData;s.append("file",n.file),r.ih.post("/api/nexopos/v4/medias",s,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){n.uploaded=!0,n.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),n.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(s,n){n!==t.response.data.indexOf(e)&&(s.selected=!1)})),e.selected=!e.selected}}};const d=(0,s(1900).Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[s("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[s("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),s("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,n){return s("li",{key:n,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?s("div",{staticClass:"content w-full overflow-hidden flex"},[s("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[s("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),s("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),s("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[s("ul",e._l(e.files,(function(t,n){return s("li",{key:n,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[s("span",[e._v(e._s(t.file.name))]),e._v(" "),s("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?s("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?s("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[s("div"),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),s("div",{staticClass:"flex flex-auto overflow-hidden"},[s("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"p-2 overflow-x-auto"},[s("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,n){return s("div",{key:n},[s("div",{staticClass:"p-2"},[s("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(s){return e.selectResource(t)}}},[s("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?s("div",{staticClass:"flex flex-auto items-center justify-center"},[s("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),s("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0",attrs:{id:"preview"}},[s("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?s("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?s("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),s("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),s("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),s("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[s("div",{staticClass:"flex -mx-2 flex-shrink-0"},[s("div",{staticClass:"px-2 flex-shrink-0 flex"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[s("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[s("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?s("div",{staticClass:"ns-button error"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[s("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),s("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[s("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),s("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),s("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},7634:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});const n={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(void 0!==e.$popupParams.onAction&&e.$popupParams.onAction(!1),e.$popup.close())}))},methods:{__:s(3632).__,emitAction:function(e){void 0!==this.$popupParams.onAction&&this.$popupParams.onAction(e),this.$popup.close()}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-6/7-screen md:w-4/7-screen lg:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"alert-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[e.title?s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]):e._e(),e._v(" "),s("p",{staticClass:"py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t justify-end items-center p-2"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))])],1)])}),[],!1,null,null,null).exports},800:(e,t,s)=>{"use strict";s.d(t,{Z:()=>G});var n=s(7700),i=s(9020),r=s(2277),a=s(4679),o=s(665),l=s(3632);function c(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function u(e){for(var t=1;tthis.availableQuantity)return n.kX.error("Unable to proceed as the quantity provided is exceed the available quantity.").subscribe();this.product.quantity=parseFloat(e),this.$popupParams.resolve(this.product),this.$popup.close()}}};const _=(0,p.Z)(b,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box overflow-hidden w-95vw md:w-4/6-screen lg:w-3/7-screen"},[s("div",{staticClass:"p-2 flex justify-between ns-box-header"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Quantity")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),e.product?s("div",{staticClass:"border-t border-b ns-box-body py-2 flex items-center justify-center text-2xl font-semibold"},[s("span",[e._v(e._s(e.seeValue))]),e._v(" "),s("span",{staticClass:"text-primary text-sm"},[e._v("("+e._s(e.availableQuantity)+" "+e._s(e.__("available"))+")")])]):e._e(),e._v(" "),e.product?s("div",{staticClass:"flex-auto overflow-y-auto p-2"},[s("ns-numpad",{attrs:{value:e.product.quantity},on:{next:function(t){return e.updateQuantity(t)},changed:function(t){return e.setChangedValue(t)}}})],1):e._e()])}),[],!1,null,null,null).exports;var y=s(2614),g=s(914),x=s(6979),w=s(282);function C(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function k(e){for(var t=1;t0?this.refundables.map((function(e){return parseFloat(e.unit_price)*parseFloat(e.quantity)})).reduce((function(e,t){return e+t}))+this.shippingFees:0+this.shippingFees},shippingFees:function(){return this.refundShipping?this.order.shipping:0}},data:function(){return{isSubmitting:!1,formValidation:new a.Z,refundables:[],paymentOptions:[],paymentField:[],print:new w.Z({urls:systemUrls,options:systemOptions}),refundShipping:!1,selectedPaymentGateway:!1,screen:0,selectFields:[{type:"select",options:this.order.products.map((function(e){return{label:"".concat(e.name," - ").concat(e.unit.name," (x").concat(e.quantity,")"),value:e.id}})),validation:"required",name:"product_id",label:(0,l.__)("Product"),description:(0,l.__)("Select the product to perform a refund.")}]}},methods:{__:l.__,updateScreen:function(e){this.screen=e},toggleRefundShipping:function(e){this.refundShipping=e,this.refundShipping},proceedPayment:function(){var e=this;return!1===this.selectedPaymentGateway?n.kX.error((0,l.__)("Please select a payment gateway before proceeding.")).subscribe():0===this.total?n.kX.error((0,l.__)("There is nothing to refund.")).subscribe():0===this.screenValue?n.kX.error((0,l.__)("Please provide a valid payment amount.")).subscribe():void x.G.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("The refund will be made on the current order."),onAction:function(t){t&&e.doProceed()}})},doProceed:function(){var e=this,t={products:this.refundables,total:this.screenValue,payment:this.selectedPaymentGateway,refund_shipping:this.refundShipping};this.isSubmitting=!0,n.ih.post("/api/nexopos/v4/orders/".concat(this.order.id,"/refund"),t).subscribe({next:function(t){e.isSubmitting=!1,e.$emit("changed",!0),"refunded"===t.data.order.payment_status&&e.$emit("loadTab","details"),e.print.process(t.data.orderRefund.id,"refund"),n.kX.success(t.message).subscribe()},error:function(t){e.isSubmitting=!1,n.kX.error(t.message).subscribe()}})},addProduct:function(){var e=this;if(this.formValidation.validateFields(this.selectFields),!this.formValidation.fieldsValid(this.selectFields))return n.kX.error((0,l.__)("Please select a product before proceeding.")).subscribe();var t=this.formValidation.extractFields(this.selectFields),s=this.order.products.filter((function(e){return e.id===t.product_id})),i=this.refundables.filter((function(e){return e.id===t.product_id}));if(i.length>0){var r=i.map((function(e){return parseInt(e.quantity)})).reduce((function(e,t){return e+t}));if(r===s[0].quantity)return n.kX.error((0,l.__)("Not enough quantity to proceed.")).subscribe()}if(0===s[0].quantity)return n.kX.error((0,l.__)("Not enough quantity to proceed.")).subscribe();var a=k(k({},s[0]),{condition:"",description:""});new Promise((function(e,t){x.G.show(m,{resolve:e,reject:t,product:a})})).then((function(t){t.quantity=e.getProductOriginalQuantity(t.id)-e.getProductUsedQuantity(t.id),e.refundables.push(t)}),(function(e){return e}))},getProductOriginalQuantity:function(e){var t=this.order.products.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},getProductUsedQuantity:function(e){var t=this.refundables.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},openSettings:function(e){var t=this;new Promise((function(t,s){x.G.show(m,{resolve:t,reject:s,product:e})})).then((function(s){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}),(function(e){return e}))},selectPaymentGateway:function(){var e=this;new Promise((function(t,s){x.G.show(y.Z,k({resolve:t,reject:s,value:[e.selectedPaymentOption]},e.paymentField[0]))})).then((function(t){e.selectedPaymentGateway=t[0]}),(function(e){return e}))},changeQuantity:function(e){var t=this;new Promise((function(s,n){var i=t.getProductOriginalQuantity(e.id)-t.getProductUsedQuantity(e.id)+parseFloat(e.quantity);x.G.show(_,{resolve:s,reject:n,product:e,availableQuantity:i})})).then((function(s){if(s.quantity>t.getProductUsedQuantity(e.id)-e.quantity){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}}))},deleteProduct:function(e){var t=this;new Promise((function(s,n){x.G.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to delete this product ?"),onAction:function(s){if(s){var n=t.refundables.indexOf(e);t.refundables.splice(n,1)}}})}))}},mounted:function(){var e=this;this.selectFields=this.formValidation.createFields(this.selectFields),n.ih.get("/api/nexopos/v4/orders/payments").subscribe((function(t){e.paymentField=t}))}};const $=(0,p.Z)(P,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-m-4 flex-auto flex flex-wrap relative"},[e.isSubmitting?s("div",{staticClass:"bg-overlay h-full w-full flex items-center justify-center absolute z-30"},[s("ns-spinner")],1):e._e(),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Refund With Products")))]),e._v(" "),s("div",{staticClass:"my-2"},[s("ul",[s("li",{staticClass:"border-b border-info-primary flex justify-between items-center mb-2"},[s("div",{staticClass:"flex-auto flex-col flex"},[s("div",{staticClass:"p-2 flex"},e._l(e.selectFields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"flex justify-between p-2"},[s("div",{staticClass:"flex items-center text-primary"},[e.order.shipping>0?s("span",{staticClass:"mr-2"},[e._v(e._s(e.__("Refund Shipping")))]):e._e(),e._v(" "),e.order.shipping>0?s("ns-checkbox",{attrs:{checked:e.refundShipping},on:{change:function(t){return e.toggleRefundShipping(t)}}}):e._e()],1),e._v(" "),s("div",[s("button",{staticClass:"border rounded-full px-2 py-1 ns-inset-button info",on:{click:function(t){return e.addProduct()}}},[e._v(e._s(e.__("Add Product")))])])])])]),e._v(" "),s("li",[s("h4",{staticClass:"py-1 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.refundables,(function(t){return s("li",{key:t.id,staticClass:"elevation-surface border flex justify-between items-center mb-2"},[s("div",{staticClass:"px-2 text-primary flex justify-between flex-auto"},[s("div",{staticClass:"flex flex-col"},[s("p",{staticClass:"py-2"},[s("span",[e._v(e._s(t.name))]),e._v(" "),"damaged"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-error-tertiary mx-2 text-white"},[e._v(e._s(e.__("Damaged")))]):e._e(),e._v(" "),"unspoiled"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-success-tertiary mx-2 text-white"},[e._v(e._s(e.__("Unspoiled")))]):e._e()]),e._v(" "),s("small",[e._v(e._s(t.unit.name))])]),e._v(" "),s("div",{staticClass:"flex items-center justify-center"},[s("span",{staticClass:"py-1 flex items-center cursor-pointer border-b border-dashed border-info-primary"},[e._v(e._s(e._f("currency")(t.unit_price*t.quantity)))])])]),e._v(" "),s("div",{staticClass:"flex"},[s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.openSettings(t)}}},[s("i",{staticClass:"las la-cog text-xl"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.deleteProduct(t)}}},[s("i",{staticClass:"las la-trash"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.changeQuantity(t)}}},[e._v(e._s(t.quantity))])])])}))],2)])]),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Summary")))]),e._v(" "),s("div",{staticClass:"py-2"},[s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Total")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.total)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border success font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Paid")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.tendered)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border info font-semibold flex mb-2 p-2 justify-between cursor-pointer",on:{click:function(t){return e.selectPaymentGateway()}}},[s("span",[e._v(e._s(e.__("Payment Gateway")))]),e._v(" "),s("span",[e._v(e._s(e.selectedPaymentGateway?e.selectedPaymentGateway.label:"N/A"))])]),e._v(" "),s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Screen")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.screenValue)))])]),e._v(" "),s("div",[s("ns-numpad",{attrs:{currency:!0,value:e.screen},on:{changed:function(t){return e.updateScreen(t)},next:function(t){return e.proceedPayment(t)}}})],1)])])])}),[],!1,null,null,null).exports;var O=s(3033);function S(e,t){for(var s=0;s0?t[0].label:(0,l.__)("Unknown Status")}},{key:"getDeliveryStatus",value:function(e){var t=deliveryStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,l.__)("Unknown Status")}},{key:"getProcessingStatus",value:function(e){var t=processingStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,l.__)("Unknown Status")}},{key:"getPaymentStatus",value:function(e){var t=paymentLabels.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,l.__)("Unknown Status")}}])&&S(t.prototype,s),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function D(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function T(e){for(var t=1;t0?s("span",[e._v(e._s(e._f("currency")(e.order.total-e.order.tendered)))]):e._e(),e._v(" "),e.order.total-e.order.tendered<=0?s("span",[e._v(e._s(e._f("currency")(0)))]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 w-full md:w-1/2"},[s("div",{staticClass:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface warning border text-xl font-bold"},[s("span",[e._v(e._s(e.__("Customer Account")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.customer.account_amount)))])])])]),e._v(" "),s("div",{staticClass:"flex -mx-4 flex-wrap"},[s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},["paid"!==e.order.payment_status?s("div",[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2"},[e._v("\n "+e._s(e.__("Payment"))+"\n ")]),e._v(" "),s("div",{staticClass:"py-2"},[e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),e._v(" "),s("div",{staticClass:"my-2 px-2 h-12 flex justify-end items-center border elevation-surface"},[e._v("\n "+e._s(e._f("currency")(e.inputValue))+"\n ")]),e._v(" "),s("ns-numpad",{attrs:{floating:!0,value:e.inputValue},on:{next:function(t){return e.submitPayment(t)},changed:function(t){return e.updateValue(t)}}})],2)]):e._e(),e._v(" "),"paid"===e.order.payment_status?s("div",{staticClass:"flex items-center justify-center h-full"},[s("h3",{staticClass:"text-primary font-semibold"},[e._v(e._s(e.__("No payment possible for paid order.")))])]):e._e()]),e._v(" "),s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2 mb-2"},[e._v("\n "+e._s(e.__("Payment History"))+"\n ")]),e._v(" "),s("ul",e._l(e.order.payments,(function(t){return s("li",{key:t.id,staticClass:"p-2 flex items-center justify-between text-shite border elevation-surface mb-2"},[s("span",[e._v(e._s(e.paymentsLabels[t.identifier]||e.__("Unknown")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(t.value)))])])})),0)])])])}),[],!1,null,null,null).exports;var q=s(1765);const M={props:["order"],data:function(){return{processingStatuses,deliveryStatuses,labels:new E,showProcessingSelect:!1,showDeliverySelect:!1}},mounted:function(){},methods:{__:l.__,submitProcessingChange:function(){var e=this;x.G.show(g.default,{title:(0,l.__)("Would you proceed ?"),message:(0,l.__)("The processing status of the order will be changed. Please confirm your action."),onAction:function(t){t&&n.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/processing"),{process_status:e.order.process_status}).subscribe({next:function(t){e.showProcessingSelect=!1,n.kX.success(t.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("Unexpected error occurred.")).subscribe()}})}})},openRefunds:function(){var e=this;try{new Promise((function(t,s){var n=e.order;x.G.show(q.Z,{order:n,resolve:t,reject:s})}))}catch(e){}},submitDeliveryStatus:function(){var e=this;x.G.show(g.default,{title:(0,l.__)("Would you proceed ?"),message:(0,l.__)("The delivery status of the order will be changed. Please confirm your action."),onAction:function(t){t&&n.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/delivery"),{delivery_status:e.order.delivery_status}).subscribe({next:function(t){e.showDeliverySelect=!1,n.kX.success(t.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("Unexpected error occurred.")).subscribe()}})}})}}};const Z=(0,p.Z)(M,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex flex-wrap"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap flex"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Payment Summary")))])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"elevation-surface border p-2 flex justify-between items-start"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Sub Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.subtotal)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[s("span",{staticClass:"text-white"},[e._v(e._s(e.__("Discount")))]),e._v(" "),"percentage"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("("+e._s(e.order.discount_percentage)+"%)")]):e._e(),e._v(" "),"flat"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("(Flat)")]):e._e()])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.discount)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Shipping")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.shipping)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v("\n "+e._s(e.__("Coupons"))+"\n ")])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.total_coupons)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice info"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.total)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice warning"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Taxes")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tax_value)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start text-primary elevation-surface error border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Change")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.change)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Paid")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tendered)))])])])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Order Status")))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Customer")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.order.nexopos_customers_name))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Type")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getTypeLabel(e.order.type)))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Delivery Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showDeliverySelect?e._e():s("span",{staticClass:"font-semibold text-secondary border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showDeliverySelect=!0}}},[e._v(e._s(e.labels.getDeliveryStatus(e.order.delivery_status)))])]),e._v(" "),e.showDeliverySelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.delivery_status,expression:"order.delivery_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"delivery_status",t.target.multiple?s:s[0])}}},e._l(e.deliveryStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showDeliverySelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitDeliveryStatus(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex flex-col md:flex-row justify-between items-center elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Processing Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showProcessingSelect?e._e():s("span",{staticClass:"border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showProcessingSelect=!0}}},[e._v(e._s(e.labels.getProcessingStatus(e.order.process_status)))])]),e._v(" "),e.showProcessingSelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.process_status,expression:"order.process_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"process_status",t.target.multiple?s:s[0])}}},e._l(e.processingStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showProcessingSelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitProcessingChange(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Payment Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getPaymentStatus(e.order.payment_status)))])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.order.products,(function(t){return s("div",{key:t.id,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A"))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])})),e._v(" "),s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary flex justify-between"},[s("span",[e._v(e._s(e.__("Refunded Products")))]),e._v(" "),s("a",{staticClass:"border-b border-info-primary border-dashed",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.openRefunds()}}},[e._v(e._s(e.__("All Refunds")))])])]),e._v(" "),e._l(e.order.refunded_products,(function(t,n){return s("div",{key:n,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.order_product.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A")+" | "),s("span",{staticClass:"rounded-full px-2",class:"damaged"===t.condition?"bg-error-tertiary text-white":"bg-info-tertiary text-white"},[e._v(e._s(t.condition))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])}))],2)])}),[],!1,null,null,null).exports;var Y=s(4687),R=s.n(Y);function z(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function I(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const U={name:"ns-order-instalments-payment",components:{nsNotice:s(876).nsNotice},data:function(){return{paymentTypes,fields:[{type:"select",name:"payment_type",description:(0,l.__)("Select the payment type that must apply to the current order."),label:(0,l.__)("Payment Type"),validation:"required",options:paymentTypes}],print:new w.Z({urls:systemUrls,options:systemOptions}),validation:new a.Z,order:null,instalment:null}},methods:{__:l.__,popupResolver:v.Z,popupCloser:o.Z,close:function(){this.popupResolver(!1)},updateInstalmentAsDue:function(e){var t=this;nsHttpClient.put("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/"),{instalment:{date:ns.date.moment.format("YYYY-MM-DD HH:mm:ss")}}).subscribe({next:function(e){t.submitPayment()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})},submitPayment:function(){var e=this;if(!this.validation.validateFields(this.fields))return n.kX.error(__m("The form is not valid.")).subcribe();nsHttpClient.post("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/pay"),function(e){for(var t=1;t0?this.instalments.map((function(e){return e.amount})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})):0}},methods:{__:l.__,loadInstalments:function(){var e=this;n.ih.get("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments")).subscribe((function(t){e.original=t,e.instalments=t.map((function(e){return e.price_clicked=!1,e.date_clicked=!1,e.date=moment(e.date).format("YYYY-MM-DD"),e}))}))},showReceipt:function(e){if(null===e.payment_id)return n.kX.error((0,l.__)("This instalment doesn't have any payment attached.")).subscribe();this.print.process(e.payment_id,"payment")},addInstalment:function(){this.instalments.push({date:ns.date.moment.format("YYYY-MM-DD"),amount:this.order.total-this.totalInstalments,paid:!1})},createInstalment:function(e){var t=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to create this instalment ?"),onAction:function(s){s&&n.ih.post("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments"),{instalment:e}).subscribe({next:function(e){t.loadInstalments(),n.kX.success(e.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})}})},deleteInstalment:function(e){var t=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to delete this instalment ?"),onAction:function(s){s&&n.ih.delete("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id)).subscribe({next:function(s){var i=t.instalments.indexOf(e);t.instalments.splice(i,1),n.kX.success(s.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})}})},markAsPaid:function(e){var t,s=this;return(t=R().mark((function t(){return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,n){Popup.show(L,{order:s.order,instalment:e,resolve:t,reject:n})}));case 3:t.sent,s.loadInstalments(),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,s=arguments;return new Promise((function(n,i){var r=t.apply(e,s);function a(e){H(r,n,i,a,o,"next",e)}function o(e){H(r,n,i,a,o,"throw",e)}a(void 0)}))})()},togglePriceEdition:function(e){var t=this;e.paid||(e.price_clicked=!e.price_clicked,this.$forceUpdate(),e.price_clicked&&setTimeout((function(){t.$refs.amount[0].select()}),100))},updateInstalment:function(e){var t=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to update that instalment ?"),onAction:function(s){s&&n.ih.put("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id),{instalment:e}).subscribe({next:function(e){n.kX.success(e.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})}})},toggleDateEdition:function(e){var t=this;e.paid||(e.date_clicked=!e.date_clicked,this.$forceUpdate(),e.date_clicked&&setTimeout((function(){t.$refs.date[0].select()}),200))}}};const X=(0,p.Z)(N,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex-auto flex flex-wrap"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Instalments")))])]),e._v(" "),s("div",{staticClass:"px-4"},[s("ul",{staticClass:"border-table-th-edge border-t text-primary"},[e._l(e.instalments,(function(t){return s("li",{key:t.id,staticClass:"border-b border-l flex justify-between elevation-surface",class:t.paid?"success":"info"},[s("span",{staticClass:"p-2"},[t.date_clicked?e._e():s("span",{on:{click:function(s){return e.toggleDateEdition(t)}}},[e._v(e._s(t.date))]),e._v(" "),t.date_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.date,expression:"instalment.date"}],ref:"date",refInFor:!0,staticClass:"border border-info-primary rounded",attrs:{type:"date"},domProps:{value:t.date},on:{blur:function(s){return e.toggleDateEdition(t)},input:function(s){s.target.composing||e.$set(t,"date",s.target.value)}}})]):e._e()]),e._v(" "),s("div",{staticClass:"flex items-center"},[s("div",{staticClass:"flex items-center px-2 h-full border-r"},[t.price_clicked?e._e():s("span",{on:{click:function(s){return e.togglePriceEdition(t)}}},[e._v(e._s(e._f("currency")(t.amount)))]),e._v(" "),t.price_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"instalment.amount"}],ref:"amount",refInFor:!0,staticClass:"border border-info-primary p-1",attrs:{type:"text"},domProps:{value:t.amount},on:{blur:function(s){return e.togglePriceEdition(t)},input:function(s){s.target.composing||e.$set(t,"amount",s.target.value)}}})]):e._e()]),e._v(" "),!t.paid&&t.id?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"success",className:"la-money-bill-wave-alt"},on:{click:function(s){return e.markAsPaid(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"info",className:"la-save"},on:{click:function(s){return e.updateInstalment(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"error",className:"la-trash-alt"},on:{click:function(s){return e.deleteInstalment(t)}}})],1)]):e._e(),e._v(" "),t.paid||t.id?e._e():s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 py-1 rounded-full",on:{click:function(s){return e.createInstalment(t)}}},[s("i",{staticClass:"las la-plus"}),e._v("\n "+e._s(e.__("Create"))+"\n ")])])])]),e._v(" "),t.paid?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 text-xs py-1 rounded-full",on:{click:function(s){return e.showReceipt(t)}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Receipt"))+"\n ")])])]):e._e()])])})),e._v(" "),s("li",{staticClass:"flex justify-between p-2 border-r border-b border-l elevation-surface"},[s("div",{staticClass:"flex items-center justify-center"},[s("span",[e._v("\n "+e._s(e.__("Total :"))+" "+e._s(e._f("currency")(e.order.total))+"\n ")]),e._v(" "),s("span",{staticClass:"ml-1 text-sm"},[e._v("\n ("+e._s(e.__("Remaining :"))+" "+e._s(e._f("currency")(e.order.total-e.totalInstalments))+")\n ")])]),e._v(" "),s("div",{staticClass:"-mx-2 flex flex-wrap items-center"},[s("span",{staticClass:"px-2"},[e._v("\n "+e._s(e.__("Instalments:"))+" "+e._s(e._f("currency")(e.totalInstalments))+"\n ")]),e._v(" "),s("span",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded-full px-3 py-1",on:{click:function(t){return e.addInstalment()}}},[e._v(e._s(e.__("Add Instalment")))])])])])])],2)])])])])}),[],!1,null,null,null).exports;var Q={filters:{nsCurrency:i.W},name:"ns-preview-popup",data:function(){return{active:"details",order:new Object,products:[],payments:[],options:null,print:new w.Z({urls:systemUrls,options:systemOptions}),settings:null}},components:{nsOrderRefund:$,nsOrderPayment:V,nsOrderDetails:Z,nsOrderInstalments:X},computed:{isVoidable:function(){return["paid","partially_paid","unpaid"].includes(this.order.payment_status)},isDeleteAble:function(){return["hold"].includes(this.order.payment_status)}},methods:{__:l.__,popupResolver:v.Z,popupCloser:o.Z,closePopup:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.popupResolver(e)},setActive:function(e){this.active=e},printOrder:function(){this.print.process(this.order.id,"sale")},refresh:function(){this.$popupParams.component.$emit("updated"),this.loadOrderDetails(this.order.id)},loadOrderDetails:function(e){var t=this;(0,r.D)([n.ih.get("/api/nexopos/v4/orders/".concat(e)),n.ih.get("/api/nexopos/v4/orders/".concat(e,"/products")),n.ih.get("/api/nexopos/v4/orders/".concat(e,"/payments"))]).subscribe((function(e){t.order=e[0],t.products=e[1],t.payments=e[2]}))},deleteOrder:function(){var e=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to delete this order"),onAction:function(t){t&&n.ih.delete("/api/nexopos/v4/orders/".concat(e.order.id)).subscribe({next:function(t){n.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){n.kX.error(e.message).subscribe()}})}})},voidOrder:function(){var e=this;try{new Promise((function(t,s){Popup.show(O.default,{resolve:t,reject:s,title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("The current order will be void. This action will be recorded. Consider providing a reason for this operation"),onAction:function(t){!1!==t&&n.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/void"),{reason:t}).subscribe({next:function(t){n.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){n.kX.error(e.message).subscribe()}})}})}))}catch(e){console.log(e)}},refreshCrudTable:function(){this.$popupParams.component.$emit("updated",!0)}},watch:{active:function(){"details"===this.active&&this.loadOrderDetails(this.order.id)}},mounted:function(){this.order=this.$popupParams.order,this.options=systemOptions,this.urls=systemUrls,this.loadOrderDetails(this.order.id),this.popupCloser()}};window.nsOrderPreviewPopup=Q;const W=Q;const G=(0,p.Z)(W,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-95vh w-95vw md:h-6/7-screen md:w-6/7-screen overflow-hidden shadow-xl ns-box flex flex-col"},[s("div",{staticClass:"border-b ns-box-header p-3 flex items-center justify-between"},[s("div",[s("h3",[e._v(e._s(e.__("Order Options")))])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup(!0)}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 overflow-scroll ns-box-body flex flex-auto"},[e.order.id?s("ns-tabs",{attrs:{active:e.active},on:{active:function(t){return e.setActive(t)}}},[s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Details"),identifier:"details"}},[s("ns-order-details",{attrs:{order:e.order}})],1),e._v(" "),["order_void","hold","refunded","partially_refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Payments"),identifier:"payments"}},[s("ns-order-payment",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1),e._v(" "),["order_void","hold","refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Refund & Return"),identifier:"refund"}},[s("ns-order-refund",{attrs:{order:e.order},on:{loadTab:function(t){return e.setActive(t)},changed:function(t){return e.refresh()}}})],1),e._v(" "),["partially_paid","unpaid"].includes(e.order.payment_status)&&e.order.support_instalments?s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Installments"),identifier:"instalments"}},[s("ns-order-instalments",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1):e._e()],1):e._e(),e._v(" "),e.order.id?e._e():s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)],1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between border-t ns-box-footer"},[s("div",[e.isVoidable?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.voidOrder()}}},[s("i",{staticClass:"las la-ban"}),e._v("\n "+e._s(e.__("Void"))+"\n ")]):e._e(),e._v(" "),e.isDeleteAble?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.deleteOrder()}}},[s("i",{staticClass:"las la-trash"}),e._v("\n "+e._s(e.__("Delete"))+"\n ")]):e._e()],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.printOrder()}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Print"))+"\n ")])],1)])])}),[],!1,null,null,null).exports},1765:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(3632),i=s(665),r=s(2830),a=s(7700),o=s(282);const l={name:"ns-orders-refund-popup",data:function(){return{order:null,refunds:[],view:"summary",previewed:null,loaded:!1,options:systemOptions,systemUrls,print:new o.Z({urls:systemUrls,options:systemOptions})}},methods:{__:n.__,popupCloser:i.Z,popupResolver:r.Z,toggleProductView:function(e){this.view="details",this.previewed=e},loadOrderRefunds:function(){var e=this;nsHttpClient.get("/api/nexopos/v4/orders/".concat(this.order.id,"/refunds")).subscribe((function(t){e.loaded=!0,e.refunds=t.refunds}),(function(e){a.kX.error(e.message).subscribe()}))},close:function(){this.$popup.close()},printRefundReceipt:function(e){this.print.process(e.id,"refund")}},mounted:function(){this.order=this.$popupParams.order,this.popupCloser(),this.loadOrderRefunds()}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-3/5-screen ns-box flex flex-col overflow-hidden"},[s("div",{staticClass:"border-b p-2 flex items-center justify-between ns-box-header"},[s("h3",[e._v(e._s(e.__("Order Refunds")))]),e._v(" "),s("div",{staticClass:"flex"},["details"===e.view?s("div",{staticClass:"flex items-center justify-center cursor-pointer rounded-full px-3 border hover:bg-info-primary hover:text-white mr-1",on:{click:function(t){e.view="summary"}}},[e._v(e._s(e.__("Go Back")))]):e._e(),e._v(" "),s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"overflow-auto flex-auto ns-box-body"},["summary"===e.view?[e.loaded?e._e():s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("ns-spinner",{attrs:{size:"24"}})],1),e._v(" "),e.loaded&&0===e.refunds.length?s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("i",{staticClass:"lar la-frown-open"})]):e._e(),e._v(" "),e.loaded&&e.refunds.length>0?e._l(e.refunds,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(e.order.code))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total)))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("By"))+" : "+e._s(t.author.username))])])])]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.toggleProductView(t)}}},[s("i",{staticClass:"las la-eye"})]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.printRefundReceipt(t)}}},[s("i",{staticClass:"las la-print"})])])})):e._e()]:e._e(),e._v(" "),"details"===e.view?e._l(e.previewed.refunded_products,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(t.product.name))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Condition"))+" : "+e._s(t.condition))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Quantity"))+" : "+e._s(t.quantity))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total_price)))])])])])])})):e._e()],2)])}),[],!1,null,null,null).exports},914:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>o});var n=s(3632),i=s(2830),r=s(665);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:n.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,s(1900).Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[s("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t"},[s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),s("hr",{staticClass:"border-r h-16"}),e._v(" "),s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports},409:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});const n={name:"ns-pos-loading-popup"};const i=(0,s(1900).Z)(n,(function(){var e=this.$createElement;return(this._self._c||e)("ns-spinner")}),[],!1,null,null,null).exports},7962:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var n=s(7700),i=s(3632);function r(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s{"use strict";s.r(t),s.d(t,{default:()=>i});const n={data:function(){return{title:"",message:"",input:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.input=this.$popupParams.input||"",this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())}))},methods:{__:s(3632).__,emitAction:function(e){this.$popupParams.onAction(e?this.input:e),this.$popup.close()},reject:function(e){void 0!==this.$popupParams.reject&&this.$popupParams.reject(e),this.$popup.close()}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-5/7-screen md:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"prompt-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-2"},[s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"w-full md:mx-auto md:w-2/3 py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"p-2"},[s("div",{staticClass:"ns-input"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.input,expression:"input"}],staticClass:"w-full border-2 p-2",attrs:{name:"",id:"",cols:"30",rows:"10"},domProps:{value:e.input},on:{input:function(t){t.target.composing||(e.input=t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"flex border-t action-buttons"},[s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))]),e._v(" "),s("hr",{staticClass:"border-r"}),e._v(" "),s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.reject(!1)}}},[e._v(e._s(e.__("Cancel")))])])])}),[],!1,null,null,null).exports},2614:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(665),i=s(3632);const r={data:function(){return{value:[],options:[],description:"",label:null,type:"select"}},computed:{},mounted:function(){this.popupCloser(),this.value=this.$popupParams.value||[],this.options=this.$popupParams.options,this.label=this.$popupParams.label,this.description=this.$popupParams.description||"",this.type=this.$popupParams.type||this.type},methods:{popupCloser:n.Z,__:i.__,toggle:function(e){var t=this.value.indexOf(e);-1===t?this.value.unshift(e):this.value.splice(t,1)},isSelected:function(e){return this.value.indexOf(e)>=0},close:function(){this.$popupParams.reject(!1),this.$popup.close()},select:function(e){void 0!==e&&(this.value=[e]),this.$popupParams.resolve(this.value),this.close()}}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box w-6/7-screen md:w-4/7-screen lg:w-3/7-screen max-h-5/6-screen overflow-hidden flex flex-col"},[s("div",{staticClass:"p-2 flex justify-between border-b items-center ns-box-header"},[s("span",{staticClass:"text-semibold text-primary"},[e._v("\n "+e._s(e.label)+"\n ")]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex flex-col overflow-hidden"},[e.description.length>0?s("p",{staticClass:"p-2 text-center text-sm bg-info-primary"},[e._v(e._s(e.description))]):e._e(),e._v(" "),s("div",{staticClass:"overflow-y-auto"},[s("ul",{staticClass:"ns-vertical-menu"},["select"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b border-box-edge text-primary cursor-pointer",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})):e._e(),e._v(" "),"multiselect"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b text-primary cursor-pointer",class:e.isSelected(t)?"active":"",on:{click:function(s){return e.toggle(t)}}},[e._v(e._s(t.label))])})):e._e()],2)])]),e._v(" "),"multiselect"===e.type?s("div",{staticClass:"flex justify-between"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.select()}}},[e._v(e._s(e.__("Select")))])],1)]):e._e()])}),[],!1,null,null,null).exports},5042:()=>{}},e=>{e.O(0,[898],(()=>{return t=4119,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/pos-init.min.js b/public/js/pos-init.min.js index 65e2eb1e7..ff6b89483 100644 --- a/public/js/pos-init.min.js +++ b/public/js/pos-init.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[443,198,33,634,409],{7700:(e,t,s)=>{"use strict";s.d(t,{l:()=>I,kq:()=>U,ih:()=>L,kX:()=>H});var n=s(6486),r=s(8945),i=s(6300),o=s(8345),a=s(9093),l=s(9248),c=s(230);function u(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,s)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,s)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var s=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=U.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:n}),new c.y((function(i){s._client[e](t,n,Object.assign(Object.assign({},s._client.defaults[e]),r)).then((function(e){s._lastRequestData=e,i.next(e.data),i.complete(),s._subject.next({identifier:"async.stop"})})).catch((function(e){var t;i.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),s._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,s=e.value;this._subject.next({identifier:t,value:s})}}],s&&u(t.prototype,s),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=s(3);function f(e,t){for(var s=0;s=1e3){for(var s,n=Math.floor((""+e).length/3),r=2;r>=1;r--){if(((s=parseFloat((0!=n?e/Math.pow(1e3,n):e).toPrecision(r)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}s%1!=0&&(s=s.toFixed(1)),t=s+["","k","m","b","t"][n]}return t})),O=s(9020),S=s(7794);function $(e,t){for(var s=0;s0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&Z(t.prototype,s),n&&Z(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()),N=new _({sidebar:["xs","sm","md"].includes(Y.breakpoint)?"hidden":"visible"});L.defineClient(r.Z),window.nsEvent=I,window.nsHttpClient=L,window.nsSnackBar=H,window.nsCurrency=O.W,window.nsTruncate=S.b,window.nsRawCurrency=O.f,window.nsAbbreviate=j,window.nsState=N,window.nsUrl=M,window.nsScreen=Y,window.ChartJS=i,window.EventEmitter=v,window.Popup=x.G,window.RxJS=y,window.FormValidation=C.Z,window.nsCrudHandler=X,window.nsTax=q.Z},876:(e,t,s)=>{"use strict";s.r(t),s.d(t,{nsAvatar:()=>G,nsButton:()=>a,nsCheckbox:()=>f,nsCkeditor:()=>E,nsCloseButton:()=>P,nsCrud:()=>N,nsCrudForm:()=>b,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>g.P,nsIconButton:()=>j,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>k,nsMenu:()=>i,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>z.Z,nsPaginate:()=>te.Z,nsSearch:()=>ne,nsSelect:()=>d,nsSelectAudio:()=>p,nsSpinner:()=>m,nsSubmenu:()=>o,nsSwitch:()=>F.Z,nsTableRow:()=>h,nsTabs:()=>D,nsTabsItem:()=>V,nsTextarea:()=>y});var n=s(538),r=s(7700),i=n.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,r.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&r.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,s){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),o=n.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),a=n.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=n.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=n.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

    \n
    \n '}),D=n.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),V=n.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),F=s(3164),A=s(5318),q=s(4687),Z=s.n(q),R=s(914),I=s(665),L=s(2830);const H={data:function(){return{fields:[],validation:new _.Z}},methods:{__:u.__,popupCloser:I.Z,popupResolver:L.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var M=s(1900);const X=(0,M.Z)(H,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[s("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[s("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[s("div",[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var U=function(e,t,s,n){return new(s||(s=Promise))((function(r,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))};const Y={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,u.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:u.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),r.kX.success((0,u.__)("The document has been generated.")).subscribe()}),(function(e){r.kX.error(e.message||(0,u.__)("Unexpected error occurred.")).subscribe()}))},clearSelectedEntries:function(){var e=this;v.G.show(R.default,{title:(0,u.__)("Clear Selected Entries ?"),message:(0,u.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(console.log({row:e}),!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var s=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(s,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(s){s.$checked=e,t.refreshRow(s)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){r.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,u.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){r.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){r.kX.error(e.message).subscribe()}}):void 0:r.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,u.__)("No selection has been made.")).subscribe():r.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,u.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return U(this,void 0,void 0,Z().mark((function e(){var t,s=this;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(X),e.next=4,new Promise((function(e,t){v.G.show(X,{resolve:e,reject:t,queryFilters:s.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,r.kX.error(t.message).subscribe()}))}}};const N=(0,M.Z)(Y,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?s("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[s("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?s("div",{staticClass:"px-2 flex items-center justify-center"},[s("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[s("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),s("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[s("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?s("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[s("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 flex items-center justify-center"},[s("button",{staticClass:"rounded-full text-sm h-10 px-3 outline-none border ns-crud-button",on:{click:function(t){return e.refresh()}}},[s("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?s("div",{staticClass:"px-2 flex items-center"},[s("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():s("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?s("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():s("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?s("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),s("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[s("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[s("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",[s("th",{staticClass:"text-center px-2 border w-16 py-2"},[s("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,n){return s("th",{key:n,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(n)}}},[s("div",{staticClass:"w-full flex justify-between items-center"},[s("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),s("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?s("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?s("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),s("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,n){return s("ns-table-row",{key:n,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():s("tr",[s("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?s("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?s:s[0]}}},[s("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,n){return s("option",{key:n,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),s("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),s("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var z=s(7751),Q=s(1726),W=s(7259);const B=n.default.extend({methods:{__:u.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,Q.createAvatar)(W,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const G=(0,M.Z)(B,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[s("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),s("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?s("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?s("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=s(328),J=s(2404),ee=s(9045),te=s(3502);const se={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:u.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,s,n;e.searchText.length>0&&r.ih[e.method||"post"](e.url,(t={},s=e.searchArgument||"search",n=e.searchText,s in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,t)).subscribe({next:function(t){e.results=t},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error occurred.")).subscribe()}})}),1e3)}},mounted:function(){}};const ne=(0,M.Z)(se,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-search"},[s("div",{staticClass:"input-group info border-2"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),s("div",{staticClass:"relative"},[s("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?s("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,n){return s("li",{key:n,staticClass:"border-b p-2 cursor-pointer",on:{click:function(s){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},4110:(e,t,s)=>{"use strict";s.d(t,{P:()=>a});var n=s(538),r=s(328),i=s(5318),o=s(3164),a=n.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:r.Z,nsDateTimePicker:i.Z,nsSwitch:o.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n '})},9020:(e,t,s)=>{"use strict";s.d(t,{W:()=>c,f:()=>u});var n=s(2077),r=s.n(n),i=s(538),o=s(6740),a=s.n(o),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=i.default.filter("currency",(function(e){var t,s,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===n){var i={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};s=a()(e,i).format()}else s=r()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(s).concat("after"===ns.currency.ns_currency_position?t:"")})),u=function(e){var t="0.".concat(l);return parseFloat(r()(e).format(t))}},7794:(e,t,s)=>{"use strict";s.d(t,{b:()=>n});var n=s(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},4679:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;sr});var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,s,r;return t=e,s=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var s in e.tabs)if(e.tabs[s].fields){var n=[],r=this.validateFieldsErrors(e.tabs[s].fields);r.length>0&&n.push(r),e.tabs[s].errors=n.flat(),t.push(n.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var s in e)0===t&&(e[s].active=!0),e[s].active=void 0!==e[s].active&&e[s].active,e[s].fields=this.createFields(e[s].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var s=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(s,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(s){t.fieldPassCheck(e,s)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var s in e.tabs)void 0===t[s]&&(t[s]={}),t[s]=this.extractFields(e.tabs[s].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var s=function(s){var n=s.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===n.length&&e.tabs[n[0]].fields.forEach((function(e){e.name===n[1]&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))})),s===e.main.name&&t.errors[s].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var n in t.errors)s(n)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var s=function(s){e.forEach((function(e){e.name===s&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))}))};for(var n in t.errors)s(n)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){s.identifier===t.identifier&&!0===s.invalid&&e.errors.splice(n,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){!0===s[t.identifier]&&e.errors.splice(n,1)}))}return e}}],s&&n(t.prototype,s),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3632:(e,t,s)=>{"use strict";s.d(t,{__:()=>n,c:()=>r});var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},r=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},665:(e,t,s)=>{"use strict";function n(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var s=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(s+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}s.d(t,{Z:()=>n})},2830:(e,t,s)=>{"use strict";function n(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}s.d(t,{Z:()=>n})},6979:(e,t,s)=>{"use strict";s.d(t,{G:()=>c});var n=s(4687),r=s.n(n),i=s(9248);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var s=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[s-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new i.x}var t,s,n;return t=e,s=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=0;s<10;s++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,s,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,r().mark((function o(){var a,l,c,u=this;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("function"!=typeof e){r.next=9;break}return r.prev=1,r.next=4,e();case 4:e=r.sent.default,r.next=9;break;case 7:r.prev=7,r.t0=r.catch(1);case 9:a=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",a.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){u.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=i,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return r.stop()}}),o,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var s="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(s),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],n=[{key:"show",value:function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new e(n);return r.open(t,s),r}}],s&&a(t.prototype,s),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},282:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;sr});var r=function(){function e(t){var s=t.urls,n=t.options;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.printingURL={refund:"refund_printing_url",sale:"sale_printing_url",payment:"payment_printing_url"},this.urls=s,this.options=n}var t,s,r;return t=e,s=[{key:"processRegularPrinting",value:function(e,t){var s=document.querySelector("#printing-section");s&&s.remove();var n=this.urls[this.printingURL[t]].replace("{reference_id}",e),r=document.createElement("iframe");r.id="printing-section",r.className="hidden",r.src=n,document.body.appendChild(r),setTimeout((function(){document.querySelector("#printing-section").remove()}),5e3)}},{key:"process",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"aloud";"default"===this.options.ns_pos_printing_gateway?this.processRegularPrinting(e,t):this.processCustomPrinting(e,this.options.ns_pos_printing_gateway,t,s)}},{key:"processCustomPrinting",value:function(e,t,s){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"aloud",r={printed:!1,reference_id:e,gateway:t,document:s,mode:n},i=nsHooks.applyFilters("ns-custom-print",{params:r,promise:function(){return new Promise((function(e,t){t({status:"failed",message:__("The selected print gateway doesn't support this type of printing.","NsPrintAdapter")})}))}});i.promise().then((function(e){nsSnackBar.success(e.message).subscribe()})).catch((function(e){nsSnackBar.error(e.message||__("An error unexpected occured while printing.")).subscribe()}))}}],s&&n(t.prototype,s),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9093:(e,t,s)=>{"use strict";s.d(t,{S:()=>i});var n=s(3260);function r(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return n.Observable.create((function(n){var i=s.__createSnack({message:e,label:t,type:r.type}),o=i.buttonNode,a=(i.textNode,i.snackWrapper,i.sampleSnack);o.addEventListener("click",(function(e){n.onNext(o),n.onCompleted(),a.remove()})),s.__startTimer(r.duration,a)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var s,n=function(){e>0&&!1!==e&&(s=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(s)})),t.addEventListener("mouseleave",(function(){n()})),n()}},{key:"__createSnack",value:function(e){var t=e.message,s=e.label,n=e.type,r=void 0===n?"info":n,i=document.getElementById("snack-wrapper")||document.createElement("div"),o=document.createElement("div"),a=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),u="",d="";switch(r){case"info":u="",d="info";break;case"error":u="",d="error";break;case"success":u="",d="success"}return a.textContent=t,a.setAttribute("class","pr-2"),s&&(l.setAttribute("class","ns-button default"),c.textContent=s,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(u)),l.appendChild(c)),o.appendChild(a),o.appendChild(l),o.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),i.appendChild(o),null===document.getElementById("snack-wrapper")&&(i.setAttribute("id","snack-wrapper"),i.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(i)),{snackWrapper:i,sampleSnack:o,buttonsWrapper:l,buttonNode:c,textNode:a}}}],s&&r(t.prototype,s),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7995:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var n=s(2376);function r(e,t){for(var s=0;s{"use strict";s.d(t,{$:()=>l});var n=s(7700),r=s(3632),i=s(6979),o=s(9958);function a(e,t){for(var s=0;sparseFloat(e.$quantities().quantity)-u)return n.kX.error((0,r.__)("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",(e.$quantities().quantity-u).toString())).subscribe()}s({quantity:1})}else l.open(o.Z,{resolve:s,reject:a,product:c,data:e})}))}}])&&a(t.prototype,s),l&&a(t,l),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1543:(e,t,s)=>{"use strict";var n=s(4687),r=s.n(n),i=s(5502),o=s(6979),a=s(7700),l=s(3632);const c={data:function(){return{unitsQuantities:[],loadsUnits:!1,options:null,optionsSubscriber:null}},beforeDestroy:function(){this.optionsSubscriber.unsubscribe()},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())})),this.optionsSubscriber=POS.options.subscribe((function(t){e.options=t})),void 0!==this.$popupParams.product.$original().selectedUnitQuantity?this.selectUnit(this.$popupParams.product.$original().selectedUnitQuantity):void 0!==this.$popupParams.product.$original().unit_quantities&&1===this.$popupParams.product.$original().unit_quantities.length?this.selectUnit(this.$popupParams.product.$original().unit_quantities[0]):(this.loadsUnits=!0,this.loadUnits())},methods:{__:l.__,displayRightPrice:function(e){return POS.getSalePrice(e,this.$popupParams.product.$original())},loadUnits:function(){var e=this;a.ih.get("/api/nexopos/v4/products/".concat(this.$popupParams.product.$original().id,"/units/quantities")).subscribe((function(t){if(0===t.length)return e.$popup.close(),a.kX.error((0,l.__)("This product doesn't have any unit defined for selling.")).subscribe();e.unitsQuantities=t,1===e.unitsQuantities.length&&e.selectUnit(e.unitsQuantities[0])}))},selectUnit:function(e){if(null===e.unit)return a.kX.error((0,l.__)('The unit attached to this product is missing or not assigned. Please review the "Unit" tab for this product.')).subscribe(),this.$popup.close();this.$popupParams.resolve({unit_quantity_id:e.id,unit_name:e.unit.name,$quantities:function(){return e}}),this.$popup.close()}}};const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-full w-full flex items-center justify-center",attrs:{id:"ns-units-selector"}},[e.unitsQuantities.length>0?s("div",{staticClass:"ns-box w-2/3-screen lg:w-1/3-screen overflow-hidden flex flex-col"},[s("div",{staticClass:"h-16 flex justify-center items-center flex-shrink-0",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold text-primary"},[e._v(e._s(e.__("Choose Selling Unit")))])]),e._v(" "),e.unitsQuantities.length>0?s("div",{staticClass:"grid grid-flow-row grid-cols-2 overflow-y-auto"},e._l(e.unitsQuantities,(function(t){return s("div",{key:t.id,staticClass:"ns-numpad-key info cursor-pointer border flex-shrink-0 flex flex-col items-center justify-center",on:{click:function(s){return e.selectUnit(t)}}},[s("div",{staticClass:"h-40 w-full flex items-center justify-center overflow-hidden"},[t.preview_url?s("img",{staticClass:"object-cover h-full",attrs:{src:t.preview_url,alt:t.unit.name}}):e._e(),e._v(" "),t.preview_url?e._e():s("div",{staticClass:"h-40 flex items-center justify-center"},[s("i",{staticClass:"las la-image text-primary text-6xl"})])]),e._v(" "),s("div",{staticClass:"h-0 w-full"},[s("div",{staticClass:"relative w-full flex items-center justify-center -top-10 h-20 py-2 flex-col overlay"},[s("h3",{staticClass:"font-bold text-primary py-2 text-center"},[e._v(e._s(t.unit.name)+" ("+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-sm font-medium text-primary"},[e._v(e._s(e._f("currency")(e.displayRightPrice(t))))])])])])})),0):e._e()]):e._e(),e._v(" "),0===e.unitsQuantities.length?s("div",{staticClass:"h-56 flex items-center justify-center"},[s("ns-spinner")],1):e._e()])}),[],!1,null,null,null).exports;function d(e,t){for(var s=0;s=544&&window.innerWidth<768?this.screenIs="sm":window.innerWidth>=768&&window.innerWidth<992?this.screenIs="md":window.innerWidth>=992&&window.innerWidth<1200?this.screenIs="lg":window.innerWidth>=1200&&(this.screenIs="xl")}},{key:"is",value:function(e){return void 0===e?this.screenIs:this.screenIs===e}}])&&h(t.prototype,s),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),_=s(9020),b=s(381),y=s.n(b),g=s(282),x=s(7995);function w(e,t){for(var s=0;s0)return(0,l.__)("Some products has been added to the cart. Would youl ike to discard this order ?")},a.kq.addAction("ns-after-cart-changed","listen-add-to-cart",(function(){return e.refreshCart()})),this.types.subscribe((function(t){var s=Object.values(t).filter((function(e){return e.selected}));if(s.length>0){var n=e.order.getValue();n.type=s[0],e.order.next(n)}})),window.addEventListener("resize",(function(){e._responsive.detect(),e.defineCurrentScreen()})),window.onbeforeunload=function(){if(e.products.getValue().length>0)return(0,l.__)("Some products has been added to the cart. Would youl ike to discard this order ?")}}},{key:"getSalePrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.sale_price_with_tax):(0,_.f)(e.sale_price_without_tax)}},{key:"getCustomPrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.custom_price_with_tax):(0,_.f)(e.custom_price_without_tax)}},{key:"getWholesalePrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.wholesale_price_with_tax):(0,_.f)(e.wholesale_price_without_tax)}},{key:"setHoldPopupEnabled",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._holdPopupEnabled=e}},{key:"getHoldPopupEnabled",value:function(){return this._holdPopupEnabled}},{key:"processInitialQueue",value:function(){return C(this,void 0,void 0,r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=r().keys(this._initialQueue);case 1:if((e.t1=e.t0()).done){e.next=14;break}return t=e.t1.value,e.prev=3,e.next=6,this._initialQueue[t]();case 6:e.sent,e.next=12;break;case 9:e.prev=9,e.t2=e.catch(3),a.kX.error(e.t2.message).subscribe();case 12:e.next=1;break;case 14:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"removeCoupon",value:function(e){var t=this.order.getValue(),s=t.coupons,n=s.indexOf(e);s.splice(n,1),t.coupons=s,this.order.next(t)}},{key:"pushCoupon",value:function(e){var t=this.order.getValue();t.coupons.forEach((function(t){if(t.code===e.code){var s=(0,l.__)("This coupon is already added to the cart");throw a.kX.error(s).subscribe(),s}})),t.coupons.push(e),this.order.next(t),this.refreshCart()}},{key:"header",get:function(){var e={buttons:{nsPosDashboardButton:k,nsPosPendingOrderButton:P,nsPosOrderTypeButton:j,nsPosCustomersButton:O,nsPosResetButton:S}};return"yes"===this.options.getValue().ns_pos_registers_enabled&&(e.buttons.nsPosCashRegister=$),a.kq.doAction("ns-pos-header",e),e}},{key:"defineOptions",value:function(e){this._options.next(e)}},{key:"defineCurrentScreen",value:function(){this._visibleSection.next(["xs","sm"].includes(this._responsive.is())?"grid":"both"),this._screen.next(this._responsive.is())}},{key:"changeVisibleSection",value:function(e){["both","cart","grid"].includes(e)&&(["cart","both"].includes(e)&&this.refreshCart(),this._visibleSection.next(e))}},{key:"addPayment",value:function(e){if(e.value>0){var t=this._order.getValue();return t.payments.push(e),this._order.next(t),this.computePaid()}return a.kX.error("Invalid amount.").subscribe()}},{key:"removePayment",value:function(e){if(void 0!==e.id)return a.kX.error((0,l.__)("Unable to delete a payment attached to the order.")).subscribe();var t=this._order.getValue(),s=t.payments.indexOf(e);t.payments.splice(s,1),this._order.next(t),a.l.emit({identifier:"ns.pos.remove-payment",value:e}),this.updateCustomerAccount(e),this.computePaid()}},{key:"updateCustomerAccount",value:function(e){if("account-payment"===e.identifier){var t=this.order.getValue().customer;t.account_amount+=e.value,this.selectCustomer(t)}}},{key:"getPriceWithoutTax",value:function(e,t,s){return"inclusive"===s?x.Z.computeInclusive(e,t):"exclusive"===s?e:void 0}},{key:"getPriceWithTax",value:function(e,t,s){return"inclusive"===s?e:"exclusive"===s?x.Z.computeExclusive(e,t):void 0}},{key:"getVatValue",value:function(e,t,s){return"inclusive"===s?e-this.getPriceWithoutTax(e,t,s):"exclusive"===s?this.getPriceWithTax(e,t,s)-e:void 0}},{key:"computeTaxes",value:function(){var e=this;return new Promise((function(t,s){var n=e.order.getValue();if(void 0===(n=e.computeProductsTaxes(n)).tax_group_id||null===n.tax_group_id)return e.computeOrderTaxes(n),t({data:{order:n},status:"success"});var r=n.tax_groups;return Object.values(r).length>0?(void 0!==r[n.tax_group_id]&&(n.taxes=r[n.tax_group_id].taxes.map((function(t){return t.tax_value=e.getVatValue(n.subtotal-n.discount,t.rate,n.tax_type),t}))),n=e.computeOrderTaxes(n),t({status:"success",data:{tax:r[n.tax_group_id],order:n}})):void 0!==n.tax_group_id&&n.tax_group_id.toString().length>0?void a.ih.get("/api/nexopos/v4/taxes/groups/".concat(n.tax_group_id)).subscribe({next:function(s){return n=e.computeOrderTaxGroup(n,s),t({status:"success",data:{tax:s,order:n}})},error:function(e){return s(e)}}):s({status:"failed",message:(0,l.__)("No tax group assigned to the order")})}))}},{key:"computeOrderTaxGroup",value:function(e,t){var s=this;return this.options.getValue().ns_pos_vat,this.options.getValue().ns_pos_price_with_tax,t.taxes=t.taxes.map((function(t){return{tax_id:t.id,tax_name:t.name,rate:parseFloat(t.rate),tax_value:s.getVatValue(e.subtotal-e.discount,t.rate,e.tax_type)}})),0===t.taxes.length?a.kX.error((0,l.__)("The selected tax group doesn't have any assigned sub taxes. This might cause wrong figures."),(0,l.__)("Proceed"),{duration:!1}).subscribe():(e.tax_groups=e.tax_groups||[],e.taxes=t.taxes,e.tax_groups[t.id]=t,this.computeOrderTaxes(e))}},{key:"computeOrderTaxes",value:function(e){var t=this.options.getValue().ns_pos_vat,s="yes"===this.options.getValue().ns_pos_price_with_tax;return["flat_vat","variable_vat","products_variable_vat","products_flat_vat"].includes(t)&&e.taxes&&e.taxes.length>0&&(e.tax_value+=e.taxes.map((function(e){return e.tax_value})).reduce((function(e,t){return e+t}))),e.total_tax_value=e.tax_value,["products_variable_vat","products_flat_vat","products_vat"].includes(t)&&!s&&(e.total_tax_value=e.products_exclusive_tax_value+e.tax_value),e}},{key:"computeProductsTaxes",value:function(e){var t=this.products.getValue(),s=t.filter((function(e){return"inclusive"===e.tax_type})).map((function(e){return e.tax_value})),n=t.filter((function(e){return"exclusive"===e.tax_type})).map((function(e){return e.tax_value}));e.products_exclusive_tax_value=0,e.products_inclusive_tax_value=0;var r=this.options.getValue().ns_pos_vat;return["products_flat_vat","products_variable_vat","products_vat"].includes(r)&&n.length>0&&(e.products_exclusive_tax_value+=n.reduce((function(e,t){return e+t}))),["products_flat_vat","products_variable_vat","products_vat"].includes(r)&&s.length>0&&(e.products_inclusive_tax_value+=s.reduce((function(e,t){return e+t}))),e.products=t,e.total_products=t.length,e}},{key:"canProceedAsLaidAway",value:function(e){var t=this;return new Promise((function(s,n){return C(t,void 0,void 0,r().mark((function t(){var i,a,c,u,d,p,f,h=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.customer.group.minimal_credit_payment,a=(e.total*i/100).toFixed(ns.currency.ns_currency_precision),a=parseFloat(a),t.prev=3,t.next=6,new Promise((function(t,s){o.G.show(V,{order:e,reject:s,resolve:t})}));case 6:if(!(0===(c=t.sent).order.instalments.length&&c.order.tendered=a&&y()(e.date).isSame(ns.date.moment.startOf("day"),"day")}))).length){t.next=17;break}return t.abrupt("return",s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}}));case 17:(f=p[0].amount)>0?o.G.show(E,{title:(0,l.__)("Initial Payment"),message:(0,l.__)('In order to proceed, an initial payment of {amount} is required for the selected payment type "{paymentType}". Would you like to proceed ?').replace("{amount}",v.default.filter("currency")(f)).replace("{paymentType}",d.label),onAction:function(e){if(e){var t={identifier:d.identifier,label:d.label,value:f,readonly:!1,selected:!0};h.addPayment(t),p[0].paid=!0,s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}})}else n({status:"failed",message:(0,l.__)("The request was canceled")})}}):s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}});case 19:t.next=24;break;case 21:return t.prev=21,t.t0=t.catch(3),t.abrupt("return",n(t.t0));case 24:case"end":return t.stop()}}),t,this,[[3,21]])})))}))}},{key:"submitOrder",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((function(s,n){return C(e,void 0,void 0,r().mark((function e(){var i,o,c,u,d,p=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=Object.assign(Object.assign({},this.order.getValue()),t),o=i.customer.group.minimal_credit_payment,"hold"===i.payment_status){e.next=20;break}if(!(0===i.payments.length&&i.total>0&&i.total>i.tendered)){e.next=20;break}if("no"!==this.options.getValue().ns_orders_allow_partial){e.next=9;break}return c=(0,l.__)("Partially paid orders are disabled."),e.abrupt("return",n({status:"failed",message:c}));case 9:if(!(o>=0)){e.next=20;break}return e.prev=10,e.next=13,this.canProceedAsLaidAway(i);case 13:u=e.sent,i=u.data.order,e.next=20;break;case 17:return e.prev=17,e.t0=e.catch(10),e.abrupt("return",n(e.t0));case 20:if(this._isSubmitting){e.next=24;break}return d=void 0!==i.id?"put":"post",this._isSubmitting=!0,e.abrupt("return",a.ih[d]("/api/nexopos/v4/orders".concat(void 0!==i.id?"/"+i.id:""),i).subscribe({next:function(e){s(e),p.reset(),a.kq.doAction("ns-order-submit-successful",e),p._isSubmitting=!1;var t=p.options.getValue().ns_pos_complete_sale_audio;t.length>0&&new Audio(t).play()},error:function(e){p._isSubmitting=!1,n(e),a.kq.doAction("ns-order-submit-failed",e)}}));case 24:return e.abrupt("return",n({status:"failed",message:(0,l.__)("An order is currently being processed.")}));case 25:case"end":return e.stop()}}),e,this,[[10,17]])})))}))}},{key:"defineQuantities",value:function(e){var t=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(n,r){var i={unit:s.filter((function(t){return t.id===e.unit_id}))[0]||{},sale_price_with_tax:"normal"===e.mode?parseFloat(e.price_with_tax):0,sale_price_without_tax:"normal"===e.mode?parseFloat(e.price_without_tax):0,sale_price:"normal"===e.mode?parseFloat(e.unit_price):0,sale_price_tax:"normal"===e.mode?e.tax_value:0,sale_price_edit:0,wholesale_price_with_tax:"wholesale"===e.mode?parseFloat(e.price_with_tax):0,wholesale_price_without_tax:"wholesale"===e.mode?parseFloat(e.price_without_tax):0,wholesale_price:"wholesale"===e.mode?parseFloat(e.unit_price):0,wholesale_price_tax:"wholesale"===e.mode?e.tax_value:0,wholesale_price_edit:0,custom_price_with_tax:"custom"===e.mode?parseFloat(e.price_with_tax):0,custom_price_without_tax:"custom"===e.mode?parseFloat(e.price_without_tax):0,custom_price:"custom"===e.mode?parseFloat(e.unit_price):0,custom_price_tax:"custom"===e.mode?e.tax_value:0,custom_price_edit:"custom"===e.mode?parseFloat(e.unit_price):0};if(["inclusive","exclusive"].includes(e.tax_type))try{if(!e.tax_group_id)return i.sale_price_tax=0,i.wholesale_price_tax=0,i.sale_price_without_tax=e.unit_price,n(i);a.ih.get("/api/nexopos/v4/taxes/groups/".concat(e.tax_group_id)).subscribe({next:function(s){return["sale","wholesale","custom"].forEach((function(n){i[n+"_price_tax"]=s.taxes.map((function(s){return t.getVatValue(i[n+"_price"],s.rate,e.tax_type)})).reduce((function(e,t){return e+t})),i["gross_"+n+"_price"]=i[n+"_price"]+i[n+"_price_tax"],i["net_"+n+"_price"]=i[n+"_price"]-i[n+"_price_tax"]})),n(i)},error:function(e){r(!1)}})}catch(e){return a.kX.error((0,l.__)("An error has occurred while computing the product.")).subscribe()}return n(i)}))}},{key:"loadOrder",value:function(e){var t=this;return new Promise((function(s,n){a.ih.get("/api/nexopos/v4/orders/".concat(e,"/pos")).subscribe({next:function(e){return C(t,void 0,void 0,r().mark((function t(){var i,o,l,c,u=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,a.kq.doAction("ns-before-load-order",{order:e}),t.next=7;break;case 4:return t.prev=4,t.t0=t.catch(0),t.abrupt("return",n(t.t0));case 7:i=this.options.getValue(),e=Object.assign(Object.assign({},this.defaultOrder()),e),o=[],l=r().mark((function t(s){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(n=e.products[s]).product){t.next=9;break}return t.t0=n.name,t.t1=n.unit_id,t.next=6,u.defineQuantities(n);case 6:t.t2=t.sent,t.t3=[t.t2],n.product={mode:"custom",name:t.t0,unit_id:t.t1,unit_quantities:t.t3};case 9:n.$original=function(){return n.product},n.$quantities=function(){var e=n.product.unit_quantities.filter((function(e){return+e.id==+n.unit_quantity_id||void 0===e.id}))[0];return"custom"===n.mode&&"yes"===i.ns_pos_price_with_tax&&(e.custom_price_edit=n.unit_price),e},o.push(n);case 12:case"end":return t.stop()}}),t)})),c=0;case 12:if(!(c0&&(e.tendered=e.payments.map((function(e){return e.value})).reduce((function(e,t){return t+e}))),e.tendered>=e.total?e.payment_status="paid":e.tendered>0&&e.tendered0&&(t.products.filter((function(t){return e.products.map((function(e){return e.product_id})).includes(t.product_id)})).length>0||-1!==s.indexOf(e)||s.push(e)),e.categories.length>0&&(t.products.filter((function(t){return e.categories.map((function(e){return e.category_id})).includes(t.$original().category_id)})).length>0||-1!==s.indexOf(e)||s.push(e))})),s.forEach((function(t){a.kX.error((0,l.__)('The coupons "%s" has been removed from the cart, as it\'s required conditions are no more meet.').replace("%s",t.name),(0,l.__)("Okay"),{duration:6e3}).subscribe(),e.removeCoupon(t)}))}},{key:"refreshCart",value:function(){return C(this,void 0,void 0,r().mark((function e(){var t,s,n,i,o,c,u,d,p,f,v,h,m;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.checkCart(),t=this.products.getValue(),s=this.order.getValue(),n=this.options.getValue().ns_pos_price_with_tax,(i=t.filter((function(e){return"dynamic"!==e.product_type})).map((function(e){return"yes"===n?e.total_price_with_tax:e.total_price_without_tax}))).length>0?(o=i.reduce((function(e,t){return e+t})),c=0,(u=t.filter((function(e){return"dynamic"===e.product_type})).map((function(e){return e.unit_price=o*e.rate/100,e.total_price=e.unit_price*e.quantity,e.total_price}))).length>0&&(c=u.reduce((function(e,t){return e+t}))),s.subtotal=o+c):s.subtotal=0,d=s.coupons.map((function(e){return"percentage_discount"===e.type?(e.value=s.subtotal*e.discount_value/100,e.value):(e.value=e.discount_value,e.value)})),s.total_coupons=0,d.length>0&&(s.total_coupons=d.reduce((function(e,t){return e+t}))),"percentage"===s.discount_type&&(s.discount=s.discount_percentage*s.subtotal/100),s.discount>s.subtotal&&0===s.total_coupons&&(s.discount=s.subtotal,a.kX.info((0,l.__)("The discount has been set to the cart subtotal.")).subscribe()),s.tax_value=0,s.total_tax_value=0,this.order.next(s),e.prev=14,e.next=17,this.computeTaxes();case 17:p=e.sent,s=p.data.order,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(14),!1!==e.t0&&void 0!==e.t0.message&&a.kX.error(e.t0.message||(0,l.__)("An unexpected error has occurred while fecthing taxes."),(0,l.__)("OKAY"),{duration:0}).subscribe();case 24:(f=t.map((function(e){return"inclusive"===e.tax_type?e.tax_value:0}))).length>0&&f.reduce((function(e,t){return e+t})),v=s.tax_type,h=this.options.getValue().ns_pos_vat,m=0,["flat_vat","variable_vat","products_vat","products_flat_vat","products_variable_vat"].includes(h)&&(m=s.total_tax_value),s.total="exclusive"===v?+(s.subtotal+(s.shipping||0)+m-s.discount-s.total_coupons).toFixed(ns.currency.ns_currency_precision):+(s.subtotal+(s.shipping||0)-s.discount-s.total_coupons).toFixed(ns.currency.ns_currency_precision),this.order.next(s),a.kq.doAction("ns-cart-after-refreshed",s);case 34:case"end":return e.stop()}}),e,this,[[14,21]])})))}},{key:"getStockUsage",value:function(e,t){var s=this._products.getValue().filter((function(s){return s.product_id===e&&s.unit_quantity_id===t})).map((function(e){return e.quantity}));return s.length>0?s.reduce((function(e,t){return e+t})):0}},{key:"addToCart",value:function(e){return C(this,void 0,void 0,r().mark((function t(){var s,n,i,o,l,c,u,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=new Object,n={product_id:e.id||0,name:e.name,discount_type:"percentage",discount:0,discount_percentage:0,product_type:e.product_type||"product",rate:e.rate||0,quantity:e.quantity||0,tax_group_id:e.tax_group_id,tax_type:e.tax_type||void 0,tax_value:0,unit_id:e.unit_id||0,unit_price:e.unit_price||0,price_with_tax:e.price_with_tax||0,price_without_tax:e.price_without_tax||0,unit_name:e.unit_name||"",total_price:0,total_price_without_tax:0,total_price_with_tax:0,mode:e.mode||"normal",$original:e.$original||function(){return e},$quantities:e.$quantities||void 0},this._processingAddQueue=!0,0===n.product_id){t.next=22;break}t.t0=r().keys(this.addToCartQueue);case 5:if((t.t1=t.t0()).done){t.next=22;break}return i=t.t1.value,t.prev=7,o=new this.addToCartQueue[i](n),t.next=11,o.run(s);case 11:l=t.sent,s=Object.assign(Object.assign({},s),l),t.next=20;break;case 15:if(t.prev=15,t.t2=t.catch(7),!1!==t.t2){t.next=20;break}return this._processingAddQueue=!1,t.abrupt("return",!1);case 20:t.next=5;break;case 22:this._processingAddQueue=!1,n=Object.assign(Object.assign({},n),s),c=this._products.getValue(),this.settings.getValue().ns_pos_items_merge?(u=c.filter((function(e){return e.product_id===n.product_id&&e.tax_group_id===n.tax_group_id&&e.unit_id===n.unit_id&&e.unit_quantity_id===n.unit_quantity_id})),u.length>0?u[0].quantity+=n.quantity:c.unshift(n)):c.unshift(n),this.recomputeProducts(c),this.products.next(c),(d=this.options.getValue().ns_pos_new_item_audio).length>0&&new Audio(d).play(),a.kq.doAction("ns-after-cart-changed");case 31:case"end":return t.stop()}}),t,this,[[7,15]])})))}},{key:"defineTypes",value:function(e){this._types.next(e)}},{key:"removeProduct",value:function(e){var t=this._products.getValue(),s=t.indexOf(e);t.splice(s,1),this.products.next(t),a.kq.doAction("ns-after-cart-changed")}},{key:"updateProduct",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=this._products.getValue();s=null===s?n.indexOf(e):s,v.default.set(n,s,Object.assign(Object.assign({},e),t)),this.recomputeProducts(n),this.products.next(n),a.kq.doAction("ns-after-cart-changed")}},{key:"recomputeProducts",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t.forEach((function(t){e.computeProduct(t)}))}},{key:"getProductUnitPrice",value:function(e,t){switch(e){case"custom":return t.custom_price_edit;case"normal":return t.sale_price_edit;case"wholesale":return t.wholesale_price_edit}}},{key:"computeProductTax",value:function(e){switch(e.mode){case"custom":return this.computeCustomProductTax(e);case"normal":return this.computeNormalProductTax(e);case"wholesale":return this.computeWholesaleProductTax(e);default:return e}}},{key:"proceedProductTaxComputation",value:function(e,t){var s=this,n=e.$original(),r=n.tax_group,i=this.getProductUnitPrice(e.mode,e.$quantities()),o=0,a=this.getProductUnitPrice(e.mode,e.$quantities());if(null!=r&&void 0!==r.taxes){var l=0;switch(r.taxes.length>0&&(l=r.taxes.map((function(e){return e.rate})).reduce((function(e,t){return e+t}))),n.tax_type){case"inclusive":i=this.getPriceWithoutTax(t,l,n.tax_type),a=t;break;case"exclusive":i=t,a=this.getPriceWithTax(t,l,n.tax_type)}var c=r.taxes.map((function(e){return s.getVatValue(t,e.rate,n.tax_type)}));c.length>0&&(o=c.reduce((function(e,t){return e+t})))}return{price_without_tax:i,tax_value:o,price_with_tax:a}}},{key:"computeCustomProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.custom_price_edit);return t.custom_price_without_tax=s.price_without_tax,t.custom_price_with_tax=s.price_with_tax,t.custom_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"computeNormalProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.sale_price_edit);return t.sale_price_without_tax=s.price_without_tax,t.sale_price_with_tax=s.price_with_tax,t.sale_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"computeWholesaleProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.wholesale_price_edit);return t.wholesale_price_without_tax=s.price_without_tax,t.wholesale_price_with_tax=s.price_with_tax,t.wholesale_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"getPrice",value:function(e,t,s){switch(t){case"normal":return e["sale_price_"+s];case"wholesale":return e["wholesale_price_"+s];case"custom":return e["custom_price_"+s]}}},{key:"computeProduct",value:function(e){"product"===e.product_type&&("normal"===e.mode?(e.unit_price=this.getSalePrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().sale_price_tax*e.quantity):"wholesale"===e.mode&&(e.unit_price=this.getWholesalePrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().wholesale_price_tax*e.quantity),"custom"===e.mode&&(e.unit_price=this.getCustomPrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().custom_price_tax*e.quantity));var t=0,s=0,n=this.getPrice(e.$quantities(),e.mode,"with_tax"),r=this.getPrice(e.$quantities(),e.mode,"without_tax");["flat","percentage"].includes(e.discount_type)&&("percentage"===e.discount_type?(e.discount=e.unit_price*e.discount_percentage/100*e.quantity,t=r*e.discount_percentage/100*e.quantity,s=n*e.discount_percentage/100*e.quantity):(t=e.discount,s=e.discount)),e.price_with_tax=n,e.price_without_tax=r,e.total_price=e.unit_price*e.quantity-e.discount,e.total_price_with_tax=n*e.quantity-s,e.total_price_without_tax=r*e.quantity-t,a.kq.doAction("ns-after-product-computed",e)}},{key:"loadCustomer",value:function(e){return a.ih.get("/api/nexopos/v4/customers/".concat(e))}},{key:"defineSettings",value:function(e){this._settings.next(e)}},{key:"voidOrder",value:function(e){var t=this;void 0!==e.id?["hold"].includes(e.payment_status)?o.G.show(E,{title:(0,l.__)("Order Deletion"),message:(0,l.__)("The current order will be deleted as no payment has been made so far."),onAction:function(s){s&&a.ih.delete("/api/nexopos/v4/orders/".concat(e.id)).subscribe({next:function(e){a.kX.success(e.message).subscribe(),t.reset()},error:function(e){return a.kX.error(e.message).subscribe()}})}}):o.G.show(D,{title:(0,l.__)("Void The Order"),message:(0,l.__)("The current order will be void. This will cancel the transaction, but the order won't be deleted. Further details about the operation will be tracked on the report. Consider providing the reason of this operation."),onAction:function(s){!1!==s&&a.ih.post("/api/nexopos/v4/orders/".concat(e.id,"/void"),{reason:s}).subscribe({next:function(e){a.kX.success(e.message).subscribe(),t.reset()},error:function(e){return a.kX.error(e.message).subscribe()}})}}):a.kX.error((0,l.__)("Unable to void an unpaid order.")).subscribe()}},{key:"triggerOrderTypeSelection",value:function(e){return C(this,void 0,void 0,r().mark((function t(){var s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s=0;case 1:if(!(s{var n={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":1793,"./ru.js":1793,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function r(e){var t=i(e);return s(t)}function i(e){if(!s.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=i,e.exports=r,r.id=6700},328:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(538),r=s(381),i=s.n(r),o=s(7144),a=s.n(o),l=(s(9095),s(3632));const c=n.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:a()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:i()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:i()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?i()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?s("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[s("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),s("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[s("i",{staticClass:"las la-times"})]),e._v(" "),s("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[s("div",{staticClass:"flex justify-between items-center w-full py-2"},[s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},5318:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(381),r=s.n(n);const i={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:r(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return r()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?r()():r()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?r()():r()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:s(3632).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(r().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker mb-2"},[e.field?s("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),s("div",{staticClass:"ns-button"},[s("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?s("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?s("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?s("span",{staticClass:"mx-1 text-sm"},[null!==e.date?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?s("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?s("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?s("div",{staticClass:"relative z-10 h-0 w-0"},[s("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[s("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[s("i",{staticClass:"las la-minus"})]),e._v(" "),s("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[s("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,n){return s("div",{key:n,staticClass:"h-8 flex justify-center items-center text-sm"},[[s("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thu")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(n,r){return s("div",{key:r,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,r){return[t.dayOfWeek===n?s("div",{key:r,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),s("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[s("div",{staticClass:"-mx-1 flex justify-between"},[s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-1 flex"},[e.field?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[s("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[s("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),s("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},9045:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(381),r=s.n(n);const i={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?r()():r()(this.date),this.build()},methods:{__:s(3632).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(r().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker"},[s("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),s("span",{staticClass:"mx-1 text-sm"},[s("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?s("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?s("div",{staticClass:"relative h-0 w-0 -mb-2"},[s("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thu")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(n,r){return s("div",{key:r,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,r){return[t.dayOfWeek===n?s("div",{key:r,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),s("div")])]):e._e()])}),[],!1,null,null,null).exports},2404:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[s("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),s("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},8909:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var n=s(3632);const r={name:"ns-numpad-plus",props:["value","currency","limit"],data:function(){return{screenValue:0,order:null,cursor:parseInt(ns.currency.ns_currency_precision),orderSubscription:null,allSelected:!0,keyRows:[[7,8,9].map((function(e){return{identifier:e,value:e}})),[4,5,6].map((function(e){return{identifier:e,value:e}})),[1,2,3].map((function(e){return{identifier:e,value:e}})),[{identifier:".",value:"."},{identifier:0,value:0},{identifier:"backspace",icon:"la-backspace"}],[{identifier:"next",value:(0,n.__)("Enter")}]]}},mounted:function(){var e=this;this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-dot").whenVisible([".is-popup"]).whenPressed(".",(function(){return e.inputValue({identifier:"."})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save"),nsHotPress.destroy("numpad-dot")},methods:{increaseBy:function(e){this.screenValue=(parseFloat(e.value)+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if("."===e.identifier)this.allSelected?(this.screenValue="0.",this.allSelected=!1):null===this.screenValue.toString().match(/^[0-9][1-9]*\.[0-9]*$/)&&(this.screenValue=this.screenValue+=".");else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}this.$emit("changed",this.screenValue)}else this.$emit("next",this.screenValue)}}};const i=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"numpad-holder"}},e._l(e.keyRows,(function(t,n){return s("div",{key:n},[s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 text-lg",attrs:{id:"numpad"}},[e._l(t,(function(n,r){return s("div",{key:r,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",class:1===t.length?"col-span-3":"",on:{click:function(t){return e.inputValue(n)}}},[void 0!==n.value?s("span",[e._v(e._s(n.value))]):e._e(),e._v(" "),n.icon?s("i",{staticClass:"las",class:n.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)])})),0)}),[],!1,null,null,null).exports},7751:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(3632);function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var s=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",s)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,n){return s("div",{key:n,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(s){return e.inputValue(t)}}},[void 0!==t.value?s("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?s("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3502:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},3164:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"mb-2 ns-switch"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,n){return s("button",{key:n,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(s){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},9542:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var n=s(4687),r=s.n(n),i=s(7700),o=s(665),a=s(3632),l=s(914);function c(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const u={name:"ns-media",props:["popup"],components:{VueUpload:s(2948)},data:function(){return{pages:[{label:(0,a.__)("Upload"),name:"upload",selected:!1},{label:(0,a.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return i.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:o.Z,__:a.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,a.__)("Confirm Your Action"),message:(0,a.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&i.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){i.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){i.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=r().mark((function e(){var s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),n=r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s[t],e.prev=1,n.progress=1,e.next=5,new Promise((function(e,t){var s=new FormData;s.append("file",n.file),i.ih.post("/api/nexopos/v4/medias",s,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){n.uploaded=!0,n.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),n.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),o=0;case 3:if(!(o0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,i.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(s,n){n!==t.response.data.indexOf(e)&&(s.selected=!1)})),e.selected=!e.selected}}};const d=(0,s(1900).Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[s("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[s("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),s("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,n){return s("li",{key:n,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?s("div",{staticClass:"content w-full overflow-hidden flex"},[s("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[s("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),s("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),s("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[s("ul",e._l(e.files,(function(t,n){return s("li",{key:n,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[s("span",[e._v(e._s(t.file.name))]),e._v(" "),s("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?s("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?s("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[s("div"),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),s("div",{staticClass:"flex flex-auto overflow-hidden"},[s("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"p-2 overflow-x-auto"},[s("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,n){return s("div",{key:n},[s("div",{staticClass:"p-2"},[s("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(s){return e.selectResource(t)}}},[s("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?s("div",{staticClass:"flex flex-auto items-center justify-center"},[s("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),s("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0",attrs:{id:"preview"}},[s("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?s("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?s("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),s("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),s("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),s("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[s("div",{staticClass:"flex -mx-2 flex-shrink-0"},[s("div",{staticClass:"px-2 flex-shrink-0 flex"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[s("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[s("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?s("div",{staticClass:"ns-button error"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[s("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),s("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[s("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),s("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),s("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},4351:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(6979),r=s(820);const i={name:"ns-pos-customers-button",methods:{__:s(3632).__,openCustomerPopup:function(){(new n.G).open(r.Z)}},beforeDestroy:function(){nsHotPress.destroy("ns_pos_keyboard_create_customer")},mounted:function(){var e=this;for(var t in nsShortcuts)["ns_pos_keyboard_create_customer"].includes(t)&&nsHotPress.create("ns_pos_keyboard_create_customer").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[t],(function(t){t.preventDefault(),e.openCustomerPopup()}))}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openCustomerPopup()}}},[s("i",{staticClass:"mr-1 text-xl lar la-user-circle"}),e._v(" "),s("span",[e._v(e._s(e.__("Customers")))])])])}),[],!1,null,null,null).exports},6442:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-pos-dashboard-button",methods:{__:s(3632).__,goToDashboard:function(){return document.location=POS.settings.getValue().urls.dashboard_url}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button success"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.goToDashboard()}}},[s("i",{staticClass:"mr-1 text-xl las la-tachometer-alt"}),e._v(" "),s("span",[e._v(e._s(e.__("Dashboard")))])])])}),[],!1,null,null,null).exports},5897:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(6979),r=s(4523);const i={name:"ns-pos-delivery-button",methods:{__:s(3632).__,openOrderTypeSelection:function(){new n.G({primarySelector:"#pos-app",popupClass:"shadow-lg bg-white w-3/5 md:w-2/3 lg:w-2/5 xl:w-2/4"}).open(r.Z)}},beforeDestroy:function(){nsHotPress.destroy("ns_pos_keyboard_order_type")},mounted:function(){var e=this;for(var t in nsShortcuts)["ns_pos_keyboard_order_type"].includes(t)&&nsHotPress.create("ns_pos_keyboard_order_type").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[t],(function(t){t.preventDefault(),e.openOrderTypeSelection()}))}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openOrderTypeSelection()}}},[s("i",{staticClass:"mr-1 text-xl las la-truck"}),e._v(" "),s("span",[e._v(e._s(e.__("Order Type")))])])])}),[],!1,null,null,null).exports},2751:(e,t,s)=>{"use strict";s.d(t,{Z:()=>_});var n=s(6979),r=s(7700),i=s(914),o=s(3632);const a={data:function(){return{products:[],isLoading:!1}},computed:{order:function(){return this.$popupParams.order}},mounted:function(){this.loadProducts()},methods:{__:o.__,close:function(){this.$popupParams.reject(!1),this.$popup.close()},loadProducts:function(){var e=this;this.isLoading=!0;var t=this.$popupParams.order.id;r.ih.get("/api/nexopos/v4/orders/".concat(t,"/products")).subscribe((function(t){e.isLoading=!1,e.products=t}))},openOrder:function(){this.$popup.close(),this.$popupParams.resolve(this.order)}}};var l=s(1900);const c=(0,l.Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between text-primary items-center border-b ns-box-header"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Products"))+" — "+e._s(e.order.code)+" "),e.order.title?s("span",[e._v("("+e._s(e.order.title)+")")]):e._e()]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex-auto p-2 overflow-y-auto ns-box-body"},[e.isLoading?s("div",{staticClass:"flex-auto relative"},[s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)]):e._e(),e._v(" "),e.isLoading?e._e():e._l(e.products,(function(t){return s("div",{key:t.id,staticClass:"item"},[s("div",{staticClass:"flex-col border-b border-info-primary py-2"},[s("div",{staticClass:"title font-semibold text-primary flex justify-between"},[s("span",[e._v(e._s(t.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(t.total_price)))])]),e._v(" "),s("div",{staticClass:"text-sm text-primary"},[s("ul",[s("li",[e._v(e._s(e.__("Unit"))+" : "+e._s(t.unit.name))])])])])])}))],2),e._v(" "),s("div",{staticClass:"flex justify-end p-2 border-t ns-box-footer"},[s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-2 flex"},[s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.openOrder()}}},[e._v(e._s(e.__("Open")))])],1),e._v(" "),s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.close()}}},[e._v(e._s(e.__("Close")))])],1)])])])])}),[],!1,null,null,null).exports;const u={props:["orders"],data:function(){return{searchField:"",columns:{rightColumn:[],leftColumn:[]}}},watch:{orders:function(){r.kq.doAction("ns-pos-pending-orders-refreshed",this.orders)}},mounted:function(){this.columns.leftColumn=r.kq.applyFilters("ns-pending-orders-left-column",[{label:(0,o.__)("Code"),value:function(e){return e.code}},{label:(0,o.__)("Cashier"),value:function(e){return e.nexopos_users_username}},{label:(0,o.__)("Total"),value:function(e){return e.total}},{label:(0,o.__)("Tendered"),value:function(e){return e.tendered}}]),this.columns.rightColumn=r.kq.applyFilters("ns-pending-orders-right-column",[{label:(0,o.__)("Customer"),value:function(e){return e.nexopos_customers_name}},{label:(0,o.__)("Date"),value:function(e){return e.created_at}},{label:(0,o.__)("Type"),value:function(e){return e.type}}])},name:"ns-pos-pending-order",methods:{__:o.__,previewOrder:function(e){this.$emit("previewOrder",e)},proceedOpenOrder:function(e){this.$emit("proceedOpenOrder",e)},searchOrder:function(){this.$emit("searchOrder",this.searchField)},printOrder:function(e){this.$emit("printOrder",e)}}};const d=(0,l.Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-auto flex-col overflow-hidden"},[s("div",{staticClass:"p-1"},[s("div",{staticClass:"flex rounded border-2 input-group info"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchField,expression:"searchField"}],staticClass:"p-2 outline-none flex-auto",attrs:{type:"text"},domProps:{value:e.searchField},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.searchOrder()},input:function(t){t.target.composing||(e.searchField=t.target.value)}}}),e._v(" "),s("button",{staticClass:"w-16 md:w-24",on:{click:function(t){return e.searchOrder()}}},[s("i",{staticClass:"las la-search"}),e._v(" "),s("span",{staticClass:"mr-1 hidden md:visible"},[e._v(e._s(e.__("Search")))])])])]),e._v(" "),s("div",{staticClass:"overflow-y-auto flex flex-auto"},[s("div",{staticClass:"flex p-2 flex-auto flex-col overflow-y-auto"},[e._l(e.orders,(function(t){return s("div",{key:t.id,staticClass:"border-b ns-box-body w-full py-2",attrs:{"data-order-id":t.id}},[s("h3",{staticClass:"text-primary"},[e._v(e._s(t.title||"Untitled Order"))]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"flex flex-wrap -mx-4"},[s("div",{staticClass:"w-full md:w-1/2 px-2"},e._l(e.columns.leftColumn,(function(n,r){return s("p",{key:r,staticClass:"text-sm text-primary"},[s("strong",[e._v(e._s(n.label))]),e._v(" : "+e._s(n.value(t)))])})),0),e._v(" "),s("div",{staticClass:"w-full md:w-1/2 px-2"},e._l(e.columns.rightColumn,(function(n,r){return s("p",{key:r,staticClass:"text-sm text-primary"},[s("strong",[e._v(e._s(n.label))]),e._v(" : "+e._s(n.value(t)))])})),0)])]),e._v(" "),s("div",{staticClass:"flex justify-end w-full mt-2"},[s("div",{staticClass:"flex rounded-lg overflow-hidden ns-buttons"},[s("button",{staticClass:"info outline-none px-2 py-1",on:{click:function(s){return e.proceedOpenOrder(t)}}},[s("i",{staticClass:"las la-lock-open"}),e._v(" "+e._s(e.__("Open")))]),e._v(" "),s("button",{staticClass:"success outline-none px-2 py-1",on:{click:function(s){return e.previewOrder(t)}}},[s("i",{staticClass:"las la-eye"}),e._v(" "+e._s(e.__("Products")))]),e._v(" "),s("button",{staticClass:"warning outline-none px-2 py-1",on:{click:function(s){return e.printOrder(t)}}},[s("i",{staticClass:"las la-print"}),e._v(" "+e._s(e.__("Print")))])])])])})),e._v(" "),0===e.orders.length?s("div",{staticClass:"h-full v-full items-center justify-center flex"},[s("h3",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Nothing to display...")))])]):e._e()],2)])])}),[],!1,null,null,null).exports;var p=s(2830),f=s(665);const v={components:{nsPosPendingOrders:d},methods:{__:o.__,popupResolver:p.Z,popupCloser:f.Z,searchOrder:function(e){var t=this;r.ih.get("/api/nexopos/v4/crud/".concat(this.active,"?search=").concat(e)).subscribe((function(e){t.orders=e.data}))},setActiveTab:function(e){this.active=e,this.loadOrderFromType(e)},openOrder:function(e){POS.loadOrder(e.id),this.$popup.close()},loadOrderFromType:function(e){var t=this;r.ih.get("/api/nexopos/v4/crud/".concat(e)).subscribe((function(e){t.orders=e.data}))},previewOrder:function(e){var t=this;new Promise((function(t,s){Popup.show(c,{order:e,resolve:t,reject:s})})).then((function(s){t.proceedOpenOrder(e)}),(function(e){return e}))},printOrder:function(e){POS.print.process(e.id,"sale")},proceedOpenOrder:function(e){var t=this;if(POS.products.getValue().length>0)return Popup.show(i.default,{title:"Confirm Your Action",message:"The cart is not empty. Opening an order will clear your cart would you proceed ?",onAction:function(s){s&&t.openOrder(e)}});this.openOrder(e)}},data:function(){return{active:"ns.hold-orders",searchField:"",orders:[]}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.$popup.close()})),this.loadOrderFromType(this.active),this.popupCloser()}};const h=(0,l.Z)(v,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between text-primary items-center ns-box-header border-b"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Orders")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.$popup.close()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 flex overflow-hidden flex-auto ns-box-body"},[s("ns-tabs",{attrs:{active:e.active},on:{changeTab:function(t){return e.setActiveTab(t)}}},[s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.hold-orders",label:e.__("On Hold"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.unpaid-orders",label:e.__("Unpaid"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.partially-paid-orders",label:e.__("Partially Paid"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1)],1)],1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"}},[e._v(e._s(e.__("Close")))])],1)])])}),[],!1,null,null,null).exports,m={name:"ns-pos-pending-orders-button",methods:{__:o.__,openPendingOrdersPopup:function(){(new n.G).open(h)}}};const _=(0,l.Z)(m,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openPendingOrdersPopup()}}},[s("i",{staticClass:"mr-1 text-xl lar la-hand-pointer"}),e._v(" "),s("span",[e._v(e._s(e.__("Orders")))])])])}),[],!1,null,null,null).exports},1689:(e,t,s)=>{"use strict";s.d(t,{Z:()=>T});var n=s(4687),r=s.n(n),i=s(7700),o=s(7751),a=s(4679),l=s(665),c=s(914),u=s(3632);const d={components:{nsNumpad:o.Z},data:function(){return{amount:0,title:null,identifier:null,settingsSubscription:null,settings:null,action:null,register:null,loaded:!1,register_id:null,validation:new a.Z,fields:[]}},mounted:function(){var e=this;this.title=this.$popupParams.title,this.identifier=this.$popupParams.identifier,this.register=this.$popupParams.register,this.action=this.$popupParams.action,this.register_id=this.$popupParams.register_id,this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t})),this.loadFields()},destroyed:function(){this.settingsSubscription.unsubscribe()},methods:{popupCloser:l.Z,__:u.__,definedValue:function(e){this.amount=e},close:function(){this.$popup.close()},loadFields:function(){var e=this;this.loaded=!1,nsHttpClient.get("/api/nexopos/v4/fields/".concat(this.identifier)).subscribe((function(t){e.loaded=!0,e.fields=t}),(function(t){return e.loaded=!0,nsSnackBar.error(t.message,"OKAY",{duration:!1}).subscribe()}))},submit:function(e){var t=this;Popup.show(c.default,{title:"Confirm Your Action",message:this.$popupParams.confirmMessage||"Would you like to confirm your action.",onAction:function(e){e&&t.triggerSubmit()}})},triggerSubmit:function(){var e=this,t=this.validation.extractFields(this.fields);t.amount=""===this.amount?0:this.amount,nsHttpClient.post("/api/nexopos/v4/cash-registers/".concat(this.action,"/").concat(this.register_id||this.settings.register.id),t).subscribe({next:function(t){e.$popupParams.resolve(t),e.$popup.close(),nsSnackBar.success(t.message).subscribe()},error:function(e){nsSnackBar.error(e.message).subscribe()}})}}};var p=s(1900);const f=(0,p.Z)(d,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.loaded?s("div",{staticClass:"shadow-lg w-95vw md:w-2/5-screen ns-box"},[s("div",{staticClass:"border-b ns-box-header p-2 text-primary flex justify-between items-center"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.title))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2"},[null!==e.register?s("div",{staticClass:"mb-2 p-3 elevation-surface font-bold border text-right flex justify-between"},[s("span",[e._v(e._s(e.__("Balance"))+" ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.register.balance)))])]):e._e(),e._v(" "),s("div",{staticClass:"mb-2 p-3 elevation-surface success border font-bold text-right flex justify-between"},[s("span",[e._v(e._s(e.__("Input")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.amount)))])]),e._v(" "),s("div",{staticClass:"mb-2"},[s("ns-numpad",{attrs:{floating:!0,value:e.amount},on:{next:function(t){return e.submit(t)},changed:function(t){return e.definedValue(t)}}})],1),e._v(" "),e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})}))],2)]):e._e(),e._v(" "),e.loaded?e._e():s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)])}),[],!1,null,null,null).exports;var v=s(2830);function h(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const m={components:{nsNumpad:o.Z},data:function(){return{registers:[],priorVerification:!1,hasLoadedRegisters:!1,validation:new a.Z,amount:0,settings:null,settingsSubscription:null}},mounted:function(){var e=this;this.checkUsedRegister(),this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t}))},beforeDestroy:function(){this.settingsSubscription.unsubscribe()},computed:{},methods:{__:u.__,popupResolver:v.Z,selectRegister:function(e){var t,s=this;return(t=r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("closed"===e.status){t.next=2;break}return t.abrupt("return",i.kX.error((0,u.__)("Unable to open this register. Only closed register can be opened.")).subscribe());case 2:return t.prev=2,t.next=5,new Promise((function(t,s){var n=(0,u.__)("Open Register : %s").replace("%s",e.name),r=e.id;Popup.show(f,{resolve:t,reject:s,title:n,identifier:"ns.cash-registers-opening",register:e,action:"open",register_id:r})}));case 5:n=t.sent,s.popupResolver(n),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),console.log(t.t0);case 12:case"end":return t.stop()}}),t,null,[[2,9]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){h(i,n,r,o,a,"next",e)}function a(e){h(i,n,r,o,a,"throw",e)}o(void 0)}))})()},checkUsedRegister:function(){var e=this;this.priorVerification=!1,i.ih.get("/api/nexopos/v4/cash-registers/used").subscribe({next:function(t){e.$popupParams.resolve(t),e.$popup.close()},error:function(t){e.priorVerification=!0,i.kX.error(t.message).subscribe(),e.loadRegisters()}})},loadRegisters:function(){var e=this;this.hasLoadedRegisters=!1,i.ih.get("/api/nexopos/v4/cash-registers").subscribe((function(t){e.registers=t,e.hasLoadedRegisters=!0}))},getClass:function(e){switch(e.status){case"in-use":return"elevation-surface warning cursor-not-allowed";case"disabled":return"elevation-surface cursor-not-allowed";case"available":return"elevation-surface success"}return"elevation-surface hoverable cursor-pointer"}}};const _=(0,p.Z)(m,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[!1===e.priorVerification?s("div",{staticClass:"h-full w-full py-10 flex justify-center items-center"},[s("ns-spinner",{attrs:{size:"24",border:"8"}})],1):e._e(),e._v(" "),e.priorVerification?s("div",{staticClass:"w-95vw md:w-3/5-screen lg:w-3/5-screen xl:w-2/5-screen flex flex-col overflow-hidden",class:e.priorVerification?"shadow-lg ns-box":"",attrs:{id:"ns-pos-cash-registers-popup"}},[[s("div",{staticClass:"title p-2 border-b ns-box-header flex justify-between items-center"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Open The Register")))]),e._v(" "),e.settings?s("div",[s("a",{staticClass:"rounded-full border ns-close-button px-3 text-sm py-1",attrs:{href:e.settings.urls.orders_url}},[e._v(e._s(e.__("Exit To Orders")))])]):e._e()]),e._v(" "),e.hasLoadedRegisters?e._e():s("div",{staticClass:"py-10 flex-auto overflow-y-auto flex items-center justify-center"},[s("ns-spinner",{attrs:{size:"16",border:"4"}})],1),e._v(" "),e.hasLoadedRegisters?s("div",{staticClass:"flex-auto overflow-y-auto"},[s("div",{staticClass:"grid grid-cols-3"},e._l(e.registers,(function(t,n){return s("div",{key:n,staticClass:"border flex items-center justify-center flex-col p-3",class:e.getClass(t),on:{click:function(s){return e.selectRegister(t)}}},[s("i",{staticClass:"las la-cash-register text-6xl"}),e._v(" "),s("h3",{staticClass:"text-semibold text-center"},[e._v(e._s(t.name))]),e._v(" "),s("span",{staticClass:"text-sm"},[e._v("("+e._s(t.status_label)+")")])])})),0),e._v(" "),0===e.registers.length?s("div",{staticClass:"p-2 alert text-white"},[e._v("\n "+e._s(e.__("Looks like there is no registers. At least one register is required to proceed."))+" — "),s("a",{staticClass:"font-bold hover:underline",attrs:{href:e.settings.urls.registers_url}},[e._v(e._s(e.__("Create Cash Register")))])]):e._e()]):e._e()]],2):e._e()])}),[],!1,null,null,null).exports;const b={data:function(){return{totalIn:0,totalOut:0,settings:null,settingsSubscription:null,histories:[]}},mounted:function(){var e=this;this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t})),this.getHistory()},destroyed:function(){this.settingsSubscription.unsubscribe()},methods:{__:u.__,popupResolver:v.Z,closePopup:function(){this.popupResolver({status:"success"})},getHistory:function(){var e=this;i.ih.get("/api/nexopos/v4/cash-registers/session-history/".concat(this.settings.register.id)).subscribe((function(t){e.histories=t,e.totalIn=e.histories.filter((function(e){return["register-opening","register-sale","register-cash-in"].includes(e.action)})).map((function(e){return parseFloat(e.value)})).reduce((function(e,t){return e+t}),0),e.totalOut=e.histories.filter((function(e){return["register-closing","register-refund","register-cash-out"].includes(e.action)})).map((function(e){return parseFloat(e.value)})).reduce((function(e,t){return e+t}),0),console.log(e.totalOut)}))}}};const y=(0,p.Z)(b,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-lg w-95vw md:w-4/6-screen lg:w-half overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between items-center ns-box-header",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Register History")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:e.closePopup}})],1)]),e._v(" "),s("div",{staticClass:"flex w-full ns-box-body"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"w-full md:w-1/2 text-right bg-success-primary text-white font-bold text-3xl p-3"},[e._v(e._s(e._f("currency")(e.totalIn)))]),e._v(" "),s("div",{staticClass:"w-full md:w-1/2 text-right bg-error-primary text-white font-bold text-3xl p-3"},[e._v(e._s(e._f("currency")(e.totalOut)))])])]),e._v(" "),s("div",{staticClass:"flex flex-col overflow-y-auto h-120"},[e._l(e.histories,(function(t){return[["register-sale","register-cash-in"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface success"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-opening"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-close"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface info"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-refund","register-cash-out"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface error"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e()]}))],2)])}),[],!1,null,null,null).exports;function g(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function x(e){for(var t=1;t0&&i.kX.error(t.t0.message).subscribe();case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))()},registerInitialQueue:function(){var e=this;POS.initialQueue.push(S(r().mark((function t(){var s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,s){void 0===e.settings.register&&Popup.show(_,{resolve:t,reject:s})}));case 3:return s=t.sent,POS.set("register",s.data.register),e.setRegister(s.data.register),t.abrupt("return",s);case 9:throw t.prev=9,t.t0=t.catch(0),t.t0;case 12:case"end":return t.stop()}}),t,null,[[0,9]])}))))},setButtonName:function(){if(void 0===this.settings.register)return this.name=(0,u.__)("Cash Register");this.name=(0,u.__)("Cash Register : {register}").replace("{register}",this.settings.register.name)},setRegister:function(e){if(void 0!==e){var t=POS.order.getValue();t.register_id=e.id,POS.order.next(t)}}},destroyed:function(){this.orderSubscriber.unsubscribe(),this.settingsSubscriber.unsubscribe()},mounted:function(){var e=this;this.registerInitialQueue(),this.orderSubscriber=POS.order.subscribe((function(t){e.order=t})),this.settingsSubscriber=POS.settings.subscribe((function(t){e.settings=t,e.setRegister(e.settings.register),e.setButtonName()}))}};const T=(0,p.Z)($,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openRegisterOptions()}}},[s("i",{staticClass:"mr-1 text-xl las la-cash-register"}),e._v(" "),s("span",[e._v(e._s(e.name))])])])}),[],!1,null,null,null).exports},9516:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(6979),r=(s(820),s(914)),i=s(665);const o={name:"ns-pos-customers-button",mounted:function(){this.popupCloser()},methods:{__,popupCloser:i.Z,reset:function(){n.G.show(r.default,{title:__("Confirm Your Action"),message:__("The current order will be cleared. But not deleted if it's persistent. Would you like to proceed ?"),onAction:function(e){e&&POS.reset()}})}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button error"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.reset()}}},[s("i",{staticClass:"mr-1 text-xl las la-eraser"}),e._v(" "),s("span",[e._v(e._s(e.__("Reset")))])])])}),[],!1,null,null,null).exports},7634:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>r});const n={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(void 0!==e.$popupParams.onAction&&e.$popupParams.onAction(!1),e.$popup.close())}))},methods:{__:s(3632).__,emitAction:function(e){void 0!==this.$popupParams.onAction&&this.$popupParams.onAction(e),this.$popup.close()}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-6/7-screen md:w-4/7-screen lg:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"alert-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[e.title?s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]):e._e(),e._v(" "),s("p",{staticClass:"py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t justify-end items-center p-2"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))])],1)])}),[],!1,null,null,null).exports},800:(e,t,s)=>{"use strict";s.d(t,{Z:()=>B});var n=s(7700),r=s(9020),i=s(2277),o=s(4679),a=s(665),l=s(3632);function c(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function u(e){for(var t=1;tthis.availableQuantity)return n.kX.error("Unable to proceed as the quantity provided is exceed the available quantity.").subscribe();this.product.quantity=parseFloat(e),this.$popupParams.resolve(this.product),this.$popup.close()}}};const b=(0,f.Z)(_,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box overflow-hidden w-95vw md:w-4/6-screen lg:w-3/7-screen"},[s("div",{staticClass:"p-2 flex justify-between ns-box-header"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Quantity")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),e.product?s("div",{staticClass:"border-t border-b ns-box-body py-2 flex items-center justify-center text-2xl font-semibold"},[s("span",[e._v(e._s(e.seeValue))]),e._v(" "),s("span",{staticClass:"text-primary text-sm"},[e._v("("+e._s(e.availableQuantity)+" "+e._s(e.__("available"))+")")])]):e._e(),e._v(" "),e.product?s("div",{staticClass:"flex-auto overflow-y-auto p-2"},[s("ns-numpad",{attrs:{value:e.product.quantity},on:{next:function(t){return e.updateQuantity(t)},changed:function(t){return e.setChangedValue(t)}}})],1):e._e()])}),[],!1,null,null,null).exports;var y=s(2614),g=s(914),x=s(6979),w=s(282);function C(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function k(e){for(var t=1;t0?this.refundables.map((function(e){return parseFloat(e.unit_price)*parseFloat(e.quantity)})).reduce((function(e,t){return e+t}))+this.shippingFees:0+this.shippingFees},shippingFees:function(){return this.refundShipping?this.order.shipping:0}},data:function(){return{isSubmitting:!1,formValidation:new o.Z,refundables:[],paymentOptions:[],paymentField:[],print:new w.Z({urls:systemUrls,options:systemOptions}),refundShipping:!1,selectedPaymentGateway:!1,screen:0,selectFields:[{type:"select",options:this.order.products.map((function(e){return{label:"".concat(e.name," - ").concat(e.unit.name," (x").concat(e.quantity,")"),value:e.id}})),validation:"required",name:"product_id",label:(0,l.__)("Product"),description:(0,l.__)("Select the product to perform a refund.")}]}},methods:{__:l.__,updateScreen:function(e){this.screen=e},toggleRefundShipping:function(e){this.refundShipping=e,this.refundShipping},proceedPayment:function(){var e=this;return!1===this.selectedPaymentGateway?n.kX.error((0,l.__)("Please select a payment gateway before proceeding.")).subscribe():0===this.total?n.kX.error((0,l.__)("There is nothing to refund.")).subscribe():0===this.screenValue?n.kX.error((0,l.__)("Please provide a valid payment amount.")).subscribe():void x.G.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("The refund will be made on the current order."),onAction:function(t){t&&e.doProceed()}})},doProceed:function(){var e=this,t={products:this.refundables,total:this.screenValue,payment:this.selectedPaymentGateway,refund_shipping:this.refundShipping};this.isSubmitting=!0,n.ih.post("/api/nexopos/v4/orders/".concat(this.order.id,"/refund"),t).subscribe({next:function(t){e.isSubmitting=!1,e.$emit("changed",!0),"refunded"===t.data.order.payment_status&&e.$emit("loadTab","details"),e.print.process(t.data.orderRefund.id,"refund"),n.kX.success(t.message).subscribe()},error:function(t){e.isSubmitting=!1,n.kX.error(t.message).subscribe()}})},addProduct:function(){var e=this;if(this.formValidation.validateFields(this.selectFields),!this.formValidation.fieldsValid(this.selectFields))return n.kX.error((0,l.__)("Please select a product before proceeding.")).subscribe();var t=this.formValidation.extractFields(this.selectFields),s=this.order.products.filter((function(e){return e.id===t.product_id})),r=this.refundables.filter((function(e){return e.id===t.product_id}));if(r.length>0){var i=r.map((function(e){return parseInt(e.quantity)})).reduce((function(e,t){return e+t}));if(i===s[0].quantity)return n.kX.error((0,l.__)("Not enough quantity to proceed.")).subscribe()}if(0===s[0].quantity)return n.kX.error((0,l.__)("Not enough quantity to proceed.")).subscribe();var o=k(k({},s[0]),{condition:"",description:""});new Promise((function(e,t){x.G.show(v,{resolve:e,reject:t,product:o})})).then((function(t){t.quantity=e.getProductOriginalQuantity(t.id)-e.getProductUsedQuantity(t.id),e.refundables.push(t)}),(function(e){return e}))},getProductOriginalQuantity:function(e){var t=this.order.products.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},getProductUsedQuantity:function(e){var t=this.refundables.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},openSettings:function(e){var t=this;new Promise((function(t,s){x.G.show(v,{resolve:t,reject:s,product:e})})).then((function(s){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}),(function(e){return e}))},selectPaymentGateway:function(){var e=this;new Promise((function(t,s){x.G.show(y.Z,k({resolve:t,reject:s,value:[e.selectedPaymentOption]},e.paymentField[0]))})).then((function(t){e.selectedPaymentGateway=t[0]}),(function(e){return e}))},changeQuantity:function(e){var t=this;new Promise((function(s,n){var r=t.getProductOriginalQuantity(e.id)-t.getProductUsedQuantity(e.id)+parseFloat(e.quantity);x.G.show(b,{resolve:s,reject:n,product:e,availableQuantity:r})})).then((function(s){if(s.quantity>t.getProductUsedQuantity(e.id)-e.quantity){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}}))},deleteProduct:function(e){var t=this;new Promise((function(s,n){x.G.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to delete this product ?"),onAction:function(s){if(s){var n=t.refundables.indexOf(e);t.refundables.splice(n,1)}}})}))}},mounted:function(){var e=this;this.selectFields=this.formValidation.createFields(this.selectFields),n.ih.get("/api/nexopos/v4/orders/payments").subscribe((function(t){e.paymentField=t}))}};const O=(0,f.Z)(j,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-m-4 flex-auto flex flex-wrap relative"},[e.isSubmitting?s("div",{staticClass:"bg-overlay h-full w-full flex items-center justify-center absolute z-30"},[s("ns-spinner")],1):e._e(),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Refund With Products")))]),e._v(" "),s("div",{staticClass:"my-2"},[s("ul",[s("li",{staticClass:"border-b border-info-primary flex justify-between items-center mb-2"},[s("div",{staticClass:"flex-auto flex-col flex"},[s("div",{staticClass:"p-2 flex"},e._l(e.selectFields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"flex justify-between p-2"},[s("div",{staticClass:"flex items-center text-primary"},[e.order.shipping>0?s("span",{staticClass:"mr-2"},[e._v(e._s(e.__("Refund Shipping")))]):e._e(),e._v(" "),e.order.shipping>0?s("ns-checkbox",{attrs:{checked:e.refundShipping},on:{change:function(t){return e.toggleRefundShipping(t)}}}):e._e()],1),e._v(" "),s("div",[s("button",{staticClass:"border rounded-full px-2 py-1 ns-inset-button info",on:{click:function(t){return e.addProduct()}}},[e._v(e._s(e.__("Add Product")))])])])])]),e._v(" "),s("li",[s("h4",{staticClass:"py-1 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.refundables,(function(t){return s("li",{key:t.id,staticClass:"elevation-surface border flex justify-between items-center mb-2"},[s("div",{staticClass:"px-2 text-primary flex justify-between flex-auto"},[s("div",{staticClass:"flex flex-col"},[s("p",{staticClass:"py-2"},[s("span",[e._v(e._s(t.name))]),e._v(" "),"damaged"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-error-tertiary mx-2 text-white"},[e._v(e._s(e.__("Damaged")))]):e._e(),e._v(" "),"unspoiled"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-success-tertiary mx-2 text-white"},[e._v(e._s(e.__("Unspoiled")))]):e._e()]),e._v(" "),s("small",[e._v(e._s(t.unit.name))])]),e._v(" "),s("div",{staticClass:"flex items-center justify-center"},[s("span",{staticClass:"py-1 flex items-center cursor-pointer border-b border-dashed border-info-primary"},[e._v(e._s(e._f("currency")(t.unit_price*t.quantity)))])])]),e._v(" "),s("div",{staticClass:"flex"},[s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.openSettings(t)}}},[s("i",{staticClass:"las la-cog text-xl"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.deleteProduct(t)}}},[s("i",{staticClass:"las la-trash"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.changeQuantity(t)}}},[e._v(e._s(t.quantity))])])])}))],2)])]),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Summary")))]),e._v(" "),s("div",{staticClass:"py-2"},[s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Total")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.total)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border success font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Paid")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.tendered)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border info font-semibold flex mb-2 p-2 justify-between cursor-pointer",on:{click:function(t){return e.selectPaymentGateway()}}},[s("span",[e._v(e._s(e.__("Payment Gateway")))]),e._v(" "),s("span",[e._v(e._s(e.selectedPaymentGateway?e.selectedPaymentGateway.label:"N/A"))])]),e._v(" "),s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Screen")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.screenValue)))])]),e._v(" "),s("div",[s("ns-numpad",{attrs:{currency:!0,value:e.screen},on:{changed:function(t){return e.updateScreen(t)},next:function(t){return e.proceedPayment(t)}}})],1)])])])}),[],!1,null,null,null).exports;var S=s(3033);function $(e,t){for(var s=0;s0?t[0].label:(0,l.__)("Unknown Status")}},{key:"getDeliveryStatus",value:function(e){var t=deliveryStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,l.__)("Unknown Status")}},{key:"getProcessingStatus",value:function(e){var t=processingStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,l.__)("Unknown Status")}},{key:"getPaymentStatus",value:function(e){var t=paymentLabels.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,l.__)("Unknown Status")}}])&&$(t.prototype,s),n&&$(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function E(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function D(e){for(var t=1;t0?s("span",[e._v(e._s(e._f("currency")(e.order.total-e.order.tendered)))]):e._e(),e._v(" "),e.order.total-e.order.tendered<=0?s("span",[e._v(e._s(e._f("currency")(0)))]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 w-full md:w-1/2"},[s("div",{staticClass:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface warning border text-xl font-bold"},[s("span",[e._v(e._s(e.__("Customer Account")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.customer.account_amount)))])])])]),e._v(" "),s("div",{staticClass:"flex -mx-4 flex-wrap"},[s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},["paid"!==e.order.payment_status?s("div",[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2"},[e._v("\n "+e._s(e.__("Payment"))+"\n ")]),e._v(" "),s("div",{staticClass:"py-2"},[e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),e._v(" "),s("div",{staticClass:"my-2 px-2 h-12 flex justify-end items-center border elevation-surface"},[e._v("\n "+e._s(e._f("currency")(e.inputValue))+"\n ")]),e._v(" "),s("ns-numpad",{attrs:{floating:!0,value:e.inputValue},on:{next:function(t){return e.submitPayment(t)},changed:function(t){return e.updateValue(t)}}})],2)]):e._e(),e._v(" "),"paid"===e.order.payment_status?s("div",{staticClass:"flex items-center justify-center h-full"},[s("h3",{staticClass:"text-primary font-semibold"},[e._v(e._s(e.__("No payment possible for paid order.")))])]):e._e()]),e._v(" "),s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2 mb-2"},[e._v("\n "+e._s(e.__("Payment History"))+"\n ")]),e._v(" "),s("ul",e._l(e.order.payments,(function(t){return s("li",{key:t.id,staticClass:"p-2 flex items-center justify-between text-shite border elevation-surface mb-2"},[s("span",[e._v(e._s(e.paymentsLabels[t.identifier]||e.__("Unknown")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(t.value)))])])})),0)])])])}),[],!1,null,null,null).exports;var q=s(1765);const Z={props:["order"],data:function(){return{processingStatuses,deliveryStatuses,labels:new T,showProcessingSelect:!1,showDeliverySelect:!1}},mounted:function(){},methods:{__:l.__,submitProcessingChange:function(){var e=this;x.G.show(g.default,{title:(0,l.__)("Would you proceed ?"),message:(0,l.__)("The processing status of the order will be changed. Please confirm your action."),onAction:function(t){t&&n.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/processing"),{process_status:e.order.process_status}).subscribe({next:function(t){e.showProcessingSelect=!1,n.kX.success(t.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("Unexpected error occurred.")).subscribe()}})}})},openRefunds:function(){var e=this;try{new Promise((function(t,s){var n=e.order;x.G.show(q.Z,{order:n,resolve:t,reject:s})}))}catch(e){}},submitDeliveryStatus:function(){var e=this;x.G.show(g.default,{title:(0,l.__)("Would you proceed ?"),message:(0,l.__)("The delivery status of the order will be changed. Please confirm your action."),onAction:function(t){t&&n.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/delivery"),{delivery_status:e.order.delivery_status}).subscribe({next:function(t){e.showDeliverySelect=!1,n.kX.success(t.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("Unexpected error occurred.")).subscribe()}})}})}}};const R=(0,f.Z)(Z,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex flex-wrap"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap flex"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Payment Summary")))])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"elevation-surface border p-2 flex justify-between items-start"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Sub Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.subtotal)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[s("span",{staticClass:"text-white"},[e._v(e._s(e.__("Discount")))]),e._v(" "),"percentage"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("("+e._s(e.order.discount_percentage)+"%)")]):e._e(),e._v(" "),"flat"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("(Flat)")]):e._e()])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.discount)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Shipping")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.shipping)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v("\n "+e._s(e.__("Coupons"))+"\n ")])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.total_coupons)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice info"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.total)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice warning"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Taxes")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tax_value)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start text-primary elevation-surface error border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Change")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.change)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Paid")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tendered)))])])])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Order Status")))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Customer")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.order.nexopos_customers_name))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Type")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getTypeLabel(e.order.type)))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Delivery Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showDeliverySelect?e._e():s("span",{staticClass:"font-semibold text-secondary border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showDeliverySelect=!0}}},[e._v(e._s(e.labels.getDeliveryStatus(e.order.delivery_status)))])]),e._v(" "),e.showDeliverySelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.delivery_status,expression:"order.delivery_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"delivery_status",t.target.multiple?s:s[0])}}},e._l(e.deliveryStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showDeliverySelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitDeliveryStatus(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex flex-col md:flex-row justify-between items-center elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Processing Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showProcessingSelect?e._e():s("span",{staticClass:"border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showProcessingSelect=!0}}},[e._v(e._s(e.labels.getProcessingStatus(e.order.process_status)))])]),e._v(" "),e.showProcessingSelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.process_status,expression:"order.process_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"process_status",t.target.multiple?s:s[0])}}},e._l(e.processingStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showProcessingSelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitProcessingChange(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Payment Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getPaymentStatus(e.order.payment_status)))])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.order.products,(function(t){return s("div",{key:t.id,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A"))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])})),e._v(" "),s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary flex justify-between"},[s("span",[e._v(e._s(e.__("Refunded Products")))]),e._v(" "),s("a",{staticClass:"border-b border-info-primary border-dashed",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.openRefunds()}}},[e._v(e._s(e.__("All Refunds")))])])]),e._v(" "),e._l(e.order.refunded_products,(function(t,n){return s("div",{key:n,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.order_product.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A")+" | "),s("span",{staticClass:"rounded-full px-2",class:"damaged"===t.condition?"bg-error-tertiary text-white":"bg-info-tertiary text-white"},[e._v(e._s(t.condition))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])}))],2)])}),[],!1,null,null,null).exports;var I=s(4687),L=s.n(I);function H(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function M(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const X={name:"ns-order-instalments-payment",components:{nsNotice:s(876).nsNotice},data:function(){return{paymentTypes,fields:[{type:"select",name:"payment_type",description:(0,l.__)("Select the payment type that must apply to the current order."),label:(0,l.__)("Payment Type"),validation:"required",options:paymentTypes}],print:new w.Z({urls:systemUrls,options:systemOptions}),validation:new o.Z,order:null,instalment:null}},methods:{__:l.__,popupResolver:h.Z,popupCloser:a.Z,close:function(){this.popupResolver(!1)},updateInstalmentAsDue:function(e){var t=this;nsHttpClient.put("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/"),{instalment:{date:ns.date.moment.format("YYYY-MM-DD HH:mm:ss")}}).subscribe({next:function(e){t.submitPayment()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})},submitPayment:function(){var e=this;if(!this.validation.validateFields(this.fields))return n.kX.error(__m("The form is not valid.")).subcribe();nsHttpClient.post("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/pay"),function(e){for(var t=1;t0?this.instalments.map((function(e){return e.amount})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})):0}},methods:{__:l.__,loadInstalments:function(){var e=this;n.ih.get("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments")).subscribe((function(t){e.original=t,e.instalments=t.map((function(e){return e.price_clicked=!1,e.date_clicked=!1,e.date=moment(e.date).format("YYYY-MM-DD"),e}))}))},showReceipt:function(e){if(null===e.payment_id)return n.kX.error((0,l.__)("This instalment doesn't have any payment attached.")).subscribe();this.print.process(e.payment_id,"payment")},addInstalment:function(){this.instalments.push({date:ns.date.moment.format("YYYY-MM-DD"),amount:this.order.total-this.totalInstalments,paid:!1})},createInstalment:function(e){var t=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to create this instalment ?"),onAction:function(s){s&&n.ih.post("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments"),{instalment:e}).subscribe({next:function(e){t.loadInstalments(),n.kX.success(e.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})}})},deleteInstalment:function(e){var t=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to delete this instalment ?"),onAction:function(s){s&&n.ih.delete("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id)).subscribe({next:function(s){var r=t.instalments.indexOf(e);t.instalments.splice(r,1),n.kX.success(s.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})}})},markAsPaid:function(e){var t,s=this;return(t=L().mark((function t(){return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,n){Popup.show(U,{order:s.order,instalment:e,resolve:t,reject:n})}));case 3:t.sent,s.loadInstalments(),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){Y(i,n,r,o,a,"next",e)}function a(e){Y(i,n,r,o,a,"throw",e)}o(void 0)}))})()},togglePriceEdition:function(e){var t=this;e.paid||(e.price_clicked=!e.price_clicked,this.$forceUpdate(),e.price_clicked&&setTimeout((function(){t.$refs.amount[0].select()}),100))},updateInstalment:function(e){var t=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to update that instalment ?"),onAction:function(s){s&&n.ih.put("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id),{instalment:e}).subscribe({next:function(e){n.kX.success(e.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})}})},toggleDateEdition:function(e){var t=this;e.paid||(e.date_clicked=!e.date_clicked,this.$forceUpdate(),e.date_clicked&&setTimeout((function(){t.$refs.date[0].select()}),200))}}};const z=(0,f.Z)(N,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex-auto flex flex-wrap"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Instalments")))])]),e._v(" "),s("div",{staticClass:"px-4"},[s("ul",{staticClass:"border-table-th-edge border-t text-primary"},[e._l(e.instalments,(function(t){return s("li",{key:t.id,staticClass:"border-b border-l flex justify-between elevation-surface",class:t.paid?"success":"info"},[s("span",{staticClass:"p-2"},[t.date_clicked?e._e():s("span",{on:{click:function(s){return e.toggleDateEdition(t)}}},[e._v(e._s(t.date))]),e._v(" "),t.date_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.date,expression:"instalment.date"}],ref:"date",refInFor:!0,staticClass:"border border-info-primary rounded",attrs:{type:"date"},domProps:{value:t.date},on:{blur:function(s){return e.toggleDateEdition(t)},input:function(s){s.target.composing||e.$set(t,"date",s.target.value)}}})]):e._e()]),e._v(" "),s("div",{staticClass:"flex items-center"},[s("div",{staticClass:"flex items-center px-2 h-full border-r"},[t.price_clicked?e._e():s("span",{on:{click:function(s){return e.togglePriceEdition(t)}}},[e._v(e._s(e._f("currency")(t.amount)))]),e._v(" "),t.price_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"instalment.amount"}],ref:"amount",refInFor:!0,staticClass:"border border-info-primary p-1",attrs:{type:"text"},domProps:{value:t.amount},on:{blur:function(s){return e.togglePriceEdition(t)},input:function(s){s.target.composing||e.$set(t,"amount",s.target.value)}}})]):e._e()]),e._v(" "),!t.paid&&t.id?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"success",className:"la-money-bill-wave-alt"},on:{click:function(s){return e.markAsPaid(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"info",className:"la-save"},on:{click:function(s){return e.updateInstalment(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"error",className:"la-trash-alt"},on:{click:function(s){return e.deleteInstalment(t)}}})],1)]):e._e(),e._v(" "),t.paid||t.id?e._e():s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 py-1 rounded-full",on:{click:function(s){return e.createInstalment(t)}}},[s("i",{staticClass:"las la-plus"}),e._v("\n "+e._s(e.__("Create"))+"\n ")])])])]),e._v(" "),t.paid?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 text-xs py-1 rounded-full",on:{click:function(s){return e.showReceipt(t)}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Receipt"))+"\n ")])])]):e._e()])])})),e._v(" "),s("li",{staticClass:"flex justify-between p-2 border-r border-b border-l elevation-surface"},[s("div",{staticClass:"flex items-center justify-center"},[s("span",[e._v("\n "+e._s(e.__("Total :"))+" "+e._s(e._f("currency")(e.order.total))+"\n ")]),e._v(" "),s("span",{staticClass:"ml-1 text-sm"},[e._v("\n ("+e._s(e.__("Remaining :"))+" "+e._s(e._f("currency")(e.order.total-e.totalInstalments))+")\n ")])]),e._v(" "),s("div",{staticClass:"-mx-2 flex flex-wrap items-center"},[s("span",{staticClass:"px-2"},[e._v("\n "+e._s(e.__("Instalments:"))+" "+e._s(e._f("currency")(e.totalInstalments))+"\n ")]),e._v(" "),s("span",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded-full px-3 py-1",on:{click:function(t){return e.addInstalment()}}},[e._v(e._s(e.__("Add Instalment")))])])])])])],2)])])])])}),[],!1,null,null,null).exports;var Q={filters:{nsCurrency:r.W},name:"ns-preview-popup",data:function(){return{active:"details",order:new Object,products:[],payments:[],options:null,print:new w.Z({urls:systemUrls,options:systemOptions}),settings:null}},components:{nsOrderRefund:O,nsOrderPayment:A,nsOrderDetails:R,nsOrderInstalments:z},computed:{isVoidable:function(){return["paid","partially_paid","unpaid"].includes(this.order.payment_status)},isDeleteAble:function(){return["hold"].includes(this.order.payment_status)}},methods:{__:l.__,popupResolver:h.Z,popupCloser:a.Z,closePopup:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.popupResolver(e)},setActive:function(e){this.active=e},printOrder:function(){this.print.process(this.order.id,"sale")},refresh:function(){this.$popupParams.component.$emit("updated"),this.loadOrderDetails(this.order.id)},loadOrderDetails:function(e){var t=this;(0,i.D)([n.ih.get("/api/nexopos/v4/orders/".concat(e)),n.ih.get("/api/nexopos/v4/orders/".concat(e,"/products")),n.ih.get("/api/nexopos/v4/orders/".concat(e,"/payments"))]).subscribe((function(e){t.order=e[0],t.products=e[1],t.payments=e[2]}))},deleteOrder:function(){var e=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to delete this order"),onAction:function(t){t&&n.ih.delete("/api/nexopos/v4/orders/".concat(e.order.id)).subscribe({next:function(t){n.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){n.kX.error(e.message).subscribe()}})}})},voidOrder:function(){var e=this;try{new Promise((function(t,s){Popup.show(S.default,{resolve:t,reject:s,title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("The current order will be void. This action will be recorded. Consider providing a reason for this operation"),onAction:function(t){!1!==t&&n.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/void"),{reason:t}).subscribe({next:function(t){n.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){n.kX.error(e.message).subscribe()}})}})}))}catch(e){console.log(e)}},refreshCrudTable:function(){this.$popupParams.component.$emit("updated",!0)}},watch:{active:function(){"details"===this.active&&this.loadOrderDetails(this.order.id)}},mounted:function(){this.order=this.$popupParams.order,this.options=systemOptions,this.urls=systemUrls,this.loadOrderDetails(this.order.id),this.popupCloser()}};window.nsOrderPreviewPopup=Q;const W=Q;const B=(0,f.Z)(W,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-95vh w-95vw md:h-6/7-screen md:w-6/7-screen overflow-hidden shadow-xl ns-box flex flex-col"},[s("div",{staticClass:"border-b ns-box-header p-3 flex items-center justify-between"},[s("div",[s("h3",[e._v(e._s(e.__("Order Options")))])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup(!0)}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 overflow-scroll ns-box-body flex flex-auto"},[e.order.id?s("ns-tabs",{attrs:{active:e.active},on:{active:function(t){return e.setActive(t)}}},[s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Details"),identifier:"details"}},[s("ns-order-details",{attrs:{order:e.order}})],1),e._v(" "),["order_void","hold","refunded","partially_refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Payments"),identifier:"payments"}},[s("ns-order-payment",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1),e._v(" "),["order_void","hold","refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Refund & Return"),identifier:"refund"}},[s("ns-order-refund",{attrs:{order:e.order},on:{loadTab:function(t){return e.setActive(t)},changed:function(t){return e.refresh()}}})],1),e._v(" "),["partially_paid","unpaid"].includes(e.order.payment_status)&&e.order.support_instalments?s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Installments"),identifier:"instalments"}},[s("ns-order-instalments",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1):e._e()],1):e._e(),e._v(" "),e.order.id?e._e():s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)],1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between border-t ns-box-footer"},[s("div",[e.isVoidable?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.voidOrder()}}},[s("i",{staticClass:"las la-ban"}),e._v("\n "+e._s(e.__("Void"))+"\n ")]):e._e(),e._v(" "),e.isDeleteAble?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.deleteOrder()}}},[s("i",{staticClass:"las la-trash"}),e._v("\n "+e._s(e.__("Delete"))+"\n ")]):e._e()],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.printOrder()}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Print"))+"\n ")])],1)])])}),[],!1,null,null,null).exports},1765:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(3632),r=s(665),i=s(2830),o=s(7700),a=s(282);const l={name:"ns-orders-refund-popup",data:function(){return{order:null,refunds:[],view:"summary",previewed:null,loaded:!1,options:systemOptions,systemUrls,print:new a.Z({urls:systemUrls,options:systemOptions})}},methods:{__:n.__,popupCloser:r.Z,popupResolver:i.Z,toggleProductView:function(e){this.view="details",this.previewed=e},loadOrderRefunds:function(){var e=this;nsHttpClient.get("/api/nexopos/v4/orders/".concat(this.order.id,"/refunds")).subscribe((function(t){e.loaded=!0,e.refunds=t.refunds}),(function(e){o.kX.error(e.message).subscribe()}))},close:function(){this.$popup.close()},printRefundReceipt:function(e){this.print.process(e.id,"refund")}},mounted:function(){this.order=this.$popupParams.order,this.popupCloser(),this.loadOrderRefunds()}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-3/5-screen ns-box flex flex-col overflow-hidden"},[s("div",{staticClass:"border-b p-2 flex items-center justify-between ns-box-header"},[s("h3",[e._v(e._s(e.__("Order Refunds")))]),e._v(" "),s("div",{staticClass:"flex"},["details"===e.view?s("div",{staticClass:"flex items-center justify-center cursor-pointer rounded-full px-3 border hover:bg-info-primary hover:text-white mr-1",on:{click:function(t){e.view="summary"}}},[e._v(e._s(e.__("Go Back")))]):e._e(),e._v(" "),s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"overflow-auto flex-auto ns-box-body"},["summary"===e.view?[e.loaded?e._e():s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("ns-spinner",{attrs:{size:"24"}})],1),e._v(" "),e.loaded&&0===e.refunds.length?s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("i",{staticClass:"lar la-frown-open"})]):e._e(),e._v(" "),e.loaded&&e.refunds.length>0?e._l(e.refunds,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(e.order.code))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total)))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("By"))+" : "+e._s(t.author.username))])])])]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.toggleProductView(t)}}},[s("i",{staticClass:"las la-eye"})]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.printRefundReceipt(t)}}},[s("i",{staticClass:"las la-print"})])])})):e._e()]:e._e(),e._v(" "),"details"===e.view?e._l(e.previewed.refunded_products,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(t.product.name))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Condition"))+" : "+e._s(t.condition))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Quantity"))+" : "+e._s(t.quantity))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total_price)))])])])])])})):e._e()],2)])}),[],!1,null,null,null).exports},914:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});var n=s(3632),r=s(2830),i=s(665);const o={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:n.__,popupResolver:r.Z,popupCloser:i.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[s("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t"},[s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),s("hr",{staticClass:"border-r h-16"}),e._v(" "),s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports},3630:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(665),r=s(2830),i=s(7700),o=s(3632),a=s(3815);s(9093);const l={name:"ns-pos-coupons-load-popup",components:{nsNotice:s(2404).Z},data:function(){return{placeHolder:(0,o.__)("Coupon Code"),couponCode:null,order:null,activeTab:"apply-coupon",orderSubscriber:null,customerCoupon:null}},mounted:function(){var e=this;this.popupCloser(),this.$refs.coupon.select(),this.orderSubscriber=POS.order.subscribe((function(t){e.order=t,e.order.coupons.length>0&&(e.activeTab="active-coupons")})),this.$popupParams&&this.$popupParams.apply_coupon&&(this.couponCode=this.$popupParams.apply_coupon,this.getCoupon(this.couponCode).subscribe({next:function(t){e.customerCoupon=t,e.apply()}}))},destroyed:function(){this.orderSubscriber.unsubscribe()},methods:{__:o.__,popupCloser:n.Z,popupResolver:r.Z,selectCustomer:function(){Popup.show(a.Z)},cancel:function(){this.customerCoupon=null,this.couponCode=null},removeCoupon:function(e){this.order.coupons.splice(e,1),POS.refreshCart()},apply:function(){var e=this;try{var t=this.customerCoupon;if(null!==this.customerCoupon.coupon.valid_hours_start&&!ns.date.moment.isAfter(this.customerCoupon.coupon.valid_hours_start)&&this.customerCoupon.coupon.valid_hours_start.length>0)return i.kX.error((0,o.__)("The coupon is out from validity date range.")).subscribe();if(null!==this.customerCoupon.coupon.valid_hours_end&&!ns.date.moment.isBefore(this.customerCoupon.coupon.valid_hours_end)&&this.customerCoupon.coupon.valid_hours_end.length>0)return i.kX.error((0,o.__)("The coupon is out from validity date range.")).subscribe();var s=this.customerCoupon.coupon.products;if(s.length>0){var n=s.map((function(e){return e.product_id}));if(0===this.order.products.filter((function(e){return n.includes(e.product_id)})).length)return i.kX.error((0,o.__)("This coupon requires products that aren't available on the cart at the moment.")).subscribe()}var r=this.customerCoupon.coupon.categories;if(r.length>0){var a=r.map((function(e){return e.category_id}));if(0===this.order.products.filter((function(e){return a.includes(e.$original().category_id)})).length)return i.kX.error((0,o.__)("This coupon requires products that belongs to specific categories that aren't included at the moment.").replace("%s")).subscribe()}this.cancel();var l={active:t.coupon.active,customer_coupon_id:t.id,minimum_cart_value:t.coupon.minimum_cart_value,maximum_cart_value:t.coupon.maximum_cart_value,name:t.coupon.name,type:t.coupon.type,value:0,limit_usage:t.coupon.limit_usage,code:t.coupon.code,discount_value:t.coupon.discount_value,categories:t.coupon.categories,products:t.coupon.products};POS.pushCoupon(l),this.activeTab="active-coupons",setTimeout((function(){e.popupResolver(l)}),500),i.kX.success((0,o.__)("The coupon has applied to the cart.")).subscribe()}catch(e){console.log(e)}},getCouponType:function(e){switch(e){case"percentage_discount":return(0,o.__)("Percentage");case"flat_discount":return(0,o.__)("Flat");default:return(0,o.__)("Unknown Type")}},getDiscountValue:function(e){switch(e.type){case"percentage_discount":return e.discount_value+"%";case"flat_discount":return this.$options.filters.currency(e.discount_value)}},closePopup:function(){this.popupResolver(!1)},setActiveTab:function(e){this.activeTab=e},getCoupon:function(e){return!this.order.customer_id>0?i.kX.error((0,o.__)("You must select a customer before applying a coupon.")).subscribe():i.ih.post("/api/nexopos/v4/customers/coupons/".concat(e),{customer_id:this.order.customer_id})},loadCoupon:function(){var e=this,t=this.couponCode;this.getCoupon(t).subscribe({next:function(t){e.customerCoupon=t,i.kX.success((0,o.__)("The coupon has been loaded.")).subscribe()},error:function(e){i.kX.error(e.message||(0,o.__)("An unexpected error occurred.")).subscribe()}})}}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-95vw md:w-3/6-screen lg:w-2/6-screen"},[s("div",{staticClass:"border-b ns-box-header p-2 flex justify-between items-center"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Load Coupon")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-1 ns-box-body"},[s("ns-tabs",{attrs:{active:e.activeTab},on:{changeTab:function(t){return e.setActiveTab(t)}}},[s("ns-tabs-item",{attrs:{label:e.__("Apply A Coupon"),padding:"p-2",identifier:"apply-coupon"}},[s("div",{staticClass:"border-2 input-group info rounded flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.couponCode,expression:"couponCode"}],ref:"coupon",staticClass:"w-full text-primary p-2 outline-none",attrs:{type:"text",placeholder:e.placeHolder},domProps:{value:e.couponCode},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.loadCoupon()},input:function(t){t.target.composing||(e.couponCode=t.target.value)}}}),e._v(" "),s("button",{staticClass:"px-3 py-2",on:{click:function(t){return e.loadCoupon()}}},[e._v(e._s(e.__("Load")))])]),e._v(" "),s("div",{staticClass:"pt-2"},[s("ns-notice",{attrs:{color:"info"},scopedSlots:e._u([{key:"description",fn:function(){return[e._v(e._s(e.__("Input the coupon code that should apply to the POS. If a coupon is issued for a customer, that customer must be selected priorly.")))]},proxy:!0}])})],1),e._v(" "),e.order&&void 0===e.order.customer_id?s("div",{staticClass:"pt-2 flex"},[s("button",{staticClass:"w-full border p-2 outline-none ns-numpad-key info cursor-pointer text-center",on:{click:function(t){return e.selectCustomer()}}},[e._v(e._s(e.__("Click here to choose a customer.")))])]):e._e(),e._v(" "),e.order&&void 0!==e.order.customer_id?s("div",{staticClass:"pt-2"},[s("ns-notice",{attrs:{color:"success"},scopedSlots:e._u([{key:"description",fn:function(){return[e._v(e._s(e.__("Loading Coupon For : ")+e.order.customer.name+" "+e.order.customer.surname))]},proxy:!0}],null,!1,2531213351)})],1):e._e(),e._v(" "),s("div",{staticClass:"overflow-hidden"},[e.customerCoupon?s("div",{staticClass:"pt-2 fade-in-entrance anim-duration-500 overflow-y-auto ns-scrollbar h-64"},[s("table",{staticClass:"w-full ns-table"},[s("tbody",[s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Coupon Name")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.name))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Discount"))+" ("+e._s(e.getCouponType(e.customerCoupon.coupon.type))+")")]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.getDiscountValue(e.customerCoupon.coupon)))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Usage")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.usage+"/"+(e.customerCoupon.limit_usage||e.__("Unlimited"))))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Valid From")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.coupon.valid_hours_start||e.__("N/A")))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Valid Till")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.coupon.valid_hours_end||e.__("N/A")))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Categories")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[s("ul",[e._l(e.customerCoupon.coupon.categories,(function(t){return s("li",{key:t.id,staticClass:"rounded-full px-3 py-1 border"},[e._v(e._s(t.category.name))])})),e._v(" "),0===e.customerCoupon.coupon.categories.length?s("li",[e._v(e._s(e.__("Not applicable")))]):e._e()],2)])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Products")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[s("ul",[e._l(e.customerCoupon.coupon.products,(function(t){return s("li",{key:t.id,staticClass:"rounded-full px-3 py-1 border"},[e._v(e._s(t.product.name))])})),e._v(" "),0===e.customerCoupon.coupon.products.length?s("li",[e._v(e._s(e.__("Not applicable")))]):e._e()],2)])])])])]):e._e()])]),e._v(" "),s("ns-tabs-item",{attrs:{label:e.__("Active Coupons"),padding:"p-1",identifier:"active-coupons"}},[e.order?s("ul",[e._l(e.order.coupons,(function(t,n){return s("li",{key:n,staticClass:"flex justify-between elevation-surface border items-center px-2 py-1"},[s("div",{staticClass:"flex-auto"},[s("h3",{staticClass:"font-semibold text-primary p-2 flex justify-between"},[s("span",[e._v(e._s(t.name))]),e._v(" "),s("span",[e._v(e._s(e.getDiscountValue(t)))])])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.removeCoupon(n)}}})],1)])})),e._v(" "),0===e.order.coupons.length?s("li",{staticClass:"flex justify-between elevation-surface border items-center p-2"},[e._v("\n "+e._s(e.__("No coupons applies to the cart."))+"\n ")]):e._e()],2):e._e()])],1)],1),e._v(" "),e.customerCoupon?s("div",{staticClass:"flex"},[s("button",{staticClass:"w-1/2 px-3 py-2 bg-success-tertiary text-white font-bold",on:{click:function(t){return e.apply()}}},[e._v("\n "+e._s(e.__("Apply"))+"\n ")]),e._v(" "),s("button",{staticClass:"w-1/2 px-3 py-2 bg-error-tertiary text-white font-bold",on:{click:function(t){return e.cancel()}}},[e._v("\n "+e._s(e.__("Cancel"))+"\n ")])]):e._e()])}),[],!1,null,null,null).exports},3815:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var n=s(7700),r=s(2830),i=s(6979),o=s(820);const a={data:function(){return{searchCustomerValue:"",orderSubscription:null,order:{},debounceSearch:null,customers:[],isLoading:!1}},computed:{customerSelected:function(){return!1}},watch:{searchCustomerValue:function(e){var t=this;clearTimeout(this.debounceSearch),this.debounceSearch=setTimeout((function(){t.searchCustomer(e)}),500)}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.resolveIfQueued(!1)})),this.orderSubscription=POS.order.subscribe((function(t){e.order=t})),this.getRecentCustomers(),this.$refs.searchField.focus()},destroyed:function(){this.orderSubscription.unsubscribe()},methods:{__:s(3632).__,resolveIfQueued:r.Z,attemptToChoose:function(){if(1===this.customers.length)return this.selectCustomer(this.customers[0]);n.kX.info("Too many result.").subscribe()},openCustomerHistory:function(e,t){t.stopImmediatePropagation(),this.$popup.close(),i.G.show(o.Z,{customer:e,activeTab:"account-payment"})},selectCustomer:function(e){var t=this;this.customers.forEach((function(e){return e.selected=!1})),e.selected=!0,this.isLoading=!0,POS.selectCustomer(e).then((function(s){t.isLoading=!1,t.resolveIfQueued(e)})).catch((function(e){t.isLoading=!1}))},searchCustomer:function(e){var t=this;n.ih.post("/api/nexopos/v4/customers/search",{search:e}).subscribe((function(e){e.forEach((function(e){return e.selected=!1})),t.customers=e}))},createCustomerWithMatch:function(e){this.resolveIfQueued(!1),i.G.show(o.Z,{name:e})},getRecentCustomers:function(){var e=this;this.isLoading=!0,n.ih.get("/api/nexopos/v4/customers/recently-active").subscribe({next:function(t){e.isLoading=!1,t.forEach((function(e){return e.selected=!1})),e.customers=t},error:function(t){e.isLoading=!1}})}}};const l=(0,s(1900).Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-xl w-4/5-screen md:w-2/5-screen xl:w-108",attrs:{id:"ns-pos-customer-select-popup"}},[s("div",{staticClass:"border-b ns-box-header text-center font-semibold text-2xl py-2",attrs:{id:"header"}},[s("h2",[e._v(e._s(e.__("Select Customer")))])]),e._v(" "),s("div",{staticClass:"relative"},[s("div",{staticClass:"p-2 border-b ns-box-body items-center flex justify-between"},[s("span",[e._v(e._s(e.__("Selected"))+" : ")]),e._v(" "),s("div",{staticClass:"flex items-center justify-between"},[s("span",[e._v(e._s(e.order.customer?e.order.customer.name:"N/A"))]),e._v(" "),e.order.customer?s("button",{staticClass:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button hover:border-transparent",on:{click:function(t){return e.openCustomerHistory(e.order.customer,t)}}},[s("i",{staticClass:"las la-eye"})]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 border-b ns-box-body flex justify-between text-primary"},[s("div",{staticClass:"input-group flex-auto border-2 rounded"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchCustomerValue,expression:"searchCustomerValue"}],ref:"searchField",staticClass:"outline-none w-full p-2",attrs:{placeholder:"Search Customer",type:"text"},domProps:{value:e.searchCustomerValue},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.attemptToChoose()},input:function(t){t.target.composing||(e.searchCustomerValue=t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"h-3/5-screen xl:h-2/5-screen overflow-y-auto ns-scrollbar"},[s("ul",{staticClass:"ns-vertical-menu"},[e.customers&&0===e.customers.length?s("li",{staticClass:"p-2 text-center text-primary"},[e._v("\n "+e._s(e.__("No customer match your query..."))+"\n ")]):e._e(),e._v(" "),e.customers&&0===e.customers.length?s("li",{staticClass:"p-2 cursor-pointer text-center text-primary",on:{click:function(t){return e.createCustomerWithMatch(e.searchCustomerValue)}}},[s("span",{staticClass:"border-b border-dashed border-info-primary"},[e._v(e._s(e.__("Create a customer")))])]):e._e(),e._v(" "),e._l(e.customers,(function(t){return s("li",{key:t.id,staticClass:"cursor-pointer p-2 border-b text-primary flex justify-between items-center",on:{click:function(s){return e.selectCustomer(t)}}},[s("span",[e._v(e._s(t.name))]),e._v(" "),s("p",{staticClass:"flex items-center"},[t.owe_amount>0?s("span",{staticClass:"text-error-primary"},[e._v("-"+e._s(e._f("currency")(t.owe_amount)))]):e._e(),e._v(" "),t.owe_amount>0?s("span",[e._v("/")]):e._e(),e._v(" "),s("span",{staticClass:"purchase-amount"},[e._v(e._s(e._f("currency")(t.purchases_amount)))]),e._v(" "),s("button",{staticClass:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button info",on:{click:function(s){return e.openCustomerHistory(t,s)}}},[s("i",{staticClass:"las la-eye"})])])])}))],2)]),e._v(" "),e.isLoading?s("div",{staticClass:"z-10 top-0 absolute w-full h-full flex items-center justify-center"},[s("ns-spinner",{attrs:{size:"24",border:"8"}})],1):e._e()])])}),[],!1,null,null,null).exports},820:(e,t,s)=>{"use strict";s.d(t,{Z:()=>x});var n=s(4687),r=s.n(n),i=s(665),o=s(7700),a=s(6979),l=s(3815),c=s(4679),u=s(3632);const d={mounted:function(){this.closeWithOverlayClicked(),this.loadTransactionFields()},data:function(){return{fields:[],isSubmiting:!1,formValidation:new c.Z}},methods:{__:u.__,closeWithOverlayClicked:i.Z,proceed:function(){var e=this,t=this.$popupParams.customer,s=this.formValidation.extractFields(this.fields);this.isSubmiting=!0,o.ih.post("/api/nexopos/v4/customers/".concat(t.id,"/account-history"),s).subscribe({next:function(t){e.isSubmiting=!1,o.kX.success(t.message).subscribe(),e.$popupParams.resolve(t),e.$popup.close()},error:function(t){e.isSubmiting=!1,o.kX.error(t.message).subscribe(),e.$popupParams.reject(t)}})},close:function(){this.$popup.close(),this.$popupParams.reject(!1)},loadTransactionFields:function(){var e=this;o.ih.get("/api/nexopos/v4/fields/ns.customers-account").subscribe({next:function(t){e.fields=e.formValidation.createFields(t)}})}}};var p=s(1900);const f=(0,p.Z)(d,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-6/7-screen md:w-5/7-screen lg:w-4/7-screen h-6/7-screen md:h-5/7-screen lg:h-5/7-screen overflow-hidden shadow-lg ns-box flex flex-col relative"},[s("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[s("h2",{staticClass:"font-semibold"},[e._v(e._s(e.__("New Transaction")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex-auto overflow-y-auto"},[0===e.fields.length?s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1):e._e(),e._v(" "),e.fields.length>0?s("div",{staticClass:"p-2"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1):e._e()]),e._v(" "),s("div",{staticClass:"p-2 ns-box-footer justify-between border-t flex"},[s("div"),e._v(" "),s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-2 flex flex-wrap"},[s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.close()}}},[e._v(e._s(e.__("Close")))])],1),e._v(" "),s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.proceed()}}},[e._v(e._s(e.__("Proceed")))])],1)])])]),e._v(" "),0===e.isSubmiting?s("div",{staticClass:"h-full w-full absolute flex items-center justify-center",staticStyle:{background:"rgb(0 98 171 / 45%)"}},[s("ns-spinner")],1):e._e()])}),[],!1,null,null,null).exports;var v=s(3630),h=s(914),m=s(2830),_=s(3502),b=s(800);function y(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const g={name:"ns-pos-customers",data:function(){return{activeTab:"create-customers",customer:null,subscription:null,orders:[],options:{},optionsSubscriber:null,selectedTab:"orders",isLoadingCoupons:!1,isLoadingRewards:!1,isLoadingHistory:!1,isLoadingOrders:!1,coupons:[],rewardsResponse:[],order:null,walletHistories:[]}},components:{nsPaginate:_.Z},destroyed:function(){this.subscription.unsubscribe(),this.optionsSubscriber.unsubscribe()},mounted:function(){var e=this;this.closeWithOverlayClicked(),this.optionsSubscriber=POS.options.subscribe((function(t){e.options=t})),this.subscription=POS.order.subscribe((function(t){e.order=t,void 0!==e.$popupParams.customer?(e.activeTab="account-payment",e.customer=e.$popupParams.customer,e.loadCustomerOrders()):void 0!==t.customer&&(e.activeTab="account-payment",e.customer=t.customer,e.loadCustomerOrders())})),this.popupCloser()},methods:{__:u.__,reload:function(){this.loadCustomerOrders()},popupResolver:m.Z,popupCloser:i.Z,getWalletHistoryLabel:function(e){switch(e){case"add":return(0,u.__)("Crediting");case"deduct":return(0,u.__)("Removing");case"refund":return(0,u.__)("Refunding");case"payment":return(0,u.__)("Payment");default:return(0,u.__)("Unknow")}},getType:function(e){switch(e){case"percentage_discount":return(0,u.__)("Percentage Discount");case"flat_discount":return(0,u.__)("Flat Discount")}},closeWithOverlayClicked:i.Z,openOrderOptions:function(e){var t,s=this;return(t=r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,s){a.G.show(b.Z,{order:e,resolve:t,reject:s})}));case 3:t.sent,s.reload(),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),o.kX.error((0,u.__)("An error occurred while opening the order options")).subscribe();case 10:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){y(i,n,r,o,a,"next",e)}function a(e){y(i,n,r,o,a,"throw",e)}o(void 0)}))})()},doChangeTab:function(e){this.selectedTab=e,"coupons"===e&&this.loadCoupons(),"rewards"===e&&this.loadRewards(),"wallet-history"===e&&this.loadAccounHistory(),"orders"===e&&this.loadCustomerOrders()},loadAccounHistory:function(){var e=this;this.isLoadingHistory=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/account-history")).subscribe({next:function(t){e.walletHistories=t.data,e.isLoadingHistory=!1},error:function(t){e.isLoadingHistory=!1}})},loadCoupons:function(){var e=this;this.isLoadingCoupons=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/coupons")).subscribe({next:function(t){e.coupons=t,e.isLoadingCoupons=!1},error:function(t){e.isLoadingCoupons=!1}})},loadRewards:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/api/nexopos/v4/customers/".concat(this.customer.id,"/rewards");this.isLoadingRewards=!0,o.ih.get(t).subscribe({next:function(t){e.rewardsResponse=t,e.isLoadingRewards=!1},error:function(t){e.isLoadingRewards=!1}})},prefillForm:function(e){void 0!==this.$popupParams.name&&(e.main.value=this.$popupParams.name)},openCustomerSelection:function(){this.$popup.close(),a.G.show(l.Z)},loadCustomerOrders:function(){var e=this;this.isLoadingOrders=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/orders")).subscribe({next:function(t){e.orders=t,e.isLoadingOrders=!1},error:function(t){e.isLoadingOrders=!1}})},newTransaction:function(e){new Promise((function(t,s){a.G.show(f,{customer:e,resolve:t,reject:s})})).then((function(t){POS.loadCustomer(e.id).subscribe((function(e){POS.selectCustomer(e)}))}))},applyCoupon:function(e){var t=this;void 0===this.order.customer?a.G.show(h.default,{title:(0,u.__)("Use Customer ?"),message:(0,u.__)("No customer is selected. Would you like to proceed with this customer ?"),onAction:function(s){s&&POS.selectCustomer(t.customer).then((function(s){t.proceedApplyingCoupon(e)}))}}):this.order.customer.id===this.customer.id?this.proceedApplyingCoupon(e):this.order.customer.id!==this.customer.id&&a.G.show(h.default,{title:(0,u.__)("Change Customer ?"),message:(0,u.__)("Would you like to assign this customer to the ongoing order ?"),onAction:function(s){s&&POS.selectCustomer(t.customer).then((function(s){t.proceedApplyingCoupon(e)}))}})},proceedApplyingCoupon:function(e){var t=this;new Promise((function(t,s){a.G.show(v.Z,{apply_coupon:e.code,resolve:t,reject:s})})).then((function(e){t.popupResolver(!1)})).catch((function(e){}))},handleSavedCustomer:function(e){o.kX.success(e.message).subscribe(),POS.selectCustomer(e.entry),this.$popup.close()}}};const x=(0,p.Z)(g,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg rounded w-95vw h-95vh lg:w-3/5-screen flex flex-col overflow-hidden",attrs:{id:"ns-pos-customers"}},[s("div",{staticClass:"ns-header p-2 flex justify-between items-center border-b"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Customers")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.$popup.close()}}})],1)]),e._v(" "),s("div",{staticClass:"ns-body flex-auto flex p-2 overflow-y-auto"},[s("ns-tabs",{attrs:{active:e.activeTab},on:{active:function(t){e.activeTab=t}}},[s("ns-tabs-item",{attrs:{identifier:"create-customers",label:"New Customer"}},["yes"===e.options.ns_pos_customers_creation_enabled?s("ns-crud-form",{attrs:{"submit-url":"/api/nexopos/v4/crud/ns.customers",src:"/api/nexopos/v4/crud/ns.customers/form-config"},on:{updated:function(t){return e.prefillForm(t)},save:function(t){return e.handleSavedCustomer(t)}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(e._s(e.__("Customer Name")))]},proxy:!0},{key:"save",fn:function(){return[e._v(e._s(e.__("Save Customer")))]},proxy:!0}],null,!1,2432171054)}):e._e(),e._v(" "),"yes"!==e.options.ns_pos_customers_creation_enabled?s("div",{staticClass:"h-full flex-col w-full flex items-center justify-center text-primary"},[s("i",{staticClass:"lar la-hand-paper ns-icon text-6xl"}),e._v(" "),s("h3",{staticClass:"font-medium text-2xl"},[e._v(e._s(e.__("Not Authorized")))]),e._v(" "),s("p",[e._v(e._s(e.__("Creating customers has been explicitly disabled from the settings.")))])]):e._e()],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex",staticStyle:{padding:"0!important"},attrs:{identifier:"account-payment",label:e.__("Customer Account")}},[null===e.customer?s("div",{staticClass:"flex-auto w-full flex items-center justify-center flex-col p-4"},[s("i",{staticClass:"lar la-frown text-6xl"}),e._v(" "),s("h3",{staticClass:"font-medium text-2xl"},[e._v(e._s(e.__("No Customer Selected")))]),e._v(" "),s("p",[e._v(e._s(e.__("In order to see a customer account, you need to select one customer.")))]),e._v(" "),s("div",{staticClass:"my-2"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.openCustomerSelection()}}},[e._v(e._s(e.__("Select Customer")))])],1)]):e._e(),e._v(" "),e.customer?s("div",{staticClass:"flex flex-col flex-auto"},[s("div",{staticClass:"flex-auto p-2 flex flex-col"},[s("div",{staticClass:"-mx-4 flex flex-wrap ns-tab-cards"},[s("div",{staticClass:"px-4 mb-4 w-full"},[s("h2",{staticClass:"font-semibold"},[e._v(e._s(e.__("Summary For"))+" : "+e._s(e.customer.name))])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-success-secondary to-green-700 p-2 flex flex-col text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Total Purchases")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"font-bold"},[e._v(e._s(e._f("currency")(e.customer.purchases_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-error-secondary to-red-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Total Owed")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.owed_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-blue-500 to-blue-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Wallet Amount")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.account_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-teal-500 to-teal-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Credit Limit")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.credit_limit_amount)))])])])])]),e._v(" "),s("div",{staticClass:"flex flex-auto flex-col overflow-hidden"},[s("ns-tabs",{attrs:{active:e.selectedTab},on:{changeTab:function(t){return e.doChangeTab(t)}}},[s("ns-tabs-item",{attrs:{identifier:"orders",label:e.__("Orders")}},[e.isLoadingOrders?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingOrders?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Last Purchases")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{colspan:"3",width:"150"}},[e._v(e._s(e.__("Order")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"50"}},[e._v(e._s(e.__("Options")))])])]),e._v(" "),s("tbody",{staticClass:"text-primary"},[0===e.orders.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No orders...")))])]):e._e(),e._v(" "),e._l(e.orders,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[s("div",{staticClass:"flex flex-col items-start"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Code"))+": "+e._s(t.code))]),e._v(" "),s("div",{staticClass:"md:-mx-2 w-full flex flex-col md:flex-row"},[s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Total"))+": "+e._s(e._f("currency")(t.total)))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Status"))+": "+e._s(t.human_status))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Delivery"))+": "+e._s(t.human_delivery_status))])])])])]),e._v(" "),s("td",{staticClass:"border p-2 text-center"},[s("button",{staticClass:"rounded-full h-8 px-2 flex items-center justify-center border border-gray ns-inset-button success",on:{click:function(s){return e.openOrderOptions(t)}}},[s("i",{staticClass:"las la-wallet"}),e._v(" "),s("span",{staticClass:"ml-1"},[e._v(e._s(e.__("Options")))])])])])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"wallet-history",label:e.__("Wallet History")}},[e.isLoadingHistory?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingHistory?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Wallet History")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{colspan:"3",width:"150"}},[e._v(e._s(e.__("Transaction")))])])]),e._v(" "),s("tbody",{staticClass:"text-primary"},[0===e.walletHistories.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[e._v(e._s(e.__("No History...")))])]):e._e(),e._v(" "),e._l(e.walletHistories,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[s("div",{staticClass:"flex flex-col items-start"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Transaction"))+": "+e._s(e.getWalletHistoryLabel(t.operation)))]),e._v(" "),s("div",{staticClass:"md:-mx-2 w-full flex flex-col md:flex-row"},[s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/3"},[s("small",[e._v(e._s(e.__("Amount"))+": "+e._s(e._f("currency")(t.amount)))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/3"},[s("small",[e._v(e._s(e.__("Date"))+": "+e._s(t.created_at))])])])])])])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"coupons",label:e.__("Coupons")}},[e.isLoadingCoupons?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingCoupons?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Coupons")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"150"}},[e._v(e._s(e.__("Name")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Type")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"})])]),e._v(" "),s("tbody",{staticClass:"text-primary text-sm"},[0===e.coupons.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No coupons for the selected customer...")))])]):e._e(),e._v(" "),e._l(e.coupons,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",[e._v(e._s(t.name))]),e._v(" "),s("div",{},[s("ul",{staticClass:"-mx-2 flex"},[s("li",{staticClass:"text-xs text-primary px-2"},[e._v(e._s(e.__("Usage :"))+" "+e._s(t.usage)+"/"+e._s(t.limit_usage))]),e._v(" "),s("li",{staticClass:"text-xs text-primary px-2"},[e._v(e._s(e.__("Code :"))+" "+e._s(t.code))])])])]),e._v(" "),s("td",{staticClass:"border p-2 text-center"},[e._v(e._s(e.getType(t.coupon.type))+"\n "),"percentage_discount"===t.coupon.type?s("span",[e._v("\n ("+e._s(t.coupon.discount_value)+"%)\n ")]):e._e(),e._v(" "),"flat_discount"===t.coupon.type?s("span",[e._v("\n ("+e._s(e._f("currency")(t.coupon.discount_value))+")\n ")]):e._e()]),e._v(" "),s("td",{staticClass:"border p-2 text-right"},[s("ns-button",{attrs:{type:"info"},on:{click:function(s){return e.applyCoupon(t)}}},[e._v(e._s(e.__("Use Coupon")))])],1)])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"rewards",label:e.__("Rewards")}},[e.isLoadingRewards?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingRewards?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Rewards")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"150"}},[e._v(e._s(e.__("Name")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Points")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Target")))])])]),e._v(" "),e.rewardsResponse.data?s("tbody",{staticClass:"text-primary text-sm"},[0===e.rewardsResponse.data.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No rewards available the selected customer...")))])]):e._e(),e._v(" "),e._l(e.rewardsResponse.data,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.reward_name))])]),e._v(" "),s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.points))])]),e._v(" "),s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.target))])])])}))],2):e._e()])])]),e._v(" "),s("div",{staticClass:"py-1 flex justify-end"},[s("ns-paginate",{attrs:{pagination:e.rewardsResponse},on:{load:function(t){return e.loadRewards(t)}}})],1)]],2)],1)],1)]),e._v(" "),s("div",{staticClass:"p-2 border-t border-box-edge flex justify-between"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.newTransaction(e.customer)}}},[e._v(e._s(e.__("Account Transaction")))])],1)])]):e._e()])],1)],1)])}),[],!1,null,null,null).exports},4065:(e,t,s)=>{"use strict";s.d(t,{Z:()=>d});var n=s(4679),r=s(7700),i=s(3632);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function a(e){for(var t=1;t0){var e=nsRawCurrency(this.order.instalments.map((function(e){return parseFloat(e.amount.value)||0})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})));this.totalPayments=this.order.total-e}else this.totalPayments=0},removeInstalment:function(e){var t=this.order.instalments.indexOf(e);this.order.instalments.splice(t,1),this.$forceUpdate()},generatePaymentFields:function(e){var t=this;this.order.instalments=new Array(parseInt(e)).fill("").map((function(e,s){return{date:{type:"date",name:"date",label:"Date",value:0===s?ns.date.moment.format("YYYY-MM-DD"):""},amount:{type:"number",name:"amount",label:"Amount",value:0===s?t.expectedPayment:0},readonly:{type:"hidden",name:"readonly",value:t.expectedPayment>0&&0===s}}})),this.$forceUpdate(),this.refreshTotalPayments()},close:function(){this.$popupParams.reject({status:"failed",message:(0,i.__)("You must define layaway settings before proceeding.")}),this.$popup.close()},skipInstalments:function(){this.expectedPayment>0?(this.order.instalments=[{amount:this.expectedPayment,date:ns.date.current}],this.order.final_payment_date=this.order.instalments.reverse()[0].date,this.order.total_instalments=this.order.instalments.length,this.order.support_instalments=!1):(this.order.final_payment_date=ns.date.current,this.order.total_instalments=0,this.order.support_instalments=!1),this.$popup.close(),POS.order.next(this.order);var e=this.$popupParams,t=e.resolve;e.reject;return t({order:this.order,skip_layaway:!0})},updateOrder:function(){var e=this;if(0===this.order.instalments.length)return r.kX.error((0,i.__)("Please provide instalments before proceeding.")).subscribe();if(this.fields.forEach((function(t){return e.formValidation.validateField(t)})),!this.formValidation.fieldsValid(this.fields))return r.kX.error((0,i.__)("Unable to process, the form is not valid")).subscribe();this.$forceUpdate();var t=this.order.instalments.map((function(e){return{amount:parseFloat(e.amount.value),date:e.date.value}})),s=nsRawCurrency(t.map((function(e){return e.amount})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})));if(t.filter((function(e){return void 0===e.date||""===e.date})).length>0)return r.kX.error((0,i.__)("One or more instalments has an invalid date.")).subscribe();if(t.filter((function(e){return!(e.amount>0)})).length>0)return r.kX.error((0,i.__)("One or more instalments has an invalid amount.")).subscribe();if(t.filter((function(e){return moment(e.date).isBefore(ns.date.moment.startOf("day"))})).length>0)return r.kX.error((0,i.__)("One or more instalments has a date prior to the current date.")).subscribe();var n=t.filter((function(e){return moment(e.date).isSame(ns.date.moment.startOf("day"),"day")})),o=0;if(n.forEach((function(e){o+=parseFloat(e.amount)})),o{"use strict";s.r(t),s.d(t,{default:()=>r});const n={name:"ns-pos-loading-popup"};const r=(0,s(1900).Z)(n,(function(){var e=this.$createElement;return(this._self._c||e)("ns-spinner")}),[],!1,null,null,null).exports},4523:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(4687),r=s.n(n),i=s(2830),o=s(3632),a=s(665);function l(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const c={data:function(){return{types:[],typeSubscription:null}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.resolveIfQueued(!1)})),this.typeSubscription=POS.types.subscribe((function(t){e.types=t,1===Object.values(e.types).length&&e.select(Object.keys(e.types)[0])})),this.popupCloser()},destroyed:function(){this.typeSubscription.unsubscribe()},methods:{__:o.__,popupCloser:a.Z,popupResolver:i.Z,resolveIfQueued:i.Z,select:function(e){var t,s=this;return(t=r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Object.values(s.types).forEach((function(e){return e.selected=!1})),s.types[e].selected=!0,n=s.types[e],t.prev=3,t.next=6,POS.triggerOrderTypeSelection(n);case 6:t.sent,POS.types.next(s.types),s.resolveIfQueued(n),t.next=13;break;case 11:t.prev=11,t.t0=t.catch(3);case 13:case"end":return t.stop()}}),t,null,[[3,11]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){l(i,n,r,o,a,"next",e)}function a(e){l(i,n,r,o,a,"throw",e)}o(void 0)}))})()}}};const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-full w-4/5-screen md:w-2/5-screen lg:w-2/5-screen xl:w-2/6-screen shadow-lg",attrs:{id:"ns-order-type"}},[s("div",{staticClass:"h-16 flex justify-center items-center",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Define The Order Type")))])]),e._v(" "),0===Object.values(e.types).length?s("div",{staticClass:"ns-box-body grid grid-flow-row grid-cols-1 grid-rows-1"},[s("div",{staticClass:"h-full w-full flex items-center justify-center flex-col"},[s("i",{staticClass:"las la-frown text-7xl"}),e._v(" "),s("div",{staticClass:"p-4 md:w-2/3"},[s("p",{staticClass:"text-center"},[e._v(e._s(e.__("No payment type has been selected on the settings. Please check your POS features and choose the supported order type")))]),e._v(" "),s("div",{staticClass:"flex justify-center py-1"},[s("ns-link",{attrs:{target:"_blank",type:"info",href:"https://my.nexopos.com/en/documentation/components/order-types"}},[e._v(e._s(e.__("Read More")))])],1)])])]):e._e(),e._v(" "),Object.values(e.types).length>0?s("div",{staticClass:"ns-box-body grid grid-flow-row grid-cols-2 grid-rows-2"},e._l(e.types,(function(t){return s("div",{key:t.identifier,staticClass:"ns-numpad-key info h-56 flex items-center justify-center flex-col cursor-pointer border",class:t.selected?"active":"",on:{click:function(s){return e.select(t.identifier)}}},[s("img",{staticClass:"w-32 h-32",attrs:{src:t.icon,alt:""}}),e._v(" "),s("h4",{staticClass:"font-semibold text-xl my-2"},[e._v(e._s(t.label))])])})),0):e._e()])}),[],!1,null,null,null).exports},9958:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(7700),r=s(3632),i=s(665),o=s(7751),a=s(8909);const l={components:{nsNumpad:o.Z,nsNumpadPlus:a.Z},data:function(){return{finalValue:1,virtualStock:null,options:{},optionsSubscription:null,allSelected:!0,isLoading:!1}},beforeDestroy:function(){this.optionsSubscription.unsubscribe()},mounted:function(){var e=this;this.optionsSubscription=POS.options.subscribe((function(t){e.options=t})),this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())})),this.$popupParams.product.quantity&&(this.finalValue=this.$popupParams.product.quantity),this.popupCloser()},destroyed:function(){nsHotPress.destroy("pos-quantity-numpad"),nsHotPress.destroy("pos-quantity-backspace"),nsHotPress.destroy("pos-quantity-enter")},methods:{__:r.__,popupCloser:i.Z,closePopup:function(){this.$popupParams.reject(!1),this.$popup.close()},updateQuantity:function(e){this.finalValue=e},defineQuantity:function(e){var t=this.$popupParams,s=t.product,i=t.data;if(0===e)return n.kX.error((0,r.__)("Please provide a quantity")).subscribe();if("enabled"===s.$original().stock_management&&"materialized"===s.$original().type){var o=POS.getStockUsage(s.$original().id,i.unit_quantity_id)-(s.quantity||0);if(e>parseFloat(i.$quantities().quantity)-o)return n.kX.error((0,r.__)("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",i.$quantities().quantity-o)).subscribe()}this.resolve({quantity:e})},resolve:function(e){this.$popupParams.resolve(e),this.$popup.close()}}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow min-h-2/5-screen w-3/4-screen md:w-3/5-screen lg:w-2/5-screen xl:w-2/5-screen relative"},[e.isLoading?s("div",{staticClass:"flex w-full h-full absolute top-O left-0 items-center justify-center",staticStyle:{background:"rgb(202 202 202 / 49%)"},attrs:{id:"loading-overlay"}},[s("ns-spinner")],1):e._e(),e._v(" "),s("div",{staticClass:"flex-shrink-0 flex justify-between items-center p-2 border-b ns-box-header"},[s("div",[s("h1",{staticClass:"text-xl font-bold text-primary text-center"},[e._v(e._s(e.__("Define Quantity")))])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"h-24 border-b primary ns-box-body flex items-center justify-center",attrs:{id:"screen"}},[s("h1",{staticClass:"font-bold text-3xl"},[e._v(e._s(e.finalValue))])]),e._v(" "),"default"===e.options.ns_pos_numpad?s("ns-numpad",{attrs:{floating:e.options.ns_pos_allow_decimal_quantities,value:e.finalValue},on:{changed:function(t){return e.updateQuantity(t)},next:function(t){return e.defineQuantity(t)}}}):e._e(),e._v(" "),"advanced"===e.options.ns_pos_numpad?s("ns-numpad-plus",{attrs:{value:e.finalValue},on:{changed:function(t){return e.updateQuantity(t)},next:function(t){return e.defineQuantity(t)}}}):e._e()],1)}),[],!1,null,null,null).exports},6071:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(7700),r=s(2830),i=s(4679);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function a(e){for(var t=1;t{"use strict";s.r(t),s.d(t,{default:()=>r});const n={data:function(){return{title:"",message:"",input:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.input=this.$popupParams.input||"",this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())}))},methods:{__:s(3632).__,emitAction:function(e){this.$popupParams.onAction(e?this.input:e),this.$popup.close()},reject:function(e){void 0!==this.$popupParams.reject&&this.$popupParams.reject(e),this.$popup.close()}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-5/7-screen md:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"prompt-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-2"},[s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"w-full md:mx-auto md:w-2/3 py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"p-2"},[s("div",{staticClass:"ns-input"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.input,expression:"input"}],staticClass:"w-full border-2 p-2",attrs:{name:"",id:"",cols:"30",rows:"10"},domProps:{value:e.input},on:{input:function(t){t.target.composing||(e.input=t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"flex border-t action-buttons"},[s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))]),e._v(" "),s("hr",{staticClass:"border-r"}),e._v(" "),s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.reject(!1)}}},[e._v(e._s(e.__("Cancel")))])])])}),[],!1,null,null,null).exports},2614:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(665),r=s(3632);const i={data:function(){return{value:[],options:[],description:"",label:null,type:"select"}},computed:{},mounted:function(){this.popupCloser(),this.value=this.$popupParams.value||[],this.options=this.$popupParams.options,this.label=this.$popupParams.label,this.description=this.$popupParams.description||"",this.type=this.$popupParams.type||this.type},methods:{popupCloser:n.Z,__:r.__,toggle:function(e){var t=this.value.indexOf(e);-1===t?this.value.unshift(e):this.value.splice(t,1)},isSelected:function(e){return this.value.indexOf(e)>=0},close:function(){this.$popupParams.reject(!1),this.$popup.close()},select:function(e){void 0!==e&&(this.value=[e]),this.$popupParams.resolve(this.value),this.close()}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box w-6/7-screen md:w-4/7-screen lg:w-3/7-screen max-h-5/6-screen overflow-hidden flex flex-col"},[s("div",{staticClass:"p-2 flex justify-between border-b items-center ns-box-header"},[s("span",{staticClass:"text-semibold text-primary"},[e._v("\n "+e._s(e.label)+"\n ")]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex flex-col overflow-hidden"},[e.description.length>0?s("p",{staticClass:"p-2 text-center text-sm bg-info-primary"},[e._v(e._s(e.description))]):e._e(),e._v(" "),s("div",{staticClass:"overflow-y-auto"},[s("ul",{staticClass:"ns-vertical-menu"},["select"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b border-box-edge text-primary cursor-pointer",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})):e._e(),e._v(" "),"multiselect"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b text-primary cursor-pointer",class:e.isSelected(t)?"active":"",on:{click:function(s){return e.toggle(t)}}},[e._v(e._s(t.label))])})):e._e()],2)])]),e._v(" "),"multiselect"===e.type?s("div",{staticClass:"flex justify-between"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.select()}}},[e._v(e._s(e.__("Select")))])],1)]):e._e()])}),[],!1,null,null,null).exports},5042:()=>{}},e=>{e.O(0,[898],(()=>{return t=1543,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[443,198,33,634,409],{7700:(e,t,s)=>{"use strict";s.d(t,{l:()=>I,kq:()=>U,ih:()=>L,kX:()=>H});var n=s(6486),r=s(8945),i=s(6300),o=s(8345),a=s(9093),l=s(9248),c=s(230);function u(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,s)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,s)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var s=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=U.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:n}),new c.y((function(i){s._client[e](t,n,Object.assign(Object.assign({},s._client.defaults[e]),r)).then((function(e){s._lastRequestData=e,i.next(e.data),i.complete(),s._subject.next({identifier:"async.stop"})})).catch((function(e){var t;i.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),s._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,s=e.value;this._subject.next({identifier:t,value:s})}}],s&&u(t.prototype,s),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=s(3);function f(e,t){for(var s=0;s=1e3){for(var s,n=Math.floor((""+e).length/3),r=2;r>=1;r--){if(((s=parseFloat((0!=n?e/Math.pow(1e3,n):e).toPrecision(r)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}s%1!=0&&(s=s.toFixed(1)),t=s+["","k","m","b","t"][n]}return t})),O=s(9020),S=s(7794);function $(e,t){for(var s=0;s0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&Z(t.prototype,s),n&&Z(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()),N=new _({sidebar:["xs","sm","md"].includes(Y.breakpoint)?"hidden":"visible"});L.defineClient(r.Z),window.nsEvent=I,window.nsHttpClient=L,window.nsSnackBar=H,window.nsCurrency=O.W,window.nsTruncate=S.b,window.nsRawCurrency=O.f,window.nsAbbreviate=j,window.nsState=N,window.nsUrl=M,window.nsScreen=Y,window.ChartJS=i,window.EventEmitter=v,window.Popup=x.G,window.RxJS=y,window.FormValidation=C.Z,window.nsCrudHandler=X,window.nsTax=q.Z},876:(e,t,s)=>{"use strict";s.r(t),s.d(t,{nsAvatar:()=>G,nsButton:()=>a,nsCheckbox:()=>f,nsCkeditor:()=>E,nsCloseButton:()=>P,nsCrud:()=>N,nsCrudForm:()=>b,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>g.P,nsIconButton:()=>j,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>k,nsMenu:()=>i,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>z.Z,nsPaginate:()=>te.Z,nsSearch:()=>ne,nsSelect:()=>d,nsSelectAudio:()=>p,nsSpinner:()=>m,nsSubmenu:()=>o,nsSwitch:()=>F.Z,nsTableRow:()=>h,nsTabs:()=>D,nsTabsItem:()=>V,nsTextarea:()=>y});var n=s(538),r=s(7700),i=n.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,r.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&r.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,s){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),o=n.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),a=n.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=n.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=n.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

    \n
    \n '}),D=n.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),V=n.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),F=s(3164),A=s(5318),q=s(4687),Z=s.n(q),R=s(914),I=s(665),L=s(2830);const H={data:function(){return{fields:[],validation:new _.Z}},methods:{__:u.__,popupCloser:I.Z,popupResolver:L.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var M=s(1900);const X=(0,M.Z)(H,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[s("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[s("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[s("div",[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var U=function(e,t,s,n){return new(s||(s=Promise))((function(r,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))};const Y={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,u.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:u.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),r.kX.success((0,u.__)("The document has been generated.")).subscribe()}),(function(e){r.kX.error(e.message||(0,u.__)("Unexpected error occurred.")).subscribe()}))},clearSelectedEntries:function(){var e=this;v.G.show(R.default,{title:(0,u.__)("Clear Selected Entries ?"),message:(0,u.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(console.log({row:e}),!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var s=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(s,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(s){s.$checked=e,t.refreshRow(s)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){r.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,u.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){r.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){r.kX.error(e.message).subscribe()}}):void 0:r.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,u.__)("No selection has been made.")).subscribe():r.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,u.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return U(this,void 0,void 0,Z().mark((function e(){var t,s=this;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(X),e.next=4,new Promise((function(e,t){v.G.show(X,{resolve:e,reject:t,queryFilters:s.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,r.kX.error(t.message).subscribe()}))}}};const N=(0,M.Z)(Y,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?s("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[s("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?s("div",{staticClass:"px-2 flex items-center justify-center"},[s("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[s("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),s("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[s("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?s("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[s("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 flex items-center justify-center"},[s("button",{staticClass:"rounded-full text-sm h-10 px-3 outline-none border ns-crud-button",on:{click:function(t){return e.refresh()}}},[s("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?s("div",{staticClass:"px-2 flex items-center"},[s("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():s("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?s("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():s("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?s("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),s("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[s("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[s("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",[s("th",{staticClass:"text-center px-2 border w-16 py-2"},[s("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,n){return s("th",{key:n,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(n)}}},[s("div",{staticClass:"w-full flex justify-between items-center"},[s("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),s("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?s("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?s("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),s("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,n){return s("ns-table-row",{key:n,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():s("tr",[s("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?s("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?s:s[0]}}},[s("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,n){return s("option",{key:n,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),s("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),s("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var z=s(7751),Q=s(1726),W=s(7259);const B=n.default.extend({methods:{__:u.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,Q.createAvatar)(W,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const G=(0,M.Z)(B,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[s("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),s("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?s("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?s("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=s(328),J=s(2404),ee=s(9045),te=s(3502);const se={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:u.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,s,n;e.searchText.length>0&&r.ih[e.method||"post"](e.url,(t={},s=e.searchArgument||"search",n=e.searchText,s in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,t)).subscribe({next:function(t){e.results=t},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error occurred.")).subscribe()}})}),1e3)}},mounted:function(){}};const ne=(0,M.Z)(se,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-search"},[s("div",{staticClass:"input-group info border-2"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),s("div",{staticClass:"relative"},[s("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?s("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,n){return s("li",{key:n,staticClass:"border-b p-2 cursor-pointer",on:{click:function(s){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},4110:(e,t,s)=>{"use strict";s.d(t,{P:()=>a});var n=s(538),r=s(328),i=s(5318),o=s(3164),a=n.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:r.Z,nsDateTimePicker:i.Z,nsSwitch:o.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n '})},9020:(e,t,s)=>{"use strict";s.d(t,{W:()=>c,f:()=>u});var n=s(2077),r=s.n(n),i=s(538),o=s(6740),a=s.n(o),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=i.default.filter("currency",(function(e){var t,s,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===n){var i={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};s=a()(e,i).format()}else s=r()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(s).concat("after"===ns.currency.ns_currency_position?t:"")})),u=function(e){var t="0.".concat(l);return parseFloat(r()(e).format(t))}},7794:(e,t,s)=>{"use strict";s.d(t,{b:()=>n});var n=s(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},4679:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;sr});var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,s,r;return t=e,s=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var s in e.tabs)if(e.tabs[s].fields){var n=[],r=this.validateFieldsErrors(e.tabs[s].fields);r.length>0&&n.push(r),e.tabs[s].errors=n.flat(),t.push(n.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var s in e)0===t&&(e[s].active=!0),e[s].active=void 0!==e[s].active&&e[s].active,e[s].fields=this.createFields(e[s].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var s=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(s,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(s){t.fieldPassCheck(e,s)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var s in e.tabs)void 0===t[s]&&(t[s]={}),t[s]=this.extractFields(e.tabs[s].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var s=function(s){var n=s.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===n.length&&e.tabs[n[0]].fields.forEach((function(e){e.name===n[1]&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))})),s===e.main.name&&t.errors[s].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var n in t.errors)s(n)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var s=function(s){e.forEach((function(e){e.name===s&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))}))};for(var n in t.errors)s(n)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){s.identifier===t.identifier&&!0===s.invalid&&e.errors.splice(n,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){!0===s[t.identifier]&&e.errors.splice(n,1)}))}return e}}],s&&n(t.prototype,s),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3632:(e,t,s)=>{"use strict";s.d(t,{__:()=>n,c:()=>r});var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},r=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},665:(e,t,s)=>{"use strict";function n(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var s=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(s+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}s.d(t,{Z:()=>n})},2830:(e,t,s)=>{"use strict";function n(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}s.d(t,{Z:()=>n})},6979:(e,t,s)=>{"use strict";s.d(t,{G:()=>c});var n=s(4687),r=s.n(n),i=s(9248);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var s=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[s-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new i.x}var t,s,n;return t=e,s=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=0;s<10;s++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,s,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,r().mark((function o(){var a,l,c,u=this;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("function"!=typeof e){r.next=9;break}return r.prev=1,r.next=4,e();case 4:e=r.sent.default,r.next=9;break;case 7:r.prev=7,r.t0=r.catch(1);case 9:a=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",a.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){u.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=i,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return r.stop()}}),o,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var s="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(s),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],n=[{key:"show",value:function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new e(n);return r.open(t,s),r}}],s&&a(t.prototype,s),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},282:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;sr});var r=function(){function e(t){var s=t.urls,n=t.options;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.printingURL={refund:"refund_printing_url",sale:"sale_printing_url",payment:"payment_printing_url"},this.urls=s,this.options=n}var t,s,r;return t=e,s=[{key:"processRegularPrinting",value:function(e,t){var s=document.querySelector("#printing-section");s&&s.remove();var n=this.urls[this.printingURL[t]].replace("{reference_id}",e),r=document.createElement("iframe");r.id="printing-section",r.className="hidden",r.src=n,document.body.appendChild(r),setTimeout((function(){document.querySelector("#printing-section").remove()}),5e3)}},{key:"process",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"aloud";"default"===this.options.ns_pos_printing_gateway?this.processRegularPrinting(e,t):this.processCustomPrinting(e,this.options.ns_pos_printing_gateway,t,s)}},{key:"processCustomPrinting",value:function(e,t,s){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"aloud",r={printed:!1,reference_id:e,gateway:t,document:s,mode:n},i=nsHooks.applyFilters("ns-custom-print",{params:r,promise:function(){return new Promise((function(e,t){t({status:"failed",message:__("The selected print gateway doesn't support this type of printing.","NsPrintAdapter")})}))}});i.promise().then((function(e){nsSnackBar.success(e.message).subscribe()})).catch((function(e){nsSnackBar.error(e.message||__("An error unexpected occured while printing.")).subscribe()}))}}],s&&n(t.prototype,s),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9093:(e,t,s)=>{"use strict";s.d(t,{S:()=>i});var n=s(3260);function r(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return n.Observable.create((function(n){var i=s.__createSnack({message:e,label:t,type:r.type}),o=i.buttonNode,a=(i.textNode,i.snackWrapper,i.sampleSnack);o.addEventListener("click",(function(e){n.onNext(o),n.onCompleted(),a.remove()})),s.__startTimer(r.duration,a)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var s,n=function(){e>0&&!1!==e&&(s=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(s)})),t.addEventListener("mouseleave",(function(){n()})),n()}},{key:"__createSnack",value:function(e){var t=e.message,s=e.label,n=e.type,r=void 0===n?"info":n,i=document.getElementById("snack-wrapper")||document.createElement("div"),o=document.createElement("div"),a=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),u="",d="";switch(r){case"info":u="",d="info";break;case"error":u="",d="error";break;case"success":u="",d="success"}return a.textContent=t,a.setAttribute("class","pr-2"),s&&(l.setAttribute("class","ns-button default"),c.textContent=s,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(u)),l.appendChild(c)),o.appendChild(a),o.appendChild(l),o.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),i.appendChild(o),null===document.getElementById("snack-wrapper")&&(i.setAttribute("id","snack-wrapper"),i.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(i)),{snackWrapper:i,sampleSnack:o,buttonsWrapper:l,buttonNode:c,textNode:a}}}],s&&r(t.prototype,s),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7995:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var n=s(2376);function r(e,t){for(var s=0;s{"use strict";s.d(t,{$:()=>l});var n=s(7700),r=s(3632),i=s(6979),o=s(9958);function a(e,t){for(var s=0;sparseFloat(e.$quantities().quantity)-u)return n.kX.error((0,r.__)("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",(e.$quantities().quantity-u).toString())).subscribe()}s({quantity:1})}else l.open(o.Z,{resolve:s,reject:a,product:c,data:e})}))}}])&&a(t.prototype,s),l&&a(t,l),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1543:(e,t,s)=>{"use strict";var n=s(4687),r=s.n(n),i=s(5502),o=s(6979),a=s(7700),l=s(3632);const c={data:function(){return{unitsQuantities:[],loadsUnits:!1,options:null,optionsSubscriber:null}},beforeDestroy:function(){this.optionsSubscriber.unsubscribe()},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())})),this.optionsSubscriber=POS.options.subscribe((function(t){e.options=t})),void 0!==this.$popupParams.product.$original().selectedUnitQuantity?this.selectUnit(this.$popupParams.product.$original().selectedUnitQuantity):void 0!==this.$popupParams.product.$original().unit_quantities&&1===this.$popupParams.product.$original().unit_quantities.length?this.selectUnit(this.$popupParams.product.$original().unit_quantities[0]):(this.loadsUnits=!0,this.loadUnits())},methods:{__:l.__,displayRightPrice:function(e){return POS.getSalePrice(e,this.$popupParams.product.$original())},loadUnits:function(){var e=this;a.ih.get("/api/nexopos/v4/products/".concat(this.$popupParams.product.$original().id,"/units/quantities")).subscribe((function(t){if(0===t.length)return e.$popup.close(),a.kX.error((0,l.__)("This product doesn't have any unit defined for selling.")).subscribe();e.unitsQuantities=t,1===e.unitsQuantities.length&&e.selectUnit(e.unitsQuantities[0])}))},selectUnit:function(e){if(null===e.unit)return a.kX.error((0,l.__)('The unit attached to this product is missing or not assigned. Please review the "Unit" tab for this product.')).subscribe(),this.$popup.close();this.$popupParams.resolve({unit_quantity_id:e.id,unit_name:e.unit.name,$quantities:function(){return e}}),this.$popup.close()}}};const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-full w-full flex items-center justify-center",attrs:{id:"ns-units-selector"}},[e.unitsQuantities.length>0?s("div",{staticClass:"ns-box w-2/3-screen lg:w-1/3-screen overflow-hidden flex flex-col"},[s("div",{staticClass:"h-16 flex justify-center items-center flex-shrink-0",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold text-primary"},[e._v(e._s(e.__("Choose Selling Unit")))])]),e._v(" "),e.unitsQuantities.length>0?s("div",{staticClass:"grid grid-flow-row grid-cols-2 overflow-y-auto"},e._l(e.unitsQuantities,(function(t){return s("div",{key:t.id,staticClass:"ns-numpad-key info cursor-pointer border flex-shrink-0 flex flex-col items-center justify-center",on:{click:function(s){return e.selectUnit(t)}}},[s("div",{staticClass:"h-40 w-full flex items-center justify-center overflow-hidden"},[t.preview_url?s("img",{staticClass:"object-cover h-full",attrs:{src:t.preview_url,alt:t.unit.name}}):e._e(),e._v(" "),t.preview_url?e._e():s("div",{staticClass:"h-40 flex items-center justify-center"},[s("i",{staticClass:"las la-image text-primary text-6xl"})])]),e._v(" "),s("div",{staticClass:"h-0 w-full"},[s("div",{staticClass:"relative w-full flex items-center justify-center -top-10 h-20 py-2 flex-col overlay"},[s("h3",{staticClass:"font-bold text-primary py-2 text-center"},[e._v(e._s(t.unit.name)+" ("+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-sm font-medium text-primary"},[e._v(e._s(e._f("currency")(e.displayRightPrice(t))))])])])])})),0):e._e()]):e._e(),e._v(" "),0===e.unitsQuantities.length?s("div",{staticClass:"h-56 flex items-center justify-center"},[s("ns-spinner")],1):e._e()])}),[],!1,null,null,null).exports;function d(e,t){for(var s=0;s=544&&window.innerWidth<768?this.screenIs="sm":window.innerWidth>=768&&window.innerWidth<992?this.screenIs="md":window.innerWidth>=992&&window.innerWidth<1200?this.screenIs="lg":window.innerWidth>=1200&&(this.screenIs="xl")}},{key:"is",value:function(e){return void 0===e?this.screenIs:this.screenIs===e}}])&&h(t.prototype,s),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),_=s(9020),b=s(381),y=s.n(b),g=s(282),x=s(7995);function w(e,t){for(var s=0;s0)return(0,l.__)("Some products has been added to the cart. Would youl ike to discard this order ?")},a.kq.addAction("ns-after-cart-changed","listen-add-to-cart",(function(){return e.refreshCart()})),this.types.subscribe((function(t){var s=Object.values(t).filter((function(e){return e.selected}));if(s.length>0){var n=e.order.getValue();n.type=s[0],e.order.next(n)}})),window.addEventListener("resize",(function(){e._responsive.detect(),e.defineCurrentScreen()})),window.onbeforeunload=function(){if(e.products.getValue().length>0)return(0,l.__)("Some products has been added to the cart. Would youl ike to discard this order ?")}}},{key:"getSalePrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.sale_price_with_tax):(0,_.f)(e.sale_price_without_tax)}},{key:"getCustomPrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.custom_price_with_tax):(0,_.f)(e.custom_price_without_tax)}},{key:"getWholesalePrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.wholesale_price_with_tax):(0,_.f)(e.wholesale_price_without_tax)}},{key:"setHoldPopupEnabled",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._holdPopupEnabled=e}},{key:"getHoldPopupEnabled",value:function(){return this._holdPopupEnabled}},{key:"processInitialQueue",value:function(){return C(this,void 0,void 0,r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=r().keys(this._initialQueue);case 1:if((e.t1=e.t0()).done){e.next=14;break}return t=e.t1.value,e.prev=3,e.next=6,this._initialQueue[t]();case 6:e.sent,e.next=12;break;case 9:e.prev=9,e.t2=e.catch(3),a.kX.error(e.t2.message).subscribe();case 12:e.next=1;break;case 14:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"removeCoupon",value:function(e){var t=this.order.getValue(),s=t.coupons,n=s.indexOf(e);s.splice(n,1),t.coupons=s,this.order.next(t)}},{key:"pushCoupon",value:function(e){var t=this.order.getValue();t.coupons.forEach((function(t){if(t.code===e.code){var s=(0,l.__)("This coupon is already added to the cart");throw a.kX.error(s).subscribe(),s}})),t.coupons.push(e),this.order.next(t),this.refreshCart()}},{key:"header",get:function(){var e={buttons:{nsPosDashboardButton:k,nsPosPendingOrderButton:P,nsPosOrderTypeButton:j,nsPosCustomersButton:O,nsPosResetButton:S}};return"yes"===this.options.getValue().ns_pos_registers_enabled&&(e.buttons.nsPosCashRegister=$),a.kq.doAction("ns-pos-header",e),e}},{key:"defineOptions",value:function(e){this._options.next(e)}},{key:"defineCurrentScreen",value:function(){this._visibleSection.next(["xs","sm"].includes(this._responsive.is())?"grid":"both"),this._screen.next(this._responsive.is())}},{key:"changeVisibleSection",value:function(e){["both","cart","grid"].includes(e)&&(["cart","both"].includes(e)&&this.refreshCart(),this._visibleSection.next(e))}},{key:"addPayment",value:function(e){if(e.value>0){var t=this._order.getValue();return t.payments.push(e),this._order.next(t),this.computePaid()}return a.kX.error("Invalid amount.").subscribe()}},{key:"removePayment",value:function(e){if(void 0!==e.id)return a.kX.error((0,l.__)("Unable to delete a payment attached to the order.")).subscribe();var t=this._order.getValue(),s=t.payments.indexOf(e);t.payments.splice(s,1),this._order.next(t),a.l.emit({identifier:"ns.pos.remove-payment",value:e}),this.updateCustomerAccount(e),this.computePaid()}},{key:"updateCustomerAccount",value:function(e){if("account-payment"===e.identifier){var t=this.order.getValue().customer;t.account_amount+=e.value,this.selectCustomer(t)}}},{key:"getPriceWithoutTax",value:function(e,t,s){return"inclusive"===s?x.Z.computeInclusive(e,t):"exclusive"===s?e:void 0}},{key:"getPriceWithTax",value:function(e,t,s){return"inclusive"===s?e:"exclusive"===s?x.Z.computeExclusive(e,t):void 0}},{key:"getVatValue",value:function(e,t,s){return"inclusive"===s?e-this.getPriceWithoutTax(e,t,s):"exclusive"===s?this.getPriceWithTax(e,t,s)-e:void 0}},{key:"computeTaxes",value:function(){var e=this;return new Promise((function(t,s){var n=e.order.getValue();if(void 0===(n=e.computeProductsTaxes(n)).tax_group_id||null===n.tax_group_id)return e.computeOrderTaxes(n),t({data:{order:n},status:"success"});var r=n.tax_groups;return Object.values(r).length>0?(void 0!==r[n.tax_group_id]&&(n.taxes=r[n.tax_group_id].taxes.map((function(t){return t.tax_value=e.getVatValue(n.subtotal-n.discount,t.rate,n.tax_type),t}))),n=e.computeOrderTaxes(n),t({status:"success",data:{tax:r[n.tax_group_id],order:n}})):void 0!==n.tax_group_id&&n.tax_group_id.toString().length>0?void a.ih.get("/api/nexopos/v4/taxes/groups/".concat(n.tax_group_id)).subscribe({next:function(s){return n=e.computeOrderTaxGroup(n,s),t({status:"success",data:{tax:s,order:n}})},error:function(e){return s(e)}}):s({status:"failed",message:(0,l.__)("No tax group assigned to the order")})}))}},{key:"computeOrderTaxGroup",value:function(e,t){var s=this;return this.options.getValue().ns_pos_vat,this.options.getValue().ns_pos_price_with_tax,t.taxes=t.taxes.map((function(t){return{tax_id:t.id,tax_name:t.name,rate:parseFloat(t.rate),tax_value:s.getVatValue(e.subtotal-e.discount,t.rate,e.tax_type)}})),0===t.taxes.length?a.kX.error((0,l.__)("The selected tax group doesn't have any assigned sub taxes. This might cause wrong figures."),(0,l.__)("Proceed"),{duration:!1}).subscribe():(e.tax_groups=e.tax_groups||[],e.taxes=t.taxes,e.tax_groups[t.id]=t,this.computeOrderTaxes(e))}},{key:"computeOrderTaxes",value:function(e){var t=this.options.getValue().ns_pos_vat,s="yes"===this.options.getValue().ns_pos_price_with_tax;return["flat_vat","variable_vat","products_variable_vat","products_flat_vat"].includes(t)&&e.taxes&&e.taxes.length>0&&(e.tax_value+=e.taxes.map((function(e){return e.tax_value})).reduce((function(e,t){return e+t}))),e.total_tax_value=e.tax_value,["products_variable_vat","products_flat_vat","products_vat"].includes(t)&&!s&&(e.total_tax_value=e.products_exclusive_tax_value+e.tax_value),e}},{key:"computeProductsTaxes",value:function(e){var t=this.products.getValue(),s=t.filter((function(e){return"inclusive"===e.tax_type})).map((function(e){return e.tax_value})),n=t.filter((function(e){return"exclusive"===e.tax_type})).map((function(e){return e.tax_value}));e.products_exclusive_tax_value=0,e.products_inclusive_tax_value=0;var r=this.options.getValue().ns_pos_vat;return["products_flat_vat","products_variable_vat","products_vat"].includes(r)&&n.length>0&&(e.products_exclusive_tax_value+=n.reduce((function(e,t){return e+t}))),["products_flat_vat","products_variable_vat","products_vat"].includes(r)&&s.length>0&&(e.products_inclusive_tax_value+=s.reduce((function(e,t){return e+t}))),e.products=t,e.total_products=t.length,e}},{key:"canProceedAsLaidAway",value:function(e){var t=this;return new Promise((function(s,n){return C(t,void 0,void 0,r().mark((function t(){var i,a,c,u,d,p,f,h=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.customer.group.minimal_credit_payment,a=(e.total*i/100).toFixed(ns.currency.ns_currency_precision),a=parseFloat(a),t.prev=3,t.next=6,new Promise((function(t,s){o.G.show(V,{order:e,reject:s,resolve:t})}));case 6:if(!(0===(c=t.sent).order.instalments.length&&c.order.tendered=a&&y()(e.date).isSame(ns.date.moment.startOf("day"),"day")}))).length){t.next=17;break}return t.abrupt("return",s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}}));case 17:(f=p[0].amount)>0?o.G.show(E,{title:(0,l.__)("Initial Payment"),message:(0,l.__)('In order to proceed, an initial payment of {amount} is required for the selected payment type "{paymentType}". Would you like to proceed ?').replace("{amount}",v.default.filter("currency")(f)).replace("{paymentType}",d.label),onAction:function(e){if(e){var t={identifier:d.identifier,label:d.label,value:f,readonly:!1,selected:!0};h.addPayment(t),p[0].paid=!0,s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}})}else n({status:"failed",message:(0,l.__)("The request was canceled")})}}):s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}});case 19:t.next=24;break;case 21:return t.prev=21,t.t0=t.catch(3),t.abrupt("return",n(t.t0));case 24:case"end":return t.stop()}}),t,this,[[3,21]])})))}))}},{key:"submitOrder",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((function(s,n){return C(e,void 0,void 0,r().mark((function e(){var i,o,c,u,d,p=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=Object.assign(Object.assign({},this.order.getValue()),t),o=i.customer.group.minimal_credit_payment,"hold"===i.payment_status){e.next=20;break}if(!(0===i.payments.length&&i.total>0&&i.total>i.tendered)){e.next=20;break}if("no"!==this.options.getValue().ns_orders_allow_partial){e.next=9;break}return c=(0,l.__)("Partially paid orders are disabled."),e.abrupt("return",n({status:"failed",message:c}));case 9:if(!(o>=0)){e.next=20;break}return e.prev=10,e.next=13,this.canProceedAsLaidAway(i);case 13:u=e.sent,i=u.data.order,e.next=20;break;case 17:return e.prev=17,e.t0=e.catch(10),e.abrupt("return",n(e.t0));case 20:if(this._isSubmitting){e.next=24;break}return d=void 0!==i.id?"put":"post",this._isSubmitting=!0,e.abrupt("return",a.ih[d]("/api/nexopos/v4/orders".concat(void 0!==i.id?"/"+i.id:""),i).subscribe({next:function(e){s(e),p.reset(),a.kq.doAction("ns-order-submit-successful",e),p._isSubmitting=!1;var t=p.options.getValue().ns_pos_complete_sale_audio;t.length>0&&new Audio(t).play()},error:function(e){p._isSubmitting=!1,n(e),a.kq.doAction("ns-order-submit-failed",e)}}));case 24:return e.abrupt("return",n({status:"failed",message:(0,l.__)("An order is currently being processed.")}));case 25:case"end":return e.stop()}}),e,this,[[10,17]])})))}))}},{key:"defineQuantities",value:function(e){var t=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(n,r){var i={unit:s.filter((function(t){return t.id===e.unit_id}))[0]||{},sale_price_with_tax:"normal"===e.mode?parseFloat(e.price_with_tax):0,sale_price_without_tax:"normal"===e.mode?parseFloat(e.price_without_tax):0,sale_price:"normal"===e.mode?parseFloat(e.unit_price):0,sale_price_tax:"normal"===e.mode?e.tax_value:0,sale_price_edit:0,wholesale_price_with_tax:"wholesale"===e.mode?parseFloat(e.price_with_tax):0,wholesale_price_without_tax:"wholesale"===e.mode?parseFloat(e.price_without_tax):0,wholesale_price:"wholesale"===e.mode?parseFloat(e.unit_price):0,wholesale_price_tax:"wholesale"===e.mode?e.tax_value:0,wholesale_price_edit:0,custom_price_with_tax:"custom"===e.mode?parseFloat(e.price_with_tax):0,custom_price_without_tax:"custom"===e.mode?parseFloat(e.price_without_tax):0,custom_price:"custom"===e.mode?parseFloat(e.unit_price):0,custom_price_tax:"custom"===e.mode?e.tax_value:0,custom_price_edit:"custom"===e.mode?parseFloat(e.unit_price):0};if(["inclusive","exclusive"].includes(e.tax_type))try{if(!e.tax_group_id)return i.sale_price_tax=0,i.wholesale_price_tax=0,i.sale_price_without_tax=e.unit_price,n(i);a.ih.get("/api/nexopos/v4/taxes/groups/".concat(e.tax_group_id)).subscribe({next:function(s){return["sale","wholesale","custom"].forEach((function(n){i[n+"_price_tax"]=s.taxes.map((function(s){return t.getVatValue(i[n+"_price"],s.rate,e.tax_type)})).reduce((function(e,t){return e+t})),i["gross_"+n+"_price"]=i[n+"_price"]+i[n+"_price_tax"],i["net_"+n+"_price"]=i[n+"_price"]-i[n+"_price_tax"]})),n(i)},error:function(e){r(!1)}})}catch(e){return a.kX.error((0,l.__)("An error has occurred while computing the product.")).subscribe()}return n(i)}))}},{key:"loadOrder",value:function(e){var t=this;return new Promise((function(s,n){a.ih.get("/api/nexopos/v4/orders/".concat(e,"/pos")).subscribe({next:function(e){return C(t,void 0,void 0,r().mark((function t(){var i,o,l,c,u=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,a.kq.doAction("ns-before-load-order",{order:e}),t.next=7;break;case 4:return t.prev=4,t.t0=t.catch(0),t.abrupt("return",n(t.t0));case 7:i=this.options.getValue(),e=Object.assign(Object.assign({},this.defaultOrder()),e),o=[],l=r().mark((function t(s){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(n=e.products[s]).product){t.next=9;break}return t.t0=n.name,t.t1=n.unit_id,t.next=6,u.defineQuantities(n);case 6:t.t2=t.sent,t.t3=[t.t2],n.product={mode:"custom",name:t.t0,unit_id:t.t1,unit_quantities:t.t3};case 9:n.$original=function(){return n.product},n.$quantities=function(){var e=n.product.unit_quantities.filter((function(e){return+e.id==+n.unit_quantity_id||void 0===e.id}))[0];return"custom"===n.mode&&"yes"===i.ns_pos_price_with_tax&&(e.custom_price_edit=n.unit_price),e},o.push(n);case 12:case"end":return t.stop()}}),t)})),c=0;case 12:if(!(c0&&(e.tendered=e.payments.map((function(e){return e.value})).reduce((function(e,t){return t+e}))),e.tendered>=e.total?e.payment_status="paid":e.tendered>0&&e.tendered0&&(t.products.filter((function(t){return e.products.map((function(e){return e.product_id})).includes(t.product_id)})).length>0||-1!==s.indexOf(e)||s.push(e)),e.categories.length>0&&(t.products.filter((function(t){return e.categories.map((function(e){return e.category_id})).includes(t.$original().category_id)})).length>0||-1!==s.indexOf(e)||s.push(e))})),s.forEach((function(t){a.kX.error((0,l.__)('The coupons "%s" has been removed from the cart, as it\'s required conditions are no more meet.').replace("%s",t.name),(0,l.__)("Okay"),{duration:6e3}).subscribe(),e.removeCoupon(t)}))}},{key:"refreshCart",value:function(){return C(this,void 0,void 0,r().mark((function e(){var t,s,n,i,o,c,u,d,p,f,v,h,m;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.checkCart(),t=this.products.getValue(),s=this.order.getValue(),n=this.options.getValue().ns_pos_price_with_tax,(i=t.filter((function(e){return"dynamic"!==e.product_type})).map((function(e){return"yes"===n?e.total_price_with_tax:e.total_price_without_tax}))).length>0?(o=i.reduce((function(e,t){return e+t})),c=0,(u=t.filter((function(e){return"dynamic"===e.product_type})).map((function(e){return e.unit_price=o*e.rate/100,e.total_price=e.unit_price*e.quantity,e.total_price}))).length>0&&(c=u.reduce((function(e,t){return e+t}))),s.subtotal=o+c):s.subtotal=0,d=s.coupons.map((function(e){return"percentage_discount"===e.type?(e.value=s.subtotal*e.discount_value/100,e.value):(e.value=e.discount_value,e.value)})),s.total_coupons=0,d.length>0&&(s.total_coupons=d.reduce((function(e,t){return e+t}))),"percentage"===s.discount_type&&(s.discount=s.discount_percentage*s.subtotal/100),s.discount>s.subtotal&&0===s.total_coupons&&(s.discount=s.subtotal,a.kX.info((0,l.__)("The discount has been set to the cart subtotal.")).subscribe()),s.tax_value=0,s.total_tax_value=0,this.order.next(s),e.prev=14,e.next=17,this.computeTaxes();case 17:p=e.sent,s=p.data.order,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(14),!1!==e.t0&&void 0!==e.t0.message&&a.kX.error(e.t0.message||(0,l.__)("An unexpected error has occurred while fecthing taxes."),(0,l.__)("OKAY"),{duration:0}).subscribe();case 24:(f=t.map((function(e){return"inclusive"===e.tax_type?e.tax_value:0}))).length>0&&f.reduce((function(e,t){return e+t})),v=s.tax_type,h=this.options.getValue().ns_pos_vat,m=0,["flat_vat","variable_vat","products_vat","products_flat_vat","products_variable_vat"].includes(h)&&(m=s.total_tax_value),s.total="exclusive"===v?+(s.subtotal+(s.shipping||0)+m-s.discount-s.total_coupons).toFixed(ns.currency.ns_currency_precision):+(s.subtotal+(s.shipping||0)-s.discount-s.total_coupons).toFixed(ns.currency.ns_currency_precision),this.order.next(s),a.kq.doAction("ns-cart-after-refreshed",s);case 34:case"end":return e.stop()}}),e,this,[[14,21]])})))}},{key:"getStockUsage",value:function(e,t){var s=this._products.getValue().filter((function(s){return s.product_id===e&&s.unit_quantity_id===t})).map((function(e){return e.quantity}));return s.length>0?s.reduce((function(e,t){return e+t})):0}},{key:"addToCart",value:function(e){return C(this,void 0,void 0,r().mark((function t(){var s,n,i,o,l,c,u,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=new Object,n={product_id:e.id||0,name:e.name,discount_type:"percentage",discount:0,discount_percentage:0,product_type:e.product_type||"product",rate:e.rate||0,quantity:e.quantity||0,tax_group_id:e.tax_group_id,tax_type:e.tax_type||void 0,tax_value:0,unit_id:e.unit_id||0,unit_price:e.unit_price||0,price_with_tax:e.price_with_tax||0,price_without_tax:e.price_without_tax||0,unit_name:e.unit_name||"",total_price:0,total_price_without_tax:0,total_price_with_tax:0,mode:e.mode||"normal",$original:e.$original||function(){return e},$quantities:e.$quantities||void 0},this._processingAddQueue=!0,0===n.product_id){t.next=22;break}t.t0=r().keys(this.addToCartQueue);case 5:if((t.t1=t.t0()).done){t.next=22;break}return i=t.t1.value,t.prev=7,o=new this.addToCartQueue[i](n),t.next=11,o.run(s);case 11:l=t.sent,s=Object.assign(Object.assign({},s),l),t.next=20;break;case 15:if(t.prev=15,t.t2=t.catch(7),!1!==t.t2){t.next=20;break}return this._processingAddQueue=!1,t.abrupt("return",!1);case 20:t.next=5;break;case 22:this._processingAddQueue=!1,n=Object.assign(Object.assign({},n),s),c=this._products.getValue(),this.settings.getValue().ns_pos_items_merge?(u=c.filter((function(e){return e.product_id===n.product_id&&e.tax_group_id===n.tax_group_id&&e.unit_id===n.unit_id&&e.unit_quantity_id===n.unit_quantity_id})),u.length>0?u[0].quantity+=n.quantity:c.unshift(n)):c.unshift(n),this.recomputeProducts(c),this.products.next(c),(d=this.options.getValue().ns_pos_new_item_audio).length>0&&new Audio(d).play(),a.kq.doAction("ns-after-cart-changed");case 31:case"end":return t.stop()}}),t,this,[[7,15]])})))}},{key:"defineTypes",value:function(e){this._types.next(e)}},{key:"removeProduct",value:function(e){var t=this._products.getValue(),s=t.indexOf(e);t.splice(s,1),this.products.next(t),a.kq.doAction("ns-after-cart-changed")}},{key:"updateProduct",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=this._products.getValue();s=null===s?n.indexOf(e):s,v.default.set(n,s,Object.assign(Object.assign({},e),t)),this.recomputeProducts(n),this.products.next(n),a.kq.doAction("ns-after-cart-changed")}},{key:"recomputeProducts",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t.forEach((function(t){e.computeProduct(t)}))}},{key:"getProductUnitPrice",value:function(e,t){switch(e){case"custom":return t.custom_price_edit;case"normal":return t.sale_price_edit;case"wholesale":return t.wholesale_price_edit}}},{key:"computeProductTax",value:function(e){switch(e.mode){case"custom":return this.computeCustomProductTax(e);case"normal":return this.computeNormalProductTax(e);case"wholesale":return this.computeWholesaleProductTax(e);default:return e}}},{key:"proceedProductTaxComputation",value:function(e,t){var s=this,n=e.$original(),r=n.tax_group,i=this.getProductUnitPrice(e.mode,e.$quantities()),o=0,a=this.getProductUnitPrice(e.mode,e.$quantities());if(null!=r&&void 0!==r.taxes){var l=0;switch(r.taxes.length>0&&(l=r.taxes.map((function(e){return e.rate})).reduce((function(e,t){return e+t}))),n.tax_type){case"inclusive":i=this.getPriceWithoutTax(t,l,n.tax_type),a=t;break;case"exclusive":i=t,a=this.getPriceWithTax(t,l,n.tax_type)}var c=r.taxes.map((function(e){return s.getVatValue(t,e.rate,n.tax_type)}));c.length>0&&(o=c.reduce((function(e,t){return e+t})))}return{price_without_tax:i,tax_value:o,price_with_tax:a}}},{key:"computeCustomProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.custom_price_edit);return t.custom_price_without_tax=s.price_without_tax,t.custom_price_with_tax=s.price_with_tax,t.custom_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"computeNormalProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.sale_price_edit);return t.sale_price_without_tax=s.price_without_tax,t.sale_price_with_tax=s.price_with_tax,t.sale_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"computeWholesaleProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.wholesale_price_edit);return t.wholesale_price_without_tax=s.price_without_tax,t.wholesale_price_with_tax=s.price_with_tax,t.wholesale_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"getPrice",value:function(e,t,s){switch(t){case"normal":return e["sale_price_"+s];case"wholesale":return e["wholesale_price_"+s];case"custom":return e["custom_price_"+s]}}},{key:"computeProduct",value:function(e){"product"===e.product_type&&("normal"===e.mode?(e.unit_price=this.getSalePrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().sale_price_tax*e.quantity):"wholesale"===e.mode&&(e.unit_price=this.getWholesalePrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().wholesale_price_tax*e.quantity),"custom"===e.mode&&(e.unit_price=this.getCustomPrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().custom_price_tax*e.quantity));var t=0,s=0,n=this.getPrice(e.$quantities(),e.mode,"with_tax"),r=this.getPrice(e.$quantities(),e.mode,"without_tax");["flat","percentage"].includes(e.discount_type)&&("percentage"===e.discount_type?(e.discount=e.unit_price*e.discount_percentage/100*e.quantity,t=r*e.discount_percentage/100*e.quantity,s=n*e.discount_percentage/100*e.quantity):(t=e.discount,s=e.discount)),e.price_with_tax=n,e.price_without_tax=r,e.total_price=e.unit_price*e.quantity-e.discount,e.total_price_with_tax=n*e.quantity-s,e.total_price_without_tax=r*e.quantity-t,a.kq.doAction("ns-after-product-computed",e)}},{key:"loadCustomer",value:function(e){return a.ih.get("/api/nexopos/v4/customers/".concat(e))}},{key:"defineSettings",value:function(e){this._settings.next(e)}},{key:"voidOrder",value:function(e){var t=this;void 0!==e.id?["hold"].includes(e.payment_status)?o.G.show(E,{title:(0,l.__)("Order Deletion"),message:(0,l.__)("The current order will be deleted as no payment has been made so far."),onAction:function(s){s&&a.ih.delete("/api/nexopos/v4/orders/".concat(e.id)).subscribe({next:function(e){a.kX.success(e.message).subscribe(),t.reset()},error:function(e){return a.kX.error(e.message).subscribe()}})}}):o.G.show(D,{title:(0,l.__)("Void The Order"),message:(0,l.__)("The current order will be void. This will cancel the transaction, but the order won't be deleted. Further details about the operation will be tracked on the report. Consider providing the reason of this operation."),onAction:function(s){!1!==s&&a.ih.post("/api/nexopos/v4/orders/".concat(e.id,"/void"),{reason:s}).subscribe({next:function(e){a.kX.success(e.message).subscribe(),t.reset()},error:function(e){return a.kX.error(e.message).subscribe()}})}}):a.kX.error((0,l.__)("Unable to void an unpaid order.")).subscribe()}},{key:"triggerOrderTypeSelection",value:function(e){return C(this,void 0,void 0,r().mark((function t(){var s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s=0;case 1:if(!(s{var n={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":1793,"./ru.js":1793,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function r(e){var t=i(e);return s(t)}function i(e){if(!s.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=i,e.exports=r,r.id=6700},328:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(538),r=s(381),i=s.n(r),o=s(7144),a=s.n(o),l=(s(9095),s(3632));const c=n.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:a()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:i()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:i()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?i()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?s("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[s("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),s("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[s("i",{staticClass:"las la-times"})]),e._v(" "),s("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[s("div",{staticClass:"flex justify-between items-center w-full py-2"},[s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},5318:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(381),r=s.n(n);const i={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:r(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return r()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?r()():r()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?r()():r()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:s(3632).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(r().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker mb-2"},[e.field?s("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),s("div",{staticClass:"ns-button"},[s("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?s("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?s("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?s("span",{staticClass:"mx-1 text-sm"},[null!==e.date?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?s("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?s("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?s("div",{staticClass:"relative z-10 h-0 w-0"},[s("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[s("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[s("i",{staticClass:"las la-minus"})]),e._v(" "),s("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[s("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,n){return s("div",{key:n,staticClass:"h-8 flex justify-center items-center text-sm"},[[s("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thu")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(n,r){return s("div",{key:r,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,r){return[t.dayOfWeek===n?s("div",{key:r,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),s("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[s("div",{staticClass:"-mx-1 flex justify-between"},[s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-1 flex"},[e.field?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[s("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[s("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),s("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},9045:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(381),r=s.n(n);const i={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?r()():r()(this.date),this.build()},methods:{__:s(3632).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(r().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker"},[s("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),s("span",{staticClass:"mx-1 text-sm"},[s("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?s("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?s("div",{staticClass:"relative h-0 w-0 -mb-2"},[s("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thu")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(n,r){return s("div",{key:r,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,r){return[t.dayOfWeek===n?s("div",{key:r,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),s("div")])]):e._e()])}),[],!1,null,null,null).exports},2404:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[s("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),s("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},8909:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var n=s(3632);const r={name:"ns-numpad-plus",props:["value","currency","limit"],data:function(){return{screenValue:0,order:null,cursor:parseInt(ns.currency.ns_currency_precision),orderSubscription:null,allSelected:!0,keyRows:[[7,8,9].map((function(e){return{identifier:e,value:e}})),[4,5,6].map((function(e){return{identifier:e,value:e}})),[1,2,3].map((function(e){return{identifier:e,value:e}})),[{identifier:".",value:"."},{identifier:0,value:0},{identifier:"backspace",icon:"la-backspace"}],[{identifier:"next",value:(0,n.__)("Enter")}]]}},mounted:function(){var e=this;this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-dot").whenVisible([".is-popup"]).whenPressed(".",(function(){return e.inputValue({identifier:"."})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save"),nsHotPress.destroy("numpad-dot")},methods:{increaseBy:function(e){this.screenValue=(parseFloat(e.value)+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if("."===e.identifier)this.allSelected?(this.screenValue="0.",this.allSelected=!1):null===this.screenValue.toString().match(/^[0-9][1-9]*\.[0-9]*$/)&&(this.screenValue=this.screenValue+=".");else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}this.$emit("changed",this.screenValue)}else this.$emit("next",this.screenValue)}}};const i=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"numpad-holder"}},e._l(e.keyRows,(function(t,n){return s("div",{key:n},[s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 text-lg",attrs:{id:"numpad"}},[e._l(t,(function(n,r){return s("div",{key:r,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",class:1===t.length?"col-span-3":"",on:{click:function(t){return e.inputValue(n)}}},[void 0!==n.value?s("span",[e._v(e._s(n.value))]):e._e(),e._v(" "),n.icon?s("i",{staticClass:"las",class:n.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)])})),0)}),[],!1,null,null,null).exports},7751:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(3632);function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var s=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",s)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,n){return s("div",{key:n,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(s){return e.inputValue(t)}}},[void 0!==t.value?s("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?s("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3502:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},3164:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"mb-2 ns-switch"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,n){return s("button",{key:n,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(s){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},9542:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var n=s(4687),r=s.n(n),i=s(7700),o=s(665),a=s(3632),l=s(914);function c(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const u={name:"ns-media",props:["popup"],components:{VueUpload:s(2948)},data:function(){return{pages:[{label:(0,a.__)("Upload"),name:"upload",selected:!1},{label:(0,a.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return i.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:o.Z,__:a.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,a.__)("Confirm Your Action"),message:(0,a.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&i.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){i.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){i.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=r().mark((function e(){var s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),n=r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s[t],e.prev=1,n.progress=1,e.next=5,new Promise((function(e,t){var s=new FormData;s.append("file",n.file),i.ih.post("/api/nexopos/v4/medias",s,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){n.uploaded=!0,n.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),n.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),o=0;case 3:if(!(o0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,i.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(s,n){n!==t.response.data.indexOf(e)&&(s.selected=!1)})),e.selected=!e.selected}}};const d=(0,s(1900).Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[s("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[s("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),s("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,n){return s("li",{key:n,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?s("div",{staticClass:"content w-full overflow-hidden flex"},[s("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[s("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),s("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),s("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[s("ul",e._l(e.files,(function(t,n){return s("li",{key:n,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[s("span",[e._v(e._s(t.file.name))]),e._v(" "),s("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?s("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?s("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[s("div"),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),s("div",{staticClass:"flex flex-auto overflow-hidden"},[s("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"p-2 overflow-x-auto"},[s("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,n){return s("div",{key:n},[s("div",{staticClass:"p-2"},[s("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(s){return e.selectResource(t)}}},[s("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?s("div",{staticClass:"flex flex-auto items-center justify-center"},[s("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),s("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0",attrs:{id:"preview"}},[s("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?s("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?s("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),s("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),s("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),s("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[s("div",{staticClass:"flex -mx-2 flex-shrink-0"},[s("div",{staticClass:"px-2 flex-shrink-0 flex"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[s("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[s("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?s("div",{staticClass:"ns-button error"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[s("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),s("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[s("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),s("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),s("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},4351:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(6979),r=s(820);const i={name:"ns-pos-customers-button",methods:{__:s(3632).__,openCustomerPopup:function(){(new n.G).open(r.Z)}},beforeDestroy:function(){nsHotPress.destroy("ns_pos_keyboard_create_customer")},mounted:function(){var e=this;for(var t in nsShortcuts)["ns_pos_keyboard_create_customer"].includes(t)&&nsHotPress.create("ns_pos_keyboard_create_customer").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[t],(function(t){t.preventDefault(),e.openCustomerPopup()}))}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openCustomerPopup()}}},[s("i",{staticClass:"mr-1 text-xl lar la-user-circle"}),e._v(" "),s("span",[e._v(e._s(e.__("Customers")))])])])}),[],!1,null,null,null).exports},6442:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-pos-dashboard-button",methods:{__:s(3632).__,goToDashboard:function(){return document.location=POS.settings.getValue().urls.dashboard_url}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button success"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.goToDashboard()}}},[s("i",{staticClass:"mr-1 text-xl las la-tachometer-alt"}),e._v(" "),s("span",[e._v(e._s(e.__("Dashboard")))])])])}),[],!1,null,null,null).exports},5897:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(6979),r=s(4523);const i={name:"ns-pos-delivery-button",methods:{__:s(3632).__,openOrderTypeSelection:function(){new n.G({primarySelector:"#pos-app",popupClass:"shadow-lg bg-white w-3/5 md:w-2/3 lg:w-2/5 xl:w-2/4"}).open(r.Z)}},beforeDestroy:function(){nsHotPress.destroy("ns_pos_keyboard_order_type")},mounted:function(){var e=this;for(var t in nsShortcuts)["ns_pos_keyboard_order_type"].includes(t)&&nsHotPress.create("ns_pos_keyboard_order_type").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[t],(function(t){t.preventDefault(),e.openOrderTypeSelection()}))}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openOrderTypeSelection()}}},[s("i",{staticClass:"mr-1 text-xl las la-truck"}),e._v(" "),s("span",[e._v(e._s(e.__("Order Type")))])])])}),[],!1,null,null,null).exports},2751:(e,t,s)=>{"use strict";s.d(t,{Z:()=>_});var n=s(6979),r=s(7700),i=s(914),o=s(3632);const a={data:function(){return{products:[],isLoading:!1}},computed:{order:function(){return this.$popupParams.order}},mounted:function(){this.loadProducts()},methods:{__:o.__,close:function(){this.$popupParams.reject(!1),this.$popup.close()},loadProducts:function(){var e=this;this.isLoading=!0;var t=this.$popupParams.order.id;r.ih.get("/api/nexopos/v4/orders/".concat(t,"/products")).subscribe((function(t){e.isLoading=!1,e.products=t}))},openOrder:function(){this.$popup.close(),this.$popupParams.resolve(this.order)}}};var l=s(1900);const c=(0,l.Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between text-primary items-center border-b ns-box-header"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Products"))+" — "+e._s(e.order.code)+" "),e.order.title?s("span",[e._v("("+e._s(e.order.title)+")")]):e._e()]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex-auto p-2 overflow-y-auto ns-box-body"},[e.isLoading?s("div",{staticClass:"flex-auto relative"},[s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)]):e._e(),e._v(" "),e.isLoading?e._e():e._l(e.products,(function(t){return s("div",{key:t.id,staticClass:"item"},[s("div",{staticClass:"flex-col border-b border-info-primary py-2"},[s("div",{staticClass:"title font-semibold text-primary flex justify-between"},[s("span",[e._v(e._s(t.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(t.total_price)))])]),e._v(" "),s("div",{staticClass:"text-sm text-primary"},[s("ul",[s("li",[e._v(e._s(e.__("Unit"))+" : "+e._s(t.unit.name))])])])])])}))],2),e._v(" "),s("div",{staticClass:"flex justify-end p-2 border-t ns-box-footer"},[s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-2 flex"},[s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.openOrder()}}},[e._v(e._s(e.__("Open")))])],1),e._v(" "),s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.close()}}},[e._v(e._s(e.__("Close")))])],1)])])])])}),[],!1,null,null,null).exports;const u={props:["orders"],data:function(){return{searchField:"",columns:{rightColumn:[],leftColumn:[]}}},watch:{orders:function(){r.kq.doAction("ns-pos-pending-orders-refreshed",this.orders)}},mounted:function(){this.columns.leftColumn=r.kq.applyFilters("ns-pending-orders-left-column",[{label:(0,o.__)("Code"),value:function(e){return e.code}},{label:(0,o.__)("Cashier"),value:function(e){return e.nexopos_users_username}},{label:(0,o.__)("Total"),value:function(e){return e.total}},{label:(0,o.__)("Tendered"),value:function(e){return e.tendered}}]),this.columns.rightColumn=r.kq.applyFilters("ns-pending-orders-right-column",[{label:(0,o.__)("Customer"),value:function(e){return e.nexopos_customers_name}},{label:(0,o.__)("Date"),value:function(e){return e.created_at}},{label:(0,o.__)("Type"),value:function(e){return e.type}}])},name:"ns-pos-pending-order",methods:{__:o.__,previewOrder:function(e){this.$emit("previewOrder",e)},proceedOpenOrder:function(e){this.$emit("proceedOpenOrder",e)},searchOrder:function(){this.$emit("searchOrder",this.searchField)},printOrder:function(e){this.$emit("printOrder",e)}}};const d=(0,l.Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-auto flex-col overflow-hidden"},[s("div",{staticClass:"p-1"},[s("div",{staticClass:"flex rounded border-2 input-group info"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchField,expression:"searchField"}],staticClass:"p-2 outline-none flex-auto",attrs:{type:"text"},domProps:{value:e.searchField},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.searchOrder()},input:function(t){t.target.composing||(e.searchField=t.target.value)}}}),e._v(" "),s("button",{staticClass:"w-16 md:w-24",on:{click:function(t){return e.searchOrder()}}},[s("i",{staticClass:"las la-search"}),e._v(" "),s("span",{staticClass:"mr-1 hidden md:visible"},[e._v(e._s(e.__("Search")))])])])]),e._v(" "),s("div",{staticClass:"overflow-y-auto flex flex-auto"},[s("div",{staticClass:"flex p-2 flex-auto flex-col overflow-y-auto"},[e._l(e.orders,(function(t){return s("div",{key:t.id,staticClass:"border-b ns-box-body w-full py-2",attrs:{"data-order-id":t.id}},[s("h3",{staticClass:"text-primary"},[e._v(e._s(t.title||"Untitled Order"))]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"flex flex-wrap -mx-4"},[s("div",{staticClass:"w-full md:w-1/2 px-2"},e._l(e.columns.leftColumn,(function(n,r){return s("p",{key:r,staticClass:"text-sm text-primary"},[s("strong",[e._v(e._s(n.label))]),e._v(" : "+e._s(n.value(t)))])})),0),e._v(" "),s("div",{staticClass:"w-full md:w-1/2 px-2"},e._l(e.columns.rightColumn,(function(n,r){return s("p",{key:r,staticClass:"text-sm text-primary"},[s("strong",[e._v(e._s(n.label))]),e._v(" : "+e._s(n.value(t)))])})),0)])]),e._v(" "),s("div",{staticClass:"flex justify-end w-full mt-2"},[s("div",{staticClass:"flex rounded-lg overflow-hidden ns-buttons"},[s("button",{staticClass:"info outline-none px-2 py-1",on:{click:function(s){return e.proceedOpenOrder(t)}}},[s("i",{staticClass:"las la-lock-open"}),e._v(" "+e._s(e.__("Open")))]),e._v(" "),s("button",{staticClass:"success outline-none px-2 py-1",on:{click:function(s){return e.previewOrder(t)}}},[s("i",{staticClass:"las la-eye"}),e._v(" "+e._s(e.__("Products")))]),e._v(" "),s("button",{staticClass:"warning outline-none px-2 py-1",on:{click:function(s){return e.printOrder(t)}}},[s("i",{staticClass:"las la-print"}),e._v(" "+e._s(e.__("Print")))])])])])})),e._v(" "),0===e.orders.length?s("div",{staticClass:"h-full v-full items-center justify-center flex"},[s("h3",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Nothing to display...")))])]):e._e()],2)])])}),[],!1,null,null,null).exports;var p=s(2830),f=s(665);const v={components:{nsPosPendingOrders:d},methods:{__:o.__,popupResolver:p.Z,popupCloser:f.Z,searchOrder:function(e){var t=this;r.ih.get("/api/nexopos/v4/crud/".concat(this.active,"?search=").concat(e)).subscribe((function(e){t.orders=e.data}))},setActiveTab:function(e){this.active=e,this.loadOrderFromType(e)},openOrder:function(e){POS.loadOrder(e.id),this.$popup.close()},loadOrderFromType:function(e){var t=this;r.ih.get("/api/nexopos/v4/crud/".concat(e)).subscribe((function(e){t.orders=e.data}))},previewOrder:function(e){var t=this;new Promise((function(t,s){Popup.show(c,{order:e,resolve:t,reject:s})})).then((function(s){t.proceedOpenOrder(e)}),(function(e){return e}))},printOrder:function(e){POS.print.process(e.id,"sale")},proceedOpenOrder:function(e){var t=this;if(POS.products.getValue().length>0)return Popup.show(i.default,{title:"Confirm Your Action",message:"The cart is not empty. Opening an order will clear your cart would you proceed ?",onAction:function(s){s&&t.openOrder(e)}});this.openOrder(e)}},data:function(){return{active:"ns.hold-orders",searchField:"",orders:[]}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.$popup.close()})),this.loadOrderFromType(this.active),this.popupCloser()}};const h=(0,l.Z)(v,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between text-primary items-center ns-box-header border-b"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Orders")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.$popup.close()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 flex overflow-hidden flex-auto ns-box-body"},[s("ns-tabs",{attrs:{active:e.active},on:{changeTab:function(t){return e.setActiveTab(t)}}},[s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.hold-orders",label:e.__("On Hold"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.unpaid-orders",label:e.__("Unpaid"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.partially-paid-orders",label:e.__("Partially Paid"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1)],1)],1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"}},[e._v(e._s(e.__("Close")))])],1)])])}),[],!1,null,null,null).exports,m={name:"ns-pos-pending-orders-button",methods:{__:o.__,openPendingOrdersPopup:function(){(new n.G).open(h)}}};const _=(0,l.Z)(m,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openPendingOrdersPopup()}}},[s("i",{staticClass:"mr-1 text-xl lar la-hand-pointer"}),e._v(" "),s("span",[e._v(e._s(e.__("Orders")))])])])}),[],!1,null,null,null).exports},1689:(e,t,s)=>{"use strict";s.d(t,{Z:()=>T});var n=s(4687),r=s.n(n),i=s(7700),o=s(7751),a=s(4679),l=s(665),c=s(914),u=s(3632);const d={components:{nsNumpad:o.Z},data:function(){return{amount:0,title:null,identifier:null,settingsSubscription:null,settings:null,action:null,register:null,loaded:!1,register_id:null,validation:new a.Z,fields:[]}},mounted:function(){var e=this;this.title=this.$popupParams.title,this.identifier=this.$popupParams.identifier,this.register=this.$popupParams.register,this.action=this.$popupParams.action,this.register_id=this.$popupParams.register_id,this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t})),this.loadFields()},destroyed:function(){this.settingsSubscription.unsubscribe()},methods:{popupCloser:l.Z,__:u.__,definedValue:function(e){this.amount=e},close:function(){this.$popup.close()},loadFields:function(){var e=this;this.loaded=!1,nsHttpClient.get("/api/nexopos/v4/fields/".concat(this.identifier)).subscribe((function(t){e.loaded=!0,e.fields=t}),(function(t){return e.loaded=!0,nsSnackBar.error(t.message,"OKAY",{duration:!1}).subscribe()}))},submit:function(e){var t=this;Popup.show(c.default,{title:"Confirm Your Action",message:this.$popupParams.confirmMessage||"Would you like to confirm your action.",onAction:function(e){e&&t.triggerSubmit()}})},triggerSubmit:function(){var e=this,t=this.validation.extractFields(this.fields);t.amount=""===this.amount?0:this.amount,nsHttpClient.post("/api/nexopos/v4/cash-registers/".concat(this.action,"/").concat(this.register_id||this.settings.register.id),t).subscribe({next:function(t){e.$popupParams.resolve(t),e.$popup.close(),nsSnackBar.success(t.message).subscribe()},error:function(e){nsSnackBar.error(e.message).subscribe()}})}}};var p=s(1900);const f=(0,p.Z)(d,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.loaded?s("div",{staticClass:"shadow-lg w-95vw md:w-2/5-screen ns-box"},[s("div",{staticClass:"border-b ns-box-header p-2 text-primary flex justify-between items-center"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.title))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2"},[null!==e.register?s("div",{staticClass:"mb-2 p-3 elevation-surface font-bold border text-right flex justify-between"},[s("span",[e._v(e._s(e.__("Balance"))+" ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.register.balance)))])]):e._e(),e._v(" "),s("div",{staticClass:"mb-2 p-3 elevation-surface success border font-bold text-right flex justify-between"},[s("span",[e._v(e._s(e.__("Input")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.amount)))])]),e._v(" "),s("div",{staticClass:"mb-2"},[s("ns-numpad",{attrs:{floating:!0,value:e.amount},on:{next:function(t){return e.submit(t)},changed:function(t){return e.definedValue(t)}}})],1),e._v(" "),e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})}))],2)]):e._e(),e._v(" "),e.loaded?e._e():s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)])}),[],!1,null,null,null).exports;var v=s(2830);function h(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const m={components:{nsNumpad:o.Z},data:function(){return{registers:[],priorVerification:!1,hasLoadedRegisters:!1,validation:new a.Z,amount:0,settings:null,settingsSubscription:null}},mounted:function(){var e=this;this.checkUsedRegister(),this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t}))},beforeDestroy:function(){this.settingsSubscription.unsubscribe()},computed:{},methods:{__:u.__,popupResolver:v.Z,selectRegister:function(e){var t,s=this;return(t=r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("closed"===e.status){t.next=2;break}return t.abrupt("return",i.kX.error((0,u.__)("Unable to open this register. Only closed register can be opened.")).subscribe());case 2:return t.prev=2,t.next=5,new Promise((function(t,s){var n=(0,u.__)("Open Register : %s").replace("%s",e.name),r=e.id;Popup.show(f,{resolve:t,reject:s,title:n,identifier:"ns.cash-registers-opening",register:e,action:"open",register_id:r})}));case 5:n=t.sent,s.popupResolver(n),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),console.log(t.t0);case 12:case"end":return t.stop()}}),t,null,[[2,9]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){h(i,n,r,o,a,"next",e)}function a(e){h(i,n,r,o,a,"throw",e)}o(void 0)}))})()},checkUsedRegister:function(){var e=this;this.priorVerification=!1,i.ih.get("/api/nexopos/v4/cash-registers/used").subscribe({next:function(t){e.$popupParams.resolve(t),e.$popup.close()},error:function(t){e.priorVerification=!0,i.kX.error(t.message).subscribe(),e.loadRegisters()}})},loadRegisters:function(){var e=this;this.hasLoadedRegisters=!1,i.ih.get("/api/nexopos/v4/cash-registers").subscribe((function(t){e.registers=t,e.hasLoadedRegisters=!0}))},getClass:function(e){switch(e.status){case"in-use":return"elevation-surface warning cursor-not-allowed";case"disabled":return"elevation-surface cursor-not-allowed";case"available":return"elevation-surface success"}return"elevation-surface hoverable cursor-pointer"}}};const _=(0,p.Z)(m,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[!1===e.priorVerification?s("div",{staticClass:"h-full w-full py-10 flex justify-center items-center"},[s("ns-spinner",{attrs:{size:"24",border:"8"}})],1):e._e(),e._v(" "),e.priorVerification?s("div",{staticClass:"w-95vw md:w-3/5-screen lg:w-3/5-screen xl:w-2/5-screen flex flex-col overflow-hidden",class:e.priorVerification?"shadow-lg ns-box":"",attrs:{id:"ns-pos-cash-registers-popup"}},[[s("div",{staticClass:"title p-2 border-b ns-box-header flex justify-between items-center"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Open The Register")))]),e._v(" "),e.settings?s("div",[s("a",{staticClass:"rounded-full border ns-close-button px-3 text-sm py-1",attrs:{href:e.settings.urls.orders_url}},[e._v(e._s(e.__("Exit To Orders")))])]):e._e()]),e._v(" "),e.hasLoadedRegisters?e._e():s("div",{staticClass:"py-10 flex-auto overflow-y-auto flex items-center justify-center"},[s("ns-spinner",{attrs:{size:"16",border:"4"}})],1),e._v(" "),e.hasLoadedRegisters?s("div",{staticClass:"flex-auto overflow-y-auto"},[s("div",{staticClass:"grid grid-cols-3"},e._l(e.registers,(function(t,n){return s("div",{key:n,staticClass:"border flex items-center justify-center flex-col p-3",class:e.getClass(t),on:{click:function(s){return e.selectRegister(t)}}},[s("i",{staticClass:"las la-cash-register text-6xl"}),e._v(" "),s("h3",{staticClass:"text-semibold text-center"},[e._v(e._s(t.name))]),e._v(" "),s("span",{staticClass:"text-sm"},[e._v("("+e._s(t.status_label)+")")])])})),0),e._v(" "),0===e.registers.length?s("div",{staticClass:"p-2 alert text-white"},[e._v("\n "+e._s(e.__("Looks like there is no registers. At least one register is required to proceed."))+" — "),s("a",{staticClass:"font-bold hover:underline",attrs:{href:e.settings.urls.registers_url}},[e._v(e._s(e.__("Create Cash Register")))])]):e._e()]):e._e()]],2):e._e()])}),[],!1,null,null,null).exports;const b={data:function(){return{totalIn:0,totalOut:0,settings:null,settingsSubscription:null,histories:[]}},mounted:function(){var e=this;this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t})),this.getHistory()},destroyed:function(){this.settingsSubscription.unsubscribe()},methods:{__:u.__,popupResolver:v.Z,closePopup:function(){this.popupResolver({status:"success"})},getHistory:function(){var e=this;i.ih.get("/api/nexopos/v4/cash-registers/session-history/".concat(this.settings.register.id)).subscribe((function(t){e.histories=t,e.totalIn=e.histories.filter((function(e){return["register-opening","register-sale","register-cash-in"].includes(e.action)})).map((function(e){return parseFloat(e.value)})).reduce((function(e,t){return e+t}),0),e.totalOut=e.histories.filter((function(e){return["register-closing","register-refund","register-cash-out"].includes(e.action)})).map((function(e){return parseFloat(e.value)})).reduce((function(e,t){return e+t}),0),console.log(e.totalOut)}))}}};const y=(0,p.Z)(b,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-lg w-95vw md:w-4/6-screen lg:w-half overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between items-center ns-box-header",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Register History")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:e.closePopup}})],1)]),e._v(" "),s("div",{staticClass:"flex w-full ns-box-body"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"w-full md:w-1/2 text-right bg-success-primary text-white font-bold text-3xl p-3"},[e._v(e._s(e._f("currency")(e.totalIn)))]),e._v(" "),s("div",{staticClass:"w-full md:w-1/2 text-right bg-error-primary text-white font-bold text-3xl p-3"},[e._v(e._s(e._f("currency")(e.totalOut)))])])]),e._v(" "),s("div",{staticClass:"flex flex-col overflow-y-auto h-120"},[e._l(e.histories,(function(t){return[["register-sale","register-cash-in"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface success"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-opening"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-close"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface info"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-refund","register-cash-out"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface error"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e()]}))],2)])}),[],!1,null,null,null).exports;function g(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function x(e){for(var t=1;t0&&i.kX.error(t.t0.message).subscribe();case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))()},registerInitialQueue:function(){var e=this;POS.initialQueue.push(S(r().mark((function t(){var s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,s){void 0===e.settings.register&&Popup.show(_,{resolve:t,reject:s})}));case 3:return s=t.sent,POS.set("register",s.data.register),e.setRegister(s.data.register),t.abrupt("return",s);case 9:throw t.prev=9,t.t0=t.catch(0),t.t0;case 12:case"end":return t.stop()}}),t,null,[[0,9]])}))))},setButtonName:function(){if(void 0===this.settings.register)return this.name=(0,u.__)("Cash Register");this.name=(0,u.__)("Cash Register : {register}").replace("{register}",this.settings.register.name)},setRegister:function(e){if(void 0!==e){var t=POS.order.getValue();t.register_id=e.id,POS.order.next(t)}}},destroyed:function(){this.orderSubscriber.unsubscribe(),this.settingsSubscriber.unsubscribe()},mounted:function(){var e=this;this.registerInitialQueue(),this.orderSubscriber=POS.order.subscribe((function(t){e.order=t})),this.settingsSubscriber=POS.settings.subscribe((function(t){e.settings=t,e.setRegister(e.settings.register),e.setButtonName()}))}};const T=(0,p.Z)($,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openRegisterOptions()}}},[s("i",{staticClass:"mr-1 text-xl las la-cash-register"}),e._v(" "),s("span",[e._v(e._s(e.name))])])])}),[],!1,null,null,null).exports},9516:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(6979),r=(s(820),s(914)),i=s(665);const o={name:"ns-pos-customers-button",mounted:function(){this.popupCloser()},methods:{__,popupCloser:i.Z,reset:function(){n.G.show(r.default,{title:__("Confirm Your Action"),message:__("The current order will be cleared. But not deleted if it's persistent. Would you like to proceed ?"),onAction:function(e){e&&POS.reset()}})}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button error"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.reset()}}},[s("i",{staticClass:"mr-1 text-xl las la-eraser"}),e._v(" "),s("span",[e._v(e._s(e.__("Reset")))])])])}),[],!1,null,null,null).exports},7634:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>r});const n={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(void 0!==e.$popupParams.onAction&&e.$popupParams.onAction(!1),e.$popup.close())}))},methods:{__:s(3632).__,emitAction:function(e){void 0!==this.$popupParams.onAction&&this.$popupParams.onAction(e),this.$popup.close()}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-6/7-screen md:w-4/7-screen lg:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"alert-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[e.title?s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]):e._e(),e._v(" "),s("p",{staticClass:"py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t justify-end items-center p-2"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))])],1)])}),[],!1,null,null,null).exports},800:(e,t,s)=>{"use strict";s.d(t,{Z:()=>B});var n=s(7700),r=s(9020),i=s(2277),o=s(4679),a=s(665),l=s(3632);function c(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function u(e){for(var t=1;tthis.availableQuantity)return n.kX.error("Unable to proceed as the quantity provided is exceed the available quantity.").subscribe();this.product.quantity=parseFloat(e),this.$popupParams.resolve(this.product),this.$popup.close()}}};const b=(0,f.Z)(_,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box overflow-hidden w-95vw md:w-4/6-screen lg:w-3/7-screen"},[s("div",{staticClass:"p-2 flex justify-between ns-box-header"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Quantity")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),e.product?s("div",{staticClass:"border-t border-b ns-box-body py-2 flex items-center justify-center text-2xl font-semibold"},[s("span",[e._v(e._s(e.seeValue))]),e._v(" "),s("span",{staticClass:"text-primary text-sm"},[e._v("("+e._s(e.availableQuantity)+" "+e._s(e.__("available"))+")")])]):e._e(),e._v(" "),e.product?s("div",{staticClass:"flex-auto overflow-y-auto p-2"},[s("ns-numpad",{attrs:{value:e.product.quantity},on:{next:function(t){return e.updateQuantity(t)},changed:function(t){return e.setChangedValue(t)}}})],1):e._e()])}),[],!1,null,null,null).exports;var y=s(2614),g=s(914),x=s(6979),w=s(282);function C(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function k(e){for(var t=1;t0?this.refundables.map((function(e){return parseFloat(e.unit_price)*parseFloat(e.quantity)})).reduce((function(e,t){return e+t}))+this.shippingFees:0+this.shippingFees},shippingFees:function(){return this.refundShipping?this.order.shipping:0}},data:function(){return{isSubmitting:!1,formValidation:new o.Z,refundables:[],paymentOptions:[],paymentField:[],print:new w.Z({urls:systemUrls,options:systemOptions}),refundShipping:!1,selectedPaymentGateway:!1,screen:0,selectFields:[{type:"select",options:this.order.products.map((function(e){return{label:"".concat(e.name," - ").concat(e.unit.name," (x").concat(e.quantity,")"),value:e.id}})),validation:"required",name:"product_id",label:(0,l.__)("Product"),description:(0,l.__)("Select the product to perform a refund.")}]}},methods:{__:l.__,updateScreen:function(e){this.screen=e},toggleRefundShipping:function(e){this.refundShipping=e,this.refundShipping},proceedPayment:function(){var e=this;return!1===this.selectedPaymentGateway?n.kX.error((0,l.__)("Please select a payment gateway before proceeding.")).subscribe():0===this.total?n.kX.error((0,l.__)("There is nothing to refund.")).subscribe():0===this.screenValue?n.kX.error((0,l.__)("Please provide a valid payment amount.")).subscribe():void x.G.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("The refund will be made on the current order."),onAction:function(t){t&&e.doProceed()}})},doProceed:function(){var e=this,t={products:this.refundables,total:this.screenValue,payment:this.selectedPaymentGateway,refund_shipping:this.refundShipping};this.isSubmitting=!0,n.ih.post("/api/nexopos/v4/orders/".concat(this.order.id,"/refund"),t).subscribe({next:function(t){e.isSubmitting=!1,e.$emit("changed",!0),"refunded"===t.data.order.payment_status&&e.$emit("loadTab","details"),e.print.process(t.data.orderRefund.id,"refund"),n.kX.success(t.message).subscribe()},error:function(t){e.isSubmitting=!1,n.kX.error(t.message).subscribe()}})},addProduct:function(){var e=this;if(this.formValidation.validateFields(this.selectFields),!this.formValidation.fieldsValid(this.selectFields))return n.kX.error((0,l.__)("Please select a product before proceeding.")).subscribe();var t=this.formValidation.extractFields(this.selectFields),s=this.order.products.filter((function(e){return e.id===t.product_id})),r=this.refundables.filter((function(e){return e.id===t.product_id}));if(r.length>0){var i=r.map((function(e){return parseInt(e.quantity)})).reduce((function(e,t){return e+t}));if(i===s[0].quantity)return n.kX.error((0,l.__)("Not enough quantity to proceed.")).subscribe()}if(0===s[0].quantity)return n.kX.error((0,l.__)("Not enough quantity to proceed.")).subscribe();var o=k(k({},s[0]),{condition:"",description:""});new Promise((function(e,t){x.G.show(v,{resolve:e,reject:t,product:o})})).then((function(t){t.quantity=e.getProductOriginalQuantity(t.id)-e.getProductUsedQuantity(t.id),e.refundables.push(t)}),(function(e){return e}))},getProductOriginalQuantity:function(e){var t=this.order.products.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},getProductUsedQuantity:function(e){var t=this.refundables.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},openSettings:function(e){var t=this;new Promise((function(t,s){x.G.show(v,{resolve:t,reject:s,product:e})})).then((function(s){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}),(function(e){return e}))},selectPaymentGateway:function(){var e=this;new Promise((function(t,s){x.G.show(y.Z,k({resolve:t,reject:s,value:[e.selectedPaymentOption]},e.paymentField[0]))})).then((function(t){e.selectedPaymentGateway=t[0]}),(function(e){return e}))},changeQuantity:function(e){var t=this;new Promise((function(s,n){var r=t.getProductOriginalQuantity(e.id)-t.getProductUsedQuantity(e.id)+parseFloat(e.quantity);x.G.show(b,{resolve:s,reject:n,product:e,availableQuantity:r})})).then((function(s){if(s.quantity>t.getProductUsedQuantity(e.id)-e.quantity){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}}))},deleteProduct:function(e){var t=this;new Promise((function(s,n){x.G.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to delete this product ?"),onAction:function(s){if(s){var n=t.refundables.indexOf(e);t.refundables.splice(n,1)}}})}))}},mounted:function(){var e=this;this.selectFields=this.formValidation.createFields(this.selectFields),n.ih.get("/api/nexopos/v4/orders/payments").subscribe((function(t){e.paymentField=t}))}};const O=(0,f.Z)(j,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-m-4 flex-auto flex flex-wrap relative"},[e.isSubmitting?s("div",{staticClass:"bg-overlay h-full w-full flex items-center justify-center absolute z-30"},[s("ns-spinner")],1):e._e(),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Refund With Products")))]),e._v(" "),s("div",{staticClass:"my-2"},[s("ul",[s("li",{staticClass:"border-b border-info-primary flex justify-between items-center mb-2"},[s("div",{staticClass:"flex-auto flex-col flex"},[s("div",{staticClass:"p-2 flex"},e._l(e.selectFields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"flex justify-between p-2"},[s("div",{staticClass:"flex items-center text-primary"},[e.order.shipping>0?s("span",{staticClass:"mr-2"},[e._v(e._s(e.__("Refund Shipping")))]):e._e(),e._v(" "),e.order.shipping>0?s("ns-checkbox",{attrs:{checked:e.refundShipping},on:{change:function(t){return e.toggleRefundShipping(t)}}}):e._e()],1),e._v(" "),s("div",[s("button",{staticClass:"border rounded-full px-2 py-1 ns-inset-button info",on:{click:function(t){return e.addProduct()}}},[e._v(e._s(e.__("Add Product")))])])])])]),e._v(" "),s("li",[s("h4",{staticClass:"py-1 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.refundables,(function(t){return s("li",{key:t.id,staticClass:"elevation-surface border flex justify-between items-center mb-2"},[s("div",{staticClass:"px-2 text-primary flex justify-between flex-auto"},[s("div",{staticClass:"flex flex-col"},[s("p",{staticClass:"py-2"},[s("span",[e._v(e._s(t.name))]),e._v(" "),"damaged"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-error-tertiary mx-2 text-white"},[e._v(e._s(e.__("Damaged")))]):e._e(),e._v(" "),"unspoiled"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-success-tertiary mx-2 text-white"},[e._v(e._s(e.__("Unspoiled")))]):e._e()]),e._v(" "),s("small",[e._v(e._s(t.unit.name))])]),e._v(" "),s("div",{staticClass:"flex items-center justify-center"},[s("span",{staticClass:"py-1 flex items-center cursor-pointer border-b border-dashed border-info-primary"},[e._v(e._s(e._f("currency")(t.unit_price*t.quantity)))])])]),e._v(" "),s("div",{staticClass:"flex"},[s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.openSettings(t)}}},[s("i",{staticClass:"las la-cog text-xl"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.deleteProduct(t)}}},[s("i",{staticClass:"las la-trash"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.changeQuantity(t)}}},[e._v(e._s(t.quantity))])])])}))],2)])]),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Summary")))]),e._v(" "),s("div",{staticClass:"py-2"},[s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Total")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.total)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border success font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Paid")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.tendered)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border info font-semibold flex mb-2 p-2 justify-between cursor-pointer",on:{click:function(t){return e.selectPaymentGateway()}}},[s("span",[e._v(e._s(e.__("Payment Gateway")))]),e._v(" "),s("span",[e._v(e._s(e.selectedPaymentGateway?e.selectedPaymentGateway.label:"N/A"))])]),e._v(" "),s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Screen")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.screenValue)))])]),e._v(" "),s("div",[s("ns-numpad",{attrs:{currency:!0,value:e.screen},on:{changed:function(t){return e.updateScreen(t)},next:function(t){return e.proceedPayment(t)}}})],1)])])])}),[],!1,null,null,null).exports;var S=s(3033);function $(e,t){for(var s=0;s0?t[0].label:(0,l.__)("Unknown Status")}},{key:"getDeliveryStatus",value:function(e){var t=deliveryStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,l.__)("Unknown Status")}},{key:"getProcessingStatus",value:function(e){var t=processingStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,l.__)("Unknown Status")}},{key:"getPaymentStatus",value:function(e){var t=paymentLabels.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,l.__)("Unknown Status")}}])&&$(t.prototype,s),n&&$(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function E(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function D(e){for(var t=1;t0?s("span",[e._v(e._s(e._f("currency")(e.order.total-e.order.tendered)))]):e._e(),e._v(" "),e.order.total-e.order.tendered<=0?s("span",[e._v(e._s(e._f("currency")(0)))]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 w-full md:w-1/2"},[s("div",{staticClass:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface warning border text-xl font-bold"},[s("span",[e._v(e._s(e.__("Customer Account")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.customer.account_amount)))])])])]),e._v(" "),s("div",{staticClass:"flex -mx-4 flex-wrap"},[s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},["paid"!==e.order.payment_status?s("div",[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2"},[e._v("\n "+e._s(e.__("Payment"))+"\n ")]),e._v(" "),s("div",{staticClass:"py-2"},[e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),e._v(" "),s("div",{staticClass:"my-2 px-2 h-12 flex justify-end items-center border elevation-surface"},[e._v("\n "+e._s(e._f("currency")(e.inputValue))+"\n ")]),e._v(" "),s("ns-numpad",{attrs:{floating:!0,value:e.inputValue},on:{next:function(t){return e.submitPayment(t)},changed:function(t){return e.updateValue(t)}}})],2)]):e._e(),e._v(" "),"paid"===e.order.payment_status?s("div",{staticClass:"flex items-center justify-center h-full"},[s("h3",{staticClass:"text-primary font-semibold"},[e._v(e._s(e.__("No payment possible for paid order.")))])]):e._e()]),e._v(" "),s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2 mb-2"},[e._v("\n "+e._s(e.__("Payment History"))+"\n ")]),e._v(" "),s("ul",e._l(e.order.payments,(function(t){return s("li",{key:t.id,staticClass:"p-2 flex items-center justify-between text-shite border elevation-surface mb-2"},[s("span",[e._v(e._s(e.paymentsLabels[t.identifier]||e.__("Unknown")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(t.value)))])])})),0)])])])}),[],!1,null,null,null).exports;var q=s(1765);const Z={props:["order"],data:function(){return{processingStatuses,deliveryStatuses,labels:new T,showProcessingSelect:!1,showDeliverySelect:!1}},mounted:function(){},methods:{__:l.__,submitProcessingChange:function(){var e=this;x.G.show(g.default,{title:(0,l.__)("Would you proceed ?"),message:(0,l.__)("The processing status of the order will be changed. Please confirm your action."),onAction:function(t){t&&n.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/processing"),{process_status:e.order.process_status}).subscribe({next:function(t){e.showProcessingSelect=!1,n.kX.success(t.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("Unexpected error occurred.")).subscribe()}})}})},openRefunds:function(){var e=this;try{new Promise((function(t,s){var n=e.order;x.G.show(q.Z,{order:n,resolve:t,reject:s})}))}catch(e){}},submitDeliveryStatus:function(){var e=this;x.G.show(g.default,{title:(0,l.__)("Would you proceed ?"),message:(0,l.__)("The delivery status of the order will be changed. Please confirm your action."),onAction:function(t){t&&n.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/delivery"),{delivery_status:e.order.delivery_status}).subscribe({next:function(t){e.showDeliverySelect=!1,n.kX.success(t.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("Unexpected error occurred.")).subscribe()}})}})}}};const R=(0,f.Z)(Z,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex flex-wrap"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap flex"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Payment Summary")))])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"elevation-surface border p-2 flex justify-between items-start"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Sub Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.subtotal)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[s("span",{staticClass:"text-white"},[e._v(e._s(e.__("Discount")))]),e._v(" "),"percentage"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("("+e._s(e.order.discount_percentage)+"%)")]):e._e(),e._v(" "),"flat"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("(Flat)")]):e._e()])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.discount)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Shipping")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.shipping)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v("\n "+e._s(e.__("Coupons"))+"\n ")])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.total_coupons)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice info"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.total)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice warning"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Taxes")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tax_value)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start text-primary elevation-surface error border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Change")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.change)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Paid")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tendered)))])])])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Order Status")))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Customer")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.order.nexopos_customers_name))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Type")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getTypeLabel(e.order.type)))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Delivery Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showDeliverySelect?e._e():s("span",{staticClass:"font-semibold text-secondary border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showDeliverySelect=!0}}},[e._v(e._s(e.labels.getDeliveryStatus(e.order.delivery_status)))])]),e._v(" "),e.showDeliverySelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.delivery_status,expression:"order.delivery_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"delivery_status",t.target.multiple?s:s[0])}}},e._l(e.deliveryStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showDeliverySelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitDeliveryStatus(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex flex-col md:flex-row justify-between items-center elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Processing Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showProcessingSelect?e._e():s("span",{staticClass:"border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showProcessingSelect=!0}}},[e._v(e._s(e.labels.getProcessingStatus(e.order.process_status)))])]),e._v(" "),e.showProcessingSelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.process_status,expression:"order.process_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"process_status",t.target.multiple?s:s[0])}}},e._l(e.processingStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showProcessingSelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitProcessingChange(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Payment Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getPaymentStatus(e.order.payment_status)))])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.order.products,(function(t){return s("div",{key:t.id,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A"))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])})),e._v(" "),s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary flex justify-between"},[s("span",[e._v(e._s(e.__("Refunded Products")))]),e._v(" "),s("a",{staticClass:"border-b border-info-primary border-dashed",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.openRefunds()}}},[e._v(e._s(e.__("All Refunds")))])])]),e._v(" "),e._l(e.order.refunded_products,(function(t,n){return s("div",{key:n,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.order_product.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A")+" | "),s("span",{staticClass:"rounded-full px-2",class:"damaged"===t.condition?"bg-error-tertiary text-white":"bg-info-tertiary text-white"},[e._v(e._s(t.condition))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])}))],2)])}),[],!1,null,null,null).exports;var I=s(4687),L=s.n(I);function H(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function M(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const X={name:"ns-order-instalments-payment",components:{nsNotice:s(876).nsNotice},data:function(){return{paymentTypes,fields:[{type:"select",name:"payment_type",description:(0,l.__)("Select the payment type that must apply to the current order."),label:(0,l.__)("Payment Type"),validation:"required",options:paymentTypes}],print:new w.Z({urls:systemUrls,options:systemOptions}),validation:new o.Z,order:null,instalment:null}},methods:{__:l.__,popupResolver:h.Z,popupCloser:a.Z,close:function(){this.popupResolver(!1)},updateInstalmentAsDue:function(e){var t=this;nsHttpClient.put("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/"),{instalment:{date:ns.date.moment.format("YYYY-MM-DD HH:mm:ss")}}).subscribe({next:function(e){t.submitPayment()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})},submitPayment:function(){var e=this;if(!this.validation.validateFields(this.fields))return n.kX.error(__m("The form is not valid.")).subcribe();nsHttpClient.post("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/pay"),function(e){for(var t=1;t0?this.instalments.map((function(e){return e.amount})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})):0}},methods:{__:l.__,loadInstalments:function(){var e=this;n.ih.get("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments")).subscribe((function(t){e.original=t,e.instalments=t.map((function(e){return e.price_clicked=!1,e.date_clicked=!1,e.date=moment(e.date).format("YYYY-MM-DD"),e}))}))},showReceipt:function(e){if(null===e.payment_id)return n.kX.error((0,l.__)("This instalment doesn't have any payment attached.")).subscribe();this.print.process(e.payment_id,"payment")},addInstalment:function(){this.instalments.push({date:ns.date.moment.format("YYYY-MM-DD"),amount:this.order.total-this.totalInstalments,paid:!1})},createInstalment:function(e){var t=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to create this instalment ?"),onAction:function(s){s&&n.ih.post("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments"),{instalment:e}).subscribe({next:function(e){t.loadInstalments(),n.kX.success(e.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})}})},deleteInstalment:function(e){var t=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to delete this instalment ?"),onAction:function(s){s&&n.ih.delete("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id)).subscribe({next:function(s){var r=t.instalments.indexOf(e);t.instalments.splice(r,1),n.kX.success(s.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})}})},markAsPaid:function(e){var t,s=this;return(t=L().mark((function t(){return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,n){Popup.show(U,{order:s.order,instalment:e,resolve:t,reject:n})}));case 3:t.sent,s.loadInstalments(),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){Y(i,n,r,o,a,"next",e)}function a(e){Y(i,n,r,o,a,"throw",e)}o(void 0)}))})()},togglePriceEdition:function(e){var t=this;e.paid||(e.price_clicked=!e.price_clicked,this.$forceUpdate(),e.price_clicked&&setTimeout((function(){t.$refs.amount[0].select()}),100))},updateInstalment:function(e){var t=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to update that instalment ?"),onAction:function(s){s&&n.ih.put("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id),{instalment:e}).subscribe({next:function(e){n.kX.success(e.message).subscribe()},error:function(e){n.kX.error(e.message||(0,l.__)("An unexpected error has occurred")).subscribe()}})}})},toggleDateEdition:function(e){var t=this;e.paid||(e.date_clicked=!e.date_clicked,this.$forceUpdate(),e.date_clicked&&setTimeout((function(){t.$refs.date[0].select()}),200))}}};const z=(0,f.Z)(N,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex-auto flex flex-wrap"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Instalments")))])]),e._v(" "),s("div",{staticClass:"px-4"},[s("ul",{staticClass:"border-table-th-edge border-t text-primary"},[e._l(e.instalments,(function(t){return s("li",{key:t.id,staticClass:"border-b border-l flex justify-between elevation-surface",class:t.paid?"success":"info"},[s("span",{staticClass:"p-2"},[t.date_clicked?e._e():s("span",{on:{click:function(s){return e.toggleDateEdition(t)}}},[e._v(e._s(t.date))]),e._v(" "),t.date_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.date,expression:"instalment.date"}],ref:"date",refInFor:!0,staticClass:"border border-info-primary rounded",attrs:{type:"date"},domProps:{value:t.date},on:{blur:function(s){return e.toggleDateEdition(t)},input:function(s){s.target.composing||e.$set(t,"date",s.target.value)}}})]):e._e()]),e._v(" "),s("div",{staticClass:"flex items-center"},[s("div",{staticClass:"flex items-center px-2 h-full border-r"},[t.price_clicked?e._e():s("span",{on:{click:function(s){return e.togglePriceEdition(t)}}},[e._v(e._s(e._f("currency")(t.amount)))]),e._v(" "),t.price_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"instalment.amount"}],ref:"amount",refInFor:!0,staticClass:"border border-info-primary p-1",attrs:{type:"text"},domProps:{value:t.amount},on:{blur:function(s){return e.togglePriceEdition(t)},input:function(s){s.target.composing||e.$set(t,"amount",s.target.value)}}})]):e._e()]),e._v(" "),!t.paid&&t.id?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"success",className:"la-money-bill-wave-alt"},on:{click:function(s){return e.markAsPaid(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"info",className:"la-save"},on:{click:function(s){return e.updateInstalment(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"error",className:"la-trash-alt"},on:{click:function(s){return e.deleteInstalment(t)}}})],1)]):e._e(),e._v(" "),t.paid||t.id?e._e():s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 py-1 rounded-full",on:{click:function(s){return e.createInstalment(t)}}},[s("i",{staticClass:"las la-plus"}),e._v("\n "+e._s(e.__("Create"))+"\n ")])])])]),e._v(" "),t.paid?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 text-xs py-1 rounded-full",on:{click:function(s){return e.showReceipt(t)}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Receipt"))+"\n ")])])]):e._e()])])})),e._v(" "),s("li",{staticClass:"flex justify-between p-2 border-r border-b border-l elevation-surface"},[s("div",{staticClass:"flex items-center justify-center"},[s("span",[e._v("\n "+e._s(e.__("Total :"))+" "+e._s(e._f("currency")(e.order.total))+"\n ")]),e._v(" "),s("span",{staticClass:"ml-1 text-sm"},[e._v("\n ("+e._s(e.__("Remaining :"))+" "+e._s(e._f("currency")(e.order.total-e.totalInstalments))+")\n ")])]),e._v(" "),s("div",{staticClass:"-mx-2 flex flex-wrap items-center"},[s("span",{staticClass:"px-2"},[e._v("\n "+e._s(e.__("Instalments:"))+" "+e._s(e._f("currency")(e.totalInstalments))+"\n ")]),e._v(" "),s("span",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded-full px-3 py-1",on:{click:function(t){return e.addInstalment()}}},[e._v(e._s(e.__("Add Instalment")))])])])])])],2)])])])])}),[],!1,null,null,null).exports;var Q={filters:{nsCurrency:r.W},name:"ns-preview-popup",data:function(){return{active:"details",order:new Object,products:[],payments:[],options:null,print:new w.Z({urls:systemUrls,options:systemOptions}),settings:null}},components:{nsOrderRefund:O,nsOrderPayment:A,nsOrderDetails:R,nsOrderInstalments:z},computed:{isVoidable:function(){return["paid","partially_paid","unpaid"].includes(this.order.payment_status)},isDeleteAble:function(){return["hold"].includes(this.order.payment_status)}},methods:{__:l.__,popupResolver:h.Z,popupCloser:a.Z,closePopup:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.popupResolver(e)},setActive:function(e){this.active=e},printOrder:function(){this.print.process(this.order.id,"sale")},refresh:function(){this.$popupParams.component.$emit("updated"),this.loadOrderDetails(this.order.id)},loadOrderDetails:function(e){var t=this;(0,i.D)([n.ih.get("/api/nexopos/v4/orders/".concat(e)),n.ih.get("/api/nexopos/v4/orders/".concat(e,"/products")),n.ih.get("/api/nexopos/v4/orders/".concat(e,"/payments"))]).subscribe((function(e){t.order=e[0],t.products=e[1],t.payments=e[2]}))},deleteOrder:function(){var e=this;Popup.show(g.default,{title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("Would you like to delete this order"),onAction:function(t){t&&n.ih.delete("/api/nexopos/v4/orders/".concat(e.order.id)).subscribe({next:function(t){n.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){n.kX.error(e.message).subscribe()}})}})},voidOrder:function(){var e=this;try{new Promise((function(t,s){Popup.show(S.default,{resolve:t,reject:s,title:(0,l.__)("Confirm Your Action"),message:(0,l.__)("The current order will be void. This action will be recorded. Consider providing a reason for this operation"),onAction:function(t){!1!==t&&n.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/void"),{reason:t}).subscribe({next:function(t){n.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){n.kX.error(e.message).subscribe()}})}})}))}catch(e){console.log(e)}},refreshCrudTable:function(){this.$popupParams.component.$emit("updated",!0)}},watch:{active:function(){"details"===this.active&&this.loadOrderDetails(this.order.id)}},mounted:function(){this.order=this.$popupParams.order,this.options=systemOptions,this.urls=systemUrls,this.loadOrderDetails(this.order.id),this.popupCloser()}};window.nsOrderPreviewPopup=Q;const W=Q;const B=(0,f.Z)(W,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-95vh w-95vw md:h-6/7-screen md:w-6/7-screen overflow-hidden shadow-xl ns-box flex flex-col"},[s("div",{staticClass:"border-b ns-box-header p-3 flex items-center justify-between"},[s("div",[s("h3",[e._v(e._s(e.__("Order Options")))])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup(!0)}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 overflow-scroll ns-box-body flex flex-auto"},[e.order.id?s("ns-tabs",{attrs:{active:e.active},on:{active:function(t){return e.setActive(t)}}},[s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Details"),identifier:"details"}},[s("ns-order-details",{attrs:{order:e.order}})],1),e._v(" "),["order_void","hold","refunded","partially_refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Payments"),identifier:"payments"}},[s("ns-order-payment",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1),e._v(" "),["order_void","hold","refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Refund & Return"),identifier:"refund"}},[s("ns-order-refund",{attrs:{order:e.order},on:{loadTab:function(t){return e.setActive(t)},changed:function(t){return e.refresh()}}})],1),e._v(" "),["partially_paid","unpaid"].includes(e.order.payment_status)&&e.order.support_instalments?s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Installments"),identifier:"instalments"}},[s("ns-order-instalments",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1):e._e()],1):e._e(),e._v(" "),e.order.id?e._e():s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)],1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between border-t ns-box-footer"},[s("div",[e.isVoidable?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.voidOrder()}}},[s("i",{staticClass:"las la-ban"}),e._v("\n "+e._s(e.__("Void"))+"\n ")]):e._e(),e._v(" "),e.isDeleteAble?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.deleteOrder()}}},[s("i",{staticClass:"las la-trash"}),e._v("\n "+e._s(e.__("Delete"))+"\n ")]):e._e()],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.printOrder()}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Print"))+"\n ")])],1)])])}),[],!1,null,null,null).exports},1765:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(3632),r=s(665),i=s(2830),o=s(7700),a=s(282);const l={name:"ns-orders-refund-popup",data:function(){return{order:null,refunds:[],view:"summary",previewed:null,loaded:!1,options:systemOptions,systemUrls,print:new a.Z({urls:systemUrls,options:systemOptions})}},methods:{__:n.__,popupCloser:r.Z,popupResolver:i.Z,toggleProductView:function(e){this.view="details",this.previewed=e},loadOrderRefunds:function(){var e=this;nsHttpClient.get("/api/nexopos/v4/orders/".concat(this.order.id,"/refunds")).subscribe((function(t){e.loaded=!0,e.refunds=t.refunds}),(function(e){o.kX.error(e.message).subscribe()}))},close:function(){this.$popup.close()},printRefundReceipt:function(e){this.print.process(e.id,"refund")}},mounted:function(){this.order=this.$popupParams.order,this.popupCloser(),this.loadOrderRefunds()}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-3/5-screen ns-box flex flex-col overflow-hidden"},[s("div",{staticClass:"border-b p-2 flex items-center justify-between ns-box-header"},[s("h3",[e._v(e._s(e.__("Order Refunds")))]),e._v(" "),s("div",{staticClass:"flex"},["details"===e.view?s("div",{staticClass:"flex items-center justify-center cursor-pointer rounded-full px-3 border hover:bg-info-primary hover:text-white mr-1",on:{click:function(t){e.view="summary"}}},[e._v(e._s(e.__("Go Back")))]):e._e(),e._v(" "),s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"overflow-auto flex-auto ns-box-body"},["summary"===e.view?[e.loaded?e._e():s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("ns-spinner",{attrs:{size:"24"}})],1),e._v(" "),e.loaded&&0===e.refunds.length?s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("i",{staticClass:"lar la-frown-open"})]):e._e(),e._v(" "),e.loaded&&e.refunds.length>0?e._l(e.refunds,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(e.order.code))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total)))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("By"))+" : "+e._s(t.author.username))])])])]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.toggleProductView(t)}}},[s("i",{staticClass:"las la-eye"})]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.printRefundReceipt(t)}}},[s("i",{staticClass:"las la-print"})])])})):e._e()]:e._e(),e._v(" "),"details"===e.view?e._l(e.previewed.refunded_products,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(t.product.name))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Condition"))+" : "+e._s(t.condition))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Quantity"))+" : "+e._s(t.quantity))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total_price)))])])])])])})):e._e()],2)])}),[],!1,null,null,null).exports},914:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});var n=s(3632),r=s(2830),i=s(665);const o={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:n.__,popupResolver:r.Z,popupCloser:i.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[s("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t"},[s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),s("hr",{staticClass:"border-r h-16"}),e._v(" "),s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports},3630:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(665),r=s(2830),i=s(7700),o=s(3632),a=s(3815);s(9093);const l={name:"ns-pos-coupons-load-popup",components:{nsNotice:s(2404).Z},data:function(){return{placeHolder:(0,o.__)("Coupon Code"),couponCode:null,order:null,activeTab:"apply-coupon",orderSubscriber:null,customerCoupon:null}},mounted:function(){var e=this;this.popupCloser(),this.$refs.coupon.select(),this.orderSubscriber=POS.order.subscribe((function(t){e.order=t,e.order.coupons.length>0&&(e.activeTab="active-coupons")})),this.$popupParams&&this.$popupParams.apply_coupon&&(this.couponCode=this.$popupParams.apply_coupon,this.getCoupon(this.couponCode).subscribe({next:function(t){e.customerCoupon=t,e.apply()}}))},destroyed:function(){this.orderSubscriber.unsubscribe()},methods:{__:o.__,popupCloser:n.Z,popupResolver:r.Z,selectCustomer:function(){Popup.show(a.Z)},cancel:function(){this.customerCoupon=null,this.couponCode=null},removeCoupon:function(e){this.order.coupons.splice(e,1),POS.refreshCart()},apply:function(){var e=this;try{var t=this.customerCoupon;if(null!==this.customerCoupon.coupon.valid_hours_start&&!ns.date.moment.isAfter(this.customerCoupon.coupon.valid_hours_start)&&this.customerCoupon.coupon.valid_hours_start.length>0)return i.kX.error((0,o.__)("The coupon is out from validity date range.")).subscribe();if(null!==this.customerCoupon.coupon.valid_hours_end&&!ns.date.moment.isBefore(this.customerCoupon.coupon.valid_hours_end)&&this.customerCoupon.coupon.valid_hours_end.length>0)return i.kX.error((0,o.__)("The coupon is out from validity date range.")).subscribe();var s=this.customerCoupon.coupon.products;if(s.length>0){var n=s.map((function(e){return e.product_id}));if(0===this.order.products.filter((function(e){return n.includes(e.product_id)})).length)return i.kX.error((0,o.__)("This coupon requires products that aren't available on the cart at the moment.")).subscribe()}var r=this.customerCoupon.coupon.categories;if(r.length>0){var a=r.map((function(e){return e.category_id}));if(0===this.order.products.filter((function(e){return a.includes(e.$original().category_id)})).length)return i.kX.error((0,o.__)("This coupon requires products that belongs to specific categories that aren't included at the moment.").replace("%s")).subscribe()}this.cancel();var l={active:t.coupon.active,customer_coupon_id:t.id,minimum_cart_value:t.coupon.minimum_cart_value,maximum_cart_value:t.coupon.maximum_cart_value,name:t.coupon.name,type:t.coupon.type,value:0,limit_usage:t.coupon.limit_usage,code:t.coupon.code,discount_value:t.coupon.discount_value,categories:t.coupon.categories,products:t.coupon.products};POS.pushCoupon(l),this.activeTab="active-coupons",setTimeout((function(){e.popupResolver(l)}),500),i.kX.success((0,o.__)("The coupon has applied to the cart.")).subscribe()}catch(e){console.log(e)}},getCouponType:function(e){switch(e){case"percentage_discount":return(0,o.__)("Percentage");case"flat_discount":return(0,o.__)("Flat");default:return(0,o.__)("Unknown Type")}},getDiscountValue:function(e){switch(e.type){case"percentage_discount":return e.discount_value+"%";case"flat_discount":return this.$options.filters.currency(e.discount_value)}},closePopup:function(){this.popupResolver(!1)},setActiveTab:function(e){this.activeTab=e},getCoupon:function(e){return!this.order.customer_id>0?i.kX.error((0,o.__)("You must select a customer before applying a coupon.")).subscribe():i.ih.post("/api/nexopos/v4/customers/coupons/".concat(e),{customer_id:this.order.customer_id})},loadCoupon:function(){var e=this,t=this.couponCode;this.getCoupon(t).subscribe({next:function(t){e.customerCoupon=t,i.kX.success((0,o.__)("The coupon has been loaded.")).subscribe()},error:function(e){i.kX.error(e.message||(0,o.__)("An unexpected error occurred.")).subscribe()}})}}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-95vw md:w-3/6-screen lg:w-2/6-screen"},[s("div",{staticClass:"border-b ns-box-header p-2 flex justify-between items-center"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Load Coupon")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-1 ns-box-body"},[s("ns-tabs",{attrs:{active:e.activeTab},on:{changeTab:function(t){return e.setActiveTab(t)}}},[s("ns-tabs-item",{attrs:{label:e.__("Apply A Coupon"),padding:"p-2",identifier:"apply-coupon"}},[s("div",{staticClass:"border-2 input-group info rounded flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.couponCode,expression:"couponCode"}],ref:"coupon",staticClass:"w-full text-primary p-2 outline-none",attrs:{type:"text",placeholder:e.placeHolder},domProps:{value:e.couponCode},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.loadCoupon()},input:function(t){t.target.composing||(e.couponCode=t.target.value)}}}),e._v(" "),s("button",{staticClass:"px-3 py-2",on:{click:function(t){return e.loadCoupon()}}},[e._v(e._s(e.__("Load")))])]),e._v(" "),s("div",{staticClass:"pt-2"},[s("ns-notice",{attrs:{color:"info"},scopedSlots:e._u([{key:"description",fn:function(){return[e._v(e._s(e.__("Input the coupon code that should apply to the POS. If a coupon is issued for a customer, that customer must be selected priorly.")))]},proxy:!0}])})],1),e._v(" "),e.order&&void 0===e.order.customer_id?s("div",{staticClass:"pt-2 flex"},[s("button",{staticClass:"w-full border p-2 outline-none ns-numpad-key info cursor-pointer text-center",on:{click:function(t){return e.selectCustomer()}}},[e._v(e._s(e.__("Click here to choose a customer.")))])]):e._e(),e._v(" "),e.order&&void 0!==e.order.customer_id?s("div",{staticClass:"pt-2"},[s("ns-notice",{attrs:{color:"success"},scopedSlots:e._u([{key:"description",fn:function(){return[e._v(e._s(e.__("Loading Coupon For : ")+e.order.customer.name+" "+e.order.customer.surname))]},proxy:!0}],null,!1,2531213351)})],1):e._e(),e._v(" "),s("div",{staticClass:"overflow-hidden"},[e.customerCoupon?s("div",{staticClass:"pt-2 fade-in-entrance anim-duration-500 overflow-y-auto ns-scrollbar h-64"},[s("table",{staticClass:"w-full ns-table"},[s("tbody",[s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Coupon Name")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.name))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Discount"))+" ("+e._s(e.getCouponType(e.customerCoupon.coupon.type))+")")]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.getDiscountValue(e.customerCoupon.coupon)))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Usage")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.usage+"/"+(e.customerCoupon.limit_usage||e.__("Unlimited"))))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Valid From")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.coupon.valid_hours_start||e.__("N/A")))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Valid Till")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.coupon.valid_hours_end||e.__("N/A")))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Categories")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[s("ul",[e._l(e.customerCoupon.coupon.categories,(function(t){return s("li",{key:t.id,staticClass:"rounded-full px-3 py-1 border"},[e._v(e._s(t.category.name))])})),e._v(" "),0===e.customerCoupon.coupon.categories.length?s("li",[e._v(e._s(e.__("Not applicable")))]):e._e()],2)])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Products")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[s("ul",[e._l(e.customerCoupon.coupon.products,(function(t){return s("li",{key:t.id,staticClass:"rounded-full px-3 py-1 border"},[e._v(e._s(t.product.name))])})),e._v(" "),0===e.customerCoupon.coupon.products.length?s("li",[e._v(e._s(e.__("Not applicable")))]):e._e()],2)])])])])]):e._e()])]),e._v(" "),s("ns-tabs-item",{attrs:{label:e.__("Active Coupons"),padding:"p-1",identifier:"active-coupons"}},[e.order?s("ul",[e._l(e.order.coupons,(function(t,n){return s("li",{key:n,staticClass:"flex justify-between elevation-surface border items-center px-2 py-1"},[s("div",{staticClass:"flex-auto"},[s("h3",{staticClass:"font-semibold text-primary p-2 flex justify-between"},[s("span",[e._v(e._s(t.name))]),e._v(" "),s("span",[e._v(e._s(e.getDiscountValue(t)))])])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.removeCoupon(n)}}})],1)])})),e._v(" "),0===e.order.coupons.length?s("li",{staticClass:"flex justify-between elevation-surface border items-center p-2"},[e._v("\n "+e._s(e.__("No coupons applies to the cart."))+"\n ")]):e._e()],2):e._e()])],1)],1),e._v(" "),e.customerCoupon?s("div",{staticClass:"flex"},[s("button",{staticClass:"w-1/2 px-3 py-2 bg-success-tertiary text-white font-bold",on:{click:function(t){return e.apply()}}},[e._v("\n "+e._s(e.__("Apply"))+"\n ")]),e._v(" "),s("button",{staticClass:"w-1/2 px-3 py-2 bg-error-tertiary text-white font-bold",on:{click:function(t){return e.cancel()}}},[e._v("\n "+e._s(e.__("Cancel"))+"\n ")])]):e._e()])}),[],!1,null,null,null).exports},3815:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var n=s(7700),r=s(2830),i=s(6979),o=s(820);const a={data:function(){return{searchCustomerValue:"",orderSubscription:null,order:{},debounceSearch:null,customers:[],isLoading:!1}},computed:{customerSelected:function(){return!1}},watch:{searchCustomerValue:function(e){var t=this;clearTimeout(this.debounceSearch),this.debounceSearch=setTimeout((function(){t.searchCustomer(e)}),500)}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.resolveIfQueued(!1)})),this.orderSubscription=POS.order.subscribe((function(t){e.order=t})),this.getRecentCustomers(),this.$refs.searchField.focus()},destroyed:function(){this.orderSubscription.unsubscribe()},methods:{__:s(3632).__,resolveIfQueued:r.Z,attemptToChoose:function(){if(1===this.customers.length)return this.selectCustomer(this.customers[0]);n.kX.info("Too many result.").subscribe()},openCustomerHistory:function(e,t){t.stopImmediatePropagation(),this.$popup.close(),i.G.show(o.Z,{customer:e,activeTab:"account-payment"})},selectCustomer:function(e){var t=this;this.customers.forEach((function(e){return e.selected=!1})),e.selected=!0,this.isLoading=!0,POS.selectCustomer(e).then((function(s){t.isLoading=!1,t.resolveIfQueued(e)})).catch((function(e){t.isLoading=!1}))},searchCustomer:function(e){var t=this;n.ih.post("/api/nexopos/v4/customers/search",{search:e}).subscribe((function(e){e.forEach((function(e){return e.selected=!1})),t.customers=e}))},createCustomerWithMatch:function(e){this.resolveIfQueued(!1),i.G.show(o.Z,{name:e})},getRecentCustomers:function(){var e=this;this.isLoading=!0,n.ih.get("/api/nexopos/v4/customers/recently-active").subscribe({next:function(t){e.isLoading=!1,t.forEach((function(e){return e.selected=!1})),e.customers=t},error:function(t){e.isLoading=!1}})}}};const l=(0,s(1900).Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-xl w-4/5-screen md:w-2/5-screen xl:w-108",attrs:{id:"ns-pos-customer-select-popup"}},[s("div",{staticClass:"border-b ns-box-header text-center font-semibold text-2xl py-2",attrs:{id:"header"}},[s("h2",[e._v(e._s(e.__("Select Customer")))])]),e._v(" "),s("div",{staticClass:"relative"},[s("div",{staticClass:"p-2 border-b ns-box-body items-center flex justify-between"},[s("span",[e._v(e._s(e.__("Selected"))+" : ")]),e._v(" "),s("div",{staticClass:"flex items-center justify-between"},[s("span",[e._v(e._s(e.order.customer?e.order.customer.name:"N/A"))]),e._v(" "),e.order.customer?s("button",{staticClass:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button hover:border-transparent",on:{click:function(t){return e.openCustomerHistory(e.order.customer,t)}}},[s("i",{staticClass:"las la-eye"})]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 border-b ns-box-body flex justify-between text-primary"},[s("div",{staticClass:"input-group flex-auto border-2 rounded"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchCustomerValue,expression:"searchCustomerValue"}],ref:"searchField",staticClass:"outline-none w-full p-2",attrs:{placeholder:"Search Customer",type:"text"},domProps:{value:e.searchCustomerValue},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.attemptToChoose()},input:function(t){t.target.composing||(e.searchCustomerValue=t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"h-3/5-screen xl:h-2/5-screen overflow-y-auto ns-scrollbar"},[s("ul",{staticClass:"ns-vertical-menu"},[e.customers&&0===e.customers.length?s("li",{staticClass:"p-2 text-center text-primary"},[e._v("\n "+e._s(e.__("No customer match your query..."))+"\n ")]):e._e(),e._v(" "),e.customers&&0===e.customers.length?s("li",{staticClass:"p-2 cursor-pointer text-center text-primary",on:{click:function(t){return e.createCustomerWithMatch(e.searchCustomerValue)}}},[s("span",{staticClass:"border-b border-dashed border-info-primary"},[e._v(e._s(e.__("Create a customer")))])]):e._e(),e._v(" "),e._l(e.customers,(function(t){return s("li",{key:t.id,staticClass:"cursor-pointer p-2 border-b text-primary flex justify-between items-center",on:{click:function(s){return e.selectCustomer(t)}}},[s("span",[e._v(e._s(t.name))]),e._v(" "),s("p",{staticClass:"flex items-center"},[t.owe_amount>0?s("span",{staticClass:"text-error-primary"},[e._v("-"+e._s(e._f("currency")(t.owe_amount)))]):e._e(),e._v(" "),t.owe_amount>0?s("span",[e._v("/")]):e._e(),e._v(" "),s("span",{staticClass:"purchase-amount"},[e._v(e._s(e._f("currency")(t.purchases_amount)))]),e._v(" "),s("button",{staticClass:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button info",on:{click:function(s){return e.openCustomerHistory(t,s)}}},[s("i",{staticClass:"las la-eye"})])])])}))],2)]),e._v(" "),e.isLoading?s("div",{staticClass:"z-10 top-0 absolute w-full h-full flex items-center justify-center"},[s("ns-spinner",{attrs:{size:"24",border:"8"}})],1):e._e()])])}),[],!1,null,null,null).exports},820:(e,t,s)=>{"use strict";s.d(t,{Z:()=>x});var n=s(4687),r=s.n(n),i=s(665),o=s(7700),a=s(6979),l=s(3815),c=s(4679),u=s(3632);const d={mounted:function(){this.closeWithOverlayClicked(),this.loadTransactionFields()},data:function(){return{fields:[],isSubmiting:!1,formValidation:new c.Z}},methods:{__:u.__,closeWithOverlayClicked:i.Z,proceed:function(){var e=this,t=this.$popupParams.customer,s=this.formValidation.extractFields(this.fields);this.isSubmiting=!0,o.ih.post("/api/nexopos/v4/customers/".concat(t.id,"/account-history"),s).subscribe({next:function(t){e.isSubmiting=!1,o.kX.success(t.message).subscribe(),e.$popupParams.resolve(t),e.$popup.close()},error:function(t){e.isSubmiting=!1,o.kX.error(t.message).subscribe(),e.$popupParams.reject(t)}})},close:function(){this.$popup.close(),this.$popupParams.reject(!1)},loadTransactionFields:function(){var e=this;o.ih.get("/api/nexopos/v4/fields/ns.customers-account").subscribe({next:function(t){e.fields=e.formValidation.createFields(t)}})}}};var p=s(1900);const f=(0,p.Z)(d,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-6/7-screen md:w-5/7-screen lg:w-4/7-screen h-6/7-screen md:h-5/7-screen lg:h-5/7-screen overflow-hidden shadow-lg ns-box flex flex-col relative"},[s("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[s("h2",{staticClass:"font-semibold"},[e._v(e._s(e.__("New Transaction")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex-auto overflow-y-auto"},[0===e.fields.length?s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1):e._e(),e._v(" "),e.fields.length>0?s("div",{staticClass:"p-2"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1):e._e()]),e._v(" "),s("div",{staticClass:"p-2 ns-box-footer justify-between border-t flex"},[s("div"),e._v(" "),s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-2 flex flex-wrap"},[s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.close()}}},[e._v(e._s(e.__("Close")))])],1),e._v(" "),s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.proceed()}}},[e._v(e._s(e.__("Proceed")))])],1)])])]),e._v(" "),0===e.isSubmiting?s("div",{staticClass:"h-full w-full absolute flex items-center justify-center",staticStyle:{background:"rgb(0 98 171 / 45%)"}},[s("ns-spinner")],1):e._e()])}),[],!1,null,null,null).exports;var v=s(3630),h=s(914),m=s(2830),_=s(3502),b=s(800);function y(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const g={name:"ns-pos-customers",data:function(){return{activeTab:"create-customers",customer:null,subscription:null,orders:[],options:{},optionsSubscriber:null,selectedTab:"orders",isLoadingCoupons:!1,isLoadingRewards:!1,isLoadingHistory:!1,isLoadingOrders:!1,coupons:[],rewardsResponse:[],order:null,walletHistories:[]}},components:{nsPaginate:_.Z},destroyed:function(){this.subscription.unsubscribe(),this.optionsSubscriber.unsubscribe()},mounted:function(){var e=this;this.closeWithOverlayClicked(),this.optionsSubscriber=POS.options.subscribe((function(t){e.options=t})),this.subscription=POS.order.subscribe((function(t){e.order=t,void 0!==e.$popupParams.customer?(e.activeTab="account-payment",e.customer=e.$popupParams.customer,e.loadCustomerOrders()):void 0!==t.customer&&(e.activeTab="account-payment",e.customer=t.customer,e.loadCustomerOrders())})),this.popupCloser()},methods:{__:u.__,reload:function(){this.loadCustomerOrders()},popupResolver:m.Z,popupCloser:i.Z,getWalletHistoryLabel:function(e){switch(e){case"add":return(0,u.__)("Crediting");case"deduct":return(0,u.__)("Removing");case"refund":return(0,u.__)("Refunding");case"payment":return(0,u.__)("Payment");default:return(0,u.__)("Unknow")}},getType:function(e){switch(e){case"percentage_discount":return(0,u.__)("Percentage Discount");case"flat_discount":return(0,u.__)("Flat Discount")}},closeWithOverlayClicked:i.Z,openOrderOptions:function(e){var t,s=this;return(t=r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,s){a.G.show(b.Z,{order:e,resolve:t,reject:s})}));case 3:t.sent,s.reload(),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),o.kX.error((0,u.__)("An error occurred while opening the order options")).subscribe();case 10:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){y(i,n,r,o,a,"next",e)}function a(e){y(i,n,r,o,a,"throw",e)}o(void 0)}))})()},doChangeTab:function(e){this.selectedTab=e,"coupons"===e&&this.loadCoupons(),"rewards"===e&&this.loadRewards(),"wallet-history"===e&&this.loadAccounHistory(),"orders"===e&&this.loadCustomerOrders()},loadAccounHistory:function(){var e=this;this.isLoadingHistory=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/account-history")).subscribe({next:function(t){e.walletHistories=t.data,e.isLoadingHistory=!1},error:function(t){e.isLoadingHistory=!1}})},loadCoupons:function(){var e=this;this.isLoadingCoupons=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/coupons")).subscribe({next:function(t){e.coupons=t,e.isLoadingCoupons=!1},error:function(t){e.isLoadingCoupons=!1}})},loadRewards:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/api/nexopos/v4/customers/".concat(this.customer.id,"/rewards");this.isLoadingRewards=!0,o.ih.get(t).subscribe({next:function(t){e.rewardsResponse=t,e.isLoadingRewards=!1},error:function(t){e.isLoadingRewards=!1}})},prefillForm:function(e){void 0!==this.$popupParams.name&&(e.main.value=this.$popupParams.name)},openCustomerSelection:function(){this.$popup.close(),a.G.show(l.Z)},loadCustomerOrders:function(){var e=this;this.isLoadingOrders=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/orders")).subscribe({next:function(t){e.orders=t,e.isLoadingOrders=!1},error:function(t){e.isLoadingOrders=!1}})},newTransaction:function(e){new Promise((function(t,s){a.G.show(f,{customer:e,resolve:t,reject:s})})).then((function(t){POS.loadCustomer(e.id).subscribe((function(e){POS.selectCustomer(e)}))}))},applyCoupon:function(e){var t=this;void 0===this.order.customer?a.G.show(h.default,{title:(0,u.__)("Use Customer ?"),message:(0,u.__)("No customer is selected. Would you like to proceed with this customer ?"),onAction:function(s){s&&POS.selectCustomer(t.customer).then((function(s){t.proceedApplyingCoupon(e)}))}}):this.order.customer.id===this.customer.id?this.proceedApplyingCoupon(e):this.order.customer.id!==this.customer.id&&a.G.show(h.default,{title:(0,u.__)("Change Customer ?"),message:(0,u.__)("Would you like to assign this customer to the ongoing order ?"),onAction:function(s){s&&POS.selectCustomer(t.customer).then((function(s){t.proceedApplyingCoupon(e)}))}})},proceedApplyingCoupon:function(e){var t=this;new Promise((function(t,s){a.G.show(v.Z,{apply_coupon:e.code,resolve:t,reject:s})})).then((function(e){t.popupResolver(!1)})).catch((function(e){}))},handleSavedCustomer:function(e){o.kX.success(e.message).subscribe(),POS.selectCustomer(e.entry),this.$popup.close()}}};const x=(0,p.Z)(g,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg rounded w-95vw h-95vh lg:w-3/5-screen flex flex-col overflow-hidden",attrs:{id:"ns-pos-customers"}},[s("div",{staticClass:"ns-header p-2 flex justify-between items-center border-b"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Customers")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.$popup.close()}}})],1)]),e._v(" "),s("div",{staticClass:"ns-body flex-auto flex p-2 overflow-y-auto"},[s("ns-tabs",{attrs:{active:e.activeTab},on:{active:function(t){e.activeTab=t}}},[s("ns-tabs-item",{attrs:{identifier:"create-customers",label:"New Customer"}},["yes"===e.options.ns_pos_customers_creation_enabled?s("ns-crud-form",{attrs:{"submit-url":"/api/nexopos/v4/crud/ns.customers",src:"/api/nexopos/v4/crud/ns.customers/form-config"},on:{updated:function(t){return e.prefillForm(t)},save:function(t){return e.handleSavedCustomer(t)}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(e._s(e.__("Customer Name")))]},proxy:!0},{key:"save",fn:function(){return[e._v(e._s(e.__("Save Customer")))]},proxy:!0}],null,!1,2432171054)}):e._e(),e._v(" "),"yes"!==e.options.ns_pos_customers_creation_enabled?s("div",{staticClass:"h-full flex-col w-full flex items-center justify-center text-primary"},[s("i",{staticClass:"lar la-hand-paper ns-icon text-6xl"}),e._v(" "),s("h3",{staticClass:"font-medium text-2xl"},[e._v(e._s(e.__("Not Authorized")))]),e._v(" "),s("p",[e._v(e._s(e.__("Creating customers has been explicitly disabled from the settings.")))])]):e._e()],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex",staticStyle:{padding:"0!important"},attrs:{identifier:"account-payment",label:e.__("Customer Account")}},[null===e.customer?s("div",{staticClass:"flex-auto w-full flex items-center justify-center flex-col p-4"},[s("i",{staticClass:"lar la-frown text-6xl"}),e._v(" "),s("h3",{staticClass:"font-medium text-2xl"},[e._v(e._s(e.__("No Customer Selected")))]),e._v(" "),s("p",[e._v(e._s(e.__("In order to see a customer account, you need to select one customer.")))]),e._v(" "),s("div",{staticClass:"my-2"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.openCustomerSelection()}}},[e._v(e._s(e.__("Select Customer")))])],1)]):e._e(),e._v(" "),e.customer?s("div",{staticClass:"flex flex-col flex-auto"},[s("div",{staticClass:"flex-auto p-2 flex flex-col"},[s("div",{staticClass:"-mx-4 flex flex-wrap ns-tab-cards"},[s("div",{staticClass:"px-4 mb-4 w-full"},[s("h2",{staticClass:"font-semibold"},[e._v(e._s(e.__("Summary For"))+" : "+e._s(e.customer.name))])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-success-secondary to-green-700 p-2 flex flex-col text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Total Purchases")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"font-bold"},[e._v(e._s(e._f("currency")(e.customer.purchases_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-error-secondary to-red-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Total Owed")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.owed_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-blue-500 to-blue-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Wallet Amount")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.account_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-teal-500 to-teal-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Credit Limit")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.credit_limit_amount)))])])])])]),e._v(" "),s("div",{staticClass:"flex flex-auto flex-col overflow-hidden"},[s("ns-tabs",{attrs:{active:e.selectedTab},on:{changeTab:function(t){return e.doChangeTab(t)}}},[s("ns-tabs-item",{attrs:{identifier:"orders",label:e.__("Orders")}},[e.isLoadingOrders?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingOrders?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Last Purchases")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{colspan:"3",width:"150"}},[e._v(e._s(e.__("Order")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"50"}},[e._v(e._s(e.__("Options")))])])]),e._v(" "),s("tbody",{staticClass:"text-primary"},[0===e.orders.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No orders...")))])]):e._e(),e._v(" "),e._l(e.orders,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[s("div",{staticClass:"flex flex-col items-start"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Code"))+": "+e._s(t.code))]),e._v(" "),s("div",{staticClass:"md:-mx-2 w-full flex flex-col md:flex-row"},[s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Total"))+": "+e._s(e._f("currency")(t.total)))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Status"))+": "+e._s(t.human_status))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Delivery"))+": "+e._s(t.human_delivery_status))])])])])]),e._v(" "),s("td",{staticClass:"border p-2 text-center"},[s("button",{staticClass:"rounded-full h-8 px-2 flex items-center justify-center border border-gray ns-inset-button success",on:{click:function(s){return e.openOrderOptions(t)}}},[s("i",{staticClass:"las la-wallet"}),e._v(" "),s("span",{staticClass:"ml-1"},[e._v(e._s(e.__("Options")))])])])])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"wallet-history",label:e.__("Wallet History")}},[e.isLoadingHistory?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingHistory?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Wallet History")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{colspan:"3",width:"150"}},[e._v(e._s(e.__("Transaction")))])])]),e._v(" "),s("tbody",{staticClass:"text-primary"},[0===e.walletHistories.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[e._v(e._s(e.__("No History...")))])]):e._e(),e._v(" "),e._l(e.walletHistories,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[s("div",{staticClass:"flex flex-col items-start"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Transaction"))+": "+e._s(e.getWalletHistoryLabel(t.operation)))]),e._v(" "),s("div",{staticClass:"md:-mx-2 w-full flex flex-col md:flex-row"},[s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/3"},[s("small",[e._v(e._s(e.__("Amount"))+": "+e._s(e._f("currency")(t.amount)))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/3"},[s("small",[e._v(e._s(e.__("Date"))+": "+e._s(t.created_at))])])])])])])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"coupons",label:e.__("Coupons")}},[e.isLoadingCoupons?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingCoupons?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Coupons")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"150"}},[e._v(e._s(e.__("Name")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Type")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"})])]),e._v(" "),s("tbody",{staticClass:"text-primary text-sm"},[0===e.coupons.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No coupons for the selected customer...")))])]):e._e(),e._v(" "),e._l(e.coupons,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",[e._v(e._s(t.name))]),e._v(" "),s("div",{},[s("ul",{staticClass:"-mx-2 flex"},[s("li",{staticClass:"text-xs text-primary px-2"},[e._v(e._s(e.__("Usage :"))+" "+e._s(t.usage)+"/"+e._s(t.limit_usage))]),e._v(" "),s("li",{staticClass:"text-xs text-primary px-2"},[e._v(e._s(e.__("Code :"))+" "+e._s(t.code))])])])]),e._v(" "),s("td",{staticClass:"border p-2 text-center"},[e._v(e._s(e.getType(t.coupon.type))+"\n "),"percentage_discount"===t.coupon.type?s("span",[e._v("\n ("+e._s(t.coupon.discount_value)+"%)\n ")]):e._e(),e._v(" "),"flat_discount"===t.coupon.type?s("span",[e._v("\n ("+e._s(e._f("currency")(t.coupon.discount_value))+")\n ")]):e._e()]),e._v(" "),s("td",{staticClass:"border p-2 text-right"},[s("ns-button",{attrs:{type:"info"},on:{click:function(s){return e.applyCoupon(t)}}},[e._v(e._s(e.__("Use Coupon")))])],1)])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"rewards",label:e.__("Rewards")}},[e.isLoadingRewards?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingRewards?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Rewards")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"150"}},[e._v(e._s(e.__("Name")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Points")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Target")))])])]),e._v(" "),e.rewardsResponse.data?s("tbody",{staticClass:"text-primary text-sm"},[0===e.rewardsResponse.data.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No rewards available the selected customer...")))])]):e._e(),e._v(" "),e._l(e.rewardsResponse.data,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.reward_name))])]),e._v(" "),s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.points))])]),e._v(" "),s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.target))])])])}))],2):e._e()])])]),e._v(" "),s("div",{staticClass:"py-1 flex justify-end"},[s("ns-paginate",{attrs:{pagination:e.rewardsResponse},on:{load:function(t){return e.loadRewards(t)}}})],1)]],2)],1)],1)]),e._v(" "),s("div",{staticClass:"p-2 border-t border-box-edge flex justify-between"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.newTransaction(e.customer)}}},[e._v(e._s(e.__("Account Transaction")))])],1)])]):e._e()])],1)],1)])}),[],!1,null,null,null).exports},4065:(e,t,s)=>{"use strict";s.d(t,{Z:()=>d});var n=s(4679),r=s(7700),i=s(3632);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function a(e){for(var t=1;t0){var e=nsRawCurrency(this.order.instalments.map((function(e){return parseFloat(e.amount.value)||0})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})));this.totalPayments=this.order.total-e}else this.totalPayments=0},removeInstalment:function(e){var t=this.order.instalments.indexOf(e);this.order.instalments.splice(t,1),this.$forceUpdate()},generatePaymentFields:function(e){var t=this;this.order.instalments=new Array(parseInt(e)).fill("").map((function(e,s){return{date:{type:"date",name:"date",label:"Date",value:0===s?ns.date.moment.format("YYYY-MM-DD"):""},amount:{type:"number",name:"amount",label:"Amount",value:0===s?t.expectedPayment:0},readonly:{type:"hidden",name:"readonly",value:t.expectedPayment>0&&0===s}}})),this.$forceUpdate(),this.refreshTotalPayments()},close:function(){this.$popupParams.reject({status:"failed",message:(0,i.__)("You must define layaway settings before proceeding.")}),this.$popup.close()},skipInstalments:function(){this.expectedPayment>0?(this.order.instalments=[{amount:this.expectedPayment,date:ns.date.current}],this.order.final_payment_date=this.order.instalments.reverse()[0].date,this.order.total_instalments=this.order.instalments.length,this.order.support_instalments=!1):(this.order.final_payment_date=ns.date.current,this.order.total_instalments=0,this.order.support_instalments=!1),this.$popup.close(),POS.order.next(this.order);var e=this.$popupParams,t=e.resolve;e.reject;return t({order:this.order,skip_layaway:!0})},updateOrder:function(){var e=this;if(0===this.order.instalments.length)return r.kX.error((0,i.__)("Please provide instalments before proceeding.")).subscribe();if(this.fields.forEach((function(t){return e.formValidation.validateField(t)})),!this.formValidation.fieldsValid(this.fields))return r.kX.error((0,i.__)("Unable to process, the form is not valid")).subscribe();this.$forceUpdate();var t=this.order.instalments.map((function(e){return{amount:parseFloat(e.amount.value),date:e.date.value}})),s=nsRawCurrency(t.map((function(e){return e.amount})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})));if(t.filter((function(e){return void 0===e.date||""===e.date})).length>0)return r.kX.error((0,i.__)("One or more instalments has an invalid date.")).subscribe();if(t.filter((function(e){return!(e.amount>0)})).length>0)return r.kX.error((0,i.__)("One or more instalments has an invalid amount.")).subscribe();if(t.filter((function(e){return moment(e.date).isBefore(ns.date.moment.startOf("day"))})).length>0)return r.kX.error((0,i.__)("One or more instalments has a date prior to the current date.")).subscribe();var n=t.filter((function(e){return moment(e.date).isSame(ns.date.moment.startOf("day"),"day")})),o=0;if(n.forEach((function(e){o+=parseFloat(e.amount)})),o{"use strict";s.r(t),s.d(t,{default:()=>r});const n={name:"ns-pos-loading-popup"};const r=(0,s(1900).Z)(n,(function(){var e=this.$createElement;return(this._self._c||e)("ns-spinner")}),[],!1,null,null,null).exports},4523:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(4687),r=s.n(n),i=s(2830),o=s(3632),a=s(665);function l(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const c={data:function(){return{types:[],typeSubscription:null}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.resolveIfQueued(!1)})),this.typeSubscription=POS.types.subscribe((function(t){e.types=t,1===Object.values(e.types).length&&e.select(Object.keys(e.types)[0])})),this.popupCloser()},destroyed:function(){this.typeSubscription.unsubscribe()},methods:{__:o.__,popupCloser:a.Z,popupResolver:i.Z,resolveIfQueued:i.Z,select:function(e){var t,s=this;return(t=r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Object.values(s.types).forEach((function(e){return e.selected=!1})),s.types[e].selected=!0,n=s.types[e],t.prev=3,t.next=6,POS.triggerOrderTypeSelection(n);case 6:t.sent,POS.types.next(s.types),s.resolveIfQueued(n),t.next=13;break;case 11:t.prev=11,t.t0=t.catch(3);case 13:case"end":return t.stop()}}),t,null,[[3,11]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){l(i,n,r,o,a,"next",e)}function a(e){l(i,n,r,o,a,"throw",e)}o(void 0)}))})()}}};const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-full w-4/5-screen md:w-2/5-screen lg:w-2/5-screen xl:w-2/6-screen shadow-lg",attrs:{id:"ns-order-type"}},[s("div",{staticClass:"h-16 flex justify-center items-center",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Define The Order Type")))])]),e._v(" "),0===Object.values(e.types).length?s("div",{staticClass:"ns-box-body grid grid-flow-row grid-cols-1 grid-rows-1"},[s("div",{staticClass:"h-full w-full flex items-center justify-center flex-col"},[s("i",{staticClass:"las la-frown text-7xl"}),e._v(" "),s("div",{staticClass:"p-4 md:w-2/3"},[s("p",{staticClass:"text-center"},[e._v(e._s(e.__("No payment type has been selected on the settings. Please check your POS features and choose the supported order type")))]),e._v(" "),s("div",{staticClass:"flex justify-center py-1"},[s("ns-link",{attrs:{target:"_blank",type:"info",href:"https://my.nexopos.com/en/documentation/components/order-types"}},[e._v(e._s(e.__("Read More")))])],1)])])]):e._e(),e._v(" "),Object.values(e.types).length>0?s("div",{staticClass:"ns-box-body grid grid-flow-row grid-cols-2 grid-rows-2"},e._l(e.types,(function(t){return s("div",{key:t.identifier,staticClass:"ns-numpad-key info h-56 flex items-center justify-center flex-col cursor-pointer border",class:t.selected?"active":"",on:{click:function(s){return e.select(t.identifier)}}},[s("img",{staticClass:"w-32 h-32",attrs:{src:t.icon,alt:""}}),e._v(" "),s("h4",{staticClass:"font-semibold text-xl my-2"},[e._v(e._s(t.label))])])})),0):e._e()])}),[],!1,null,null,null).exports},9958:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(7700),r=s(3632),i=s(665),o=s(7751),a=s(8909);const l={components:{nsNumpad:o.Z,nsNumpadPlus:a.Z},data:function(){return{finalValue:1,virtualStock:null,options:{},optionsSubscription:null,allSelected:!0,isLoading:!1}},beforeDestroy:function(){this.optionsSubscription.unsubscribe()},mounted:function(){var e=this;this.optionsSubscription=POS.options.subscribe((function(t){e.options=t})),this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())})),this.$popupParams.product.quantity&&(this.finalValue=this.$popupParams.product.quantity),this.popupCloser()},destroyed:function(){nsHotPress.destroy("pos-quantity-numpad"),nsHotPress.destroy("pos-quantity-backspace"),nsHotPress.destroy("pos-quantity-enter")},methods:{__:r.__,popupCloser:i.Z,closePopup:function(){this.$popupParams.reject(!1),this.$popup.close()},updateQuantity:function(e){this.finalValue=e},defineQuantity:function(e){var t=this.$popupParams,s=t.product,i=t.data;if(0===e)return n.kX.error((0,r.__)("Please provide a quantity")).subscribe();if("enabled"===s.$original().stock_management&&"materialized"===s.$original().type){var o=POS.getStockUsage(s.$original().id,i.unit_quantity_id)-(s.quantity||0);if(e>parseFloat(i.$quantities().quantity)-o)return n.kX.error((0,r.__)("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",i.$quantities().quantity-o)).subscribe()}this.resolve({quantity:e})},resolve:function(e){this.$popupParams.resolve(e),this.$popup.close()}}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow min-h-2/5-screen w-3/4-screen md:w-3/5-screen lg:w-2/5-screen xl:w-2/5-screen relative"},[e.isLoading?s("div",{staticClass:"flex w-full h-full absolute top-O left-0 items-center justify-center",staticStyle:{background:"rgb(202 202 202 / 49%)"},attrs:{id:"loading-overlay"}},[s("ns-spinner")],1):e._e(),e._v(" "),s("div",{staticClass:"flex-shrink-0 flex justify-between items-center p-2 border-b ns-box-header"},[s("div",[s("h1",{staticClass:"text-xl font-bold text-primary text-center"},[e._v(e._s(e.__("Define Quantity")))])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"h-24 border-b primary ns-box-body flex items-center justify-center",attrs:{id:"screen"}},[s("h1",{staticClass:"font-bold text-3xl"},[e._v(e._s(e.finalValue))])]),e._v(" "),"default"===e.options.ns_pos_numpad?s("ns-numpad",{attrs:{floating:e.options.ns_pos_allow_decimal_quantities,value:e.finalValue},on:{changed:function(t){return e.updateQuantity(t)},next:function(t){return e.defineQuantity(t)}}}):e._e(),e._v(" "),"advanced"===e.options.ns_pos_numpad?s("ns-numpad-plus",{attrs:{value:e.finalValue},on:{changed:function(t){return e.updateQuantity(t)},next:function(t){return e.defineQuantity(t)}}}):e._e()],1)}),[],!1,null,null,null).exports},6071:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(7700),r=s(2830),i=s(4679);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function a(e){for(var t=1;t{"use strict";s.r(t),s.d(t,{default:()=>r});const n={data:function(){return{title:"",message:"",input:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.input=this.$popupParams.input||"",this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())}))},methods:{__:s(3632).__,emitAction:function(e){this.$popupParams.onAction(e?this.input:e),this.$popup.close()},reject:function(e){void 0!==this.$popupParams.reject&&this.$popupParams.reject(e),this.$popup.close()}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-5/7-screen md:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"prompt-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-2"},[s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"w-full md:mx-auto md:w-2/3 py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"p-2"},[s("div",{staticClass:"ns-input"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.input,expression:"input"}],staticClass:"w-full border-2 p-2",attrs:{name:"",id:"",cols:"30",rows:"10"},domProps:{value:e.input},on:{input:function(t){t.target.composing||(e.input=t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"flex border-t action-buttons"},[s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))]),e._v(" "),s("hr",{staticClass:"border-r"}),e._v(" "),s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.reject(!1)}}},[e._v(e._s(e.__("Cancel")))])])])}),[],!1,null,null,null).exports},2614:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(665),r=s(3632);const i={data:function(){return{value:[],options:[],description:"",label:null,type:"select"}},computed:{},mounted:function(){this.popupCloser(),this.value=this.$popupParams.value||[],this.options=this.$popupParams.options,this.label=this.$popupParams.label,this.description=this.$popupParams.description||"",this.type=this.$popupParams.type||this.type},methods:{popupCloser:n.Z,__:r.__,toggle:function(e){var t=this.value.indexOf(e);-1===t?this.value.unshift(e):this.value.splice(t,1)},isSelected:function(e){return this.value.indexOf(e)>=0},close:function(){this.$popupParams.reject(!1),this.$popup.close()},select:function(e){void 0!==e&&(this.value=[e]),this.$popupParams.resolve(this.value),this.close()}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box w-6/7-screen md:w-4/7-screen lg:w-3/7-screen max-h-5/6-screen overflow-hidden flex flex-col"},[s("div",{staticClass:"p-2 flex justify-between border-b items-center ns-box-header"},[s("span",{staticClass:"text-semibold text-primary"},[e._v("\n "+e._s(e.label)+"\n ")]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex flex-col overflow-hidden"},[e.description.length>0?s("p",{staticClass:"p-2 text-center text-sm bg-info-primary"},[e._v(e._s(e.description))]):e._e(),e._v(" "),s("div",{staticClass:"overflow-y-auto"},[s("ul",{staticClass:"ns-vertical-menu"},["select"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b border-box-edge text-primary cursor-pointer",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})):e._e(),e._v(" "),"multiselect"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b text-primary cursor-pointer",class:e.isSelected(t)?"active":"",on:{click:function(s){return e.toggle(t)}}},[e._v(e._s(t.label))])})):e._e()],2)])]),e._v(" "),"multiselect"===e.type?s("div",{staticClass:"flex justify-between"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.select()}}},[e._v(e._s(e.__("Select")))])],1)]):e._e()])}),[],!1,null,null,null).exports},5042:()=>{}},e=>{e.O(0,[898],(()=>{return t=1543,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/pos.min.js b/public/js/pos.min.js index e49f0620c..4b6ee208a 100644 --- a/public/js/pos.min.js +++ b/public/js/pos.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[159,198],{7700:(e,t,n)=>{"use strict";n.d(t,{l:()=>z,kq:()=>I,ih:()=>H,kX:()=>L});var s=n(6486),i=n(8945),r=n(6300),a=n(8345),o=n(9093),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=I.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),S=n(9020),E=n(7794);function D(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&V(t.prototype,n),s&&V(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),U=new b({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});H.defineClient(i.Z),window.nsEvent=z,window.nsHttpClient=H,window.nsSnackBar=L,window.nsCurrency=S.W,window.nsTruncate=E.b,window.nsRawCurrency=S.f,window.nsAbbreviate=$,window.nsState=U,window.nsUrl=Z,window.nsScreen=N,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=R,window.nsTax=q.Z},876:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(7700),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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

    \n

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

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